From b60d75b06cdb1caa327935dc095b541c2a61ffe2 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 22:01:54 +0100 Subject: [PATCH 01/31] set min_self_delegation to 0 in TestAminoCodecFullDecodeAndEncode --- codec/amino_codec_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/amino_codec_test.go b/codec/amino_codec_test.go index ae5d37d857a3..80fc26aa81b4 100644 --- a/codec/amino_codec_test.go +++ b/codec/amino_codec_test.go @@ -123,7 +123,7 @@ func TestAminoCodecUnpackAnyFails(t *testing.T) { func TestAminoCodecFullDecodeAndEncode(t *testing.T) { // This tx comes from https://github.com/cosmos/cosmos-sdk/issues/8117. - txSigned := `{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"fulltest","identity":"satoshi","website":"example.com","details":"example inc"},"commission":{"rate":"0.500000000000000000","max_rate":"1.000000000000000000","max_change_rate":"0.200000000000000000"},"min_self_delegation":"1000000","delegator_address":"cosmos14pt0q5cwf38zt08uu0n6yrstf3rndzr5057jys","validator_address":"cosmosvaloper14pt0q5cwf38zt08uu0n6yrstf3rndzr52q28gr","pubkey":{"type":"tendermint/PubKeyEd25519","value":"CYrOiM3HtS7uv1B1OAkknZnFYSRpQYSYII8AtMMtev0="},"value":{"denom":"umuon","amount":"700000000"}}}],"fee":{"amount":[{"denom":"umuon","amount":"6000"}],"gas":"160000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AwAOXeWgNf1FjMaayrSnrOOKz+Fivr6DiI/i0x0sZCHw"},"signature":"RcnfS/u2yl7uIShTrSUlDWvsXo2p2dYu6WJC8VDVHMBLEQZWc8bsINSCjOnlsIVkUNNe1q/WCA9n3Gy1+0zhYA=="}],"memo":"","timeout_height":"0"}}` + txSigned := `{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"fulltest","identity":"satoshi","website":"example.com","details":"example inc"},"commission":{"rate":"0.500000000000000000","max_rate":"1.000000000000000000","max_change_rate":"0.200000000000000000"},"min_self_delegation":"0","delegator_address":"cosmos14pt0q5cwf38zt08uu0n6yrstf3rndzr5057jys","validator_address":"cosmosvaloper14pt0q5cwf38zt08uu0n6yrstf3rndzr52q28gr","pubkey":{"type":"tendermint/PubKeyEd25519","value":"CYrOiM3HtS7uv1B1OAkknZnFYSRpQYSYII8AtMMtev0="},"value":{"denom":"umuon","amount":"700000000"}}}],"fee":{"amount":[{"denom":"umuon","amount":"6000"}],"gas":"160000"},"signatures":[{"pub_key":{"type":"tendermint/PubKeySecp256k1","value":"AwAOXeWgNf1FjMaayrSnrOOKz+Fivr6DiI/i0x0sZCHw"},"signature":"RcnfS/u2yl7uIShTrSUlDWvsXo2p2dYu6WJC8VDVHMBLEQZWc8bsINSCjOnlsIVkUNNe1q/WCA9n3Gy1+0zhYA=="}],"memo":"","timeout_height":"0"}}` legacyCdc := testutil.MakeTestEncodingConfig(staking.AppModuleBasic{}, auth.AppModuleBasic{}).Amino var tx legacytx.StdTx err := legacyCdc.UnmarshalJSON([]byte(txSigned), &tx) From 0f20ef080294106d550004389a775e896628b79c Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 22:06:06 +0100 Subject: [PATCH 02/31] add WithdrawTokenizeShareRecordReward and WithdrawAllTokenizeShareRecordReward --- x/distribution/keeper/msg_server.go | 48 +++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index dae5df0fe548..b682cacd720f 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -161,12 +161,56 @@ func (k msgServer) CommunityPoolSpend(goCtx context.Context, req *types.MsgCommu // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for owning TokenizeShareRecord func (k msgServer) WithdrawTokenizeShareRecordReward(goCtx context.Context, msg *types.MsgWithdrawTokenizeShareRecordReward) (*types.MsgWithdrawTokenizeShareRecordRewardResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawTokenizeShareRecordReward(ctx, ownerAddr, msg.RecordId) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_tokenize_share_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + return &types.MsgWithdrawTokenizeShareRecordRewardResponse{}, nil } // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for owning TokenizeShareRecord func (k msgServer) WithdrawAllTokenizeShareRecordReward(goCtx context.Context, msg *types.MsgWithdrawAllTokenizeShareRecordReward) (*types.MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawAllTokenizeShareRecordReward(ctx, ownerAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_all_tokenize_share_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + return &types.MsgWithdrawAllTokenizeShareRecordRewardResponse{}, nil } From 5db6fd65ee870944e52990a4ec9f1454abcbd651 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 22:59:16 +0100 Subject: [PATCH 03/31] add methods to distribution/keeper --- x/distribution/keeper/keeper.go | 142 +++++++++++++++- .../testutil/expected_keepers_mocks.go | 43 +++++ x/distribution/types/errors.go | 25 +-- x/distribution/types/events.go | 13 +- x/distribution/types/expected_keepers.go | 4 + x/staking/keeper/tokenize_share_record.go | 151 ++++++++++++++++++ .../keeper/tokenize_share_record_test.go | 14 ++ x/staking/types/errors.go | 100 +++++++----- x/staking/types/keys.go | 42 +++++ x/staking/types/tokenize_share_record.go | 22 +++ 10 files changed, 493 insertions(+), 63 deletions(-) create mode 100644 x/staking/keeper/tokenize_share_record.go create mode 100644 x/staking/keeper/tokenize_share_record_test.go create mode 100644 x/staking/types/tokenize_share_record.go diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 236084a0e681..cb07dd5c0b4e 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -165,20 +165,154 @@ func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk. } func (k Keeper) WithdrawSingleShareRecordReward(ctx sdk.Context, recordID uint64) error { - // TODO add LSM logic + record, err := k.stakingKeeper.GetTokenizeShareRecord(ctx, recordID) + if err != nil { + return err + } + + owner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return err + } + + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if val != nil && del != nil { + // withdraw rewards into reward module account and send it to reward owner + cacheCtx, write := ctx.CacheContext() + _, err = k.WithdrawDelegationRewards(cacheCtx, record.GetModuleAddress(), valAddr) + if err != nil { + return err + } + write() + } + + // apply changes when the module account has positive balance + balances := k.bankKeeper.GetAllBalances(ctx, record.GetModuleAddress()) + if !balances.Empty() { + err = k.bankKeeper.SendCoins(ctx, record.GetModuleAddress(), owner, balances) + if err != nil { + return err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, owner.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, balances.String()), + ), + ) + } return nil } // withdraw reward for owning TokenizeShareRecord func (k Keeper) WithdrawTokenizeShareRecordReward(ctx sdk.Context, ownerAddr sdk.AccAddress, recordID uint64) (sdk.Coins, error) { - rewards := sdk.Coins{} - // TODO add LSM logic + record, err := k.stakingKeeper.GetTokenizeShareRecord(ctx, recordID) + if err != nil { + return nil, err + } + + if record.Owner != ownerAddr.String() { + return nil, types.ErrNotTokenizeShareRecordOwner + } + + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + if val == nil { + return nil, err + } + + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if del == nil { + return nil, err + } + + // withdraw rewards into reward module account and send it to reward owner + _, err = k.WithdrawDelegationRewards(ctx, record.GetModuleAddress(), valAddr) + if err != nil { + return nil, err + } + + // apply changes when the module account has positive balance + rewards := k.bankKeeper.GetAllBalances(ctx, record.GetModuleAddress()) + if !rewards.Empty() { + err = k.bankKeeper.SendCoins(ctx, record.GetModuleAddress(), ownerAddr, rewards) + if err != nil { + return nil, err + } + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, ownerAddr.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, rewards.String()), + ), + ) + return rewards, nil } // withdraw reward for all owning TokenizeShareRecord func (k Keeper) WithdrawAllTokenizeShareRecordReward(ctx sdk.Context, ownerAddr sdk.AccAddress) (sdk.Coins, error) { totalRewards := sdk.Coins{} - // TODO add LSM logic + + records := k.stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, ownerAddr) + + for _, record := range records { + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + val := k.stakingKeeper.Validator(ctx, valAddr) + if val == nil { + continue + } + + del := k.stakingKeeper.Delegation(ctx, record.GetModuleAddress(), valAddr) + if del == nil { + continue + } + + // withdraw rewards into reward module account and send it to reward owner + cacheCtx, write := ctx.CacheContext() + _, err = k.WithdrawDelegationRewards(cacheCtx, record.GetModuleAddress(), valAddr) + if err != nil { + k.Logger(ctx).Error(err.Error()) + continue + } + + // apply changes when the module account has positive balance + balances := k.bankKeeper.GetAllBalances(cacheCtx, record.GetModuleAddress()) + if !balances.Empty() { + err = k.bankKeeper.SendCoins(cacheCtx, record.GetModuleAddress(), ownerAddr, balances) + if err != nil { + k.Logger(ctx).Error(err.Error()) + continue + } + write() + totalRewards = totalRewards.Add(balances...) + } + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeWithdrawTokenizeShareReward, + sdk.NewAttribute(types.AttributeKeyWithdrawAddress, ownerAddr.String()), + sdk.NewAttribute(sdk.AttributeKeyAmount, totalRewards.String()), + ), + ) + return totalRewards, nil } diff --git a/x/distribution/testutil/expected_keepers_mocks.go b/x/distribution/testutil/expected_keepers_mocks.go index 585d2cb57792..656763bb4f03 100644 --- a/x/distribution/testutil/expected_keepers_mocks.go +++ b/x/distribution/testutil/expected_keepers_mocks.go @@ -183,6 +183,20 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderMod return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } +// SendCoins mocks base method. +func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) +} + // SpendableCoins mocks base method. func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() @@ -328,6 +342,35 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } +// GetTokenizeShareRecordsByOwner mocks base method. +func (m *MockStakingKeeper) GetTokenizeShareRecordsByOwner(ctx types.Context, owner types.AccAddress) (tokenizeShareRecords []types1.TokenizeShareRecord) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokenizeShareRecordsByOwner", ctx, owner) + ret0, _ := ret[0].([]types1.TokenizeShareRecord) + return ret0 +} + +// GetTokenizeShareRecordsByOwner indicates an expected call of GetTokenizeShareRecordsByOwner. +func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecordsByOwner(ctx, owner interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecordsByOwner", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecordsByOwner), ctx, owner) +} + +// GetTokenizeShareRecord mocks base method. +func (m *MockStakingKeeper) GetTokenizeShareRecord(ctx types.Context, id uint64) (tokenizeShareRecord types1.TokenizeShareRecord, err error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokenizeShareRecord", ctx, id) + ret0, _ := ret[0].(types1.TokenizeShareRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTokenizeShareRecord indicates an expected call of GetTokenizeShareRecord. +func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecord(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecord", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecord), ctx, id) +} + // MockStakingHooks is a mock of StakingHooks interface. type MockStakingHooks struct { ctrl *gomock.Controller diff --git a/x/distribution/types/errors.go b/x/distribution/types/errors.go index 147cfd320341..83c254b6ef6b 100644 --- a/x/distribution/types/errors.go +++ b/x/distribution/types/errors.go @@ -6,16 +6,17 @@ import ( // x/distribution module sentinel errors var ( - ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") - ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") - ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") - ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") - ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") - ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") - ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") - ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") - ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") - ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") - ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") - ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") + ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 2, "delegator address is empty") + ErrEmptyWithdrawAddr = sdkerrors.Register(ModuleName, 3, "withdraw address is empty") + ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 4, "validator address is empty") + ErrEmptyDelegationDistInfo = sdkerrors.Register(ModuleName, 5, "no delegation distribution info") + ErrNoValidatorDistInfo = sdkerrors.Register(ModuleName, 6, "no validator distribution info") + ErrNoValidatorCommission = sdkerrors.Register(ModuleName, 7, "no validator commission to withdraw") + ErrSetWithdrawAddrDisabled = sdkerrors.Register(ModuleName, 8, "set withdraw address disabled") + ErrBadDistribution = sdkerrors.Register(ModuleName, 9, "community pool does not have sufficient coins to distribute") + ErrInvalidProposalAmount = sdkerrors.Register(ModuleName, 10, "invalid community pool spend proposal amount") + ErrEmptyProposalRecipient = sdkerrors.Register(ModuleName, 11, "invalid community pool spend proposal recipient") + ErrNoValidatorExists = sdkerrors.Register(ModuleName, 12, "validator does not exist") + ErrNoDelegationExists = sdkerrors.Register(ModuleName, 13, "delegation does not exist") + ErrNotTokenizeShareRecordOwner = sdkerrors.Register(ModuleName, 14, "not tokenize share record owner") ) diff --git a/x/distribution/types/events.go b/x/distribution/types/events.go index e0ea7069106b..f1ab6b51e163 100644 --- a/x/distribution/types/events.go +++ b/x/distribution/types/events.go @@ -2,12 +2,13 @@ package types // distribution module event types const ( - EventTypeSetWithdrawAddress = "set_withdraw_address" - EventTypeRewards = "rewards" - EventTypeCommission = "commission" - EventTypeWithdrawRewards = "withdraw_rewards" - EventTypeWithdrawCommission = "withdraw_commission" - EventTypeProposerReward = "proposer_reward" + EventTypeSetWithdrawAddress = "set_withdraw_address" + EventTypeRewards = "rewards" + EventTypeCommission = "commission" + EventTypeWithdrawRewards = "withdraw_rewards" + EventTypeWithdrawCommission = "withdraw_commission" + EventTypeWithdrawTokenizeShareReward = "withdraw_tokenize_share_reward" + EventTypeProposerReward = "proposer_reward" AttributeKeyWithdrawAddress = "withdraw_address" AttributeKeyValidator = "validator" diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index 94cea333ab06..e6f10ad5261b 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -26,6 +26,7 @@ type BankKeeper interface { SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error BlockedAddr(addr sdk.AccAddress) bool } @@ -49,6 +50,9 @@ type StakingKeeper interface { GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator) GetAllDelegatorDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.Delegation + + GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []stakingtypes.TokenizeShareRecord) + GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord stakingtypes.TokenizeShareRecord, err error) } // StakingHooks event hooks for staking validator object (noalias) diff --git a/x/staking/keeper/tokenize_share_record.go b/x/staking/keeper/tokenize_share_record.go new file mode 100644 index 000000000000..ecde86be0c2f --- /dev/null +++ b/x/staking/keeper/tokenize_share_record.go @@ -0,0 +1,151 @@ +package keeper + +import ( + "fmt" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + gogotypes "github.com/gogo/protobuf/types" + + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +func (k Keeper) GetLastTokenizeShareRecordID(ctx sdk.Context) uint64 { + store := ctx.KVStore(k.storeKey) + bytes := store.Get(types.LastTokenizeShareRecordIDKey) + if bytes == nil { + return 0 + } + return sdk.BigEndianToUint64(bytes) +} + +func (k Keeper) SetLastTokenizeShareRecordID(ctx sdk.Context, id uint64) { + store := ctx.KVStore(k.storeKey) + store.Set(types.LastTokenizeShareRecordIDKey, sdk.Uint64ToBigEndian(id)) +} + +func (k Keeper) GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord types.TokenizeShareRecord, err error) { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.GetTokenizeShareRecordByIndexKey(id)) + if bz == nil { + return tokenizeShareRecord, sdkerrors.Wrap(types.ErrTokenizeShareRecordNotExists, fmt.Sprintf("tokenizeShareRecord %d does not exist", id)) + } + + k.cdc.MustUnmarshal(bz, &tokenizeShareRecord) + return tokenizeShareRecord, nil +} + +func (k Keeper) GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + + it := sdk.KVStorePrefixIterator(store, types.GetTokenizeShareRecordIdsByOwnerPrefix(owner)) + defer it.Close() + + for ; it.Valid(); it.Next() { + var id gogotypes.UInt64Value + k.cdc.MustUnmarshal(it.Value(), &id) + + tokenizeShareRecord, err := k.GetTokenizeShareRecord(ctx, id.Value) + if err != nil { + continue + } + tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) + } + return +} + +func (k Keeper) GetTokenizeShareRecordByDenom(ctx sdk.Context, denom string) (types.TokenizeShareRecord, error) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.GetTokenizeShareRecordIDByDenomKey(denom)) + if bz == nil { + return types.TokenizeShareRecord{}, fmt.Errorf("tokenize share record not found from denom: %s", denom) + } + + var id gogotypes.UInt64Value + k.cdc.MustUnmarshal(bz, &id) + + return k.GetTokenizeShareRecord(ctx, id.Value) +} + +func (k Keeper) GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecords []types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + + it := sdk.KVStorePrefixIterator(store, types.TokenizeShareRecordPrefix) + defer it.Close() + + for ; it.Valid(); it.Next() { + var tokenizeShareRecord types.TokenizeShareRecord + k.cdc.MustUnmarshal(it.Value(), &tokenizeShareRecord) + + tokenizeShareRecords = append(tokenizeShareRecords, tokenizeShareRecord) + } + return +} + +func (k Keeper) AddTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) error { + if k.hasTokenizeShareRecord(ctx, tokenizeShareRecord.Id) { + return sdkerrors.Wrapf(types.ErrTokenizeShareRecordAlreadyExists, "TokenizeShareRecord already exists: %d", tokenizeShareRecord.Id) + } + + k.setTokenizeShareRecord(ctx, tokenizeShareRecord) + + owner, err := sdk.AccAddressFromBech32(tokenizeShareRecord.Owner) + if err != nil { + return err + } + + k.setTokenizeShareRecordWithOwner(ctx, owner, tokenizeShareRecord.Id) + k.setTokenizeShareRecordWithDenom(ctx, tokenizeShareRecord.GetShareTokenDenom(), tokenizeShareRecord.Id) + + return nil +} + +func (k Keeper) DeleteTokenizeShareRecord(ctx sdk.Context, recordID uint64) error { + record, err := k.GetTokenizeShareRecord(ctx, recordID) + if err != nil { + return err + } + owner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return err + } + + store := ctx.KVStore(k.storeKey) + store.Delete(types.GetTokenizeShareRecordByIndexKey(recordID)) + store.Delete(types.GetTokenizeShareRecordIDByOwnerAndIDKey(owner, recordID)) + store.Delete(types.GetTokenizeShareRecordIDByDenomKey(record.GetShareTokenDenom())) + return nil +} + +func (k Keeper) hasTokenizeShareRecord(ctx sdk.Context, id uint64) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.GetTokenizeShareRecordByIndexKey(id)) +} + +func (k Keeper) setTokenizeShareRecord(ctx sdk.Context, tokenizeShareRecord types.TokenizeShareRecord) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&tokenizeShareRecord) + + store.Set(types.GetTokenizeShareRecordByIndexKey(tokenizeShareRecord.Id), bz) +} + +func (k Keeper) setTokenizeShareRecordWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: id}) + + store.Set(types.GetTokenizeShareRecordIDByOwnerAndIDKey(owner, id), bz) +} + +func (k Keeper) deleteTokenizeShareRecordWithOwner(ctx sdk.Context, owner sdk.AccAddress, id uint64) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.GetTokenizeShareRecordIDByOwnerAndIDKey(owner, id)) +} + +func (k Keeper) setTokenizeShareRecordWithDenom(ctx sdk.Context, denom string, id uint64) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&gogotypes.UInt64Value{Value: id}) + + store.Set(types.GetTokenizeShareRecordIDByDenomKey(denom), bz) +} diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go new file mode 100644 index 000000000000..3f0bc7679a5c --- /dev/null +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -0,0 +1,14 @@ +package keeper_test + +func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { + ctx, keeper := suite.ctx, suite.stakingKeeper + lastTokenizeShareRecordID := keeper.GetLastTokenizeShareRecordID(ctx) + suite.Equal(lastTokenizeShareRecordID, uint64(0)) + keeper.SetLastTokenizeShareRecordID(ctx, 100) + lastTokenizeShareRecordID = keeper.GetLastTokenizeShareRecordID(ctx) + suite.Equal(lastTokenizeShareRecordID, uint64(100)) +} + +func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { + // TODO add LSM test +} diff --git a/x/staking/types/errors.go b/x/staking/types/errors.go index 5cf482984dc5..32d07d74b972 100644 --- a/x/staking/types/errors.go +++ b/x/staking/types/errors.go @@ -11,45 +11,63 @@ import ( // // REF: https://github.com/cosmos/cosmos-sdk/issues/5450 var ( - ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") - ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") - ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") - ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") - ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") - ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") - ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") - ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") - ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") - ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") - ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") - ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") - ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") - ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") - ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") - ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") - ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") - ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") - ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") - ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") - ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") - ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") - ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") - ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") - ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") - ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") - ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") - ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") - ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") - ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") - ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") - ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") - ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") - ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") - ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") - ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") - ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") - ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") - ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") - ErrUnbondingNotFound = sdkerrors.Register(ModuleName, 41, "unbonding operation not found") - ErrUnbondingOnHoldRefCountNegative = sdkerrors.Register(ModuleName, 42, "cannot un-hold unbonding operation that is not on hold") + ErrEmptyValidatorAddr = sdkerrors.Register(ModuleName, 2, "empty validator address") + ErrNoValidatorFound = sdkerrors.Register(ModuleName, 3, "validator does not exist") + ErrValidatorOwnerExists = sdkerrors.Register(ModuleName, 4, "validator already exist for this operator address; must use new validator operator address") + ErrValidatorPubKeyExists = sdkerrors.Register(ModuleName, 5, "validator already exist for this pubkey; must use new validator pubkey") + ErrValidatorPubKeyTypeNotSupported = sdkerrors.Register(ModuleName, 6, "validator pubkey type is not supported") + ErrValidatorJailed = sdkerrors.Register(ModuleName, 7, "validator for this address is currently jailed") + ErrBadRemoveValidator = sdkerrors.Register(ModuleName, 8, "failed to remove validator") + ErrCommissionNegative = sdkerrors.Register(ModuleName, 9, "commission must be positive") + ErrCommissionHuge = sdkerrors.Register(ModuleName, 10, "commission cannot be more than 100%") + ErrCommissionGTMaxRate = sdkerrors.Register(ModuleName, 11, "commission cannot be more than the max rate") + ErrCommissionUpdateTime = sdkerrors.Register(ModuleName, 12, "commission cannot be changed more than once in 24h") + ErrCommissionChangeRateNegative = sdkerrors.Register(ModuleName, 13, "commission change rate must be positive") + ErrCommissionChangeRateGTMaxRate = sdkerrors.Register(ModuleName, 14, "commission change rate cannot be more than the max rate") + ErrCommissionGTMaxChangeRate = sdkerrors.Register(ModuleName, 15, "commission cannot be changed more than max change rate") + ErrSelfDelegationBelowMinimum = sdkerrors.Register(ModuleName, 16, "validator's self delegation must be greater than their minimum self delegation") + ErrMinSelfDelegationDecreased = sdkerrors.Register(ModuleName, 17, "minimum self delegation cannot be decrease") + ErrEmptyDelegatorAddr = sdkerrors.Register(ModuleName, 18, "empty delegator address") + ErrNoDelegation = sdkerrors.Register(ModuleName, 19, "no delegation for (address, validator) tuple") + ErrBadDelegatorAddr = sdkerrors.Register(ModuleName, 20, "delegator does not exist with address") + ErrNoDelegatorForAddress = sdkerrors.Register(ModuleName, 21, "delegator does not contain delegation") + ErrInsufficientShares = sdkerrors.Register(ModuleName, 22, "insufficient delegation shares") + ErrDelegationValidatorEmpty = sdkerrors.Register(ModuleName, 23, "cannot delegate to an empty validator") + ErrNotEnoughDelegationShares = sdkerrors.Register(ModuleName, 24, "not enough delegation shares") + ErrNotMature = sdkerrors.Register(ModuleName, 25, "entry not mature") + ErrNoUnbondingDelegation = sdkerrors.Register(ModuleName, 26, "no unbonding delegation found") + ErrMaxUnbondingDelegationEntries = sdkerrors.Register(ModuleName, 27, "too many unbonding delegation entries for (delegator, validator) tuple") + ErrNoRedelegation = sdkerrors.Register(ModuleName, 28, "no redelegation found") + ErrSelfRedelegation = sdkerrors.Register(ModuleName, 29, "cannot redelegate to the same validator") + ErrTinyRedelegationAmount = sdkerrors.Register(ModuleName, 30, "too few tokens to redelegate (truncates to zero tokens)") + ErrBadRedelegationDst = sdkerrors.Register(ModuleName, 31, "redelegation destination validator not found") + ErrTransitiveRedelegation = sdkerrors.Register(ModuleName, 32, "redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation") + ErrMaxRedelegationEntries = sdkerrors.Register(ModuleName, 33, "too many redelegation entries for (delegator, src-validator, dst-validator) tuple") + ErrDelegatorShareExRateInvalid = sdkerrors.Register(ModuleName, 34, "cannot delegate to validators with invalid (zero) ex-rate") + ErrBothShareMsgsGiven = sdkerrors.Register(ModuleName, 35, "both shares amount and shares percent provided") + ErrNeitherShareMsgsGiven = sdkerrors.Register(ModuleName, 36, "neither shares amount nor shares percent provided") + ErrInvalidHistoricalInfo = sdkerrors.Register(ModuleName, 37, "invalid historical info") + ErrNoHistoricalInfo = sdkerrors.Register(ModuleName, 38, "no historical info found") + ErrEmptyValidatorPubKey = sdkerrors.Register(ModuleName, 39, "empty validator public key") + ErrCommissionLTMinRate = sdkerrors.Register(ModuleName, 40, "commission cannot be less than min rate") + ErrUnbondingNotFound = sdkerrors.Register(ModuleName, 41, "unbonding operation not found") + ErrUnbondingOnHoldRefCountNegative = sdkerrors.Register(ModuleName, 42, "cannot un-hold unbonding operation that is not on hold") + ErrNotEnoughBalance = sdkerrors.Register(ModuleName, 101, "not enough balance") + ErrTokenizeShareRecordNotExists = sdkerrors.Register(ModuleName, 102, "tokenize share record not exists") + ErrTokenizeShareRecordAlreadyExists = sdkerrors.Register(ModuleName, 103, "tokenize share record already exists") + ErrNotTokenizeShareRecordOwner = sdkerrors.Register(ModuleName, 104, "not tokenize share record owner") + ErrExceedingFreeVestingDelegations = sdkerrors.Register(ModuleName, 105, "trying to exceed vested free delegation for vesting account") + ErrOnlyBondDenomAllowdForTokenize = sdkerrors.Register(ModuleName, 106, "only bond denom is allowed for tokenize") + ErrInsufficientValidatorBondShares = sdkerrors.Register(ModuleName, 107, "insufficient validator bond shares") + ErrRedelegationNotAllowedForValidatorBond = sdkerrors.Register(ModuleName, 108, "redelegation is not allowed for validator bond delegation") + ErrValidatorBondNotAllowedForTokenizeShare = sdkerrors.Register(ModuleName, 109, "validator bond delegation is not allowed to tokenize share") + ErrValidatorBondNotAllowedFromModuleAccount = sdkerrors.Register(ModuleName, 110, "validator bond is not allowed from a module account") + ErrGlobalLiquidStakingCapExceeded = sdkerrors.Register(ModuleName, 111, "delegation or tokenization exceeds the global cap") + ErrValidatorLiquidStakingCapExceeded = sdkerrors.Register(ModuleName, 112, "delegation or tokenization exceeds the validator cap") + ErrTokenizeSharesDisabledForAccount = sdkerrors.Register(ModuleName, 113, "tokenize shares currently disabled for account") + ErrUnableToDisableTokenizeShares = sdkerrors.Register(ModuleName, 114, "unable to disable tokenize shares for account") + ErrTokenizeSharesAlreadyEnabledForAccount = sdkerrors.Register(ModuleName, 115, "tokenize shares is already enabled for this account") + ErrTokenizeSharesAlreadyDisabledForAccount = sdkerrors.Register(ModuleName, 116, "tokenize shares is already disabled for this account") + ErrValidatorLiquidSharesUnderflow = sdkerrors.Register(ModuleName, 117, "validator liquid shares underflow") + ErrTotalLiquidStakedUnderflow = sdkerrors.Register(ModuleName, 118, "total liquid staked underflow") ) diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index 6fede0ef1a0c..3d2626c1b875 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -23,6 +23,9 @@ const ( // RouterKey is the msg router key for the staking module RouterKey = ModuleName + + // Prefix for module accounts that custodian tokenized shares + TokenizeShareModuleAccountPrefix = "tokenizeshare_" ) var ( @@ -54,6 +57,14 @@ var ( ValidatorUpdatesKey = []byte{0x61} // prefix for the end block validator updates key ParamsKey = []byte{0x51} // prefix for parameters for module x/staking + + TokenizeShareRecordPrefix = []byte{0x81} // key for tokenizeshare record prefix + TokenizeShareRecordIDByOwnerPrefix = []byte{0x82} // key for tokenizeshare record id by owner prefix + TokenizeShareRecordIDByDenomPrefix = []byte{0x83} // key for tokenizeshare record id by denom prefix + LastTokenizeShareRecordIDKey = []byte{0x84} // key for last tokenize share record id + TotalLiquidStakedTokensKey = []byte{0x85} // key for total liquid staked tokens + TokenizeSharesLockPrefix = []byte{0x86} // key for locking tokenize shares + TokenizeSharesUnlockQueuePrefix = []byte{0x87} // key for the queue that unlocks tokenize shares ) // UnbondingType defines the type of unbonding operation @@ -377,3 +388,34 @@ func GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddr func GetHistoricalInfoKey(height int64) []byte { return append(HistoricalInfoKey, []byte(strconv.FormatInt(height, 10))...) } + +// GetTokenizeShareRecordByIndexKey returns the key of the specified id. Intended for querying the tokenizeShareRecord by the id. +func GetTokenizeShareRecordByIndexKey(id uint64) []byte { + return append(TokenizeShareRecordPrefix, sdk.Uint64ToBigEndian(id)...) +} + +// GetTokenizeShareRecordIdsByOwnerPrefix returns the key of the specified owner. Intended for querying all tokenizeShareRecords of an owner +func GetTokenizeShareRecordIdsByOwnerPrefix(owner sdk.AccAddress) []byte { + return append(TokenizeShareRecordIDByOwnerPrefix, address.MustLengthPrefix(owner)...) +} + +// GetTokenizeShareRecordIdByOwnerAndIdKey returns the key of the specified owner and id. Intended for setting tokenizeShareRecord of an owner +func GetTokenizeShareRecordIDByOwnerAndIDKey(owner sdk.AccAddress, id uint64) []byte { + return append(append(TokenizeShareRecordIDByOwnerPrefix, address.MustLengthPrefix(owner)...), sdk.Uint64ToBigEndian(id)...) +} + +func GetTokenizeShareRecordIDByDenomKey(denom string) []byte { + return append(TokenizeShareRecordIDByDenomPrefix, []byte(denom)...) +} + +// GetTokenizeSharesLockKey returns the key for storing a tokenize share lock for a specified account +func GetTokenizeSharesLockKey(owner sdk.AccAddress) []byte { + return append(TokenizeSharesLockPrefix, address.MustLengthPrefix(owner)...) +} + +// GetTokenizeShareAuthorizationTimeKey returns the prefix key used for getting a set of pending +// tokenize share unlocks that complete at the given time +func GetTokenizeShareAuthorizationTimeKey(timestamp time.Time) []byte { + bz := sdk.FormatTimeBytes(timestamp) + return append(TokenizeSharesUnlockQueuePrefix, bz...) +} diff --git a/x/staking/types/tokenize_share_record.go b/x/staking/types/tokenize_share_record.go new file mode 100644 index 000000000000..01a64a1f69ac --- /dev/null +++ b/x/staking/types/tokenize_share_record.go @@ -0,0 +1,22 @@ +package types + +import ( + fmt "fmt" + "strconv" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" +) + +func (r TokenizeShareRecord) GetModuleAddress() sdk.AccAddress { + // NOTE: The module name is intentionally hard coded so that, if this + // function were to move to a different module in future SDK version, + // it would not break all the address lookups + moduleName := "lsm" + return address.Module(moduleName, []byte(r.ModuleAccount)) +} + +func (r TokenizeShareRecord) GetShareTokenDenom() string { + return fmt.Sprintf("%s/%s", strings.ToLower(r.Validator), strconv.Itoa(int(r.Id))) +} From fde5dc7d0d325a8340cff3011a9713c71bf786c2 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 23:22:31 +0100 Subject: [PATCH 04/31] register distribution msgs --- x/distribution/types/codec.go | 4 ++ x/distribution/types/msg.go | 86 ++++++++++++++++++++++++++++++++--- 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go index 9d5118a938f8..852de74b67f8 100644 --- a/x/distribution/types/codec.go +++ b/x/distribution/types/codec.go @@ -23,6 +23,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgFundCommunityPool{}, "cosmos-sdk/MsgFundCommunityPool") legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/distribution/MsgUpdateParams") legacy.RegisterAminoMsg(cdc, &MsgCommunityPoolSpend{}, "cosmos-sdk/distr/MsgCommunityPoolSpend") + legacy.RegisterAminoMsg(cdc, &MsgWithdrawTokenizeShareRecordReward{}, "cosmos-sdk/MsgWithdrawTokenizeReward") + legacy.RegisterAminoMsg(cdc, &MsgWithdrawAllTokenizeShareRecordReward{}, "cosmos-sdk/MsgWithdrawAllTokenizeReward") cdc.RegisterConcrete(Params{}, "cosmos-sdk/x/distribution/Params", nil) } @@ -36,6 +38,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgFundCommunityPool{}, &MsgUpdateParams{}, &MsgCommunityPoolSpend{}, + &MsgWithdrawTokenizeShareRecordReward{}, + &MsgWithdrawAllTokenizeShareRecordReward{}, ) registry.RegisterImplementations( diff --git a/x/distribution/types/msg.go b/x/distribution/types/msg.go index ee1660db681f..1831f4424a9a 100644 --- a/x/distribution/types/msg.go +++ b/x/distribution/types/msg.go @@ -3,18 +3,21 @@ package types import ( "errors" + "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // distribution message types const ( - TypeMsgSetWithdrawAddress = "set_withdraw_address" - TypeMsgWithdrawDelegatorReward = "withdraw_delegator_reward" - TypeMsgWithdrawValidatorCommission = "withdraw_validator_commission" - TypeMsgFundCommunityPool = "fund_community_pool" - TypeMsgUpdateParams = "update_params" - TypeMsgCommunityPoolSpend = "community_pool_spend" + TypeMsgSetWithdrawAddress = "set_withdraw_address" + TypeMsgWithdrawDelegatorReward = "withdraw_delegator_reward" + TypeMsgWithdrawValidatorCommission = "withdraw_validator_commission" + TypeMsgFundCommunityPool = "fund_community_pool" + TypeMsgUpdateParams = "update_params" + TypeMsgCommunityPoolSpend = "community_pool_spend" + TypeMsgWithdrawTokenizeShareRecordReward = "withdraw_tokenize_share_record_reward" + TypeMsgWithdrawAllTokenizeShareRecordReward = "withdraw_all_tokenize_share_record_reward" ) // Verify interface at compile time @@ -24,6 +27,8 @@ var ( _ sdk.Msg = (*MsgWithdrawValidatorCommission)(nil) _ sdk.Msg = (*MsgUpdateParams)(nil) _ sdk.Msg = (*MsgCommunityPoolSpend)(nil) + _ sdk.Msg = (*MsgWithdrawTokenizeShareRecordReward)(nil) + _ sdk.Msg = (*MsgWithdrawAllTokenizeShareRecordReward)(nil) ) func NewMsgSetWithdrawAddress(delAddr, withdrawAddr sdk.AccAddress) *MsgSetWithdrawAddress { @@ -224,3 +229,72 @@ func (msg MsgCommunityPoolSpend) ValidateBasic() error { return msg.Amount.Validate() } + +func NewMsgWithdrawTokenizeShareRecordReward(ownerAddr sdk.AccAddress, recordID uint64) *MsgWithdrawTokenizeShareRecordReward { + return &MsgWithdrawTokenizeShareRecordReward{ + OwnerAddress: ownerAddr.String(), + RecordId: recordID, + } +} + +func (msg MsgWithdrawTokenizeShareRecordReward) Route() string { return ModuleName } +func (msg MsgWithdrawTokenizeShareRecordReward) Type() string { + return TypeMsgWithdrawTokenizeShareRecordReward +} + +// Return address that must sign over msg.GetSignBytes() +func (msg MsgWithdrawTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { + owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{owner} +} + +// get the bytes for the message signer to sign on +func (msg MsgWithdrawTokenizeShareRecordReward) GetSignBytes() []byte { + bz := legacy.Cdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// quick validity check +func (msg MsgWithdrawTokenizeShareRecordReward) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.OwnerAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid owner address: %s", err) + } + return nil +} + +func NewMsgWithdrawAllTokenizeShareRecordReward(ownerAddr sdk.AccAddress) *MsgWithdrawAllTokenizeShareRecordReward { + return &MsgWithdrawAllTokenizeShareRecordReward{ + OwnerAddress: ownerAddr.String(), + } +} + +func (msg MsgWithdrawAllTokenizeShareRecordReward) Route() string { return ModuleName } +func (msg MsgWithdrawAllTokenizeShareRecordReward) Type() string { + return TypeMsgWithdrawAllTokenizeShareRecordReward +} + +// Return address that must sign over msg.GetSignBytes() +func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSigners() []sdk.AccAddress { + owner, err := sdk.AccAddressFromBech32(msg.OwnerAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{owner} +} + +// get the bytes for the message signer to sign on +func (msg MsgWithdrawAllTokenizeShareRecordReward) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// quick validity check +func (msg MsgWithdrawAllTokenizeShareRecordReward) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.OwnerAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid owner address: %s", err) + } + return nil +} From 8e659bcd0cf1fbdbf24daeacdf2719aaace95921 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 23:22:52 +0100 Subject: [PATCH 05/31] add SimulateMsgWithdrawTokenizeShareRecordReward --- x/distribution/simulation/operations.go | 79 ++++++++++++++++--- x/distribution/simulation/operations_test.go | 13 ++- .../testutil/expected_keepers_mocks.go | 14 ++++ x/distribution/types/expected_keepers.go | 1 + 4 files changed, 94 insertions(+), 13 deletions(-) diff --git a/x/distribution/simulation/operations.go b/x/distribution/simulation/operations.go index 9a5e5de737bf..82319a337b7b 100644 --- a/x/distribution/simulation/operations.go +++ b/x/distribution/simulation/operations.go @@ -19,15 +19,17 @@ import ( // Simulation operation weights constants const ( - OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec - OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec - OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec - OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec - - DefaultWeightMsgSetWithdrawAddress int = 50 - DefaultWeightMsgWithdrawDelegationReward int = 50 - DefaultWeightMsgWithdrawValidatorCommission int = 50 - DefaultWeightMsgFundCommunityPool int = 50 + OpWeightMsgSetWithdrawAddress = "op_weight_msg_set_withdraw_address" //nolint:gosec + OpWeightMsgWithdrawDelegationReward = "op_weight_msg_withdraw_delegation_reward" //nolint:gosec + OpWeightMsgWithdrawValidatorCommission = "op_weight_msg_withdraw_validator_commission" //nolint:gosec + OpWeightMsgFundCommunityPool = "op_weight_msg_fund_community_pool" //nolint:gosec + OpWeightMsgWithdrawAllTokenizeShareRecordReward = "op_weight_msg_withdraw_all_tokenize_share_record_reward" //nolint:gosec + + DefaultWeightMsgSetWithdrawAddress int = 50 + DefaultWeightMsgWithdrawDelegationReward int = 50 + DefaultWeightMsgWithdrawValidatorCommission int = 50 + DefaultWeightMsgFundCommunityPool int = 50 + DefaultWeightMsgWithdrawAllTokenizeShareRecordReward int = 50 ) // WeightedOperations returns all the operations from the module with their respective weights @@ -60,6 +62,13 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty }, ) + var weightMsgWithdrawTokenizeShareRecordReward int + appParams.GetOrGenerate(cdc, OpWeightMsgWithdrawAllTokenizeShareRecordReward, &weightMsgWithdrawTokenizeShareRecordReward, nil, + func(_ *rand.Rand) { + weightMsgWithdrawTokenizeShareRecordReward = DefaultWeightMsgWithdrawAllTokenizeShareRecordReward + }, + ) + interfaceRegistry := codectypes.NewInterfaceRegistry() txConfig := tx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), tx.DefaultSignModes) @@ -80,6 +89,10 @@ func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak ty weightMsgFundCommunityPool, SimulateMsgFundCommunityPool(txConfig, ak, bk, k, sk), ), + simulation.NewWeightedOperation( + weightMsgWithdrawTokenizeShareRecordReward, + SimulateMsgWithdrawTokenizeShareRecordReward(txConfig, ak, bk, k, sk), + ), } } @@ -252,3 +265,51 @@ func SimulateMsgFundCommunityPool(txConfig client.TxConfig, ak types.AccountKeep return simulation.GenAndDeliverTx(txCtx, fees) } } + +// SimulateMsgWithdrawTokenizeShareRecordReward simulates MsgWithdrawTokenizeShareRecordReward execution where +// a random account claim tokenize share record rewards. +func SimulateMsgWithdrawTokenizeShareRecordReward(txConfig client.TxConfig, ak types.AccountKeeper, bk types.BankKeeper, _ keeper.Keeper, sk types.StakingKeeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + rewardOwner, _ := simtypes.RandomAcc(r, accs) + + records := sk.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + if acc.Address.String() == record.Owner { + rewardOwner = acc + break + } + } + } + + // if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error + if rewardOwner.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgWithdrawTokenizeShareRecordReward, "account private key is nil"), nil, nil + } + + msg := types.NewMsgWithdrawAllTokenizeShareRecordReward(rewardOwner.Address) + + account := ak.GetAccount(ctx, rewardOwner.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: txConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: rewardOwner, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 3f9896287d21..d4b1c219ab1a 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -48,6 +48,7 @@ func (suite *SimTestSuite) TestWeightedOperations() { {simulation.DefaultWeightMsgWithdrawDelegationReward, types.ModuleName, types.TypeMsgWithdrawDelegatorReward}, {simulation.DefaultWeightMsgWithdrawValidatorCommission, types.ModuleName, types.TypeMsgWithdrawValidatorCommission}, {simulation.DefaultWeightMsgFundCommunityPool, types.ModuleName, types.TypeMsgFundCommunityPool}, + {simulation.DefaultWeightMsgWithdrawAllTokenizeShareRecordReward, types.ModuleName, types.TypeMsgWithdrawAllTokenizeShareRecordReward}, } for i, w := range weightesOps { @@ -80,7 +81,8 @@ func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() { suite.Require().NoError(err) var msg types.MsgSetWithdrawAddress - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) @@ -121,7 +123,8 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { suite.Require().NoError(err) var msg types.MsgWithdrawDelegatorReward - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1l4s054098kk9hmr5753c6k3m2kw65h686d3mhr", msg.ValidatorAddress) @@ -182,7 +185,8 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName suite.Require().NoError(err) var msg types.MsgWithdrawValidatorCommission - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress) @@ -209,7 +213,8 @@ func (suite *SimTestSuite) TestSimulateMsgFundCommunityPool() { suite.Require().NoError(err) var msg types.MsgFundCommunityPool - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("4896096stake", msg.Amount.String()) diff --git a/x/distribution/testutil/expected_keepers_mocks.go b/x/distribution/testutil/expected_keepers_mocks.go index 656763bb4f03..c51a8ec771d0 100644 --- a/x/distribution/testutil/expected_keepers_mocks.go +++ b/x/distribution/testutil/expected_keepers_mocks.go @@ -371,6 +371,20 @@ func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecord(ctx, id interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecord", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecord), ctx, id) } +// GetAllTokenizeShareRecords mocks base method. +func (m *MockStakingKeeper) GetAllTokenizeShareRecords(ctx types.Context) (tokenizeShareRecords []types1.TokenizeShareRecord) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllTokenizeShareRecords", ctx) + ret0, _ := ret[0].([]types1.TokenizeShareRecord) + return ret0 +} + +// GetAllTokenizeShareRecords indicates an expected call of GetAllTokenizeShareRecords. +func (mr *MockStakingKeeperMockRecorder) GetAllTokenizeShareRecords(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllTokenizeShareRecords", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllTokenizeShareRecords), ctx) +} + // MockStakingHooks is a mock of StakingHooks interface. type MockStakingHooks struct { ctrl *gomock.Controller diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go index e6f10ad5261b..0ecab454683d 100644 --- a/x/distribution/types/expected_keepers.go +++ b/x/distribution/types/expected_keepers.go @@ -53,6 +53,7 @@ type StakingKeeper interface { GetTokenizeShareRecordsByOwner(ctx sdk.Context, owner sdk.AccAddress) (tokenizeShareRecords []stakingtypes.TokenizeShareRecord) GetTokenizeShareRecord(ctx sdk.Context, id uint64) (tokenizeShareRecord stakingtypes.TokenizeShareRecord, err error) + GetAllTokenizeShareRecords(ctx sdk.Context) (tokenizeShareRecords []stakingtypes.TokenizeShareRecord) } // StakingHooks event hooks for staking validator object (noalias) From e94237afc351518584f2edae145081693c6e65a8 Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 23:57:00 +0100 Subject: [PATCH 06/31] LSM distribution queries --- .../distribution/keeper/grpc_query_test.go | 82 +++++++++++++++++++ x/distribution/keeper/delegation_test.go | 4 + x/distribution/keeper/grpc_query.go | 40 ++++++++- 3 files changed, 125 insertions(+), 1 deletion(-) diff --git a/tests/integration/distribution/keeper/grpc_query_test.go b/tests/integration/distribution/keeper/grpc_query_test.go index d3c6c7bdef4d..b9841a328720 100644 --- a/tests/integration/distribution/keeper/grpc_query_test.go +++ b/tests/integration/distribution/keeper/grpc_query_test.go @@ -19,6 +19,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/distribution/keeper" "github.com/cosmos/cosmos-sdk/x/distribution/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil" @@ -35,6 +37,7 @@ type KeeperTestSuite struct { interfaceRegistry codectypes.InterfaceRegistry bankKeeper bankkeeper.Keeper + mintKeeper mintkeeper.Keeper distrKeeper keeper.Keeper stakingKeeper *stakingkeeper.Keeper msgServer types.MsgServer @@ -44,6 +47,7 @@ func (suite *KeeperTestSuite) SetupTest() { app, err := simtestutil.Setup(testutil.AppConfig, &suite.interfaceRegistry, &suite.bankKeeper, + &suite.mintKeeper, &suite.distrKeeper, &suite.stakingKeeper, ) @@ -673,6 +677,84 @@ func (suite *KeeperTestSuite) TestGRPCCommunityPool() { } } +func (suite *KeeperTestSuite) TestGRPCTokenizeShareRecordReward() { + ctx, queryClient := suite.ctx, suite.queryClient + + addr := simtestutil.AddTestAddrs(suite.bankKeeper, suite.stakingKeeper, ctx, 2, sdk.NewInt(100000000)) + valAddrs := simtestutil.ConvertAddrsToValAddrs(addr) + tstaking := stakingtestutil.NewHelper(suite.T(), ctx, suite.stakingKeeper) + + // create validator with 50% commission + tstaking.Commission = stakingtypes.NewCommissionRates(sdk.NewDecWithPrec(5, 1), sdk.NewDecWithPrec(5, 1), sdk.NewDec(0)) + valPower := int64(100) + tstaking.CreateValidatorWithValPower(valAddrs[0], valConsPk1, valPower, true) + + // end block to bond validator + staking.EndBlocker(ctx, suite.stakingKeeper) + + // next block + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + + // fetch validator and delegation + val := suite.stakingKeeper.Validator(ctx, valAddrs[0]) + del := suite.stakingKeeper.Delegation(ctx, sdk.AccAddress(valAddrs[0]), valAddrs[0]) + + // end period + endingPeriod := suite.distrKeeper.IncrementValidatorPeriod(ctx, val) + + // calculate delegation rewards + suite.distrKeeper.CalculateDelegationRewards(ctx, val, del, endingPeriod) + + // start out block height + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + val = suite.stakingKeeper.Validator(ctx, valAddrs[0]) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 3) + + // allocate some rewards + initial := suite.stakingKeeper.TokensFromConsensusPower(ctx, 10) + tokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDecFromInt(initial)}} + suite.distrKeeper.AllocateTokensToValidator(ctx, val, tokens) + + // end period + suite.distrKeeper.IncrementValidatorPeriod(ctx, val) + + coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, initial)} + err := suite.mintKeeper.MintCoins(ctx, coins) + suite.Require().NoError(err) + + err = suite.bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.ModuleName, coins) + suite.Require().NoError(err) + // tokenize share amount + delTokens := sdk.NewInt(1000000) + msgServer := stakingkeeper.NewMsgServerImpl(suite.stakingKeeper) + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &stakingtypes.MsgTokenizeShares{ + DelegatorAddress: sdk.AccAddress(valAddrs[0]).String(), + ValidatorAddress: valAddrs[0].String(), + TokenizedShareOwner: sdk.AccAddress(valAddrs[0]).String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, delTokens), + }) + suite.Require().NoError(err) + + staking.EndBlocker(ctx, suite.stakingKeeper) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + suite.distrKeeper.AllocateTokensToValidator(ctx, val, tokens) + suite.distrKeeper.IncrementValidatorPeriod(ctx, val) + + rewards, err := queryClient.TokenizeShareRecordReward(gocontext.Background(), &types.QueryTokenizeShareRecordRewardRequest{ + OwnerAddress: sdk.AccAddress(valAddrs[0]).String(), + }) + suite.Require().NoError(err) + suite.Require().Equal(&types.QueryTokenizeShareRecordRewardResponse{ + Rewards: []types.TokenizeShareRecordReward{ + { + RecordId: 1, + Reward: sdk.DecCoins{sdk.NewInt64DecCoin("stake", 50000)}, + }, + }, + Total: sdk.DecCoins{sdk.NewInt64DecCoin("stake", 50000)}, + }, rewards) +} + func TestDistributionTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 8310f06d1493..a4cd5e959caa 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -98,6 +98,10 @@ func TestCalculateRewardsBasic(t *testing.T) { require.Equal(t, sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: math.LegacyNewDec(initial / 2)}}, distrKeeper.GetValidatorAccumulatedCommission(ctx, valAddr).Commission) } +func TestWithdrawTokenizeShareRecordReward(t *testing.T) { + // TODO add LSM test +} + func TestCalculateRewardsAfterSlash(t *testing.T) { ctrl := gomock.NewController(t) key := sdk.NewKVStoreKey(disttypes.StoreKey) diff --git a/x/distribution/keeper/grpc_query.go b/x/distribution/keeper/grpc_query.go index 33ef1499b5ea..d0d36421d9da 100644 --- a/x/distribution/keeper/grpc_query.go +++ b/x/distribution/keeper/grpc_query.go @@ -296,9 +296,47 @@ func (k Querier) CommunityPool(c context.Context, req *types.QueryCommunityPoolR // TokenizeShareRecordReward returns estimated amount of reward from tokenize share record ownership func (k Keeper) TokenizeShareRecordReward(c context.Context, req *types.QueryTokenizeShareRecordRewardRequest) (*types.QueryTokenizeShareRecordRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + totalRewards := sdk.DecCoins{} rewards := []types.TokenizeShareRecordReward{} - // TODO add LSM logic + + ownerAddr, err := sdk.AccAddressFromBech32(req.OwnerAddress) + if err != nil { + return nil, err + } + records := k.stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, ownerAddr) + for _, record := range records { + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + moduleAddr := record.GetModuleAddress() + moduleBalance := k.bankKeeper.GetAllBalances(ctx, moduleAddr) + moduleBalanceDecCoins := sdk.NewDecCoinsFromCoins(moduleBalance...) + + val := k.stakingKeeper.Validator(ctx, valAddr) + del := k.stakingKeeper.Delegation(ctx, moduleAddr, valAddr) + if val != nil && del != nil { + // withdraw rewards + endingPeriod := k.IncrementValidatorPeriod(ctx, val) + recordReward := k.CalculateDelegationRewards(ctx, val, del, endingPeriod) + + rewards = append(rewards, types.TokenizeShareRecordReward{ + RecordId: record.Id, + Reward: recordReward.Add(moduleBalanceDecCoins...), + }) + totalRewards = totalRewards.Add(recordReward...) + } else if !moduleBalance.IsZero() { + rewards = append(rewards, types.TokenizeShareRecordReward{ + RecordId: record.Id, + Reward: moduleBalanceDecCoins, + }) + totalRewards = totalRewards.Add(moduleBalanceDecCoins...) + } + } + return &types.QueryTokenizeShareRecordRewardResponse{ Rewards: rewards, Total: totalRewards, From 75bec41ad5ca7fbf964905c913fa9d5bab56098e Mon Sep 17 00:00:00 2001 From: mpoke Date: Mon, 27 Nov 2023 23:57:15 +0100 Subject: [PATCH 07/31] LSM distr cli --- x/distribution/client/cli/query.go | 46 ++++++++++++++++ x/distribution/client/cli/suite_test.go | 48 +++++++++++++++++ x/distribution/client/cli/tx.go | 72 +++++++++++++++++++++++++ 3 files changed, 166 insertions(+) diff --git a/x/distribution/client/cli/query.go b/x/distribution/client/cli/query.go index 2ffdd5f1158d..e212fdc6f651 100644 --- a/x/distribution/client/cli/query.go +++ b/x/distribution/client/cli/query.go @@ -32,6 +32,7 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryValidatorSlashes(), GetCmdQueryDelegatorRewards(), GetCmdQueryCommunityPool(), + GetCmdQueryTokenizeShareRecordReward(), ) return distQueryCmd @@ -364,3 +365,48 @@ $ %s query distribution community-pool flags.AddQueryFlagsToCmd(cmd) return cmd } + +// GetCmdQueryTokenizeShareRecordReward implements the query tokenize share record rewards +func GetCmdQueryTokenizeShareRecordReward() *cobra.Command { + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "tokenize-share-record-rewards [owner]", + Args: cobra.ExactArgs(1), + Short: "Query distribution tokenize share record rewards", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the query tokenize share record rewards. + +Example: +$ %s query distribution tokenize-share-record-rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj +`, + version.AppName, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + ownerAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordReward( + cmd.Context(), + &types.QueryTokenizeShareRecordRewardRequest{OwnerAddress: ownerAddr.String()}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/distribution/client/cli/suite_test.go b/x/distribution/client/cli/suite_test.go index fce975803fa4..fa426fdadf05 100644 --- a/x/distribution/client/cli/suite_test.go +++ b/x/distribution/client/cli/suite_test.go @@ -678,3 +678,51 @@ func (s *CLITestSuite) TestNewFundCommunityPoolCmd() { }) } } + +func (s *CLITestSuite) TestNewWithdrawAllTokenizeShareRecordRewardCmd() { + val := testutil.CreateKeyringAccounts(s.T(), s.kr, 1) + + testCases := []struct { + name string + args []string + expectErr bool + expectedCode uint32 + respType proto.Message + }{ + { + "valid transaction of withdraw tokenize share record reward", + []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, val[0].Address.String()), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10))).String()), + }, + false, 0, &sdk.TxResponse{}, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewWithdrawAllTokenizeShareRecordRewardCmd() + + out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err, out.String()) + s.Require().NoError(s.clientCtx.Codec.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} + +// This test requires multiple validators, if I add this test to `IntegrationTestSuite` by increasing +// `NumValidators` the existing tests are leading to non-determnism so created new suite for this test. +func (s *CLITestSuite) TestNewWithdrawAllRewardsGenerateOnly() { + // TODO add LSM test +} diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index e1f0312daf1c..1804bf7087a9 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "strconv" "strings" "github.com/spf13/cobra" @@ -40,6 +41,8 @@ func NewTxCmd() *cobra.Command { NewWithdrawAllRewardsCmd(), NewSetWithdrawAddrCmd(), NewFundCommunityPoolCmd(), + NewWithdrawTokenizeShareRecordRewardCmd(), + NewWithdrawAllTokenizeShareRecordRewardCmd(), ) return distTxCmd @@ -254,3 +257,72 @@ $ %s tx distribution fund-community-pool 100uatom --from mykey return cmd } + +// WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord +func NewWithdrawAllTokenizeShareRecordRewardCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-all-tokenize-share-rewards", + Args: cobra.ExactArgs(0), + Short: "Withdraw reward for all owning TokenizeShareRecord", + Long: strings.TrimSpace( + fmt.Sprintf(`Withdraw reward for all owned TokenizeShareRecord + +Example: +$ %s tx distribution withdraw-tokenize-share-rewards --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawAllTokenizeShareRecordReward(clientCtx.GetFromAddress()) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord +func NewWithdrawTokenizeShareRecordRewardCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-tokenize-share-rewards", + Args: cobra.ExactArgs(1), + Short: "Withdraw reward for an owning TokenizeShareRecord", + Long: strings.TrimSpace( + fmt.Sprintf(`Withdraw reward for an owned TokenizeShareRecord + +Example: +$ %s tx distribution withdraw-tokenize-share-rewards 1 --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recordID, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + msg := types.NewMsgWithdrawTokenizeShareRecordReward(clientCtx.GetFromAddress(), uint64(recordID)) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} From 5b14e52282e108f021209bdf1e7704c119c267ca Mon Sep 17 00:00:00 2001 From: mpoke Date: Tue, 28 Nov 2023 10:25:14 +0100 Subject: [PATCH 08/31] add BeforeTokenizeShareRecordRemoved hook --- x/distribution/keeper/hooks.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index cb8ca0c3f757..1c50cb999d4f 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -111,6 +111,15 @@ func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, f return nil } +// Withdraw rewards before removing record +func (h Hooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordID uint64) error { + err := h.k.WithdrawSingleShareRecordReward(ctx, recordID) + if err != nil { + h.k.Logger(ctx).Error(err.Error()) + } + return err +} + func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } From 1f2be7c118b4b636355491f201c1cbcb5b066f71 Mon Sep 17 00:00:00 2001 From: mpoke Date: Tue, 28 Nov 2023 12:28:11 +0100 Subject: [PATCH 09/31] add signers to proto distribution --- api/cosmos/distribution/v1beta1/tx.pulsar.go | 209 ++++++++++--------- go.mod | 2 +- proto/cosmos/distribution/v1beta1/tx.proto | 6 + x/distribution/types/tx.pb.go | 127 +++++------ 4 files changed, 180 insertions(+), 164 deletions(-) diff --git a/api/cosmos/distribution/v1beta1/tx.pulsar.go b/api/cosmos/distribution/v1beta1/tx.pulsar.go index 10cb6409fd45..89a9805e859b 100644 --- a/api/cosmos/distribution/v1beta1/tx.pulsar.go +++ b/api/cosmos/distribution/v1beta1/tx.pulsar.go @@ -7843,7 +7843,7 @@ var file_cosmos_distribution_v1beta1_tx_proto_rawDesc = []byte{ 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, - 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x22, 0x8c, 0x01, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x57, 0x69, + 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x22, 0xd7, 0x01, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -7851,116 +7851,125 @@ var file_cosmos_distribution_v1beta1_tx_proto_rawDesc = []byte{ 0x3a, 0x22, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x3a, 0x08, 0x88, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x2e, 0x0a, 0x2c, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, - 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, + 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x3a, 0x53, 0x88, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x12, 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, - 0x6c, 0x3a, 0x22, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x22, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, - 0x08, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x22, 0x31, 0x0a, 0x2f, 0x4d, 0x73, 0x67, - 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, - 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, 0x09, - 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x2e, 0x63, + 0x22, 0x2e, 0x0a, 0x2c, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xc0, 0x01, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, 0x0a, 0x0d, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0c, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x56, 0x88, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, + 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x22, 0x31, 0x0a, 0x2f, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, 0x09, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, + 0x84, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x17, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, + 0x1b, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, - 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x93, 0x01, 0x0a, - 0x17, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, - 0x64, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, - 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x1b, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x3b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x43, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, + 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, + 0x01, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, + 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, + 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, - 0x43, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, - 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, - 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x39, 0x2e, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x75, + 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, - 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, - 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, - 0x65, 0x6e, 0x64, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, + 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, + 0x64, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, + 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xb1, 0x01, + 0x0a, 0x21, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, + 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, - 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, - 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0xb1, 0x01, 0x0a, 0x21, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x49, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x49, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, - 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xba, 0x01, 0x0a, 0x24, 0x57, 0x69, 0x74, 0x68, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0xba, 0x01, 0x0a, 0x24, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, + 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x44, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x12, 0x44, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, + 0x1a, 0x4c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x4c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, - 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/go.mod b/go.mod index eda45f98b6fc..b987c9bccb6b 100644 --- a/go.mod +++ b/go.mod @@ -28,6 +28,7 @@ require ( github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/iavl v0.20.1 github.com/cosmos/ledger-cosmos-go v0.12.4 + github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 github.com/google/gofuzz v1.2.0 @@ -104,7 +105,6 @@ require ( github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 0162bcaf8317..2221a86027d9 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -181,6 +181,9 @@ message MsgCommunityPoolSpend { // MsgWithdrawTokenizeShareRecordReward withdraws tokenize share rewards for a specific record message MsgWithdrawTokenizeShareRecordReward { + option (cosmos.msg.v1.signer) = "record_owner"; + option (amino.name) = "cosmos-sdk/distr/MsgWithdrawTokenizeShareRecordReward"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -194,6 +197,9 @@ message MsgWithdrawTokenizeShareRecordRewardResponse {} // MsgWithdrawAllTokenizeShareRecordReward withdraws tokenize share rewards or all // records owned by the designated owner message MsgWithdrawAllTokenizeShareRecordReward { + option (cosmos.msg.v1.signer) = "record_owner"; + option (amino.name) = "cosmos-sdk/distr/MsgWithdrawAllTokenizeShareRecordReward"; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 96e297f04ff5..94010b9fb1d6 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -754,69 +754,70 @@ func init() { } var fileDescriptor_ed4f433d965e58ca = []byte{ - // 978 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0x34, 0x10, 0xd5, 0xd3, 0xa2, 0x26, 0xab, 0xa0, 0x24, 0x9b, 0xb2, 0x2e, 0xdb, 0x28, - 0x8d, 0xa2, 0x76, 0x57, 0x0e, 0x5f, 0xea, 0x22, 0x84, 0x12, 0xb7, 0x91, 0x22, 0x61, 0x51, 0xad, - 0xf9, 0x90, 0xb8, 0x44, 0x6b, 0xcf, 0xb0, 0x1e, 0xd5, 0xbb, 0xb3, 0xda, 0x19, 0xc7, 0x35, 0x27, - 0x40, 0x1c, 0x10, 0x42, 0x08, 0x95, 0x1f, 0x40, 0x8f, 0x15, 0x17, 0x82, 0xc4, 0x09, 0xfe, 0x40, - 0x2f, 0x48, 0x15, 0x27, 0x4e, 0x05, 0x39, 0x87, 0x20, 0x71, 0x43, 0x70, 0x47, 0xfb, 0xe9, 0x5d, - 0xef, 0xda, 0x6b, 0xf7, 0x83, 0x5e, 0xf2, 0x31, 0xf3, 0xbe, 0xcf, 0x3c, 0xcf, 0x33, 0xef, 0xbc, - 0xaf, 0x0d, 0xd7, 0x5b, 0x94, 0x59, 0x94, 0xa9, 0x88, 0x30, 0xee, 0x92, 0x66, 0x97, 0x13, 0x6a, - 0xab, 0x87, 0xd5, 0x26, 0xe6, 0x46, 0x55, 0xe5, 0xb7, 0x14, 0xc7, 0xa5, 0x9c, 0x0a, 0x6b, 0x41, - 0x94, 0x92, 0x8c, 0x52, 0xc2, 0x28, 0x71, 0xc9, 0xa4, 0x26, 0xf5, 0xe3, 0x54, 0xef, 0xaf, 0x20, - 0x45, 0x94, 0x42, 0xe0, 0xa6, 0xc1, 0x70, 0x0c, 0xd8, 0xa2, 0xc4, 0x0e, 0xf7, 0x57, 0x83, 0xfd, - 0x83, 0x20, 0x31, 0xc4, 0x0f, 0xb6, 0x96, 0xc3, 0x54, 0x8b, 0x99, 0xea, 0x61, 0xd5, 0xfb, 0x15, - 0x6e, 0x2c, 0x1a, 0x16, 0xb1, 0xa9, 0xea, 0xff, 0x0c, 0x97, 0x94, 0x49, 0xfc, 0x53, 0x74, 0xfd, - 0x78, 0xf9, 0x2f, 0x00, 0x9f, 0xaf, 0x33, 0xb3, 0x81, 0xf9, 0xfb, 0x84, 0xb7, 0x91, 0x6b, 0xf4, - 0x76, 0x10, 0x72, 0x31, 0x63, 0xc2, 0x75, 0xb8, 0x88, 0x70, 0x07, 0x9b, 0x06, 0xa7, 0xee, 0x81, - 0x11, 0x2c, 0xae, 0x80, 0x0b, 0x60, 0xb3, 0xbc, 0xbb, 0xf2, 0xeb, 0x8f, 0x57, 0x96, 0x42, 0x8a, - 0x61, 0x78, 0x83, 0xbb, 0xc4, 0x36, 0xf5, 0x85, 0x38, 0x25, 0x82, 0xa9, 0xc1, 0x85, 0x5e, 0x88, - 0x1c, 0xa3, 0x9c, 0x2a, 0x40, 0x39, 0xd7, 0x4b, 0x73, 0xd1, 0xf6, 0x3e, 0xbf, 0x53, 0x29, 0xfd, - 0x79, 0xa7, 0x52, 0xfa, 0xf4, 0xe4, 0x68, 0x2b, 0x4b, 0xeb, 0x8b, 0x93, 0xa3, 0xad, 0x8b, 0x01, - 0xd2, 0x15, 0x86, 0x6e, 0xaa, 0x75, 0x66, 0xd6, 0x29, 0x22, 0x1f, 0xf6, 0x47, 0x34, 0xc9, 0x15, - 0xf8, 0x42, 0xae, 0x58, 0x1d, 0x33, 0x87, 0xda, 0x0c, 0xcb, 0xff, 0x02, 0x28, 0xd6, 0x99, 0x19, - 0x6d, 0x5f, 0x8b, 0x4e, 0xd2, 0x71, 0xcf, 0x70, 0xd1, 0xe3, 0xf2, 0xe4, 0x3a, 0x5c, 0x3c, 0x34, - 0x3a, 0x04, 0xa5, 0x60, 0x8a, 0x4c, 0x59, 0x88, 0x53, 0x22, 0x57, 0xf6, 0x8b, 0x5d, 0xd9, 0x48, - 0xbb, 0x32, 0xa2, 0x8b, 0x50, 0x3b, 0x10, 0x26, 0x7f, 0x05, 0xa0, 0x3c, 0x5e, 0x77, 0x64, 0x8f, - 0xd0, 0x86, 0xf3, 0x86, 0x45, 0xbb, 0x36, 0x5f, 0x01, 0x17, 0xe6, 0x36, 0xcf, 0x6c, 0xaf, 0x86, - 0xe5, 0xa6, 0x78, 0x55, 0x1d, 0x3d, 0x00, 0xa5, 0x46, 0x89, 0xbd, 0xfb, 0xca, 0xbd, 0x07, 0x95, - 0xd2, 0x77, 0xbf, 0x57, 0x36, 0x4d, 0xc2, 0xdb, 0xdd, 0xa6, 0xd2, 0xa2, 0x56, 0x58, 0xd5, 0x6a, - 0x82, 0x13, 0xef, 0x3b, 0x98, 0xf9, 0x09, 0xec, 0xee, 0xc9, 0xd1, 0x16, 0xd0, 0x43, 0x7c, 0xf9, - 0x7b, 0x00, 0xa5, 0x04, 0xa1, 0xf7, 0x22, 0xed, 0x35, 0x6a, 0x59, 0x84, 0x31, 0x42, 0xed, 0x7c, - 0x17, 0xc1, 0xcc, 0x2e, 0xa6, 0x6b, 0x2b, 0x83, 0x98, 0x53, 0x5b, 0x09, 0x52, 0x43, 0x3a, 0xf2, - 0x6d, 0x00, 0x37, 0x26, 0x33, 0x7e, 0x0a, 0x36, 0xfe, 0x03, 0xe0, 0x52, 0x9d, 0x99, 0x7b, 0x5d, - 0x1b, 0x79, 0x3c, 0xba, 0x36, 0xe1, 0xfd, 0x1b, 0x94, 0x76, 0xfe, 0x3f, 0x0a, 0xc2, 0xab, 0xb0, - 0x8c, 0xb0, 0x43, 0x19, 0xe1, 0xd4, 0x2d, 0x2c, 0xf2, 0x61, 0xa8, 0xa6, 0x25, 0xef, 0x65, 0xb8, - 0xee, 0xdd, 0x47, 0x25, 0x7d, 0x1f, 0x19, 0x75, 0xb2, 0x04, 0xcf, 0xe7, 0xad, 0xc7, 0xcf, 0xfc, - 0x17, 0x00, 0xcf, 0xd5, 0x99, 0xf9, 0xae, 0x83, 0x0c, 0x8e, 0x6f, 0x18, 0xae, 0x61, 0x31, 0x8f, - 0xa7, 0xd1, 0xe5, 0x6d, 0xea, 0x12, 0xde, 0x2f, 0x2c, 0xa3, 0x61, 0xa8, 0xb0, 0x07, 0xe7, 0x1d, - 0x1f, 0xc1, 0x17, 0x77, 0x66, 0xfb, 0xa2, 0x32, 0x61, 0x38, 0x28, 0xc1, 0x61, 0xbb, 0x65, 0xcf, - 0xd3, 0xd0, 0xa7, 0x20, 0x5b, 0xd3, 0x7c, 0x9d, 0x31, 0xae, 0xa7, 0xf3, 0x52, 0x42, 0x67, 0xaa, - 0xa1, 0x8f, 0x70, 0x97, 0x57, 0xe1, 0xf2, 0xc8, 0x52, 0x2c, 0xf5, 0xf6, 0x29, 0xbf, 0xc1, 0xa7, - 0x7c, 0x68, 0x38, 0xd8, 0x46, 0x0f, 0x2d, 0xf8, 0x3c, 0x2c, 0xbb, 0xb8, 0x45, 0x1c, 0x82, 0x6d, - 0x1e, 0x5c, 0xa8, 0x3e, 0x5c, 0x48, 0x14, 0xd6, 0xdc, 0x93, 0x2d, 0x2c, 0xed, 0x6a, 0xd6, 0xb0, - 0x8d, 0x51, 0xc3, 0xd4, 0x5c, 0xe9, 0xf2, 0x97, 0x00, 0xae, 0x27, 0xde, 0xea, 0x3b, 0xf4, 0x26, - 0xb6, 0xc9, 0x47, 0xb8, 0xd1, 0x36, 0x5c, 0xac, 0xe3, 0x16, 0xf5, 0x5a, 0x9e, 0xdf, 0xf0, 0xdf, - 0x80, 0xcf, 0xd1, 0x9e, 0x8d, 0x33, 0xfd, 0xe5, 0xef, 0x07, 0x95, 0xa5, 0xbe, 0x61, 0x75, 0x34, - 0x39, 0xb5, 0x2d, 0xeb, 0x67, 0xfd, 0xff, 0xa3, 0x46, 0xbf, 0xe6, 0x5b, 0x45, 0x5d, 0x74, 0x40, - 0x90, 0x6f, 0xd5, 0x33, 0xfa, 0xe9, 0x60, 0x61, 0x1f, 0x69, 0xa7, 0xa3, 0x02, 0x97, 0x15, 0x78, - 0x79, 0x1a, 0x36, 0xf1, 0x9d, 0xba, 0xf0, 0x52, 0x22, 0x7e, 0xa7, 0xd3, 0x79, 0x52, 0x02, 0x12, - 0x1c, 0xab, 0x50, 0x9d, 0xf2, 0xcc, 0x98, 0x66, 0x30, 0x6d, 0xb3, 0xf6, 0x47, 0x01, 0xdb, 0x3f, - 0x97, 0xe1, 0x5c, 0x9d, 0x99, 0xc2, 0x67, 0x00, 0x0a, 0x39, 0x9f, 0x40, 0xb6, 0x27, 0xbe, 0xa4, - 0xdc, 0x41, 0x2e, 0x6a, 0xb3, 0xe7, 0xc4, 0x6d, 0xf9, 0x1b, 0x00, 0x97, 0xc7, 0x4d, 0xfe, 0xd7, - 0x8a, 0x70, 0xc7, 0x24, 0x8a, 0x6f, 0x3e, 0x64, 0x62, 0xcc, 0xea, 0x5b, 0x00, 0xd7, 0x26, 0x8d, - 0xc1, 0xd7, 0xa7, 0x3d, 0x20, 0x27, 0x59, 0xac, 0x3d, 0x42, 0x72, 0xcc, 0xf0, 0x13, 0x00, 0x17, - 0xb3, 0x13, 0xa6, 0x5a, 0x04, 0x9d, 0x49, 0x11, 0xaf, 0xce, 0x9c, 0x12, 0x73, 0x70, 0xe1, 0xd9, - 0x54, 0x37, 0xbf, 0x5c, 0x04, 0x95, 0x8c, 0x16, 0x5f, 0x9e, 0x25, 0x3a, 0x3e, 0xd3, 0x2b, 0xdb, - 0x9c, 0xbe, 0x5a, 0x58, 0xb6, 0xd9, 0x9c, 0xe2, 0xb2, 0x1d, 0xff, 0x8a, 0x84, 0x1f, 0x00, 0x7c, - 0xb1, 0xb8, 0x93, 0xed, 0x4c, 0x7b, 0xd3, 0x63, 0x21, 0xc4, 0xfd, 0x47, 0x86, 0x88, 0x39, 0xff, - 0x04, 0xe0, 0xfa, 0x54, 0xfd, 0xeb, 0xda, 0xb4, 0x67, 0x4e, 0x42, 0x11, 0xdf, 0x7a, 0x1c, 0x28, - 0x11, 0x79, 0xf1, 0xd9, 0x8f, 0xbd, 0x39, 0xb4, 0xfb, 0xf6, 0xdd, 0x81, 0x04, 0xee, 0x0d, 0x24, - 0x70, 0x7f, 0x20, 0x81, 0x3f, 0x06, 0x12, 0xf8, 0xfa, 0x58, 0x2a, 0xdd, 0x3f, 0x96, 0x4a, 0xbf, - 0x1d, 0x4b, 0xa5, 0x0f, 0xaa, 0x13, 0x87, 0xda, 0xad, 0xf4, 0x3c, 0xf7, 0x67, 0x5c, 0x73, 0xde, - 0xff, 0x4a, 0xf6, 0xd2, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa8, 0xa7, 0x9f, 0x2b, 0x84, 0x0e, - 0x00, 0x00, + // 1000 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xde, 0x69, 0x20, 0x62, 0xa7, 0x41, 0x4d, 0xac, 0xa0, 0x24, 0x4e, 0xf1, 0x16, 0x37, 0x4a, + 0xa3, 0xa8, 0xb5, 0xb5, 0x81, 0x02, 0x35, 0x42, 0x28, 0x49, 0x1b, 0x29, 0x12, 0x2b, 0x2a, 0x2f, + 0x14, 0x89, 0x4b, 0xe4, 0xdd, 0x19, 0xbc, 0xa3, 0xae, 0x3d, 0x96, 0x67, 0x36, 0xdb, 0xe5, 0x04, + 0x88, 0x03, 0xe2, 0x80, 0x50, 0xf9, 0x03, 0xe8, 0xb1, 0xe2, 0x42, 0x90, 0x38, 0xc1, 0x85, 0x63, + 0x2f, 0x48, 0x15, 0x17, 0x38, 0x15, 0x94, 0x1c, 0x82, 0xc4, 0x0d, 0xc1, 0x1d, 0xf9, 0xe7, 0xda, + 0x6b, 0xaf, 0xbd, 0xe9, 0x0f, 0xb8, 0x24, 0xbb, 0x33, 0xef, 0x7d, 0xf3, 0x7d, 0xdf, 0xbc, 0x79, + 0x33, 0x0b, 0x57, 0xda, 0x94, 0x59, 0x94, 0xa9, 0x88, 0x30, 0xee, 0x92, 0x56, 0x8f, 0x13, 0x6a, + 0xab, 0xfb, 0xf5, 0x16, 0xe6, 0x46, 0x5d, 0xe5, 0xb7, 0x14, 0xc7, 0xa5, 0x9c, 0x0a, 0xcb, 0x41, + 0x94, 0x92, 0x8c, 0x52, 0xc2, 0x28, 0x71, 0xde, 0xa4, 0x26, 0xf5, 0xe3, 0x54, 0xef, 0x53, 0x90, + 0x22, 0x4a, 0x21, 0x70, 0xcb, 0x60, 0x38, 0x06, 0x6c, 0x53, 0x62, 0x87, 0xf3, 0x4b, 0xc1, 0xfc, + 0x5e, 0x90, 0x18, 0xe2, 0x07, 0x53, 0x0b, 0x61, 0xaa, 0xc5, 0x4c, 0x75, 0xbf, 0xee, 0xfd, 0x0b, + 0x27, 0xe6, 0x0c, 0x8b, 0xd8, 0x54, 0xf5, 0xff, 0x86, 0x43, 0x4a, 0x11, 0xff, 0x14, 0x5d, 0x3f, + 0x5e, 0xfe, 0x13, 0xc0, 0xe7, 0x1a, 0xcc, 0x6c, 0x62, 0xfe, 0x2e, 0xe1, 0x1d, 0xe4, 0x1a, 0xfd, + 0x4d, 0x84, 0x5c, 0xcc, 0x98, 0x70, 0x0d, 0xce, 0x21, 0xdc, 0xc5, 0xa6, 0xc1, 0xa9, 0xbb, 0x67, + 0x04, 0x83, 0x8b, 0xe0, 0x1c, 0x58, 0xab, 0x6e, 0x2d, 0xfe, 0xfc, 0xdd, 0xa5, 0xf9, 0x90, 0x62, + 0x18, 0xde, 0xe4, 0x2e, 0xb1, 0x4d, 0x7d, 0x36, 0x4e, 0x89, 0x60, 0xb6, 0xe1, 0x6c, 0x3f, 0x44, + 0x8e, 0x51, 0x4e, 0x95, 0xa0, 0x9c, 0xe9, 0xa7, 0xb9, 0x68, 0x3b, 0x9f, 0xde, 0xa9, 0x55, 0xfe, + 0xb8, 0x53, 0xab, 0x7c, 0x7c, 0x7c, 0xb0, 0x9e, 0xa5, 0xf5, 0xd9, 0xf1, 0xc1, 0xfa, 0xf9, 0x00, + 0xe9, 0x12, 0x43, 0x37, 0xd5, 0x06, 0x33, 0x1b, 0x14, 0x91, 0xf7, 0x07, 0x23, 0x9a, 0xe4, 0x1a, + 0x7c, 0x3e, 0x57, 0xac, 0x8e, 0x99, 0x43, 0x6d, 0x86, 0xe5, 0x7f, 0x00, 0x14, 0x1b, 0xcc, 0x8c, + 0xa6, 0xaf, 0x46, 0x2b, 0xe9, 0xb8, 0x6f, 0xb8, 0xe8, 0x71, 0x79, 0x72, 0x0d, 0xce, 0xed, 0x1b, + 0x5d, 0x82, 0x52, 0x30, 0x65, 0xa6, 0xcc, 0xc6, 0x29, 0x91, 0x2b, 0xbb, 0xe5, 0xae, 0xac, 0xa6, + 0x5d, 0x19, 0xd1, 0x45, 0xa8, 0x1d, 0x08, 0x93, 0x3f, 0x07, 0x50, 0x1e, 0xaf, 0x3b, 0xb2, 0x47, + 0xe8, 0xc0, 0x69, 0xc3, 0xa2, 0x3d, 0x9b, 0x2f, 0x82, 0x73, 0x53, 0x6b, 0xa7, 0x37, 0x96, 0xc2, + 0x72, 0x53, 0xbc, 0xaa, 0x8e, 0x0e, 0x80, 0xb2, 0x4d, 0x89, 0xbd, 0x75, 0xf9, 0xde, 0x83, 0x5a, + 0xe5, 0xeb, 0xdf, 0x6a, 0x6b, 0x26, 0xe1, 0x9d, 0x5e, 0x4b, 0x69, 0x53, 0x2b, 0xac, 0x6a, 0x35, + 0xc1, 0x89, 0x0f, 0x1c, 0xcc, 0xfc, 0x04, 0x76, 0xf7, 0xf8, 0x60, 0x1d, 0xe8, 0x21, 0xbe, 0xfc, + 0x0d, 0x80, 0x52, 0x82, 0xd0, 0x8d, 0x48, 0xfb, 0x36, 0xb5, 0x2c, 0xc2, 0x18, 0xa1, 0x76, 0xbe, + 0x8b, 0xe0, 0xc4, 0x2e, 0xa6, 0x6b, 0x2b, 0x83, 0x98, 0x53, 0x5b, 0x09, 0x52, 0x43, 0x3a, 0xf2, + 0x6d, 0x00, 0x57, 0x8b, 0x19, 0xff, 0x0f, 0x36, 0xfe, 0x0d, 0xe0, 0x7c, 0x83, 0x99, 0x3b, 0x3d, + 0x1b, 0x79, 0x3c, 0x7a, 0x36, 0xe1, 0x83, 0xeb, 0x94, 0x76, 0xff, 0x3b, 0x0a, 0xc2, 0xcb, 0xb0, + 0x8a, 0xb0, 0x43, 0x19, 0xe1, 0xd4, 0x2d, 0x2d, 0xf2, 0x61, 0xa8, 0xa6, 0x25, 0xf7, 0x65, 0x38, + 0xee, 0xed, 0x47, 0x2d, 0xbd, 0x1f, 0x19, 0x75, 0xb2, 0x04, 0xcf, 0xe6, 0x8d, 0xc7, 0xc7, 0xfc, + 0x27, 0x00, 0xcf, 0x34, 0x98, 0xf9, 0x8e, 0x83, 0x0c, 0x8e, 0xaf, 0x1b, 0xae, 0x61, 0x31, 0x8f, + 0xa7, 0xd1, 0xe3, 0x1d, 0xea, 0x12, 0x3e, 0x28, 0x2d, 0xa3, 0x61, 0xa8, 0xb0, 0x03, 0xa7, 0x1d, + 0x1f, 0xc1, 0x17, 0x77, 0x7a, 0xe3, 0xbc, 0x52, 0x70, 0x39, 0x28, 0xc1, 0x62, 0x5b, 0x55, 0xcf, + 0xd3, 0xd0, 0xa7, 0x20, 0x5b, 0xd3, 0x7c, 0x9d, 0x31, 0xae, 0xa7, 0xf3, 0x42, 0x42, 0x67, 0xaa, + 0xa1, 0x8f, 0x70, 0x97, 0x97, 0xe0, 0xc2, 0xc8, 0x50, 0x2c, 0xf5, 0xf6, 0x29, 0xbf, 0xc1, 0xa7, + 0x7c, 0x68, 0x3a, 0xd8, 0x46, 0x0f, 0x2d, 0xf8, 0x2c, 0xac, 0xba, 0xb8, 0x4d, 0x1c, 0x82, 0x6d, + 0x1e, 0x6c, 0xa8, 0x3e, 0x1c, 0x48, 0x14, 0xd6, 0xd4, 0x93, 0x2d, 0x2c, 0xed, 0x4a, 0xd6, 0xb0, + 0xd5, 0x51, 0xc3, 0xd4, 0x5c, 0xe9, 0xf2, 0x2f, 0x00, 0xae, 0x24, 0xce, 0xea, 0xdb, 0xf4, 0x26, + 0xb6, 0xc9, 0x07, 0xb8, 0xd9, 0x31, 0x5c, 0xac, 0xe3, 0x36, 0xf5, 0x5a, 0x9e, 0xdf, 0xf0, 0x5f, + 0x87, 0xcf, 0xd2, 0xbe, 0x8d, 0x33, 0xfd, 0xe5, 0xaf, 0x07, 0xb5, 0xf9, 0x81, 0x61, 0x75, 0x35, + 0x39, 0x35, 0x2d, 0xeb, 0x33, 0xfe, 0xf7, 0xa8, 0xd1, 0x2f, 0xfb, 0x56, 0x51, 0x17, 0xed, 0x11, + 0xe4, 0x5b, 0xf5, 0x94, 0xfe, 0x4c, 0x30, 0xb0, 0x8b, 0xb4, 0x66, 0xb2, 0xc0, 0x67, 0xc2, 0x38, + 0x3f, 0xdd, 0x93, 0x72, 0x39, 0x4f, 0x4a, 0x29, 0x61, 0x59, 0x81, 0x17, 0x27, 0x89, 0x8b, 0xcb, + 0xe3, 0x47, 0x00, 0x2f, 0x24, 0x12, 0x36, 0xbb, 0xdd, 0x27, 0x65, 0x86, 0x76, 0xa3, 0x50, 0xef, + 0xab, 0x45, 0x7a, 0x8b, 0x68, 0xc9, 0x75, 0x38, 0x69, 0x68, 0xac, 0x3a, 0x78, 0x07, 0x64, 0x0b, + 0x23, 0x0a, 0xd8, 0xf8, 0xa1, 0x0a, 0xa7, 0x1a, 0xcc, 0x14, 0x3e, 0x01, 0x50, 0xc8, 0x79, 0x1b, + 0x6d, 0x14, 0x9e, 0xf1, 0xdc, 0x27, 0x86, 0xa8, 0x9d, 0x3c, 0x27, 0xbe, 0x30, 0xbe, 0x04, 0x70, + 0x61, 0xdc, 0x9b, 0xe4, 0x95, 0x32, 0xdc, 0x31, 0x89, 0xe2, 0x1b, 0x0f, 0x99, 0x18, 0xb3, 0xfa, + 0x0a, 0xc0, 0xe5, 0xa2, 0x0b, 0xfa, 0xb5, 0x49, 0x17, 0xc8, 0x49, 0x16, 0xb7, 0x1f, 0x21, 0x39, + 0x66, 0xf8, 0x11, 0x80, 0x73, 0xd9, 0xbb, 0xaf, 0x5e, 0x06, 0x9d, 0x49, 0x11, 0xaf, 0x9c, 0x38, + 0x25, 0xe6, 0xe0, 0xc2, 0x99, 0xd4, 0x3d, 0x73, 0xb1, 0x0c, 0x2a, 0x19, 0x2d, 0xbe, 0x74, 0x92, + 0xe8, 0x78, 0x4d, 0xaf, 0x6c, 0x73, 0x3a, 0x7e, 0x69, 0xd9, 0x66, 0x73, 0xca, 0xcb, 0x76, 0xfc, + 0x29, 0x12, 0xbe, 0x05, 0xf0, 0x85, 0xf2, 0x1e, 0xbb, 0x39, 0xe9, 0x4e, 0x8f, 0x85, 0x10, 0x77, + 0x1f, 0x19, 0x22, 0xe6, 0xfc, 0x3d, 0x80, 0x2b, 0x13, 0x75, 0xc3, 0xab, 0x93, 0xae, 0x59, 0x84, + 0x22, 0xbe, 0xf9, 0x38, 0x50, 0x22, 0xf2, 0xe2, 0xd3, 0x1f, 0x7a, 0x37, 0xe4, 0xd6, 0x5b, 0x77, + 0x0f, 0x25, 0x70, 0xef, 0x50, 0x02, 0xf7, 0x0f, 0x25, 0xf0, 0xfb, 0xa1, 0x04, 0xbe, 0x38, 0x92, + 0x2a, 0xf7, 0x8f, 0xa4, 0xca, 0xaf, 0x47, 0x52, 0xe5, 0xbd, 0x7a, 0xe1, 0x75, 0x7b, 0x2b, 0xfd, + 0xd2, 0xf0, 0x6f, 0xdf, 0xd6, 0xb4, 0xff, 0x63, 0xf1, 0xc5, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x8f, 0xb4, 0xbd, 0x86, 0x1e, 0x0f, 0x00, 0x00, } func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { From c96df011dfa8d370f5aee0d4c9bdb4eda547cc85 Mon Sep 17 00:00:00 2001 From: mpoke Date: Tue, 28 Nov 2023 12:34:04 +0100 Subject: [PATCH 10/31] set signers correctly --- api/cosmos/distribution/v1beta1/tx.pulsar.go | 222 +++++++++---------- proto/cosmos/distribution/v1beta1/tx.proto | 4 +- x/distribution/types/tx.pb.go | 126 +++++------ 3 files changed, 176 insertions(+), 176 deletions(-) diff --git a/api/cosmos/distribution/v1beta1/tx.pulsar.go b/api/cosmos/distribution/v1beta1/tx.pulsar.go index 89a9805e859b..2a12102997d4 100644 --- a/api/cosmos/distribution/v1beta1/tx.pulsar.go +++ b/api/cosmos/distribution/v1beta1/tx.pulsar.go @@ -7843,7 +7843,7 @@ var file_cosmos_distribution_v1beta1_tx_proto_rawDesc = []byte{ 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, - 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x22, 0xd7, 0x01, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x57, 0x69, + 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x22, 0xd8, 0x01, 0x0a, 0x24, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, 0x0a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, @@ -7851,125 +7851,125 @@ var file_cosmos_distribution_v1beta1_tx_proto_rawDesc = []byte{ 0x3a, 0x22, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0c, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x3a, 0x53, 0x88, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, + 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x49, 0x64, 0x3a, 0x54, 0x88, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x35, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x22, 0x2e, 0x0a, 0x2c, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, 0x0a, + 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0c, + 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x57, 0x88, 0xa0, + 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0d, 0x6f, 0x77, 0x6e, 0x65, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x38, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, + 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, 0x31, 0x0a, 0x2f, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, + 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x22, 0x2e, 0x0a, 0x2c, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xc0, 0x01, 0x0a, 0x27, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x3d, 0x0a, 0x0d, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0c, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x56, 0x88, 0xa0, 0x1f, - 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x8a, 0xe7, 0xb0, 0x2a, 0x38, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x64, 0x69, 0x73, 0x74, 0x72, 0x2f, 0x4d, 0x73, 0x67, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, - 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x22, 0x31, 0x0a, 0x2f, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, - 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, - 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, 0x09, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, - 0x84, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, - 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x17, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, - 0x72, 0x64, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, - 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x3f, 0x2e, 0x63, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x43, + 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, 0x09, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, + 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x74, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x3a, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x65, + 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x17, 0x57, 0x69, 0x74, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, + 0x77, 0x61, 0x72, 0x64, 0x12, 0x37, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x3f, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, + 0x01, 0x0a, 0x1b, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x43, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, - 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x9f, 0x01, 0x0a, - 0x1b, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x43, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x68, 0x64, 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x81, 0x01, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, + 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, - 0x72, 0x61, 0x77, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x81, - 0x01, 0x0a, 0x11, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, - 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, + 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, - 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x1a, 0x39, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6d, - 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, + 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x1a, 0x34, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x75, - 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x12, 0x32, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, - 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, - 0x64, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, - 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xb1, 0x01, - 0x0a, 0x21, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, - 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, - 0x61, 0x72, 0x64, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x84, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x12, + 0x32, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x70, + 0x65, 0x6e, 0x64, 0x1a, 0x3a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x49, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0xba, 0x01, 0x0a, 0x24, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, - 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x44, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, - 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, - 0x1a, 0x4c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, - 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x64, 0x69, - 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x76, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, 0x1b, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, 0x6f, 0x73, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x50, 0x6f, + 0x6f, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0xb1, 0x01, 0x0a, 0x21, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x41, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x49, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, + 0x61, 0x77, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0xba, 0x01, 0x0a, 0x24, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, + 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x12, 0x44, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, + 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, + 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, + 0x72, 0x64, 0x1a, 0x4c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x41, 0x6c, 0x6c, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x44, 0x58, 0xaa, 0x02, + 0x1b, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, - 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, - 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0xa8, 0xe2, 0x1e, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 2221a86027d9..d41f96dd1982 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -181,7 +181,7 @@ message MsgCommunityPoolSpend { // MsgWithdrawTokenizeShareRecordReward withdraws tokenize share rewards for a specific record message MsgWithdrawTokenizeShareRecordReward { - option (cosmos.msg.v1.signer) = "record_owner"; + option (cosmos.msg.v1.signer) = "owner_address"; option (amino.name) = "cosmos-sdk/distr/MsgWithdrawTokenizeShareRecordReward"; option (gogoproto.equal) = false; @@ -197,7 +197,7 @@ message MsgWithdrawTokenizeShareRecordRewardResponse {} // MsgWithdrawAllTokenizeShareRecordReward withdraws tokenize share rewards or all // records owned by the designated owner message MsgWithdrawAllTokenizeShareRecordReward { - option (cosmos.msg.v1.signer) = "record_owner"; + option (cosmos.msg.v1.signer) = "owner_address"; option (amino.name) = "cosmos-sdk/distr/MsgWithdrawAllTokenizeShareRecordReward"; option (gogoproto.equal) = false; diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 94010b9fb1d6..f72244e68b11 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -754,70 +754,70 @@ func init() { } var fileDescriptor_ed4f433d965e58ca = []byte{ - // 1000 bytes of a gzipped FileDescriptorProto + // 998 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xde, 0x69, 0x20, 0x62, 0xa7, 0x41, 0x4d, 0xac, 0xa0, 0x24, 0x4e, 0xf1, 0x16, 0x37, 0x4a, - 0xa3, 0xa8, 0xb5, 0xb5, 0x81, 0x02, 0x35, 0x42, 0x28, 0x49, 0x1b, 0x29, 0x12, 0x2b, 0x2a, 0x2f, - 0x14, 0x89, 0x4b, 0xe4, 0xdd, 0x19, 0xbc, 0xa3, 0xae, 0x3d, 0x96, 0x67, 0x36, 0xdb, 0xe5, 0x04, - 0x88, 0x03, 0xe2, 0x80, 0x50, 0xf9, 0x03, 0xe8, 0xb1, 0xe2, 0x42, 0x90, 0x38, 0xc1, 0x85, 0x63, - 0x2f, 0x48, 0x15, 0x17, 0x38, 0x15, 0x94, 0x1c, 0x82, 0xc4, 0x0d, 0xc1, 0x1d, 0xf9, 0xe7, 0xda, - 0x6b, 0xaf, 0xbd, 0xe9, 0x0f, 0xb8, 0x24, 0xbb, 0x33, 0xef, 0x7d, 0xf3, 0x7d, 0xdf, 0xbc, 0x79, - 0x33, 0x0b, 0x57, 0xda, 0x94, 0x59, 0x94, 0xa9, 0x88, 0x30, 0xee, 0x92, 0x56, 0x8f, 0x13, 0x6a, - 0xab, 0xfb, 0xf5, 0x16, 0xe6, 0x46, 0x5d, 0xe5, 0xb7, 0x14, 0xc7, 0xa5, 0x9c, 0x0a, 0xcb, 0x41, - 0x94, 0x92, 0x8c, 0x52, 0xc2, 0x28, 0x71, 0xde, 0xa4, 0x26, 0xf5, 0xe3, 0x54, 0xef, 0x53, 0x90, - 0x22, 0x4a, 0x21, 0x70, 0xcb, 0x60, 0x38, 0x06, 0x6c, 0x53, 0x62, 0x87, 0xf3, 0x4b, 0xc1, 0xfc, - 0x5e, 0x90, 0x18, 0xe2, 0x07, 0x53, 0x0b, 0x61, 0xaa, 0xc5, 0x4c, 0x75, 0xbf, 0xee, 0xfd, 0x0b, - 0x27, 0xe6, 0x0c, 0x8b, 0xd8, 0x54, 0xf5, 0xff, 0x86, 0x43, 0x4a, 0x11, 0xff, 0x14, 0x5d, 0x3f, - 0x5e, 0xfe, 0x13, 0xc0, 0xe7, 0x1a, 0xcc, 0x6c, 0x62, 0xfe, 0x2e, 0xe1, 0x1d, 0xe4, 0x1a, 0xfd, - 0x4d, 0x84, 0x5c, 0xcc, 0x98, 0x70, 0x0d, 0xce, 0x21, 0xdc, 0xc5, 0xa6, 0xc1, 0xa9, 0xbb, 0x67, - 0x04, 0x83, 0x8b, 0xe0, 0x1c, 0x58, 0xab, 0x6e, 0x2d, 0xfe, 0xfc, 0xdd, 0xa5, 0xf9, 0x90, 0x62, - 0x18, 0xde, 0xe4, 0x2e, 0xb1, 0x4d, 0x7d, 0x36, 0x4e, 0x89, 0x60, 0xb6, 0xe1, 0x6c, 0x3f, 0x44, - 0x8e, 0x51, 0x4e, 0x95, 0xa0, 0x9c, 0xe9, 0xa7, 0xb9, 0x68, 0x3b, 0x9f, 0xde, 0xa9, 0x55, 0xfe, - 0xb8, 0x53, 0xab, 0x7c, 0x7c, 0x7c, 0xb0, 0x9e, 0xa5, 0xf5, 0xd9, 0xf1, 0xc1, 0xfa, 0xf9, 0x00, - 0xe9, 0x12, 0x43, 0x37, 0xd5, 0x06, 0x33, 0x1b, 0x14, 0x91, 0xf7, 0x07, 0x23, 0x9a, 0xe4, 0x1a, - 0x7c, 0x3e, 0x57, 0xac, 0x8e, 0x99, 0x43, 0x6d, 0x86, 0xe5, 0x7f, 0x00, 0x14, 0x1b, 0xcc, 0x8c, - 0xa6, 0xaf, 0x46, 0x2b, 0xe9, 0xb8, 0x6f, 0xb8, 0xe8, 0x71, 0x79, 0x72, 0x0d, 0xce, 0xed, 0x1b, - 0x5d, 0x82, 0x52, 0x30, 0x65, 0xa6, 0xcc, 0xc6, 0x29, 0x91, 0x2b, 0xbb, 0xe5, 0xae, 0xac, 0xa6, - 0x5d, 0x19, 0xd1, 0x45, 0xa8, 0x1d, 0x08, 0x93, 0x3f, 0x07, 0x50, 0x1e, 0xaf, 0x3b, 0xb2, 0x47, - 0xe8, 0xc0, 0x69, 0xc3, 0xa2, 0x3d, 0x9b, 0x2f, 0x82, 0x73, 0x53, 0x6b, 0xa7, 0x37, 0x96, 0xc2, - 0x72, 0x53, 0xbc, 0xaa, 0x8e, 0x0e, 0x80, 0xb2, 0x4d, 0x89, 0xbd, 0x75, 0xf9, 0xde, 0x83, 0x5a, - 0xe5, 0xeb, 0xdf, 0x6a, 0x6b, 0x26, 0xe1, 0x9d, 0x5e, 0x4b, 0x69, 0x53, 0x2b, 0xac, 0x6a, 0x35, - 0xc1, 0x89, 0x0f, 0x1c, 0xcc, 0xfc, 0x04, 0x76, 0xf7, 0xf8, 0x60, 0x1d, 0xe8, 0x21, 0xbe, 0xfc, - 0x0d, 0x80, 0x52, 0x82, 0xd0, 0x8d, 0x48, 0xfb, 0x36, 0xb5, 0x2c, 0xc2, 0x18, 0xa1, 0x76, 0xbe, - 0x8b, 0xe0, 0xc4, 0x2e, 0xa6, 0x6b, 0x2b, 0x83, 0x98, 0x53, 0x5b, 0x09, 0x52, 0x43, 0x3a, 0xf2, - 0x6d, 0x00, 0x57, 0x8b, 0x19, 0xff, 0x0f, 0x36, 0xfe, 0x0d, 0xe0, 0x7c, 0x83, 0x99, 0x3b, 0x3d, - 0x1b, 0x79, 0x3c, 0x7a, 0x36, 0xe1, 0x83, 0xeb, 0x94, 0x76, 0xff, 0x3b, 0x0a, 0xc2, 0xcb, 0xb0, - 0x8a, 0xb0, 0x43, 0x19, 0xe1, 0xd4, 0x2d, 0x2d, 0xf2, 0x61, 0xa8, 0xa6, 0x25, 0xf7, 0x65, 0x38, - 0xee, 0xed, 0x47, 0x2d, 0xbd, 0x1f, 0x19, 0x75, 0xb2, 0x04, 0xcf, 0xe6, 0x8d, 0xc7, 0xc7, 0xfc, - 0x27, 0x00, 0xcf, 0x34, 0x98, 0xf9, 0x8e, 0x83, 0x0c, 0x8e, 0xaf, 0x1b, 0xae, 0x61, 0x31, 0x8f, - 0xa7, 0xd1, 0xe3, 0x1d, 0xea, 0x12, 0x3e, 0x28, 0x2d, 0xa3, 0x61, 0xa8, 0xb0, 0x03, 0xa7, 0x1d, - 0x1f, 0xc1, 0x17, 0x77, 0x7a, 0xe3, 0xbc, 0x52, 0x70, 0x39, 0x28, 0xc1, 0x62, 0x5b, 0x55, 0xcf, - 0xd3, 0xd0, 0xa7, 0x20, 0x5b, 0xd3, 0x7c, 0x9d, 0x31, 0xae, 0xa7, 0xf3, 0x42, 0x42, 0x67, 0xaa, - 0xa1, 0x8f, 0x70, 0x97, 0x97, 0xe0, 0xc2, 0xc8, 0x50, 0x2c, 0xf5, 0xf6, 0x29, 0xbf, 0xc1, 0xa7, - 0x7c, 0x68, 0x3a, 0xd8, 0x46, 0x0f, 0x2d, 0xf8, 0x2c, 0xac, 0xba, 0xb8, 0x4d, 0x1c, 0x82, 0x6d, - 0x1e, 0x6c, 0xa8, 0x3e, 0x1c, 0x48, 0x14, 0xd6, 0xd4, 0x93, 0x2d, 0x2c, 0xed, 0x4a, 0xd6, 0xb0, - 0xd5, 0x51, 0xc3, 0xd4, 0x5c, 0xe9, 0xf2, 0x2f, 0x00, 0xae, 0x24, 0xce, 0xea, 0xdb, 0xf4, 0x26, - 0xb6, 0xc9, 0x07, 0xb8, 0xd9, 0x31, 0x5c, 0xac, 0xe3, 0x36, 0xf5, 0x5a, 0x9e, 0xdf, 0xf0, 0x5f, - 0x87, 0xcf, 0xd2, 0xbe, 0x8d, 0x33, 0xfd, 0xe5, 0xaf, 0x07, 0xb5, 0xf9, 0x81, 0x61, 0x75, 0x35, - 0x39, 0x35, 0x2d, 0xeb, 0x33, 0xfe, 0xf7, 0xa8, 0xd1, 0x2f, 0xfb, 0x56, 0x51, 0x17, 0xed, 0x11, - 0xe4, 0x5b, 0xf5, 0x94, 0xfe, 0x4c, 0x30, 0xb0, 0x8b, 0xb4, 0x66, 0xb2, 0xc0, 0x67, 0xc2, 0x38, - 0x3f, 0xdd, 0x93, 0x72, 0x39, 0x4f, 0x4a, 0x29, 0x61, 0x59, 0x81, 0x17, 0x27, 0x89, 0x8b, 0xcb, - 0xe3, 0x47, 0x00, 0x2f, 0x24, 0x12, 0x36, 0xbb, 0xdd, 0x27, 0x65, 0x86, 0x76, 0xa3, 0x50, 0xef, - 0xab, 0x45, 0x7a, 0x8b, 0x68, 0xc9, 0x75, 0x38, 0x69, 0x68, 0xac, 0x3a, 0x78, 0x07, 0x64, 0x0b, - 0x23, 0x0a, 0xd8, 0xf8, 0xa1, 0x0a, 0xa7, 0x1a, 0xcc, 0x14, 0x3e, 0x01, 0x50, 0xc8, 0x79, 0x1b, - 0x6d, 0x14, 0x9e, 0xf1, 0xdc, 0x27, 0x86, 0xa8, 0x9d, 0x3c, 0x27, 0xbe, 0x30, 0xbe, 0x04, 0x70, - 0x61, 0xdc, 0x9b, 0xe4, 0x95, 0x32, 0xdc, 0x31, 0x89, 0xe2, 0x1b, 0x0f, 0x99, 0x18, 0xb3, 0xfa, - 0x0a, 0xc0, 0xe5, 0xa2, 0x0b, 0xfa, 0xb5, 0x49, 0x17, 0xc8, 0x49, 0x16, 0xb7, 0x1f, 0x21, 0x39, - 0x66, 0xf8, 0x11, 0x80, 0x73, 0xd9, 0xbb, 0xaf, 0x5e, 0x06, 0x9d, 0x49, 0x11, 0xaf, 0x9c, 0x38, - 0x25, 0xe6, 0xe0, 0xc2, 0x99, 0xd4, 0x3d, 0x73, 0xb1, 0x0c, 0x2a, 0x19, 0x2d, 0xbe, 0x74, 0x92, - 0xe8, 0x78, 0x4d, 0xaf, 0x6c, 0x73, 0x3a, 0x7e, 0x69, 0xd9, 0x66, 0x73, 0xca, 0xcb, 0x76, 0xfc, - 0x29, 0x12, 0xbe, 0x05, 0xf0, 0x85, 0xf2, 0x1e, 0xbb, 0x39, 0xe9, 0x4e, 0x8f, 0x85, 0x10, 0x77, - 0x1f, 0x19, 0x22, 0xe6, 0xfc, 0x3d, 0x80, 0x2b, 0x13, 0x75, 0xc3, 0xab, 0x93, 0xae, 0x59, 0x84, - 0x22, 0xbe, 0xf9, 0x38, 0x50, 0x22, 0xf2, 0xe2, 0xd3, 0x1f, 0x7a, 0x37, 0xe4, 0xd6, 0x5b, 0x77, - 0x0f, 0x25, 0x70, 0xef, 0x50, 0x02, 0xf7, 0x0f, 0x25, 0xf0, 0xfb, 0xa1, 0x04, 0xbe, 0x38, 0x92, - 0x2a, 0xf7, 0x8f, 0xa4, 0xca, 0xaf, 0x47, 0x52, 0xe5, 0xbd, 0x7a, 0xe1, 0x75, 0x7b, 0x2b, 0xfd, - 0xd2, 0xf0, 0x6f, 0xdf, 0xd6, 0xb4, 0xff, 0x63, 0xf1, 0xc5, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, - 0x8f, 0xb4, 0xbd, 0x86, 0x1e, 0x0f, 0x00, 0x00, + 0x14, 0xde, 0x69, 0x20, 0x62, 0xa7, 0x45, 0x4d, 0xac, 0xa0, 0x24, 0x4e, 0xf1, 0x16, 0x37, 0x4a, + 0xa3, 0xa8, 0xb5, 0xb5, 0x81, 0x02, 0x35, 0x42, 0x28, 0x49, 0x1b, 0x29, 0x12, 0x2b, 0x2a, 0xa7, + 0x50, 0x89, 0x4b, 0xe4, 0xdd, 0x19, 0xbc, 0xa3, 0xae, 0x3d, 0x96, 0x67, 0x36, 0xdb, 0xe5, 0x04, + 0x88, 0x03, 0xe2, 0x80, 0x50, 0xf9, 0x03, 0xe8, 0xb1, 0xe2, 0x42, 0x90, 0x38, 0xc1, 0x89, 0x5b, + 0x2f, 0x48, 0x15, 0xa7, 0x9e, 0x0a, 0x4a, 0x0e, 0x41, 0xe2, 0x86, 0xe0, 0x8e, 0xfc, 0x73, 0xed, + 0xb5, 0xd7, 0xde, 0xed, 0x0f, 0x7a, 0x49, 0x76, 0x67, 0xde, 0xfb, 0xe6, 0xfb, 0xbe, 0x79, 0xf3, + 0x66, 0x16, 0x2e, 0xb7, 0x28, 0xb3, 0x28, 0x53, 0x11, 0x61, 0xdc, 0x25, 0xcd, 0x2e, 0x27, 0xd4, + 0x56, 0xf7, 0xeb, 0x4d, 0xcc, 0x8d, 0xba, 0xca, 0x6f, 0x29, 0x8e, 0x4b, 0x39, 0x15, 0x96, 0x82, + 0x28, 0x25, 0x19, 0xa5, 0x84, 0x51, 0xe2, 0x9c, 0x49, 0x4d, 0xea, 0xc7, 0xa9, 0xde, 0xa7, 0x20, + 0x45, 0x94, 0x42, 0xe0, 0xa6, 0xc1, 0x70, 0x0c, 0xd8, 0xa2, 0xc4, 0x0e, 0xe7, 0x17, 0x83, 0xf9, + 0xbd, 0x20, 0x31, 0xc4, 0x0f, 0xa6, 0xe6, 0xc3, 0x54, 0x8b, 0x99, 0xea, 0x7e, 0xdd, 0xfb, 0x17, + 0x4e, 0xcc, 0x1a, 0x16, 0xb1, 0xa9, 0xea, 0xff, 0x0d, 0x87, 0x94, 0x22, 0xfe, 0x29, 0xba, 0x7e, + 0xbc, 0xfc, 0x17, 0x80, 0x2f, 0x35, 0x98, 0xb9, 0x8b, 0xf9, 0x0d, 0xc2, 0xdb, 0xc8, 0x35, 0x7a, + 0x1b, 0x08, 0xb9, 0x98, 0x31, 0xe1, 0x2a, 0x9c, 0x45, 0xb8, 0x83, 0x4d, 0x83, 0x53, 0x77, 0xcf, + 0x08, 0x06, 0x17, 0xc0, 0x59, 0xb0, 0x5a, 0xdd, 0x5c, 0xf8, 0xed, 0xc7, 0x8b, 0x73, 0x21, 0xc5, + 0x30, 0x7c, 0x97, 0xbb, 0xc4, 0x36, 0xf5, 0x99, 0x38, 0x25, 0x82, 0xd9, 0x82, 0x33, 0xbd, 0x10, + 0x39, 0x46, 0x39, 0x51, 0x82, 0x72, 0xba, 0x97, 0xe6, 0xa2, 0x6d, 0x7f, 0x71, 0xa7, 0x56, 0xf9, + 0xf3, 0x4e, 0xad, 0xf2, 0xd9, 0xf1, 0xc1, 0x5a, 0x96, 0xd6, 0x97, 0xc7, 0x07, 0x6b, 0xe7, 0x02, + 0xa4, 0x8b, 0x0c, 0xdd, 0x54, 0x1b, 0xcc, 0x6c, 0x50, 0x44, 0x3e, 0xea, 0x0f, 0x69, 0x92, 0x6b, + 0xf0, 0xe5, 0x5c, 0xb1, 0x3a, 0x66, 0x0e, 0xb5, 0x19, 0x96, 0xff, 0x05, 0x50, 0x6c, 0x30, 0x33, + 0x9a, 0xbe, 0x12, 0xad, 0xa4, 0xe3, 0x9e, 0xe1, 0xa2, 0x27, 0xe5, 0xc9, 0x55, 0x38, 0xbb, 0x6f, + 0x74, 0x08, 0x4a, 0xc1, 0x94, 0x99, 0x32, 0x13, 0xa7, 0x44, 0xae, 0xec, 0x94, 0xbb, 0xb2, 0x92, + 0x76, 0x65, 0x48, 0x17, 0xa1, 0x76, 0x20, 0x4c, 0xfe, 0x0a, 0x40, 0x79, 0xb4, 0xee, 0xc8, 0x1e, + 0xa1, 0x0d, 0xa7, 0x0d, 0x8b, 0x76, 0x6d, 0xbe, 0x00, 0xce, 0x4e, 0xad, 0x9e, 0x5c, 0x5f, 0x0c, + 0xcb, 0x4d, 0xf1, 0xaa, 0x3a, 0x3a, 0x00, 0xca, 0x16, 0x25, 0xf6, 0xe6, 0xa5, 0x7b, 0x0f, 0x6b, + 0x95, 0xef, 0x7e, 0xaf, 0xad, 0x9a, 0x84, 0xb7, 0xbb, 0x4d, 0xa5, 0x45, 0xad, 0xb0, 0xaa, 0xd5, + 0x04, 0x27, 0xde, 0x77, 0x30, 0xf3, 0x13, 0xd8, 0xdd, 0xe3, 0x83, 0x35, 0xa0, 0x87, 0xf8, 0xf2, + 0xf7, 0x00, 0x4a, 0x09, 0x42, 0x1f, 0x44, 0xda, 0xb7, 0xa8, 0x65, 0x11, 0xc6, 0x08, 0xb5, 0xf3, + 0x5d, 0x04, 0x13, 0xbb, 0x98, 0xae, 0xad, 0x0c, 0x62, 0x4e, 0x6d, 0x25, 0x48, 0x0d, 0xe8, 0xc8, + 0xb7, 0x01, 0x5c, 0x29, 0x66, 0xfc, 0x0c, 0x6c, 0xfc, 0x07, 0xc0, 0xb9, 0x06, 0x33, 0xb7, 0xbb, + 0x36, 0xf2, 0x78, 0x74, 0x6d, 0xc2, 0xfb, 0xd7, 0x28, 0xed, 0xfc, 0x7f, 0x14, 0x84, 0xd7, 0x61, + 0x15, 0x61, 0x87, 0x32, 0xc2, 0xa9, 0x5b, 0x5a, 0xe4, 0x83, 0x50, 0x4d, 0x4b, 0xee, 0xcb, 0x60, + 0xdc, 0xdb, 0x8f, 0x5a, 0x7a, 0x3f, 0x32, 0xea, 0x64, 0x09, 0x9e, 0xc9, 0x1b, 0x8f, 0x8f, 0xf9, + 0xaf, 0x00, 0x9e, 0x6e, 0x30, 0xf3, 0x7d, 0x07, 0x19, 0x1c, 0x5f, 0x33, 0x5c, 0xc3, 0x62, 0x1e, + 0x4f, 0xa3, 0xcb, 0xdb, 0xd4, 0x25, 0xbc, 0x5f, 0x5a, 0x46, 0x83, 0x50, 0x61, 0x1b, 0x4e, 0x3b, + 0x3e, 0x82, 0x2f, 0xee, 0xe4, 0xfa, 0x39, 0xa5, 0xe0, 0x72, 0x50, 0x82, 0xc5, 0x36, 0xab, 0x9e, + 0xa7, 0xa1, 0x4f, 0x41, 0xb6, 0xa6, 0xf9, 0x3a, 0x63, 0x5c, 0x4f, 0xe7, 0xf9, 0x84, 0xce, 0x54, + 0x43, 0x1f, 0xe2, 0x2e, 0x2f, 0xc2, 0xf9, 0xa1, 0xa1, 0x58, 0xea, 0xed, 0x13, 0x7e, 0x83, 0x4f, + 0xf9, 0xb0, 0xeb, 0x60, 0x1b, 0x3d, 0xb2, 0xe0, 0x33, 0xb0, 0xea, 0xe2, 0x16, 0x71, 0x08, 0xb6, + 0x79, 0xb0, 0xa1, 0xfa, 0x60, 0x20, 0x51, 0x58, 0x53, 0x4f, 0xb7, 0xb0, 0xb4, 0xcb, 0x59, 0xc3, + 0x56, 0x86, 0x0d, 0x53, 0x73, 0xa5, 0xcb, 0x0f, 0x00, 0x5c, 0x4e, 0x9c, 0xd5, 0xeb, 0xf4, 0x26, + 0xb6, 0xc9, 0xc7, 0x78, 0xb7, 0x6d, 0xb8, 0x58, 0xc7, 0x2d, 0xea, 0xb5, 0x3c, 0xbf, 0xe1, 0xbf, + 0x0d, 0x5f, 0xa4, 0x3d, 0x1b, 0x67, 0xfa, 0xcb, 0xdf, 0x0f, 0x6b, 0x73, 0x7d, 0xc3, 0xea, 0x68, + 0x72, 0x6a, 0x5a, 0xd6, 0x4f, 0xf9, 0xdf, 0xa3, 0x46, 0xbf, 0xe4, 0x5b, 0x45, 0x5d, 0xb4, 0x47, + 0x90, 0x6f, 0xd5, 0x73, 0xfa, 0x0b, 0xc1, 0xc0, 0x0e, 0xd2, 0xae, 0x27, 0x0b, 0x3c, 0xbd, 0x8c, + 0xa7, 0xe5, 0x52, 0x9e, 0x96, 0x52, 0xc6, 0xb2, 0x02, 0x2f, 0x8c, 0x13, 0x17, 0xd7, 0xc7, 0x2f, + 0x00, 0x9e, 0x4f, 0x24, 0x6c, 0x74, 0x3a, 0x4f, 0xcb, 0x0d, 0xed, 0x46, 0xb1, 0xe0, 0x37, 0x8b, + 0x04, 0x17, 0xf1, 0x92, 0xeb, 0x70, 0xdc, 0xd0, 0x58, 0x76, 0xf0, 0x12, 0xc8, 0x96, 0x46, 0x14, + 0xb0, 0xfe, 0x73, 0x15, 0x4e, 0x35, 0x98, 0x29, 0x7c, 0x0e, 0xa0, 0x90, 0xf3, 0x3a, 0x5a, 0x2f, + 0x3c, 0xe5, 0xb9, 0x8f, 0x0c, 0x51, 0x9b, 0x3c, 0x27, 0xbe, 0x32, 0xbe, 0x01, 0x70, 0x7e, 0xd4, + 0xab, 0xe4, 0x8d, 0x32, 0xdc, 0x11, 0x89, 0xe2, 0x3b, 0x8f, 0x98, 0x18, 0xb3, 0xfa, 0x16, 0xc0, + 0xa5, 0xa2, 0x2b, 0xfa, 0xad, 0x71, 0x17, 0xc8, 0x49, 0x16, 0xb7, 0x1e, 0x23, 0x39, 0x66, 0xf8, + 0x29, 0x80, 0xb3, 0xd9, 0xdb, 0xaf, 0x5e, 0x06, 0x9d, 0x49, 0x11, 0x2f, 0x4f, 0x9c, 0x12, 0x73, + 0x70, 0xe1, 0xa9, 0xd4, 0x4d, 0x73, 0xa1, 0x0c, 0x2a, 0x19, 0x2d, 0xbe, 0x36, 0x49, 0x74, 0xbc, + 0xa6, 0x57, 0xb6, 0x39, 0x3d, 0xbf, 0xb4, 0x6c, 0xb3, 0x39, 0xe5, 0x65, 0x3b, 0xfa, 0x14, 0x09, + 0x3f, 0x00, 0xf8, 0x4a, 0x79, 0x97, 0xdd, 0x18, 0x77, 0xa7, 0x47, 0x42, 0x88, 0x3b, 0x8f, 0x0d, + 0x11, 0x73, 0xfe, 0x09, 0xc0, 0xe5, 0xb1, 0xda, 0xe1, 0x95, 0x71, 0xd7, 0x2c, 0x42, 0x11, 0xdf, + 0x7d, 0x12, 0x28, 0x11, 0x79, 0xf1, 0xf9, 0x4f, 0xbc, 0x3b, 0x72, 0xf3, 0xbd, 0xbb, 0x87, 0x12, + 0xb8, 0x77, 0x28, 0x81, 0xfb, 0x87, 0x12, 0xf8, 0xe3, 0x50, 0x02, 0x5f, 0x1f, 0x49, 0x95, 0xfb, + 0x47, 0x52, 0xe5, 0xc1, 0x91, 0x54, 0xf9, 0xb0, 0x5e, 0x78, 0xe1, 0xde, 0x4a, 0xbf, 0x35, 0xfc, + 0xfb, 0xb7, 0x39, 0xed, 0xff, 0x5c, 0x7c, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x06, + 0x36, 0xfb, 0x20, 0x0f, 0x00, 0x00, } func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { From cf3d174a697aaed4ad8e069baf6dbed87f8ed265 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 28 Nov 2023 17:56:55 +0100 Subject: [PATCH 11/31] minimum refactor to build --- .../integration/staking/keeper/common_test.go | 6 + .../staking/keeper/genesis_test.go | 44 + .../testutil/expected_keepers_mocks.go | 114 +- x/slashing/keeper/hooks.go | 4 + x/staking/abci.go | 1 + x/staking/client/cli/query.go | 331 +++++ x/staking/client/cli/tx.go | 286 ++++ x/staking/keeper/liquid_stake.go | 430 ++++++ x/staking/keeper/liquid_stake_test.go | 1207 +++++++++++++++++ x/staking/keeper/msg_server.go | 596 +++++++- x/staking/keeper/params.go | 17 + x/staking/simulation/genesis.go | 30 +- x/staking/testutil/expected_keepers_mocks.go | 56 + x/staking/types/events.go | 23 +- x/staking/types/expected_keepers.go | 4 + x/staking/types/hooks.go | 9 + x/staking/types/msg.go | 327 ++++- x/staking/types/params.go | 95 +- x/staking/types/params_legacy.go | 18 +- x/staking/types/validator.go | 7 +- 20 files changed, 3483 insertions(+), 122 deletions(-) create mode 100644 x/staking/keeper/liquid_stake.go create mode 100644 x/staking/keeper/liquid_stake_test.go diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index 21acfe1599a9..f6169b9d44c1 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -88,3 +88,9 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers return addrs, valAddrs, vals } + +func delegateCoinsFromAccount(ctx sdk.Context, app *simapp.SimApp, addr sdk.AccAddress, amount sdk.Int, val types.Validator) error { + _, err := app.StakingKeeper.Delegate(ctx, addr, amount, types.Unbonded, val, true) + + return err +} diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 608e84f9751f..4e3409f4e9fa 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "fmt" "testing" + "time" "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" @@ -218,3 +219,46 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { vals = vals[:100] require.Equal(t, abcivals, vals) } + +func TestInitExportLiquidStakingGenesis(t *testing.T) { + app, ctx, addrs := bootstrapGenesisTest(t, 2) + address1, address2 := addrs[0], addrs[1] + + // Mock out a genesis state + inGenesisState := types.GenesisState{ + Params: types.DefaultParams(), + TokenizeShareRecords: []types.TokenizeShareRecord{ + {Id: 1, Owner: address1.String(), ModuleAccount: "module1", Validator: "val1"}, + {Id: 2, Owner: address2.String(), ModuleAccount: "module2", Validator: "val2"}, + }, + LastTokenizeShareRecordId: 2, + TotalLiquidStakedTokens: sdk.NewInt(1_000_000), + TokenizeShareLocks: []types.TokenizeShareLock{ + { + Address: address1.String(), + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + { + Address: address2.String(), + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC), + }, + }, + } + + // Call init and then export genesis - confirming the same state is returned + staking.InitGenesis(ctx, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, &inGenesisState) + outGenesisState := *staking.ExportGenesis(ctx, app.StakingKeeper) + + require.ElementsMatch(t, inGenesisState.TokenizeShareRecords, outGenesisState.TokenizeShareRecords, + "tokenize share records") + + require.Equal(t, inGenesisState.LastTokenizeShareRecordId, outGenesisState.LastTokenizeShareRecordId, + "last tokenize share record ID") + + require.Equal(t, inGenesisState.TotalLiquidStakedTokens.Int64(), outGenesisState.TotalLiquidStakedTokens.Int64(), + "total liquid staked") + + require.ElementsMatch(t, inGenesisState.TokenizeShareLocks, outGenesisState.TokenizeShareLocks, + "tokenize share locks") +} diff --git a/x/distribution/testutil/expected_keepers_mocks.go b/x/distribution/testutil/expected_keepers_mocks.go index c51a8ec771d0..b3de49ec23c6 100644 --- a/x/distribution/testutil/expected_keepers_mocks.go +++ b/x/distribution/testutil/expected_keepers_mocks.go @@ -141,6 +141,20 @@ func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllBalances", reflect.TypeOf((*MockBankKeeper)(nil).GetAllBalances), ctx, addr) } +// SendCoins mocks base method. +func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr, toAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) +} + // SendCoinsFromAccountToModule mocks base method. func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { m.ctrl.T.Helper() @@ -183,20 +197,6 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderMod return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } -// SendCoins mocks base method. -func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) -} - // SpendableCoins mocks base method. func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() @@ -276,6 +276,20 @@ func (mr *MockStakingKeeperMockRecorder) GetAllSDKDelegations(ctx interface{}) * return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllSDKDelegations", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllSDKDelegations), ctx) } +// GetAllTokenizeShareRecords mocks base method. +func (m *MockStakingKeeper) GetAllTokenizeShareRecords(ctx types.Context) []types1.TokenizeShareRecord { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllTokenizeShareRecords", ctx) + ret0, _ := ret[0].([]types1.TokenizeShareRecord) + return ret0 +} + +// GetAllTokenizeShareRecords indicates an expected call of GetAllTokenizeShareRecords. +func (mr *MockStakingKeeperMockRecorder) GetAllTokenizeShareRecords(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllTokenizeShareRecords", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllTokenizeShareRecords), ctx) +} + // GetAllValidators mocks base method. func (m *MockStakingKeeper) GetAllValidators(ctx types.Context) []types1.Validator { m.ctrl.T.Helper() @@ -290,6 +304,35 @@ func (mr *MockStakingKeeperMockRecorder) GetAllValidators(ctx interface{}) *gomo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllValidators", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllValidators), ctx) } +// GetTokenizeShareRecord mocks base method. +func (m *MockStakingKeeper) GetTokenizeShareRecord(ctx types.Context, id uint64) (types1.TokenizeShareRecord, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokenizeShareRecord", ctx, id) + ret0, _ := ret[0].(types1.TokenizeShareRecord) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTokenizeShareRecord indicates an expected call of GetTokenizeShareRecord. +func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecord(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecord", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecord), ctx, id) +} + +// GetTokenizeShareRecordsByOwner mocks base method. +func (m *MockStakingKeeper) GetTokenizeShareRecordsByOwner(ctx types.Context, owner types.AccAddress) []types1.TokenizeShareRecord { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTokenizeShareRecordsByOwner", ctx, owner) + ret0, _ := ret[0].([]types1.TokenizeShareRecord) + return ret0 +} + +// GetTokenizeShareRecordsByOwner indicates an expected call of GetTokenizeShareRecordsByOwner. +func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecordsByOwner(ctx, owner interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecordsByOwner", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecordsByOwner), ctx, owner) +} + // IterateDelegations mocks base method. func (m *MockStakingKeeper) IterateDelegations(ctx types.Context, delegator types.AccAddress, fn func(int64, types1.DelegationI) bool) { m.ctrl.T.Helper() @@ -342,49 +385,6 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } -// GetTokenizeShareRecordsByOwner mocks base method. -func (m *MockStakingKeeper) GetTokenizeShareRecordsByOwner(ctx types.Context, owner types.AccAddress) (tokenizeShareRecords []types1.TokenizeShareRecord) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenizeShareRecordsByOwner", ctx, owner) - ret0, _ := ret[0].([]types1.TokenizeShareRecord) - return ret0 -} - -// GetTokenizeShareRecordsByOwner indicates an expected call of GetTokenizeShareRecordsByOwner. -func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecordsByOwner(ctx, owner interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecordsByOwner", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecordsByOwner), ctx, owner) -} - -// GetTokenizeShareRecord mocks base method. -func (m *MockStakingKeeper) GetTokenizeShareRecord(ctx types.Context, id uint64) (tokenizeShareRecord types1.TokenizeShareRecord, err error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenizeShareRecord", ctx, id) - ret0, _ := ret[0].(types1.TokenizeShareRecord) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetTokenizeShareRecord indicates an expected call of GetTokenizeShareRecord. -func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecord(ctx, id interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecord", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecord), ctx, id) -} - -// GetAllTokenizeShareRecords mocks base method. -func (m *MockStakingKeeper) GetAllTokenizeShareRecords(ctx types.Context) (tokenizeShareRecords []types1.TokenizeShareRecord) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAllTokenizeShareRecords", ctx) - ret0, _ := ret[0].([]types1.TokenizeShareRecord) - return ret0 -} - -// GetAllTokenizeShareRecords indicates an expected call of GetAllTokenizeShareRecords. -func (mr *MockStakingKeeperMockRecorder) GetAllTokenizeShareRecords(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllTokenizeShareRecords", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllTokenizeShareRecords), ctx) -} - // MockStakingHooks is a mock of StakingHooks interface. type MockStakingHooks struct { ctrl *gomock.Controller diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index bdb2f38c1439..b0e10ab33ab9 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -90,3 +90,7 @@ func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { return nil } + +func (h Hooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordID uint64) error { + return nil +} diff --git a/x/staking/abci.go b/x/staking/abci.go index 1912beb99747..6b14b025a514 100644 --- a/x/staking/abci.go +++ b/x/staking/abci.go @@ -17,6 +17,7 @@ func BeginBlocker(ctx sdk.Context, k *keeper.Keeper) { defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) k.TrackHistoricalInfo(ctx) + k.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) } // Called every block, update validator set diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index 0982296161e4..1de70b7cc8ea 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -39,6 +39,14 @@ func GetQueryCmd() *cobra.Command { GetCmdQueryHistoricalInfo(), GetCmdQueryParams(), GetCmdQueryPool(), + GetCmdQueryTokenizeShareRecordByID(), + GetCmdQueryTokenizeShareRecordByDenom(), + GetCmdQueryTokenizeShareRecordsOwned(), + GetCmdQueryAllTokenizeShareRecords(), + GetCmdQueryLastTokenizeShareRecordID(), + GetCmdQueryTotalTokenizeSharedAssets(), + GetCmdQueryTokenizeShareLockInfo(), + GetCmdQueryTotalLiquidStaked(), ) return stakingQueryCmd @@ -744,3 +752,326 @@ $ %s query staking params return cmd } + +// GetCmdQueryTokenizeShareRecordById implements the query for individual tokenize share record information by share by id +func GetCmdQueryTokenizeShareRecordByID() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-record-by-id [id]", + Args: cobra.ExactArgs(1), + Short: "Query individual tokenize share record information by share by id", + Long: strings.TrimSpace( + fmt.Sprintf(`Query individual tokenize share record information by share by id. + +Example: +$ %s query staking tokenize-share-record-by-id [id] +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + id, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordById(cmd.Context(), &types.QueryTokenizeShareRecordByIdRequest{ + Id: uint64(id), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTokenizeShareRecordByDenom implements the query for individual tokenize share record information by share denom +func GetCmdQueryTokenizeShareRecordByDenom() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-record-by-denom", + Args: cobra.ExactArgs(1), + Short: "Query individual tokenize share record information by share denom", + Long: strings.TrimSpace( + fmt.Sprintf(`Query individual tokenize share record information by share denom. + +Example: +$ %s query staking tokenize-share-record-by-denom +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.TokenizeShareRecordByDenom(cmd.Context(), &types.QueryTokenizeShareRecordByDenomRequest{ + Denom: args[0], + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTokenizeShareRecordsOwned implements the query tokenize share records by address +func GetCmdQueryTokenizeShareRecordsOwned() *cobra.Command { + cmd := &cobra.Command{ + Use: "tokenize-share-records-owned", + Args: cobra.ExactArgs(1), + Short: "Query tokenize share records by address", + Long: strings.TrimSpace( + fmt.Sprintf(`Query tokenize share records by address. + +Example: +$ %s query staking tokenize-share-records-owned [owner] +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + owner, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + res, err := queryClient.TokenizeShareRecordsOwned(cmd.Context(), &types.QueryTokenizeShareRecordsOwnedRequest{ + Owner: owner.String(), + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryAllTokenizeShareRecords implements the query for all tokenize share records +func GetCmdQueryAllTokenizeShareRecords() *cobra.Command { + cmd := &cobra.Command{ + Use: "all-tokenize-share-records", + Args: cobra.NoArgs, + Short: "Query for all tokenize share records", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for all tokenize share records. + +Example: +$ %s query staking all-tokenize-share-records +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + params := &types.QueryAllTokenizeShareRecordsRequest{ + Pagination: pageReq, + } + + res, err := queryClient.AllTokenizeShareRecords(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "tokenize share records") + + return cmd +} + +// GetCmdQueryLastTokenizeShareRecordId implements the query for last tokenize share record id +func GetCmdQueryLastTokenizeShareRecordID() *cobra.Command { + cmd := &cobra.Command{ + Use: "last-tokenize-share-record-id", + Args: cobra.NoArgs, + Short: "Query for last tokenize share record id", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for last tokenize share record id. + +Example: +$ %s query staking last-tokenize-share-record-id +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.LastTokenizeShareRecordId(cmd.Context(), &types.QueryLastTokenizeShareRecordIdRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTotalTokenizeSharedAssets implements the query for total tokenized staked assets +func GetCmdQueryTotalTokenizeSharedAssets() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-tokenize-share-assets", + Args: cobra.NoArgs, + Short: "Query for total tokenized staked assets", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for total tokenized staked assets. + +Example: +$ %s query staking total-tokenize-share-assets +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.TotalTokenizeSharedAssets(cmd.Context(), &types.QueryTotalTokenizeSharedAssetsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTotalLiquidStaked implements the query for total liquid staked tokens +func GetCmdQueryTotalLiquidStaked() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-liquid-staked", + Args: cobra.NoArgs, + Short: "Query for total liquid staked tokens", + Long: strings.TrimSpace( + fmt.Sprintf(`Query for total number of liquid staked tokens. +Liquid staked tokens are identified as either a tokenized delegation, +or tokens owned by an interchain account. +Example: +$ %s query staking total-liquid-staked +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.TotalLiquidStaked(cmd.Context(), &types.QueryTotalLiquidStaked{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryTokenizeShareLockInfo returns the tokenize share lock status for a user +func GetCmdQueryTokenizeShareLockInfo() *cobra.Command { + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "tokenize-share-lock-info [address]", + Args: cobra.ExactArgs(1), + Short: "Query tokenize share lock information", + Long: strings.TrimSpace( + fmt.Sprintf(`Query the status of a tokenize share lock for a given account +Example: +$ %s query staking tokenize-share-lock-info %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj +`, + version.AppName, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + address := args[0] + if _, err := sdk.AccAddressFromBech32(address); err != nil { + return err + } + + res, err := queryClient.TokenizeShareLockInfo( + cmd.Context(), + &types.QueryTokenizeShareLockInfo{Address: address}, + ) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/staking/client/cli/tx.go b/x/staking/client/cli/tx.go index ceebbe40a54b..d99a3b3796c4 100644 --- a/x/staking/client/cli/tx.go +++ b/x/staking/client/cli/tx.go @@ -44,7 +44,14 @@ func NewTxCmd() *cobra.Command { NewDelegateCmd(), NewRedelegateCmd(), NewUnbondCmd(), + NewUnbondValidatorCmd(), NewCancelUnbondingDelegation(), + NewTokenizeSharesCmd(), + NewRedeemTokensCmd(), + NewTransferTokenizeShareRecordCmd(), + NewDisableTokenizeShares(), + NewEnableTokenizeShares(), + NewValidatorBondCmd(), ) return stakingTxCmd @@ -272,6 +279,37 @@ $ %s tx staking unbond %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from return cmd } +func NewUnbondValidatorCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "unbond-validator", + Short: "Unbond a validator", + Args: cobra.ExactArgs(0), + Long: strings.TrimSpace( + fmt.Sprintf(`Unbond a validator. + +Example: +$ %s tx staking unbond-validator --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUnbondValidator(sdk.ValAddress(clientCtx.GetFromAddress())) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + // NewCancelUnbondingDelegation returns a CLI command handler for creating a MsgCancelUnbondingDelegation transaction. func NewCancelUnbondingDelegation() *cobra.Command { bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() @@ -575,3 +613,251 @@ func BuildCreateValidatorMsg(clientCtx client.Context, config TxCreateValidatorC return txBldr, msg, nil } + +// NewTokenizeSharesCmd defines a command for tokenizing shares from a validator. +func NewTokenizeSharesCmd() *cobra.Command { + bech32PrefixValAddr := sdk.GetConfig().GetBech32ValidatorAddrPrefix() + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "tokenize-share [validator-addr] [amount] [rewardOwner]", + Short: "Tokenize delegation to share tokens", + Args: cobra.ExactArgs(3), + Long: strings.TrimSpace( + fmt.Sprintf(`Tokenize delegation to share tokens. + +Example: +$ %s tx staking tokenize-share %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey +`, + version.AppName, bech32PrefixValAddr, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + valAddr, err := sdk.ValAddressFromBech32(args[0]) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + rewardOwner, err := sdk.AccAddressFromBech32(args[2]) + if err != nil { + return err + } + + msg := &types.MsgTokenizeShares{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + Amount: amount, + TokenizedShareOwner: rewardOwner.String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewRedeemTokensCmd defines a command for redeeming tokens from a validator for shares. +func NewRedeemTokensCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "redeem-tokens [amount]", + Short: "Redeem specified amount of share tokens to delegation", + Args: cobra.ExactArgs(1), + Long: strings.TrimSpace( + fmt.Sprintf(`Redeem specified amount of share tokens to delegation. + +Example: +$ %s tx staking redeem-tokens 100sharetoken --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + delAddr := clientCtx.GetFromAddress() + + amount, err := sdk.ParseCoinNormalized(args[0]) + if err != nil { + return err + } + + msg := &types.MsgRedeemTokensForShares{ + DelegatorAddress: delAddr.String(), + Amount: amount, + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewTransferTokenizeShareRecordCmd defines a command to transfer ownership of TokenizeShareRecord +func NewTransferTokenizeShareRecordCmd() *cobra.Command { + bech32PrefixAccAddr := sdk.GetConfig().GetBech32AccountAddrPrefix() + + cmd := &cobra.Command{ + Use: "transfer-tokenize-share-record [record-id] [new-owner]", + Short: "Transfer ownership of TokenizeShareRecord", + Args: cobra.ExactArgs(2), + Long: strings.TrimSpace( + fmt.Sprintf(`Transfer ownership of TokenizeShareRecord. + +Example: +$ %s tx staking transfer-tokenize-share-record 1 %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey +`, + version.AppName, bech32PrefixAccAddr, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + recordID, err := strconv.Atoi(args[0]) + if err != nil { + return err + } + + ownerAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + msg := &types.MsgTransferTokenizeShareRecord{ + Sender: clientCtx.GetFromAddress().String(), + TokenizeShareRecordId: uint64(recordID), + NewOwner: ownerAddr.String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewDisableTokenizeShares defines a command to disable tokenization for an address +func NewDisableTokenizeShares() *cobra.Command { + cmd := &cobra.Command{ + Use: "disable-tokenize-shares", + Short: "Disable tokenization of shares", + Args: cobra.ExactArgs(0), + Long: strings.TrimSpace( + fmt.Sprintf(`Disables the tokenization of shares for an address. The account +must explicitly re-enable if they wish to tokenize again, at which point they must wait +the chain's unbonding period. + +Example: +$ %s tx staking disable-tokenize-shares --from mykey +`, version.AppName), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgDisableTokenizeShares{ + DelegatorAddress: clientCtx.GetFromAddress().String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewEnableTokenizeShares defines a command to re-enable tokenization for an address +func NewEnableTokenizeShares() *cobra.Command { + cmd := &cobra.Command{ + Use: "enable-tokenize-shares", + Short: "Enable tokenization of shares", + Args: cobra.ExactArgs(0), + Long: strings.TrimSpace( + fmt.Sprintf(`Enables the tokenization of shares for an address after +it had been disable. This transaction queues the enablement of tokenization, but +the address must wait 1 unbonding period from the time of this transaction before +tokenization is permitted. + +Example: +$ %s tx staking enable-tokenize-shares --from mykey +`, version.AppName), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgEnableTokenizeShares{ + DelegatorAddress: clientCtx.GetFromAddress().String(), + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewValidatorBondCmd defines a command to mark a delegation as a validator self bond +func NewValidatorBondCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "validator-bond [validator]", + Short: "Mark a delegation as a validator self-bond", + Args: cobra.ExactArgs(1), + Long: strings.TrimSpace( + fmt.Sprintf(`Mark a delegation as a validator self-bond. + +Example: +$ %s tx staking validator-bond cosmosvaloper13h5xdxhsdaugwdrkusf8lkgu406h8t62jkqv3h --from mykey +`, + version.AppName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgValidatorBond{ + DelegatorAddress: clientCtx.GetFromAddress().String(), + ValidatorAddress: args[0], + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/staking/keeper/liquid_stake.go b/x/staking/keeper/liquid_stake.go new file mode 100644 index 000000000000..b9b5280bd17c --- /dev/null +++ b/x/staking/keeper/liquid_stake.go @@ -0,0 +1,430 @@ +package keeper + +import ( + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// SetTotalLiquidStakedTokens stores the total outstanding tokens owned by a liquid staking provider +func (k Keeper) SetTotalLiquidStakedTokens(ctx sdk.Context, tokens sdk.Int) { + store := ctx.KVStore(k.storeKey) + + tokensBz, err := tokens.Marshal() + if err != nil { + panic(err) + } + + store.Set(types.TotalLiquidStakedTokensKey, tokensBz) +} + +// GetTotalLiquidStakedTokens returns the total outstanding tokens owned by a liquid staking provider +// Returns zero if the total liquid stake amount has not been initialized +func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) sdk.Int { + store := ctx.KVStore(k.storeKey) + tokensBz := store.Get(types.TotalLiquidStakedTokensKey) + + if tokensBz == nil { + return sdk.ZeroInt() + } + + var tokens sdk.Int + if err := tokens.Unmarshal(tokensBz); err != nil { + panic(err) + } + + return tokens +} + +// Checks if an account associated with a given delegation is related to liquid staking +// +// This is determined by checking if the account has a 32-length address +// which will identify the following scenarios: +// - An account has tokenized their shares, and thus the delegation is +// owned by the tokenize share record module account +// - A liquid staking provider is delegating through an ICA account +// +// Both ICA accounts and tokenize share record module accounts have 32-length addresses +// NOTE: This will have to be refactored before adapting it to chains beyond gaia +// as other chains may have 32-length addresses that are not related to the above scenarios +func (k Keeper) DelegatorIsLiquidStaker(delegatorAddress sdk.AccAddress) bool { + return len(delegatorAddress) == 32 +} + +// CheckExceedsGlobalLiquidStakingCap checks if a liquid delegation would cause the +// global liquid staking cap to be exceeded +// A liquid delegation is defined as either tokenized shares, or a delegation from an ICA Account +// The total stake is determined by the balance of the bonded pool +// If the delegation's shares are already bonded (e.g. in the event of a tokenized share) +// the tokens are already included in the bonded pool +// If the delegation's shares are not bonded (e.g. normal delegation), +// we need to add the tokens to the current bonded pool balance to get the total staked +func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens sdk.Int, sharesAlreadyBonded bool) bool { + liquidStakingCap := k.GlobalLiquidStakingCap(ctx) + liquidStakedAmount := k.GetTotalLiquidStakedTokens(ctx) + + // Determine the total stake from the balance of the bonded pool + // If this is not a tokenized delegation, we need to add the tokens to the pool balance since + // they would not have been counted yet + // If this is for a tokenized delegation, the tokens are already included in the pool balance + totalStakedAmount := k.TotalBondedTokens(ctx) + if !sharesAlreadyBonded { + totalStakedAmount = totalStakedAmount.Add(tokens) + } + + // Calculate the percentage of stake that is liquid + updatedLiquidStaked := liquidStakedAmount.Add(tokens).ToLegacyDec() + liquidStakePercent := updatedLiquidStaked.Quo(totalStakedAmount.ToLegacyDec()) + + return liquidStakePercent.GT(liquidStakingCap) +} + +// CheckExceedsValidatorBondCap checks if a liquid delegation to a validator would cause +// the liquid shares to exceed the validator bond factor +// A liquid delegation is defined as either tokenized shares, or a delegation from an ICA Account +// Returns true if the cap is exceeded +func (k Keeper) CheckExceedsValidatorBondCap(ctx sdk.Context, validator types.Validator, shares sdk.Dec) bool { + validatorBondFactor := k.ValidatorBondFactor(ctx) + if validatorBondFactor.Equal(types.ValidatorBondCapDisabled) { + return false + } + maxValLiquidShares := validator.ValidatorBondShares.Mul(validatorBondFactor) + return validator.LiquidShares.Add(shares).GT(maxValLiquidShares) +} + +// CheckExceedsValidatorLiquidStakingCap checks if a liquid delegation could cause the +// total liuquid shares to exceed the liquid staking cap +// A liquid delegation is defined as either tokenized shares, or a delegation from an ICA Account +// Returns true if the cap is exceeded +func (k Keeper) CheckExceedsValidatorLiquidStakingCap(ctx sdk.Context, validator types.Validator, shares sdk.Dec) bool { + updatedLiquidShares := validator.LiquidShares.Add(shares) + updatedTotalShares := validator.DelegatorShares.Add(shares) + + liquidStakePercent := updatedLiquidShares.Quo(updatedTotalShares) + liquidStakingCap := k.ValidatorLiquidStakingCap(ctx) + + return liquidStakePercent.GT(liquidStakingCap) +} + +// SafelyIncreaseTotalLiquidStakedTokens increments the total liquid staked tokens +// if the global cap is not surpassed by this delegation +// +// The percentage of liquid staked tokens must be less than the GlobalLiquidStakingCap: +// (TotalLiquidStakedTokens / TotalStakedTokens) <= GlobalLiquidStakingCap +func (k Keeper) SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int, sharesAlreadyBonded bool) error { + if k.CheckExceedsGlobalLiquidStakingCap(ctx, amount, sharesAlreadyBonded) { + return types.ErrGlobalLiquidStakingCapExceeded + } + + k.SetTotalLiquidStakedTokens(ctx, k.GetTotalLiquidStakedTokens(ctx).Add(amount)) + return nil +} + +// DecreaseTotalLiquidStakedTokens decrements the total liquid staked tokens +func (k Keeper) DecreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int) error { + totalLiquidStake := k.GetTotalLiquidStakedTokens(ctx) + if amount.GT(totalLiquidStake) { + return types.ErrTotalLiquidStakedUnderflow + } + k.SetTotalLiquidStakedTokens(ctx, totalLiquidStake.Sub(amount)) + return nil +} + +// SafelyIncreaseValidatorLiquidShares increments the liquid shares on a validator, if: +// the validator bond factor and validator liquid staking cap will not be exceeded by this delegation +// +// The percentage of validator liquid shares must be less than the ValidatorLiquidStakingCap, +// and the total liquid staked shares cannot exceed the validator bond cap +// 1) (TotalLiquidStakedTokens / TotalStakedTokens) <= ValidatorLiquidStakingCap +// 2) LiquidShares <= (ValidatorBondShares * ValidatorBondFactor) +func (k Keeper) SafelyIncreaseValidatorLiquidShares(ctx sdk.Context, valAddress sdk.ValAddress, shares sdk.Dec) (types.Validator, error) { + validator, found := k.GetValidator(ctx, valAddress) + if !found { + return validator, types.ErrNoValidatorFound + } + + // Confirm the validator bond factor and validator liquid staking cap will not be exceeded + if k.CheckExceedsValidatorBondCap(ctx, validator, shares) { + return validator, types.ErrInsufficientValidatorBondShares + } + if k.CheckExceedsValidatorLiquidStakingCap(ctx, validator, shares) { + return validator, types.ErrValidatorLiquidStakingCapExceeded + } + + // Increment the validator's liquid shares + validator.LiquidShares = validator.LiquidShares.Add(shares) + k.SetValidator(ctx, validator) + + return validator, nil +} + +// DecreaseValidatorLiquidShares decrements the liquid shares on a validator +func (k Keeper) DecreaseValidatorLiquidShares(ctx sdk.Context, valAddress sdk.ValAddress, shares sdk.Dec) (types.Validator, error) { + validator, found := k.GetValidator(ctx, valAddress) + if !found { + return validator, types.ErrNoValidatorFound + } + + if shares.GT(validator.LiquidShares) { + return validator, types.ErrValidatorLiquidSharesUnderflow + } + + validator.LiquidShares = validator.LiquidShares.Sub(shares) + k.SetValidator(ctx, validator) + + return validator, nil +} + +// Increase validator bond shares increments the validator's self bond +// in the event that the delegation amount on a validator bond delegation is increased +func (k Keeper) IncreaseValidatorBondShares(ctx sdk.Context, valAddress sdk.ValAddress, shares sdk.Dec) error { + validator, found := k.GetValidator(ctx, valAddress) + if !found { + return types.ErrNoValidatorFound + } + + validator.ValidatorBondShares = validator.ValidatorBondShares.Add(shares) + k.SetValidator(ctx, validator) + + return nil +} + +// SafelyDecreaseValidatorBond decrements the validator's self bond +// so long as it will not cause the current delegations to exceed the threshold +// set by validator bond factor +func (k Keeper) SafelyDecreaseValidatorBond(ctx sdk.Context, valAddress sdk.ValAddress, shares sdk.Dec) error { + validator, found := k.GetValidator(ctx, valAddress) + if !found { + return types.ErrNoValidatorFound + } + + // Check if the decreased self bond will cause the validator bond threshold to be exceeded + validatorBondFactor := k.ValidatorBondFactor(ctx) + validatorBondEnabled := !validatorBondFactor.Equal(types.ValidatorBondCapDisabled) + maxValTotalShare := validator.ValidatorBondShares.Sub(shares).Mul(validatorBondFactor) + + if validatorBondEnabled && validator.LiquidShares.GT(maxValTotalShare) { + return types.ErrInsufficientValidatorBondShares + } + + // Decrement the validator's self bond + validator.ValidatorBondShares = validator.ValidatorBondShares.Sub(shares) + k.SetValidator(ctx, validator) + + return nil +} + +// Adds a lock that prevents tokenizing shares for an account +// The tokenize share lock store is implemented by keying on the account address +// and storing a timestamp as the value. The timestamp is empty when the lock is +// set and gets populated with the unlock completion time once the unlock has started +func (k Keeper) AddTokenizeSharesLock(ctx sdk.Context, address sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + key := types.GetTokenizeSharesLockKey(address) + store.Set(key, sdk.FormatTimeBytes(time.Time{})) +} + +// Removes the tokenize share lock for an account to enable tokenizing shares +func (k Keeper) RemoveTokenizeSharesLock(ctx sdk.Context, address sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + key := types.GetTokenizeSharesLockKey(address) + store.Delete(key) +} + +// Updates the timestamp associated with a lock to the time at which the lock expires +func (k Keeper) SetTokenizeSharesUnlockTime(ctx sdk.Context, address sdk.AccAddress, completionTime time.Time) { + store := ctx.KVStore(k.storeKey) + key := types.GetTokenizeSharesLockKey(address) + store.Set(key, sdk.FormatTimeBytes(completionTime)) +} + +// Checks if there is currently a tokenize share lock for a given account +// Returns the status indicating whether the account is locked, unlocked, +// or as a lock expiring. If the lock is expiring, the expiration time is returned +func (k Keeper) GetTokenizeSharesLock(ctx sdk.Context, address sdk.AccAddress) (status types.TokenizeShareLockStatus, unlockTime time.Time) { + store := ctx.KVStore(k.storeKey) + key := types.GetTokenizeSharesLockKey(address) + bz := store.Get(key) + if len(bz) == 0 { + return types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED, time.Time{} + } + unlockTime, err := sdk.ParseTimeBytes(bz) + if err != nil { + panic(err) + } + if unlockTime.IsZero() { + return types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED, time.Time{} + } + return types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING, unlockTime +} + +// Returns all tokenize share locks +func (k Keeper) GetAllTokenizeSharesLocks(ctx sdk.Context) (tokenizeShareLocks []types.TokenizeShareLock) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.TokenizeSharesLockPrefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + addressBz := iterator.Key()[2:] // remove prefix bytes and address length + unlockTime, err := sdk.ParseTimeBytes(iterator.Value()) + if err != nil { + panic(err) + } + + var status types.TokenizeShareLockStatus + if unlockTime.IsZero() { + status = types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED + } else { + status = types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING + } + + bechPrefix := sdk.GetConfig().GetBech32AccountAddrPrefix() + lock := types.TokenizeShareLock{ + Address: sdk.MustBech32ifyAddressBytes(bechPrefix, addressBz), + Status: status.String(), + CompletionTime: unlockTime, + } + + tokenizeShareLocks = append(tokenizeShareLocks, lock) + } + + return tokenizeShareLocks +} + +// Stores a list of addresses pending tokenize share unlocking at the same time +func (k Keeper) SetPendingTokenizeShareAuthorizations(ctx sdk.Context, completionTime time.Time, authorizations types.PendingTokenizeShareAuthorizations) { + store := ctx.KVStore(k.storeKey) + timeKey := types.GetTokenizeShareAuthorizationTimeKey(completionTime) + bz := k.cdc.MustMarshal(&authorizations) + store.Set(timeKey, bz) +} + +// Returns a list of addresses pending tokenize share unlocking at the same time +func (k Keeper) GetPendingTokenizeShareAuthorizations(ctx sdk.Context, completionTime time.Time) types.PendingTokenizeShareAuthorizations { + store := ctx.KVStore(k.storeKey) + + timeKey := types.GetTokenizeShareAuthorizationTimeKey(completionTime) + bz := store.Get(timeKey) + + authorizations := types.PendingTokenizeShareAuthorizations{Addresses: []string{}} + if len(bz) == 0 { + return authorizations + } + k.cdc.MustUnmarshal(bz, &authorizations) + + return authorizations +} + +// Inserts the address into a queue where it will sit for 1 unbonding period +// before the tokenize share lock is removed +// Returns the completion time +func (k Keeper) QueueTokenizeSharesAuthorization(ctx sdk.Context, address sdk.AccAddress) time.Time { + params := k.GetParams(ctx) + completionTime := ctx.BlockTime().Add(params.UnbondingTime) + + // Append the address to the list of addresses that also unlock at this time + authorizations := k.GetPendingTokenizeShareAuthorizations(ctx, completionTime) + authorizations.Addresses = append(authorizations.Addresses, address.String()) + + k.SetPendingTokenizeShareAuthorizations(ctx, completionTime, authorizations) + k.SetTokenizeSharesUnlockTime(ctx, address, completionTime) + + return completionTime +} + +// Cancels a pending tokenize share authorization by removing the lock from the queue +func (k Keeper) CancelTokenizeShareLockExpiration(ctx sdk.Context, address sdk.AccAddress, completionTime time.Time) { + authorizations := k.GetPendingTokenizeShareAuthorizations(ctx, completionTime) + + updatedAddresses := []string{} + for _, expiringAddress := range authorizations.Addresses { + if address.String() != expiringAddress { + updatedAddresses = append(updatedAddresses, expiringAddress) + } + } + + authorizations.Addresses = updatedAddresses + k.SetPendingTokenizeShareAuthorizations(ctx, completionTime, authorizations) +} + +// Unlocks all queued tokenize share authorizations that have matured +// (i.e. have waited the full unbonding period) +func (k Keeper) RemoveExpiredTokenizeShareLocks(ctx sdk.Context, blockTime time.Time) (unlockedAddresses []string) { + store := ctx.KVStore(k.storeKey) + + // iterators all time slices from time 0 until the current block time + prefixEnd := sdk.InclusiveEndBytes(types.GetTokenizeShareAuthorizationTimeKey(blockTime)) + iterator := store.Iterator(types.TokenizeSharesUnlockQueuePrefix, prefixEnd) + defer iterator.Close() + + // collect all unlocked addresses + unlockedAddresses = []string{} + for ; iterator.Valid(); iterator.Next() { + authorizations := types.PendingTokenizeShareAuthorizations{} + k.cdc.MustUnmarshal(iterator.Value(), &authorizations) + + for _, addressString := range authorizations.Addresses { + unlockedAddresses = append(unlockedAddresses, addressString) + } + store.Delete(iterator.Key()) + } + + // remove the lock from each unlocked address + for _, unlockedAddress := range unlockedAddresses { + k.RemoveTokenizeSharesLock(ctx, sdk.MustAccAddressFromBech32(unlockedAddress)) + } + + return unlockedAddresses +} + +// Calculates and sets the global liquid staked tokens and liquid shares by validator +// The totals are determined by looping each delegation record and summing the stake +// if the delegator has a 32-length address. Checking for a 32-length address will capture +// ICA accounts, as well as tokenized delegations which are owned by module accounts +// under the hood +// This function must be called in the upgrade handler which onboards LSM +func (k Keeper) RefreshTotalLiquidStaked(ctx sdk.Context) error { + // First reset each validator's liquid shares to 0 + for _, validator := range k.GetAllValidators(ctx) { + validator.LiquidShares = sdk.ZeroDec() + k.SetValidator(ctx, validator) + } + + // Sum up the total liquid tokens and increment each validator's liquid shares + totalLiquidStakedTokens := sdk.ZeroInt() + for _, delegation := range k.GetAllDelegations(ctx) { + delegatorAddress, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) + if err != nil { + return err + } + + // If the delegator is either an ICA account or a tokenize share module account, + // the delegation should be considered to be associated with liquid staking + // Consequently, the global number of liquid staked tokens, and the total + // liquid shares on the validator should be incremented + if k.DelegatorIsLiquidStaker(delegatorAddress) { + validatorAddress, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) + if err != nil { + return err + } + validator, found := k.GetValidator(ctx, validatorAddress) + if !found { + return types.ErrNoValidatorFound + } + + liquidShares := delegation.Shares + liquidTokens := validator.TokensFromShares(liquidShares).TruncateInt() + + validator.LiquidShares = validator.LiquidShares.Add(liquidShares) + k.SetValidator(ctx, validator) + + totalLiquidStakedTokens = totalLiquidStakedTokens.Add(liquidTokens) + } + } + + k.SetTotalLiquidStakedTokens(ctx, totalLiquidStakedTokens) + + return nil +} diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go new file mode 100644 index 000000000000..5717fd7c0640 --- /dev/null +++ b/x/staking/keeper/liquid_stake_test.go @@ -0,0 +1,1207 @@ +package keeper_test + +// import ( +// "fmt" +// "testing" +// "time" + +// testutil "github.com/cosmos/cosmos-sdk/testutil/sims" + +// "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" +// "github.com/cosmos/cosmos-sdk/simapp" +// sdk "github.com/cosmos/cosmos-sdk/types" +// "github.com/cosmos/cosmos-sdk/types/address" +// authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +// minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" +// "github.com/cosmos/cosmos-sdk/x/staking/types" +// "github.com/stretchr/testify/require" +// ) + +// // Helper function to create a base account from an account name +// // Used to differentiate against liquid staking provider module account +// func createBaseAccount(app *simapp.SimApp, ctx sdk.Context, accountName string) sdk.AccAddress { +// baseAccountAddress := sdk.AccAddress(accountName) +// app.AccountKeeper.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) +// return baseAccountAddress +// } + +// // Helper function to create 32-length account +// // Used to mock an liquid staking provider's ICA account +// func createICAAccount(app *simapp.SimApp, ctx sdk.Context) sdk.AccAddress { +// icahost := "icahost" +// connectionID := "connection-0" +// portID := icahost + +// moduleAddress := authtypes.NewModuleAddress(icahost) +// icaAddress := sdk.AccAddress(address.Derive(moduleAddress, []byte(connectionID+portID))) + +// account := authtypes.NewBaseAccountWithAddress(icaAddress) +// app.AccountKeeper.SetAccount(ctx, account) + +// return icaAddress +// } + +// // Helper function to create a module account address from a tokenized share +// // Used to mock the delegation owner of a tokenized share +// func createTokenizeShareModuleAccount(recordID uint64) sdk.AccAddress { +// record := types.TokenizeShareRecord{ +// Id: recordID, +// ModuleAccount: fmt.Sprintf("%s%d", types.TokenizeShareModuleAccountPrefix, recordID), +// } +// return record.GetModuleAddress() +// } + +// // Tests Set/Get TotalLiquidStakedTokens +// func (s *KeeperTestSuite) TestTotalLiquidStakedTokens(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Update the total liquid staked +// total := sdk.NewInt(100) +// keeper.SetTotalLiquidStakedTokens(ctx, total) + +// // Confirm it was updated +// require.Equal(t, total, keeper.GetTotalLiquidStakedTokens(ctx), "initial") +// } + +// // Tests Increase/Decrease TotalValidatorLiquidShares +// func (s *KeeperTestSuite) TestValidatorLiquidShares(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper + +// // Create a validator address +// privKey := secp256k1.GenPrivKey() +// pubKey := privKey.PubKey() +// valAddress := sdk.ValAddress(pubKey.Address()) + +// // Set an initial total +// initial := sdk.NewDec(100) +// validator := types.Validator{ +// OperatorAddress: valAddress.String(), +// LiquidShares: initial, +// } +// keeper.SetValidator(ctx, validator) +// } + +// // Tests DelegatorIsLiquidStaker +// func (s *KeeperTestSuite) TestDelegatorIsLiquidStaker(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Create base and ICA accounts +// baseAccountAddress := createBaseAccount(app, ctx, "base-account") +// icaAccountAddress := createICAAccount(app, ctx) + +// // Only the ICA module account should be considered a liquid staking provider +// require.False(keeper.DelegatorIsLiquidStaker(baseAccountAddress), "base account") +// require.True(keeper.DelegatorIsLiquidStaker(icaAccountAddress), "ICA module account") +// } + +// // Helper function to clear the Bonded pool balances before a unit test +// func clearPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context) { +// bondDenom := keeper.BondDenom(ctx) +// initialBondedBalance := app.BankKeeper.GetBalance(ctx, app.AccountKeeper.GetModuleAddress(types.BondedPoolName), bondDenom) + +// err := app.BankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, minttypes.ModuleName, sdk.NewCoins(initialBondedBalance)) +// require.NoError(t, err, "no error expected when clearing bonded pool balance") +// } + +// // Helper function to fund the Bonded pool balances before a unit test +// func fundPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context, amount sdk.Int) { +// bondDenom := keeper.BondDenom(ctx) +// bondedPoolCoin := sdk.NewCoin(bondDenom, amount) + +// err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(bondedPoolCoin)) +// require.NoError(t, err, "no error expected when minting") + +// err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.BondedPoolName, sdk.NewCoins(bondedPoolCoin)) +// require.NoError(t, err, "no error expected when sending tokens to bonded pool") +// } + +// // Tests CheckExceedsGlobalLiquidStakingCap +// func (s *KeeperTestSuite) TestCheckExceedsGlobalLiquidStakingCap(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// testCases := []struct { +// name string +// globalLiquidCap sdk.Dec +// totalLiquidStake sdk.Int +// totalStake sdk.Int +// newLiquidStake sdk.Int +// tokenizingShares bool +// expectedExceeds bool +// }{ +// { +// // Cap: 10% - Native Delegation - Delegation Below Threshold +// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 1 +// // => Total Liquid Stake: 5+1=6, Total Stake: 95+1=96 => 6/96 = 6% < 10% cap +// name: "10 percent cap _ native delegation _ delegation below cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), +// totalLiquidStake: sdk.NewInt(5), +// totalStake: sdk.NewInt(95), +// newLiquidStake: sdk.NewInt(1), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 10% - Native Delegation - Delegation At Threshold +// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 5 +// // => Total Liquid Stake: 5+5=10, Total Stake: 95+5=100 => 10/100 = 10% == 10% cap +// name: "10 percent cap _ native delegation _ delegation equals cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), +// totalLiquidStake: sdk.NewInt(5), +// totalStake: sdk.NewInt(95), +// newLiquidStake: sdk.NewInt(5), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 10% - Native Delegation - Delegation Exceeds Threshold +// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 6 +// // => Total Liquid Stake: 5+6=11, Total Stake: 95+6=101 => 11/101 = 11% > 10% cap +// name: "10 percent cap _ native delegation _ delegation exceeds cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), +// totalLiquidStake: sdk.NewInt(5), +// totalStake: sdk.NewInt(95), +// newLiquidStake: sdk.NewInt(6), +// tokenizingShares: false, +// expectedExceeds: true, +// }, +// { +// // Cap: 20% - Native Delegation - Delegation Below Threshold +// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 29 +// // => Total Liquid Stake: 20+29=49, Total Stake: 220+29=249 => 49/249 = 19% < 20% cap +// name: "20 percent cap _ native delegation _ delegation below cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), +// totalLiquidStake: sdk.NewInt(20), +// totalStake: sdk.NewInt(220), +// newLiquidStake: sdk.NewInt(29), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 20% - Native Delegation - Delegation At Threshold +// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 30 +// // => Total Liquid Stake: 20+30=50, Total Stake: 220+30=250 => 50/250 = 20% == 20% cap +// name: "20 percent cap _ native delegation _ delegation equals cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), +// totalLiquidStake: sdk.NewInt(20), +// totalStake: sdk.NewInt(220), +// newLiquidStake: sdk.NewInt(30), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 20% - Native Delegation - Delegation Exceeds Threshold +// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 31 +// // => Total Liquid Stake: 20+31=51, Total Stake: 220+31=251 => 51/251 = 21% > 20% cap +// name: "20 percent cap _ native delegation _ delegation exceeds cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), +// totalLiquidStake: sdk.NewInt(20), +// totalStake: sdk.NewInt(220), +// newLiquidStake: sdk.NewInt(31), +// tokenizingShares: false, +// expectedExceeds: true, +// }, +// { +// // Cap: 50% - Native Delegation - Delegation Below Threshold +// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 +// // => Total Liquid Stake: 0+50=50, Total Stake: 100+50=150 => 50/150 = 33% < 50% cap +// name: "50 percent cap _ native delegation _ delegation below cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), +// totalLiquidStake: sdk.NewInt(0), +// totalStake: sdk.NewInt(100), +// newLiquidStake: sdk.NewInt(50), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 50% - Tokenized Delegation - Delegation At Threshold +// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 +// // => 50 / 100 = 50% == 50% cap +// name: "50 percent cap _ tokenized delegation _ delegation equals cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), +// totalLiquidStake: sdk.NewInt(0), +// totalStake: sdk.NewInt(100), +// newLiquidStake: sdk.NewInt(50), +// tokenizingShares: true, +// expectedExceeds: false, +// }, +// { +// // Cap: 50% - Native Delegation - Delegation Below Threshold +// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 +// // => Total Liquid Stake: 0+51=51, Total Stake: 100+51=151 => 51/151 = 33% < 50% cap +// name: "50 percent cap _ native delegation _ delegation below cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), +// totalLiquidStake: sdk.NewInt(0), +// totalStake: sdk.NewInt(100), +// newLiquidStake: sdk.NewInt(51), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// { +// // Cap: 50% - Tokenized Delegation - Delegation Exceeds Threshold +// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 +// // => 51 / 100 = 51% > 50% cap +// name: "50 percent cap _ tokenized delegation _delegation exceeds cap", +// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), +// totalLiquidStake: sdk.NewInt(0), +// totalStake: sdk.NewInt(100), +// newLiquidStake: sdk.NewInt(51), +// tokenizingShares: true, +// expectedExceeds: true, +// }, +// { +// // Cap of 0% - everything should exceed +// name: "0 percent cap", +// globalLiquidCap: sdk.ZeroDec(), +// totalLiquidStake: sdk.NewInt(0), +// totalStake: sdk.NewInt(1_000_000), +// newLiquidStake: sdk.NewInt(1), +// tokenizingShares: false, +// expectedExceeds: true, +// }, +// { +// // Cap of 100% - nothing should exceed +// name: "100 percent cap", +// globalLiquidCap: sdk.OneDec(), +// totalLiquidStake: sdk.NewInt(1), +// totalStake: sdk.NewInt(1), +// newLiquidStake: sdk.NewInt(1_000_000), +// tokenizingShares: false, +// expectedExceeds: false, +// }, +// } + +// for _, tc := range testCases { +// t.Run(tc.name, func(t *testing.T) { +// // Update the global liquid staking cap +// params := keeper.GetParams(ctx) +// params.GlobalLiquidStakingCap = tc.globalLiquidCap +// keeper.SetParams(ctx, params) + +// // Update the total liquid tokens +// keeper.SetTotalLiquidStakedTokens(ctx, tc.totalLiquidStake) + +// // Fund each pool for the given test case +// clearPoolBalance(t, app, ctx) +// fundPoolBalance(t, app, ctx, tc.totalStake) + +// // Check if the new tokens would exceed the global cap +// actualExceeds := keeper.CheckExceedsGlobalLiquidStakingCap(ctx, tc.newLiquidStake, tc.tokenizingShares) +// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) +// }) +// } +// } + +// // Tests SafelyIncreaseTotalLiquidStakedTokens +// func (s *KeeperTestSuite) TestSafelyIncreaseTotalLiquidStakedTokens(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// intitialTotalLiquidStaked := sdk.NewInt(100) +// increaseAmount := sdk.NewInt(10) +// poolBalance := sdk.NewInt(200) + +// // Set the total staked and total liquid staked amounts +// // which are required components when checking the global cap +// // Total stake is calculated from the pool balance +// clearPoolBalance(t, app, ctx) +// fundPoolBalance(t, app, ctx, poolBalance) +// keeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) + +// // Set the global cap such that a small delegation would exceed the cap +// params := keeper.GetParams(ctx) +// params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.0001") +// keeper.SetParams(ctx, params) + +// // Attempt to increase the total liquid stake again, it should error since +// // the cap was exceeded +// err := keeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) +// require.ErrorIs(t, err, types.ErrGlobalLiquidStakingCapExceeded) +// require.Equal(t, intitialTotalLiquidStaked, keeper.GetTotalLiquidStakedTokens(ctx)) + +// // Now relax the cap so that the increase succeeds +// params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.99") +// keeper.SetParams(ctx, params) + +// // Confirm the total increased +// err = keeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) +// require.NoError(t, err) +// require.Equal(t, intitialTotalLiquidStaked.Add(increaseAmount), keeper.GetTotalLiquidStakedTokens(ctx)) +// } + +// // Tests DecreaseTotalLiquidStakedTokens +// func (s *KeeperTestSuite) TestDecreaseTotalLiquidStakedTokens(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// intitialTotalLiquidStaked := sdk.NewInt(100) +// decreaseAmount := sdk.NewInt(10) + +// // Set the total liquid staked to an arbitrary value +// keeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) + +// // Decrease the total liquid stake and confirm the total was updated +// err := keeper.DecreaseTotalLiquidStakedTokens(ctx, decreaseAmount) +// require.NoError(t, err, "no error expected when decreasing total liquid staked tokens") +// require.Equal(t, intitialTotalLiquidStaked.Sub(decreaseAmount), keeper.GetTotalLiquidStakedTokens(ctx)) + +// // Attempt to decrease by an excessive amount, it should error +// err = keeper.DecreaseTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) +// require.ErrorIs(err, types.ErrTotalLiquidStakedUnderflow) +// } + +// // Tests CheckExceedsValidatorBondCap +// func (s *KeeperTestSuite) TestCheckExceedsValidatorBondCap(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// testCases := []struct { +// name string +// validatorShares sdk.Dec +// validatorBondFactor sdk.Dec +// currentLiquidShares sdk.Dec +// newShares sdk.Dec +// expectedExceeds bool +// }{ +// { +// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 +// // New Shares: 5 - below cap +// name: "factor 1 - below cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(1), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(5), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 +// // New Shares: 10 - at cap +// name: "factor 1 - at cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(1), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(10), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 +// // New Shares: 15 - above cap +// name: "factor 1 - above cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(1), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(15), +// expectedExceeds: true, +// }, +// { +// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 +// // New Shares: 5 - below cap +// name: "factor 2 - well below cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(2), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(5), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 +// // New Shares: 100 - below cap +// name: "factor 2 - below cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(2), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(100), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 +// // New Shares: 110 - below cap +// name: "factor 2 - at cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(2), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(110), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 +// // New Shares: 111 - above cap +// name: "factor 2 - above cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(2), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(111), +// expectedExceeds: true, +// }, +// { +// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 +// // New Shares: 100 - below cap +// name: "factor 100 - below cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(100), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(100), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 +// // New Shares: 9910 - at cap +// name: "factor 100 - at cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(100), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(9910), +// expectedExceeds: false, +// }, +// { +// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 +// // New Shares: 9911 - above cap +// name: "factor 100 - above cap", +// validatorShares: sdk.NewDec(100), +// validatorBondFactor: sdk.NewDec(100), +// currentLiquidShares: sdk.NewDec(90), +// newShares: sdk.NewDec(9911), +// expectedExceeds: true, +// }, +// { +// // Factor of -1 (disabled): Should always return false +// name: "factor disabled", +// validatorShares: sdk.NewDec(1), +// validatorBondFactor: sdk.NewDec(-1), +// currentLiquidShares: sdk.NewDec(1), +// newShares: sdk.NewDec(1_000_000), +// expectedExceeds: false, +// }, +// } + +// for _, tc := range testCases { +// t.Run(tc.name, func(t *testing.T) { +// // Update the validator bond factor +// params := keeper.GetParams(ctx) +// params.ValidatorBondFactor = tc.validatorBondFactor +// keeper.SetParams(ctx, params) + +// // Create a validator with designated self-bond shares +// validator := types.Validator{ +// LiquidShares: tc.currentLiquidShares, +// ValidatorBondShares: tc.validatorShares, +// } + +// // Check whether the cap is exceeded +// actualExceeds := keeper.CheckExceedsValidatorBondCap(ctx, validator, tc.newShares) +// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) +// }) +// } +// } + +// // Tests TestCheckExceedsValidatorLiquidStakingCap +// func (s *KeeperTestSuite) TestCheckExceedsValidatorLiquidStakingCap(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// testCases := []struct { +// name string +// validatorLiquidCap sdk.Dec +// validatorLiquidShares sdk.Dec +// validatorTotalShares sdk.Dec +// newLiquidShares sdk.Dec +// expectedExceeds bool +// }{ +// { +// // Cap: 10% - Delegation Below Threshold +// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 1 +// // => Liquid Shares: 5+1=6, Total Shares: 95+1=96 => 6/96 = 6% < 10% cap +// name: "10 percent cap _ delegation below cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), +// validatorLiquidShares: sdk.NewDec(5), +// validatorTotalShares: sdk.NewDec(95), +// newLiquidShares: sdk.NewDec(1), +// expectedExceeds: false, +// }, +// { +// // Cap: 10% - Delegation At Threshold +// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 5 +// // => Liquid Shares: 5+5=10, Total Shares: 95+5=100 => 10/100 = 10% == 10% cap +// name: "10 percent cap _ delegation equals cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), +// validatorLiquidShares: sdk.NewDec(5), +// validatorTotalShares: sdk.NewDec(95), +// newLiquidShares: sdk.NewDec(4), +// expectedExceeds: false, +// }, +// { +// // Cap: 10% - Delegation Exceeds Threshold +// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 6 +// // => Liquid Shares: 5+6=11, Total Shares: 95+6=101 => 11/101 = 11% > 10% cap +// name: "10 percent cap _ delegation exceeds cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), +// validatorLiquidShares: sdk.NewDec(5), +// validatorTotalShares: sdk.NewDec(95), +// newLiquidShares: sdk.NewDec(6), +// expectedExceeds: true, +// }, +// { +// // Cap: 20% - Delegation Below Threshold +// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 29 +// // => Liquid Shares: 20+29=49, Total Shares: 220+29=249 => 49/249 = 19% < 20% cap +// name: "20 percent cap _ delegation below cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), +// validatorLiquidShares: sdk.NewDec(20), +// validatorTotalShares: sdk.NewDec(220), +// newLiquidShares: sdk.NewDec(29), +// expectedExceeds: false, +// }, +// { +// // Cap: 20% - Delegation At Threshold +// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 30 +// // => Liquid Shares: 20+30=50, Total Shares: 220+30=250 => 50/250 = 20% == 20% cap +// name: "20 percent cap _ delegation equals cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), +// validatorLiquidShares: sdk.NewDec(20), +// validatorTotalShares: sdk.NewDec(220), +// newLiquidShares: sdk.NewDec(30), +// expectedExceeds: false, +// }, +// { +// // Cap: 20% - Delegation Exceeds Threshold +// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 31 +// // => Liquid Shares: 20+31=51, Total Shares: 220+31=251 => 51/251 = 21% > 20% cap +// name: "20 percent cap _ delegation exceeds cap", +// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), +// validatorLiquidShares: sdk.NewDec(20), +// validatorTotalShares: sdk.NewDec(220), +// newLiquidShares: sdk.NewDec(31), +// expectedExceeds: true, +// }, +// { +// // Cap of 0% - everything should exceed +// name: "0 percent cap", +// validatorLiquidCap: sdk.ZeroDec(), +// validatorLiquidShares: sdk.NewDec(0), +// validatorTotalShares: sdk.NewDec(1_000_000), +// newLiquidShares: sdk.NewDec(1), +// expectedExceeds: true, +// }, +// { +// // Cap of 100% - nothing should exceed +// name: "100 percent cap", +// validatorLiquidCap: sdk.OneDec(), +// validatorLiquidShares: sdk.NewDec(1), +// validatorTotalShares: sdk.NewDec(1_000_000), +// newLiquidShares: sdk.NewDec(1), +// expectedExceeds: false, +// }, +// } + +// for _, tc := range testCases { +// t.Run(tc.name, func(t *testing.T) { +// // Update the validator liquid staking cap +// params := keeper.GetParams(ctx) +// params.ValidatorLiquidStakingCap = tc.validatorLiquidCap +// keeper.SetParams(ctx, params) + +// // Create a validator with designated self-bond shares +// validator := types.Validator{ +// LiquidShares: tc.validatorLiquidShares, +// DelegatorShares: tc.validatorTotalShares, +// } + +// // Check whether the cap is exceeded +// actualExceeds := keeper.CheckExceedsValidatorLiquidStakingCap(ctx, validator, tc.newLiquidShares) +// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) +// }) +// } +// } + +// // Tests SafelyIncreaseValidatorLiquidShares +// func (s *KeeperTestSuite) TestSafelyIncreaseValidatorLiquidShares(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Generate a test validator address +// privKey := secp256k1.GenPrivKey() +// pubKey := privKey.PubKey() +// valAddress := sdk.ValAddress(pubKey.Address()) + +// // Helper function to check the validator's liquid shares +// checkValidatorLiquidShares := func(expected sdk.Dec, description string) { +// actualValidator, found := keeper.GetValidator(ctx, valAddress) +// require.True(found) +// require.Equal(expected.TruncateInt64(), actualValidator.LiquidShares.TruncateInt64(), description) +// } + +// // Start with the following: +// // Initial Liquid Shares: 0 +// // Validator Bond Shares: 10 +// // Validator TotalShares: 75 +// // +// // Initial Caps: +// // ValidatorBondFactor: 1 (Cap applied at 10 shares) +// // ValidatorLiquidStakingCap: 25% (Cap applied at 25 shares) +// // +// // Cap Increases: +// // ValidatorBondFactor: 10 (Cap applied at 100 shares) +// // ValidatorLiquidStakingCap: 40% (Cap applied at 50 shares) +// initialLiquidShares := sdk.NewDec(0) +// validatorBondShares := sdk.NewDec(10) +// validatorTotalShares := sdk.NewDec(75) + +// firstIncreaseAmount := sdk.NewDec(20) +// secondIncreaseAmount := sdk.NewDec(10) // total increase of 30 + +// initialBondFactor := sdk.NewDec(1) +// finalBondFactor := sdk.NewDec(10) +// initialLiquidStakingCap := sdk.MustNewDecFromStr("0.25") +// finalLiquidStakingCap := sdk.MustNewDecFromStr("0.4") + +// // Create a validator with designated self-bond shares +// initialValidator := types.Validator{ +// OperatorAddress: valAddress.String(), +// LiquidShares: initialLiquidShares, +// ValidatorBondShares: validatorBondShares, +// DelegatorShares: validatorTotalShares, +// } +// keeper.SetValidator(ctx, initialValidator) + +// // Set validator bond factor to a small number such that any delegation would fail, +// // and set the liquid staking cap such that the first stake would succeed, but the second +// // would fail +// params := keeper.GetParams(ctx) +// params.ValidatorBondFactor = initialBondFactor +// params.ValidatorLiquidStakingCap = initialLiquidStakingCap +// keeper.SetParams(ctx, params) + +// // Attempt to increase the validator liquid shares, it should throw an +// // error that the validator bond cap was exceeded +// _, err := keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) +// require.ErrorIs(t, err, types.ErrInsufficientValidatorBondShares) +// checkValidatorLiquidShares(initialLiquidShares, "shares after low bond factor") + +// // Change validator bond factor to a more conservative number, so that the increase succeeds +// params.ValidatorBondFactor = finalBondFactor +// keeper.SetParams(ctx, params) + +// // Try the increase again and check that it succeeded +// expectedLiquidSharesAfterFirstStake := initialLiquidShares.Add(firstIncreaseAmount) +// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) +// require.NoError(t, err) +// checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares with cap loose bond cap") + +// // Attempt another increase, it should fail from the liquid staking cap +// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) +// require.ErrorIs(t, err, types.ErrValidatorLiquidStakingCapExceeded) +// checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares after liquid staking cap hit") + +// // Raise the liquid staking cap so the new increment succeeds +// params.ValidatorLiquidStakingCap = finalLiquidStakingCap +// keeper.SetParams(ctx, params) + +// // Finally confirm that the increase succeeded this time +// expectedLiquidSharesAfterSecondStake := expectedLiquidSharesAfterFirstStake.Add(secondIncreaseAmount) +// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) +// require.NoError(t, err, "no error expected after increasing liquid staking cap") +// checkValidatorLiquidShares(expectedLiquidSharesAfterSecondStake, "shares after loose liquid stake cap") +// } + +// // Tests DecreaseValidatorLiquidShares +// func (s *KeeperTestSuite) TestDecreaseValidatorLiquidShares(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// initialLiquidShares := sdk.NewDec(100) +// decreaseAmount := sdk.NewDec(10) + +// // Create a validator with designated self-bond shares +// privKey := secp256k1.GenPrivKey() +// pubKey := privKey.PubKey() +// valAddress := sdk.ValAddress(pubKey.Address()) + +// initialValidator := types.Validator{ +// OperatorAddress: valAddress.String(), +// LiquidShares: initialLiquidShares, +// } +// keeper.SetValidator(ctx, initialValidator) + +// // Decrease the validator liquid shares, and confirm the new share amount has been updated +// _, err := keeper.DecreaseValidatorLiquidShares(ctx, valAddress, decreaseAmount) +// require.NoError(t, err, "no error expected when decreasing validator liquid shares") + +// actualValidator, found := keeper.GetValidator(ctx, valAddress) +// require.True(t, found) +// require.Equal(t, initialLiquidShares.Sub(decreaseAmount), actualValidator.LiquidShares, "liquid shares") + +// // Attempt to decrease by a larger amount than it has, it should fail +// _, err = keeper.DecreaseValidatorLiquidShares(ctx, valAddress, initialLiquidShares) +// require.ErrorIs(t, err, types.ErrValidatorLiquidSharesUnderflow) +// } + +// // Tests SafelyDecreaseValidatorBond +// func (s *KeeperTestSuite) TestSafelyDecreaseValidatorBond(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Initial Bond Factor: 100, Initial Validator Bond: 10 +// // => Max Liquid Shares 1000 (Initial Liquid Shares: 200) +// initialBondFactor := sdk.NewDec(100) +// initialValidatorBondShares := sdk.NewDec(10) +// initialLiquidShares := sdk.NewDec(200) + +// // Create a validator with designated self-bond shares +// privKey := secp256k1.GenPrivKey() +// pubKey := privKey.PubKey() +// valAddress := sdk.ValAddress(pubKey.Address()) + +// initialValidator := types.Validator{ +// OperatorAddress: valAddress.String(), +// ValidatorBondShares: initialValidatorBondShares, +// LiquidShares: initialLiquidShares, +// } +// keeper.SetValidator(ctx, initialValidator) + +// // Set the bond factor +// params := keeper.GetParams(ctx) +// params.ValidatorBondFactor = initialBondFactor +// keeper.SetParams(ctx, params) + +// // Decrease the validator bond from 10 to 5 (minus 5) +// // This will adjust the cap (factor * shares) +// // from (100 * 10 = 1000) to (100 * 5 = 500) +// // Since this is still above the initial liquid shares of 200, this will succeed +// decreaseAmount, expectedBondShares := sdk.NewDec(5), sdk.NewDec(5) +// err := keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) +// require.NoError(t, err) + +// actualValidator, found := keeper.GetValidator(ctx, valAddress) +// require.True(t, found) +// require.Equal(t, expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") + +// // Now attempt to decrease the validator bond again from 5 to 1 (minus 4) +// // This time, the cap will be reduced to (factor * shares) = (100 * 1) = 100 +// // However, the liquid shares are currently 200, so this should fail +// decreaseAmount, expectedBondShares = sdk.NewDec(4), sdk.NewDec(1) +// err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) +// require.ErrorIs(t, err, types.ErrInsufficientValidatorBondShares) + +// // Finally, disable the cap and attempt to decrease again +// // This time it should succeed +// params.ValidatorBondFactor = types.ValidatorBondCapDisabled +// keeper.SetParams(ctx, params) + +// err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) +// require.NoError(t, err) + +// actualValidator, found = keeper.GetValidator(ctx, valAddress) +// require.True(t, found) +// require.Equal(t, expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") +// } + +// // Tests Add/Remove/Get/SetTokenizeSharesLock +// func (s *KeeperTestSuite) TestTokenizeSharesLock(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// addresses := simtestutil.AddTestAddrs(s.bankKeeper, ctx, 2, sdk.NewInt(1)) +// addressA, addressB := addresses[0], addresses[1] + +// unlocked := types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED.String() +// locked := types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String() +// lockExpiring := types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String() + +// // Confirm both accounts start unlocked +// status, _ := keeper.GetTokenizeSharesLock(ctx, addressA) +// require.Equal(t, unlocked, status.String(), "addressA unlocked at start") + +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) +// require.Equal(t, unlocked, status.String(), "addressB unlocked at start") + +// // Lock the first account +// keeper.AddTokenizeSharesLock(ctx, addressA) + +// // The first account should now have tokenize shares disabled +// // and the unlock time should be the zero time +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) +// require.Equal(t, locked, status.String(), "addressA locked") + +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) +// require.Equal(t, unlocked, status.String(), "addressB still unlocked") + +// // Update the lock time and confirm it was set +// expectedUnlockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) +// keeper.SetTokenizeSharesUnlockTime(ctx, addressA, expectedUnlockTime) + +// status, actualUnlockTime := keeper.GetTokenizeSharesLock(ctx, addressA) +// require.Equal(t, lockExpiring, status.String(), "addressA lock expiring") +// require.Equal(t, expectedUnlockTime, actualUnlockTime, "addressA unlock time") + +// // Confirm B is still unlocked +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) +// require.Equal(t, unlocked, status.String(), "addressB still unlocked") + +// // Remove the lock +// keeper.RemoveTokenizeSharesLock(ctx, addressA) +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) +// require.Equal(t, unlocked, status.String(), "addressA unlocked at end") + +// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) +// require.Equal(t, unlocked, status.String(), "addressB unlocked at end") +// } + +// // Tests GetAllTokenizeSharesLocks +// func (s *KeeperTestSuite) TestGetAllTokenizeSharesLocks(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1)) + +// // Set 2 locked accounts, and two accounts with a lock expiring +// keeper.AddTokenizeSharesLock(ctx, addresses[0]) +// keeper.AddTokenizeSharesLock(ctx, addresses[1]) + +// unlockTime1 := time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC) +// unlockTime2 := time.Date(2023, 1, 2, 1, 0, 0, 0, time.UTC) +// keeper.SetTokenizeSharesUnlockTime(ctx, addresses[2], unlockTime1) +// keeper.SetTokenizeSharesUnlockTime(ctx, addresses[3], unlockTime2) + +// // Defined expected locks after GetAll +// expectedLocks := map[string]types.TokenizeShareLock{ +// addresses[0].String(): { +// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), +// }, +// addresses[1].String(): { +// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), +// }, +// addresses[2].String(): { +// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), +// CompletionTime: unlockTime1, +// }, +// addresses[3].String(): { +// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), +// CompletionTime: unlockTime2, +// }, +// } + +// // Check output from GetAll +// actualLocks := keeper.GetAllTokenizeSharesLocks(ctx) +// require.Len(actualLocks, len(expectedLocks), "number of locks") + +// for i, actual := range actualLocks { +// expected, ok := expectedLocks[actual.Address] +// require.True(ok, "address %s not expected", actual.Address) +// require.Equal(expected.Status, actual.Status, "tokenize share lock #%d status", i) +// require.Equal(expected.CompletionTime, actual.CompletionTime, "tokenize share lock #%d completion time", i) +// } +// } + +// // Test Get/SetPendingTokenizeShareAuthorizations +// func (s *KeeperTestSuite) TestPendingTokenizeShareAuthorizations(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Create dummy accounts and completion times +// addresses := simapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1)) +// addressStrings := []string{} +// for _, address := range addresses { +// addressStrings = append(addressStrings, address.String()) +// } + +// timeA := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) +// timeB := timeA.Add(time.Hour) + +// // There should be no addresses returned originally +// authorizationsA := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) +// require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected") + +// authorizationsB := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) +// require.Empty(t, authorizationsB.Addresses, "no addresses at timeB expected") + +// // Store addresses for timeB +// keeper.SetPendingTokenizeShareAuthorizations(ctx, timeB, types.PendingTokenizeShareAuthorizations{ +// Addresses: addressStrings, +// }) + +// // Check addresses +// authorizationsA = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) +// require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected at end") + +// authorizationsB = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) +// require.Equal(t, addressStrings, authorizationsB.Addresses, "address length") +// } + +// // Test QueueTokenizeSharesAuthorization and RemoveExpiredTokenizeShareLocks +// func (s *KeeperTestSuite) TestTokenizeShareAuthorizationQueue(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // We'll start by adding the following addresses to the queue +// // Time 0: [address0] +// // Time 1: [] +// // Time 2: [address1, address2, address3] +// // Time 3: [address4, address5] +// // Time 4: [address6] +// addresses := simapp.AddTestAddrs(app, ctx, 7, sdk.NewInt(1)) +// addressesByTime := map[int][]sdk.AccAddress{ +// 0: {addresses[0]}, +// 1: {}, +// 2: {addresses[1], addresses[2], addresses[3]}, +// 3: {addresses[4], addresses[5]}, +// 4: {addresses[6]}, +// } + +// // Set the unbonding time to 1 day +// unbondingPeriod := time.Hour * 24 +// params := keeper.GetParams(ctx) +// params.UnbondingTime = unbondingPeriod +// keeper.SetParams(ctx, params) + +// // Add each address to the queue and then increment the block time +// // such that the times line up as follows +// // Time 0: 2023-01-01 00:00:00 +// // Time 1: 2023-01-01 00:01:00 +// // Time 2: 2023-01-01 00:02:00 +// // Time 3: 2023-01-01 00:03:00 +// startTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) +// ctx = ctx.WithBlockTime(startTime) +// blockTimeIncrement := time.Hour + +// for timeIndex := 0; timeIndex <= 4; timeIndex++ { +// for _, address := range addressesByTime[timeIndex] { +// keeper.QueueTokenizeSharesAuthorization(ctx, address) +// } +// ctx = ctx.WithBlockTime(ctx.BlockTime().Add(blockTimeIncrement)) +// } + +// // We'll unlock the tokens using the following progression +// // The "alias'"/keys for these times assume a starting point of the Time 0 +// // from above, plus the Unbonding Time +// // Time -1 (2023-01-01 23:59:99): [] +// // Time 0 (2023-01-02 00:00:00): [address0] +// // Time 1 (2023-01-02 00:01:00): [] +// // Time 2.5 (2023-01-02 00:02:30): [address1, address2, address3] +// // Time 10 (2023-01-02 00:10:00): [address4, address5, address6] +// unlockBlockTimes := map[string]time.Time{ +// "-1": startTime.Add(unbondingPeriod).Add(-time.Second), +// "0": startTime.Add(unbondingPeriod), +// "1": startTime.Add(unbondingPeriod).Add(blockTimeIncrement), +// "2.5": startTime.Add(unbondingPeriod).Add(2 * blockTimeIncrement).Add(blockTimeIncrement / 2), +// "10": startTime.Add(unbondingPeriod).Add(10 * blockTimeIncrement), +// } +// expectedUnlockedAddresses := map[string][]string{ +// "-1": {}, +// "0": {addresses[0].String()}, +// "1": {}, +// "2.5": {addresses[1].String(), addresses[2].String(), addresses[3].String()}, +// "10": {addresses[4].String(), addresses[5].String(), addresses[6].String()}, +// } + +// // Now we'll remove items from the queue sequentially +// // First check with a block time before the first expiration - it should remove no addresses +// actualAddresses := keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["-1"]) +// require.Equal(t, expectedUnlockedAddresses["-1"], actualAddresses, "no addresses unlocked from time -1") + +// // Then pass in (time 0 + unbonding time) - it should remove the first address +// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["0"]) +// require.Equal(t, expectedUnlockedAddresses["0"], actualAddresses, "one address unlocked from time 0") + +// // Now pass in (time 1 + unbonding time) - it should remove no addresses since +// // the address at time 0 was already removed +// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["1"]) +// require.Equal(t, expectedUnlockedAddresses["1"], actualAddresses, "no addresses unlocked from time 1") + +// // Now pass in (time 2.5 + unbonding time) - it should remove the three addresses from time 2 +// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["2.5"]) +// require.Equal(t, expectedUnlockedAddresses["2.5"], actualAddresses, "addresses unlocked from time 2.5") + +// // Finally pass in a block time far in the future, which should remove all the remaining locks +// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["10"]) +// require.Equal(t, expectedUnlockedAddresses["10"], actualAddresses, "addresses unlocked from time 10") +// } + +// // Test RefreshTotalLiquidStaked +// func (s *KeeperTestSuite) TestRefreshTotalLiquidStaked(t *testing.T) { +// ctx, keeper := s.ctx, s.stakingKeeper +// require := s.Require() + +// // Set an arbitrary total liquid staked tokens amount that will get overwritten by the refresh +// keeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(999)) + +// // Add validator's with various exchange rates +// validators := []types.Validator{ +// { +// // Exchange rate of 1 +// OperatorAddress: "valA", +// Tokens: sdk.NewInt(100), +// DelegatorShares: sdk.NewDec(100), +// LiquidShares: sdk.NewDec(100), // should be overwritten +// }, +// { +// // Exchange rate of 0.9 +// OperatorAddress: "valB", +// Tokens: sdk.NewInt(90), +// DelegatorShares: sdk.NewDec(100), +// LiquidShares: sdk.NewDec(200), // should be overwritten +// }, +// { +// // Exchange rate of 0.75 +// OperatorAddress: "valC", +// Tokens: sdk.NewInt(75), +// DelegatorShares: sdk.NewDec(100), +// LiquidShares: sdk.NewDec(300), // should be overwritten +// }, +// } + +// // Add various delegations across the above validator's +// // Total Liquid Staked: 1,849 + 922 = 2,771 +// // Liquid Shares: +// // ValA: 400 + 325 = 725 +// // ValB: 860 + 580 = 1,440 +// // ValC: 900 + 100 = 1,000 +// expectedTotalLiquidStaked := int64(2771) +// expectedValidatorLiquidShares := map[string]sdk.Dec{ +// "valA": sdk.NewDec(725), +// "valB": sdk.NewDec(1440), +// "valC": sdk.NewDec(1000), +// } + +// delegations := []struct { +// delegation types.Delegation +// isLSTP bool +// isTokenized bool +// }{ +// // Delegator A - Not a liquid staking provider +// // Number of tokens/shares is irrelevant for this test +// { +// isLSTP: false, +// delegation: types.Delegation{ +// DelegatorAddress: "delA", +// ValidatorAddress: "valA", +// Shares: sdk.NewDec(100), +// }, +// }, +// { +// isLSTP: false, +// delegation: types.Delegation{ +// DelegatorAddress: "delA", +// ValidatorAddress: "valB", +// Shares: sdk.NewDec(860), +// }, +// }, +// { +// isLSTP: false, +// delegation: types.Delegation{ +// DelegatorAddress: "delA", +// ValidatorAddress: "valC", +// Shares: sdk.NewDec(750), +// }, +// }, +// // Delegator B - Liquid staking provider, tokens included in total +// // Total liquid staked: 400 + 774 + 675 = 1,849 +// { +// // Shares: 400 shares, Exchange Rate: 1.0, Tokens: 400 +// isLSTP: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delB-LSTP", +// ValidatorAddress: "valA", +// Shares: sdk.NewDec(400), +// }, +// }, +// { +// // Shares: 860 shares, Exchange Rate: 0.9, Tokens: 774 +// isLSTP: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delB-LSTP", +// ValidatorAddress: "valB", +// Shares: sdk.NewDec(860), +// }, +// }, +// { +// // Shares: 900 shares, Exchange Rate: 0.75, Tokens: 675 +// isLSTP: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delB-LSTP", +// ValidatorAddress: "valC", +// Shares: sdk.NewDec(900), +// }, +// }, +// // Delegator C - Tokenized shares, tokens included in total +// // Total liquid staked: 325 + 522 + 75 = 922 +// { +// // Shares: 325 shares, Exchange Rate: 1.0, Tokens: 325 +// isTokenized: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delC-LSTP", +// ValidatorAddress: "valA", +// Shares: sdk.NewDec(325), +// }, +// }, +// { +// // Shares: 580 shares, Exchange Rate: 0.9, Tokens: 522 +// isTokenized: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delC-LSTP", +// ValidatorAddress: "valB", +// Shares: sdk.NewDec(580), +// }, +// }, +// { +// // Shares: 100 shares, Exchange Rate: 0.75, Tokens: 75 +// isTokenized: true, +// delegation: types.Delegation{ +// DelegatorAddress: "delC-LSTP", +// ValidatorAddress: "valC", +// Shares: sdk.NewDec(100), +// }, +// }, +// } + +// // Create validators based on the above (must use an actual validator address) +// addresses := testutil.AddTestAddrsIncremental(s.bankKeeper, ctx, 5, keeper.TokensFromConsensusPower(ctx, 300)) +// validatorAddresses := map[string]sdk.ValAddress{ +// "valA": sdk.ValAddress(addresses[0]), +// "valB": sdk.ValAddress(addresses[1]), +// "valC": sdk.ValAddress(addresses[2]), +// } +// for _, validator := range validators { +// validator.OperatorAddress = validatorAddresses[validator.OperatorAddress].String() +// keeper.SetValidator(ctx, validator) +// } + +// // Create the delegations based on the above (must use actual delegator addresses) +// for _, delegationCase := range delegations { +// var delegatorAddress sdk.AccAddress +// switch { +// case delegationCase.isLSTP: +// delegatorAddress = createICAAccount(app, ctx) +// case delegationCase.isTokenized: +// delegatorAddress = createTokenizeShareModuleAccount(1) +// default: +// delegatorAddress = createBaseAccount(app, ctx, delegationCase.delegation.DelegatorAddress) +// } + +// delegation := delegationCase.delegation +// delegation.DelegatorAddress = delegatorAddress.String() +// delegation.ValidatorAddress = validatorAddresses[delegation.ValidatorAddress].String() +// keeper.SetDelegation(ctx, delegation) +// } + +// // Refresh the total liquid staked and validator liquid shares +// err := keeper.RefreshTotalLiquidStaked(ctx) +// require.NoError(t, err, "no error expected when refreshing total liquid staked") + +// // Check the total liquid staked and liquid shares by validator +// actualTotalLiquidStaked := keeper.GetTotalLiquidStakedTokens(ctx) +// require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked.Int64(), "total liquid staked tokens") + +// for _, moniker := range []string{"valA", "valB", "valC"} { +// address := validatorAddresses[moniker] +// expectedLiquidShares := expectedValidatorLiquidShares[moniker] + +// actualValidator, found := keeper.GetValidator(ctx, address) +// require.True(t, found, "validator %s should have been found after refresh", moniker) + +// actualLiquidShares := actualValidator.LiquidShares +// require.Equal(t, expectedLiquidShares.TruncateInt64(), actualLiquidShares.TruncateInt64(), +// "liquid staked shares for validator %s", moniker) +// } +// } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 93615bcb137d..b9aa4b7ffddd 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -2,10 +2,12 @@ package keeper import ( "context" + "fmt" "strconv" "time" "github.com/armon/go-metrics" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -208,18 +210,47 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ ) } + tokens := msg.Amount.Amount + + // if this delegation is from a liquid staking provider (identified if the delegator + // is an ICA account), it cannot exceed the global or validator bond cap + if k.DelegatorIsLiquidStaker(delegatorAddress) { + shares, err := validator.SharesFromTokens(tokens) + if err != nil { + return nil, err + } + if err := k.SafelyIncreaseTotalLiquidStakedTokens(ctx, tokens, false); err != nil { + return nil, err + } + validator, err = k.SafelyIncreaseValidatorLiquidShares(ctx, valAddr, shares) + if err != nil { + return nil, err + } + } + // NOTE: source funds are always unbonded - newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) + newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, tokens, types.Unbonded, validator, true) if err != nil { return nil, err } - if msg.Amount.Amount.IsInt64() { + // If the delegation is a validator bond, increment the validator bond shares + delegation, found := k.Keeper.GetDelegation(ctx, delegatorAddress, valAddr) + if !found { + return nil, types.ErrNoDelegation + } + if delegation.ValidatorBond { + if err := k.IncreaseValidatorBondShares(ctx, valAddr, newShares); err != nil { + return nil, err + } + } + + if tokens.IsInt64() { defer func() { telemetry.IncrCounter(1, types.ModuleName, "delegate") telemetry.SetGaugeWithLabels( []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), + float32(tokens.Int64()), []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, ) }() @@ -241,21 +272,70 @@ func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*typ // BeginRedelegate defines a method for performing a redelegation of coins from a delegator and source validator to a destination validator func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) if err != nil { return nil, err } + valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) + if err != nil { + return nil, err + } + + _, found := k.GetValidator(ctx, valSrcAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + dstValidator, found := k.GetValidator(ctx, valDstAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) if err != nil { return nil, err } - shares, err := k.ValidateUnbondAmount( + + srcDelegation, found := k.GetDelegation(ctx, delegatorAddress, valSrcAddr) + if !found { + return nil, status.Errorf( + codes.NotFound, + "delegation with delegator %s not found for validator %s", + msg.DelegatorAddress, msg.ValidatorSrcAddress, + ) + } + + srcShares, err := k.ValidateUnbondAmount( ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, ) if err != nil { return nil, err } + // If this is a validator self-bond, the new liquid delegation cannot fall below the self-bond * bond factor + // The delegation on the new validator will not a validator bond + if srcDelegation.ValidatorBond { + if err := k.SafelyDecreaseValidatorBond(ctx, valSrcAddr, srcShares); err != nil { + return nil, err + } + } + + // If this delegation from a liquid staker, the delegation on the new validator + // cannot exceed that validator's self-bond cap + // The liquid shares from the source validator should get moved to the destination validator + if k.DelegatorIsLiquidStaker(delegatorAddress) { + dstShares, err := dstValidator.SharesFromTokensTruncated(msg.Amount.Amount) + if err != nil { + return nil, err + } + if _, err := k.SafelyIncreaseValidatorLiquidShares(ctx, valDstAddr, dstShares); err != nil { + return nil, err + } + if _, err := k.DecreaseValidatorLiquidShares(ctx, valSrcAddr, srcShares); err != nil { + return nil, err + } + } + bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, sdkerrors.Wrapf( @@ -263,18 +343,28 @@ func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRed ) } - valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) - if err != nil { - return nil, err - } - completionTime, err := k.BeginRedelegation( - ctx, delegatorAddress, valSrcAddr, valDstAddr, shares, + ctx, delegatorAddress, valSrcAddr, valDstAddr, srcShares, ) if err != nil { return nil, err } + // If the redelegation adds to a validator bond delegation, update the validator's bond shares + dstDelegation, found := k.GetDelegation(ctx, delegatorAddress, valDstAddr) + if !found { + return nil, types.ErrNoDelegation + } + if dstDelegation.ValidatorBond { + dstShares, err := dstValidator.SharesFromTokensTruncated(msg.Amount.Amount) + if err != nil { + return nil, err + } + if err := k.IncreaseValidatorBondShares(ctx, valDstAddr, dstShares); err != nil { + return nil, err + } + } + if msg.Amount.Amount.IsInt64() { defer func() { telemetry.IncrCounter(1, types.ModuleName, "redelegate") @@ -313,13 +403,47 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( if err != nil { return nil, err } + + tokens := msg.Amount.Amount shares, err := k.ValidateUnbondAmount( - ctx, delegatorAddress, addr, msg.Amount.Amount, + ctx, delegatorAddress, addr, tokens, ) if err != nil { return nil, err } + _, found := k.GetValidator(ctx, addr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, delegatorAddress, addr) + if !found { + return nil, status.Errorf( + codes.NotFound, + "delegation with delegator %s not found for validator %s", + msg.DelegatorAddress, msg.ValidatorAddress, + ) + } + + // if this is a validator self-bond, the new liquid delegation cannot fall below the self-bond * bond factor + if delegation.ValidatorBond { + if err := k.SafelyDecreaseValidatorBond(ctx, addr, shares); err != nil { + return nil, err + } + } + + // if this delegation is from a liquid staking provider (identified if the delegator + // is an ICA account), the global and validator liquid totals should be decremented + if k.DelegatorIsLiquidStaker(delegatorAddress) { + if err := k.DecreaseTotalLiquidStakedTokens(ctx, tokens); err != nil { + return nil, err + } + if _, err := k.DecreaseValidatorLiquidShares(ctx, addr, shares); err != nil { + return nil, err + } + } + bondDenom := k.BondDenom(ctx) if msg.Amount.Denom != bondDenom { return nil, sdkerrors.Wrapf( @@ -332,12 +456,12 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( return nil, err } - if msg.Amount.Amount.IsInt64() { + if tokens.IsInt64() { defer func() { telemetry.IncrCounter(1, types.ModuleName, "undelegate") telemetry.SetGaugeWithLabels( []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), + float32(tokens.Int64()), []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, ) }() @@ -358,8 +482,6 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( }, nil } -// CancelUnbondingDelegation defines a method for canceling the unbonding delegation -// and delegate back to the validator. func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -405,6 +527,23 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ) } + // if this undelegation was from a liquid staking provider (identified if the delegator + // is an ICA account), the global and validator liquid totals should be incremented + tokens := msg.Amount.Amount + if k.DelegatorIsLiquidStaker(delegatorAddress) { + shares, err := validator.SharesFromTokens(tokens) + if err != nil { + return nil, err + } + if err := k.SafelyIncreaseTotalLiquidStakedTokens(ctx, tokens, false); err != nil { + return nil, err + } + validator, err = k.SafelyIncreaseValidatorLiquidShares(ctx, valAddr, shares) + if err != nil { + return nil, err + } + } + var ( unbondEntry types.UnbondingDelegationEntry unbondEntryIndex int64 = -1 @@ -430,11 +569,22 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M } // delegate back the unbonding delegation amount to the validator - _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonding, validator, false) + newShares, err := k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonding, validator, false) if err != nil { return nil, err } + // If the delegation is a validator bond, increment the validator bond shares + delegation, found := k.Keeper.GetDelegation(ctx, delegatorAddress, valAddr) + if !found { + return nil, types.ErrNoDelegation + } + if delegation.ValidatorBond { + if err := k.IncreaseValidatorBondShares(ctx, valAddr, newShares); err != nil { + return nil, err + } + } + amount := unbondEntry.Balance.Sub(msg.Amount.Amount) if amount.IsZero() { ubd.RemoveEntry(unbondEntryIndex) @@ -454,11 +604,11 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ctx.EventManager().EmitEvent( sdk.NewEvent( - types.EventTypeCancelUnbondingDelegation, + "cancel_unbonding_delegation", sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), - sdk.NewAttribute(types.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), + sdk.NewAttribute("creation_height", strconv.FormatInt(msg.CreationHeight, 10)), ), ) @@ -485,15 +635,180 @@ func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara // This allows a validator to stop their services and jail themselves without // experiencing a slash func (k msgServer) UnbondValidator(goCtx context.Context, msg *types.MsgUnbondValidator) (*types.MsgUnbondValidatorResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + // validator must already be registered + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + // jail the validator. + k.jailValidator(ctx, validator) return &types.MsgUnbondValidatorResponse{}, nil } // Tokenizes shares associated with a delegation by creating a tokenize share record // and returning tokens with a denom of the format {validatorAddress}/{recordId} func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeShares) (*types.MsgTokenizeSharesResponse, error) { - shareToken := sdk.Coin{} - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + // Check if the delegator has disabled tokenization + lockStatus, unlockTime := k.GetTokenizeSharesLock(ctx, delegatorAddress) + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED { + return nil, types.ErrTokenizeSharesDisabledForAccount + } + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING { + return nil, types.ErrTokenizeSharesDisabledForAccount.Wrapf("tokenization will be allowed at %s", unlockTime) + } + + delegation, found := k.GetDelegation(ctx, delegatorAddress, valAddr) + if !found { + return nil, types.ErrNoDelegatorForAddress + } + + if delegation.ValidatorBond { + return nil, types.ErrValidatorBondNotAllowedForTokenizeShare + } + + if msg.Amount.Denom != k.BondDenom(ctx) { + return nil, types.ErrOnlyBondDenomAllowdForTokenize + } + + acc := k.authKeeper.GetAccount(ctx, delegatorAddress) + if acc != nil { + acc, ok := acc.(vesting.VestingAccount) + if ok { + // if account is a vesting account, it checks if free delegation (non-vesting delegation) is not exceeding + // the tokenize share amount and execute further tokenize share process + // tokenize share is reducing unlocked tokens delegation from the vesting account and further process + // is not causing issues + delFree := acc.GetDelegatedFree().AmountOf(msg.Amount.Denom) + if delFree.LT(msg.Amount.Amount) { + return nil, types.ErrExceedingFreeVestingDelegations + } + } + } + + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, valAddr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + // If this tokenization is NOT from a liquid staking provider, + // confirm it does not exceed the global and validator liquid staking cap + // If the tokenization is from a liquid staking provider, + // the shares are already considered liquid and there's no need to increment the totals + if !k.DelegatorIsLiquidStaker(delegatorAddress) { + if err := k.SafelyIncreaseTotalLiquidStakedTokens(ctx, msg.Amount.Amount, true); err != nil { + return nil, err + } + validator, err = k.SafelyIncreaseValidatorLiquidShares(ctx, valAddr, shares) + if err != nil { + return nil, err + } + } + + recordID := k.GetLastTokenizeShareRecordID(ctx) + 1 + k.SetLastTokenizeShareRecordID(ctx, recordID) + + record := types.TokenizeShareRecord{ + Id: recordID, + Owner: msg.TokenizedShareOwner, + ModuleAccount: fmt.Sprintf("%s%d", types.TokenizeShareModuleAccountPrefix, recordID), + Validator: msg.ValidatorAddress, + } + + // note: this returnAmount can be slightly off from the original delegation amount if there + // is a decimal to int precision error + returnAmount, err := k.Unbond(ctx, delegatorAddress, valAddr, shares) + if err != nil { + return nil, err + } + + if validator.IsBonded() { + k.bondedTokensToNotBonded(ctx, returnAmount) + } + + // Note: UndelegateCoinsFromModuleToAccount is internally calling TrackUndelegation for vesting account + returnCoin := sdk.NewCoin(k.BondDenom(ctx), returnAmount) + err = k.bankKeeper.UndelegateCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegatorAddress, sdk.Coins{returnCoin}) + if err != nil { + return nil, err + } + + // Re-calculate the shares in case there was rounding precision during the undelegation + newShares, err := validator.SharesFromTokens(returnAmount) + if err != nil { + return nil, err + } + + // The share tokens returned maps 1:1 with shares + shareToken := sdk.NewCoin(record.GetShareTokenDenom(), newShares.TruncateInt()) + + err = k.bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + + // create reward ownership record + err = k.AddTokenizeShareRecord(ctx, record) + if err != nil { + return nil, err + } + // send coins to module account + err = k.bankKeeper.SendCoins(ctx, delegatorAddress, record.GetModuleAddress(), sdk.Coins{returnCoin}) + if err != nil { + return nil, err + } + + // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly + validator, found = k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + // delegate from module account + _, err = k.Keeper.Delegate(ctx, record.GetModuleAddress(), returnAmount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeTokenizeShares, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(types.AttributeKeyShareOwner, msg.TokenizedShareOwner), + sdk.NewAttribute(types.AttributeKeyShareRecordID, fmt.Sprintf("%d", record.Id)), + sdk.NewAttribute(types.AttributeKeyAmount, msg.Amount.String()), + ), + ) + return &types.MsgTokenizeSharesResponse{ Amount: shareToken, }, nil @@ -501,8 +816,123 @@ func (k msgServer) TokenizeShares(goCtx context.Context, msg *types.MsgTokenizeS // Converts tokenized shares back into a native delegation func (k msgServer) RedeemTokensForShares(goCtx context.Context, msg *types.MsgRedeemTokensForShares) (*types.MsgRedeemTokensForSharesResponse, error) { - returnCoin := sdk.Coin{} - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + shareToken := msg.Amount + balance := k.bankKeeper.GetBalance(ctx, delegatorAddress, shareToken.Denom) + if balance.Amount.LT(shareToken.Amount) { + return nil, types.ErrNotEnoughBalance + } + + record, err := k.GetTokenizeShareRecordByDenom(ctx, shareToken.Denom) + if err != nil { + return nil, err + } + + valAddr, valErr := sdk.ValAddressFromBech32(record.Validator) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, record.GetModuleAddress(), valAddr) + if !found { + return nil, types.ErrNoUnbondingDelegation + } + + // Similar to undelegations, if the account is attempting to tokenize the full delegation, + // but there's a precision error due to the decimal to int conversion, round up to the + // full decimal amount before modifying the delegation + shares := shareToken.Amount.ToDec() + if shareToken.Amount.Equal(delegation.Shares.TruncateInt()) { + shares = delegation.Shares + } + tokens := validator.TokensFromShares(shares).TruncateInt() + + // If this redemption is NOT from a liquid staking provider, decrement the total liquid staked + // If the redemption was from a liquid staking provider, the shares are still considered + // liquid, even in their non-tokenized form (since they are owned by a liquid staking provider) + if !k.DelegatorIsLiquidStaker(delegatorAddress) { + if err := k.DecreaseTotalLiquidStakedTokens(ctx, tokens); err != nil { + return nil, err + } + validator, err = k.DecreaseValidatorLiquidShares(ctx, valAddr, shares) + if err != nil { + return nil, err + } + } + + returnAmount, err := k.Unbond(ctx, record.GetModuleAddress(), valAddr, shares) + if err != nil { + return nil, err + } + + if validator.IsBonded() { + k.bondedTokensToNotBonded(ctx, returnAmount) + } + + // Note: since delegation object has been changed from unbond call, it gets latest delegation + _, found = k.GetDelegation(ctx, record.GetModuleAddress(), valAddr) + if !found { + if k.hooks != nil { + if err := k.hooks.BeforeTokenizeShareRecordRemoved(ctx, record.Id); err != nil { + return nil, err + } + } + err = k.DeleteTokenizeShareRecord(ctx, record.Id) + if err != nil { + return nil, err + } + } + + // send share tokens to NotBondedPool and burn + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, delegatorAddress, types.NotBondedPoolName, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + err = k.bankKeeper.BurnCoins(ctx, types.NotBondedPoolName, sdk.Coins{shareToken}) + if err != nil { + return nil, err + } + + // send equivalent amount of tokens to the delegator + returnCoin := sdk.NewCoin(k.BondDenom(ctx), returnAmount) + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.NotBondedPoolName, delegatorAddress, sdk.Coins{returnCoin}) + if err != nil { + return nil, err + } + + // Note: it is needed to get latest validator object to get Keeper.Delegate function work properly + validator, found = k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + // convert the share tokens to delegated status + // Note: Delegate(substractAccount => true) -> DelegateCoinsFromAccountToModule -> TrackDelegation for vesting account + _, err = k.Keeper.Delegate(ctx, delegatorAddress, returnAmount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeRedeemShares, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, validator.OperatorAddress), + sdk.NewAttribute(types.AttributeKeyAmount, shareToken.String()), + ), + ) + return &types.MsgRedeemTokensForSharesResponse{ Amount: returnCoin, }, nil @@ -510,27 +940,137 @@ func (k msgServer) RedeemTokensForShares(goCtx context.Context, msg *types.MsgRe // Transfers the ownership of rewards associated with a tokenize share record func (k msgServer) TransferTokenizeShareRecord(goCtx context.Context, msg *types.MsgTransferTokenizeShareRecord) (*types.MsgTransferTokenizeShareRecordResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + record, err := k.GetTokenizeShareRecord(ctx, msg.TokenizeShareRecordId) + if err != nil { + return nil, types.ErrTokenizeShareRecordNotExists + } + + if record.Owner != msg.Sender { + return nil, types.ErrNotTokenizeShareRecordOwner + } + + // Remove old account reference + oldOwner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress + } + k.deleteTokenizeShareRecordWithOwner(ctx, oldOwner, record.Id) + + record.Owner = msg.NewOwner + k.setTokenizeShareRecord(ctx, record) + + // Set new account reference + newOwner, err := sdk.AccAddressFromBech32(record.Owner) + if err != nil { + return nil, sdkerrors.ErrInvalidAddress + } + k.setTokenizeShareRecordWithOwner(ctx, newOwner, record.Id) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeTransferTokenizeShareRecord, + sdk.NewAttribute(types.AttributeKeyShareRecordID, fmt.Sprintf("%d", msg.TokenizeShareRecordId)), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeKeyShareOwner, msg.NewOwner), + ), + ) + return &types.MsgTransferTokenizeShareRecordResponse{}, nil } // DisableTokenizeShares prevents an address from tokenizing any of their delegations func (k msgServer) DisableTokenizeShares(goCtx context.Context, msg *types.MsgDisableTokenizeShares) (*types.MsgDisableTokenizeSharesResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + delegator := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) + + // If tokenized shares is already disabled, alert the user + lockStatus, completionTime := k.GetTokenizeSharesLock(ctx, delegator) + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED { + return nil, types.ErrTokenizeSharesAlreadyDisabledForAccount + } + + // If the tokenized shares lock is expiring, remove the pending unlock from the queue + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING { + k.CancelTokenizeShareLockExpiration(ctx, delegator, completionTime) + } + + // Create a new tokenization lock for the user + // Note: if there is a lock expiration in progress, this will override the expiration + k.AddTokenizeSharesLock(ctx, delegator) + return &types.MsgDisableTokenizeSharesResponse{}, nil } // EnableTokenizeShares begins the countdown after which tokenizing shares by the // sender address is re-allowed, which will complete after the unbonding period func (k msgServer) EnableTokenizeShares(goCtx context.Context, msg *types.MsgEnableTokenizeShares) (*types.MsgEnableTokenizeSharesResponse, error) { - completionTime := time.Time{} - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + delegator := sdk.MustAccAddressFromBech32(msg.DelegatorAddress) + + // If tokenized shares aren't current disabled, alert the user + lockStatus, unlockTime := k.GetTokenizeSharesLock(ctx, delegator) + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED { + return nil, types.ErrTokenizeSharesAlreadyEnabledForAccount + } + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING { + return nil, types.ErrTokenizeSharesAlreadyEnabledForAccount.Wrapf( + "tokenize shares re-enablement already in progress, ending at %s", unlockTime) + } + + // Otherwise queue the unlock + completionTime := k.QueueTokenizeSharesAuthorization(ctx, delegator) + return &types.MsgEnableTokenizeSharesResponse{CompletionTime: completionTime}, nil } // Designates a delegation as a validator bond // This enables the validator to receive more liquid staking delegations func (k msgServer) ValidatorBond(goCtx context.Context, msg *types.MsgValidatorBond) (*types.MsgValidatorBondResponse, error) { - // TODO add LSM logic + ctx := sdk.UnwrapSDKContext(goCtx) + + delAddr, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, delAddr, valAddr) + if !found { + return nil, types.ErrNoDelegation + } + + // liquid staking providers should not be able to validator bond + if k.DelegatorIsLiquidStaker(delAddr) { + return nil, types.ErrValidatorBondNotAllowedFromModuleAccount + } + + if !delegation.ValidatorBond { + delegation.ValidatorBond = true + k.SetDelegation(ctx, delegation) + validator.ValidatorBondShares = validator.ValidatorBondShares.Add(delegation.Shares) + k.SetValidator(ctx, validator) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeValidatorBondDelegation, + sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + ), + ) + } + return &types.MsgValidatorBondResponse{}, nil } diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 3e1bb083916e..30b250dd672f 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -44,6 +44,23 @@ func (k Keeper) PowerReduction(ctx sdk.Context) math.Int { return sdk.DefaultPowerReduction } +// Validator bond factor for all validators +func (k Keeper) ValidatorBondFactor(ctx sdk.Context) (res sdk.Dec) { + return k.GetParams(ctx).ValidatorBondFactor + +} + +// Global liquid staking cap across all liquid staking providers +func (k Keeper) GlobalLiquidStakingCap(ctx sdk.Context) (res sdk.Dec) { + return k.GetParams(ctx).GlobalLiquidStakingCap + +} + +// Liquid staking cap for each validator +func (k Keeper) ValidatorLiquidStakingCap(ctx sdk.Context) (res sdk.Dec) { + return k.GetParams(ctx).ValidatorLiquidStakingCap +} + // MinCommissionRate - Minimum validator commission rate func (k Keeper) MinCommissionRate(ctx sdk.Context) math.LegacyDec { return k.GetParams(ctx).MinCommissionRate diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index afd393c1c778..6e0c372a54d5 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -16,9 +16,12 @@ import ( // Simulation parameter constants const ( - unbondingTime = "unbonding_time" - maxValidators = "max_validators" - historicalEntries = "historical_entries" + unbondingTime = "unbonding_time" + maxValidators = "max_validators" + historicalEntries = "historical_entries" + ValidatorBondFactor = "validator_bond_factor" + GlobalLiquidStakingCap = "global_liquid_staking_cap" + ValidatorLiquidStakingCap = "validator_liquid_staking_cap" ) // genUnbondingTime returns randomized UnbondingTime @@ -40,10 +43,13 @@ func getHistEntries(r *rand.Rand) uint32 { func RandomizedGenState(simState *module.SimulationState) { // params var ( - unbondTime time.Duration - maxVals uint32 - histEntries uint32 - minCommissionRate sdk.Dec + unbondTime time.Duration + maxVals uint32 + histEntries uint32 + minCommissionRate sdk.Dec + validatorBondFactor sdk.Dec + globalLiquidStakingCap sdk.Dec + validatorLiquidStakingCap sdk.Dec ) simState.AppParams.GetOrGenerate( @@ -64,7 +70,15 @@ func RandomizedGenState(simState *module.SimulationState) { // NOTE: the slashing module need to be defined after the staking module on the // NewSimulationManager constructor for this to work simState.UnbondTime = unbondTime - params := types.NewParams(simState.UnbondTime, maxVals, 7, histEntries, sdk.DefaultBondDenom, minCommissionRate) + params := types.NewParams(simState.UnbondTime, maxVals, + 7, + histEntries, + sdk.DefaultBondDenom, + minCommissionRate, + validatorBondFactor, + globalLiquidStakingCap, + validatorLiquidStakingCap, + ) // validators & delegations var ( diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index 375c6ff3c729..e15eb1eb57ed 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -261,6 +261,48 @@ func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LockedCoins", reflect.TypeOf((*MockBankKeeper)(nil).LockedCoins), ctx, addr) } +// MintCoins mocks base method. +func (m *MockBankKeeper) MintCoins(cts types.Context, name string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MintCoins", cts, name, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// MintCoins indicates an expected call of MintCoins. +func (mr *MockBankKeeperMockRecorder) MintCoins(cts, name, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MintCoins", reflect.TypeOf((*MockBankKeeper)(nil).MintCoins), cts, name, amt) +} + +// SendCoins mocks base method. +func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr, toAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoins indicates an expected call of SendCoins. +func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) +} + +// SendCoinsFromModuleToAccount mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToAccount indicates an expected call of SendCoinsFromModuleToAccount. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) +} + // SendCoinsFromModuleToModule mocks base method. func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx types.Context, senderPool, recipientPool string, amt types.Coins) error { m.ctrl.T.Helper() @@ -696,6 +738,20 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delA return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeDelegationSharesModified", reflect.TypeOf((*MockStakingHooks)(nil).BeforeDelegationSharesModified), ctx, delAddr, valAddr) } +// BeforeTokenizeShareRecordRemoved mocks base method. +func (m *MockStakingHooks) BeforeTokenizeShareRecordRemoved(ctx types.Context, recordID uint64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BeforeTokenizeShareRecordRemoved", ctx, recordID) + ret0, _ := ret[0].(error) + return ret0 +} + +// BeforeTokenizeShareRecordRemoved indicates an expected call of BeforeTokenizeShareRecordRemoved. +func (mr *MockStakingHooksMockRecorder) BeforeTokenizeShareRecordRemoved(ctx, recordID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeforeTokenizeShareRecordRemoved", reflect.TypeOf((*MockStakingHooks)(nil).BeforeTokenizeShareRecordRemoved), ctx, recordID) +} + // BeforeValidatorModified mocks base method. func (m *MockStakingHooks) BeforeValidatorModified(ctx types.Context, valAddr types.ValAddress) error { m.ctrl.T.Helper() diff --git a/x/staking/types/events.go b/x/staking/types/events.go index 5195955feae7..431535399094 100644 --- a/x/staking/types/events.go +++ b/x/staking/types/events.go @@ -2,14 +2,18 @@ package types // staking module event types const ( - EventTypeCompleteUnbonding = "complete_unbonding" - EventTypeCompleteRedelegation = "complete_redelegation" - EventTypeCreateValidator = "create_validator" - EventTypeEditValidator = "edit_validator" - EventTypeDelegate = "delegate" - EventTypeUnbond = "unbond" - EventTypeCancelUnbondingDelegation = "cancel_unbonding_delegation" - EventTypeRedelegate = "redelegate" + EventTypeCompleteUnbonding = "complete_unbonding" + EventTypeCompleteRedelegation = "complete_redelegation" + EventTypeCreateValidator = "create_validator" + EventTypeEditValidator = "edit_validator" + EventTypeDelegate = "delegate" + EventTypeUnbond = "unbond" + EventTypeCancelUnbondingDelegation = "cancel_unbonding_delegation" + EventTypeRedelegate = "redelegate" + EventTypeTokenizeShares = "tokenize_shares" + EventTypeRedeemShares = "redeem_shares" + EventTypeTransferTokenizeShareRecord = "transfer_tokenize_share_record" + EventTypeValidatorBondDelegation = "validator_bond_delegation" AttributeKeyValidator = "validator" AttributeKeyCommissionRate = "commission_rate" @@ -19,4 +23,7 @@ const ( AttributeKeyCreationHeight = "creation_height" AttributeKeyCompletionTime = "completion_time" AttributeKeyNewShares = "new_shares" + AttributeKeyShareOwner = "share_owner" + AttributeKeyShareRecordID = "share_record_id" + AttributeKeyAmount = "amount" ) diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 05672ee256da..0220dfa1e79f 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -34,10 +34,13 @@ type BankKeeper interface { GetSupply(ctx sdk.Context, denom string) sdk.Coin + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + MintCoins(cts sdk.Context, name string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error } @@ -105,6 +108,7 @@ type StakingHooks interface { AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error AfterUnbondingInitiated(ctx sdk.Context, id uint64) error + BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordID uint64) error // Must be called when tokenize share record is deleted } // StakingHooksWrapper is a wrapper for modules to inject StakingHooks using depinject. diff --git a/x/staking/types/hooks.go b/x/staking/types/hooks.go index 6fad1df77d6b..cee47afbaad3 100644 --- a/x/staking/types/hooks.go +++ b/x/staking/types/hooks.go @@ -112,3 +112,12 @@ func (h MultiStakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) e } return nil } + +func (h MultiStakingHooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordID uint64) error { + for i := range h { + if err := h[i].BeforeTokenizeShareRecordRemoved(ctx, recordID); err != nil { + return err + } + } + return nil +} diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 553f49bf8570..e435c1069c70 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -10,13 +10,20 @@ import ( // staking message types const ( - TypeMsgUndelegate = "begin_unbonding" - TypeMsgCancelUnbondingDelegation = "cancel_unbond" - TypeMsgEditValidator = "edit_validator" - TypeMsgCreateValidator = "create_validator" - TypeMsgDelegate = "delegate" - TypeMsgBeginRedelegate = "begin_redelegate" - TypeMsgUpdateParams = "update_params" + TypeMsgUndelegate = "begin_unbonding" + TypeMsgUnbondValidator = "unbond_validator" + TypeMsgCancelUnbondingDelegation = "cancel_unbond" + TypeMsgEditValidator = "edit_validator" + TypeMsgCreateValidator = "create_validator" + TypeMsgDelegate = "delegate" + TypeMsgBeginRedelegate = "begin_redelegate" + TypeMsgUpdateParams = "update_params" + TypeMsgTokenizeShares = "tokenize_shares" + TypeMsgRedeemTokensForShares = "redeem_tokens_for_shares" + TypeMsgTransferTokenizeShareRecord = "transfer_tokenize_share_record" + TypeMsgDisableTokenizeShares = "disable_tokenize_shares" + TypeMsgEnableTokenizeShares = "enable_tokenize_shares" + TypeMsgValidatorBond = "validator_bond" ) var ( @@ -401,3 +408,309 @@ func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress { addr, _ := sdk.AccAddressFromBech32(m.Authority) return []sdk.AccAddress{addr} } + +// NewMsgUnbondValidator creates a new MsgUnbondValidator instance. +// +//nolint:interfacer +func NewMsgUnbondValidator(valAddr sdk.ValAddress) *MsgUnbondValidator { + return &MsgUnbondValidator{ + ValidatorAddress: valAddr.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgUnbondValidator) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgUnbondValidator) Type() string { return TypeMsgUnbondValidator } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgUnbondValidator) GetSigners() []sdk.AccAddress { + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{valAddr.Bytes()} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgUnbondValidator) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgUnbondValidator) ValidateBasic() error { + if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) + } + + return nil +} + +// NewMsgTokenizeShares creates a new MsgTokenizeShares instance. +// +//nolint:interfacer +func NewMsgTokenizeShares(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amount sdk.Coin, owner sdk.AccAddress) *MsgTokenizeShares { + return &MsgTokenizeShares{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + Amount: amount, + TokenizedShareOwner: owner.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgTokenizeShares) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgTokenizeShares) Type() string { return TypeMsgTokenizeShares } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgTokenizeShares) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +// MsgTokenizeShares implements the sdk.Msg interface. +func (msg MsgTokenizeShares) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgTokenizeShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) + } + if _, err := sdk.AccAddressFromBech32(msg.TokenizedShareOwner); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid tokenize share owner address: %s", err) + } + + if !msg.Amount.IsValid() || !msg.Amount.Amount.IsPositive() { + return sdkerrors.Wrap( + sdkerrors.ErrInvalidRequest, + "invalid shares amount", + ) + } + + return nil +} + +// NewMsgRedeemTokensForShares creates a new MsgRedeemTokensForShares instance. +// +//nolint:interfacer +func NewMsgRedeemTokensForShares(delAddr sdk.AccAddress, amount sdk.Coin) *MsgRedeemTokensForShares { + return &MsgRedeemTokensForShares{ + DelegatorAddress: delAddr.String(), + Amount: amount, + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgRedeemTokensForShares) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgRedeemTokensForShares) Type() string { return TypeMsgRedeemTokensForShares } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgRedeemTokensForShares) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgRedeemTokensForShares) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgRedeemTokensForShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + + if !msg.Amount.IsValid() || !msg.Amount.Amount.IsPositive() { + return sdkerrors.Wrap( + sdkerrors.ErrInvalidRequest, + "invalid shares amount", + ) + } + + return nil +} + +// NewMsgTransferTokenizeShareRecord creates a new MsgTransferTokenizeShareRecord instance. +// +//nolint:interfacer +func NewMsgTransferTokenizeShareRecord(recordId uint64, sender, newOwner sdk.AccAddress) *MsgTransferTokenizeShareRecord { + return &MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: recordId, + Sender: sender.String(), + NewOwner: newOwner.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) Type() string { return TypeMsgTransferTokenizeShareRecord } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgTransferTokenizeShareRecord) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + if _, err := sdk.AccAddressFromBech32(msg.NewOwner); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid new owner address: %s", err) + } + + return nil +} + +// NewMsgDisableTokenizeShares creates a new MsgDisableTokenizeShares instance. +// +//nolint:interfacer +func NewMsgDisableTokenizeShares(delAddr sdk.AccAddress) *MsgDisableTokenizeShares { + return &MsgDisableTokenizeShares{ + DelegatorAddress: delAddr.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgDisableTokenizeShares) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgDisableTokenizeShares) Type() string { return TypeMsgDisableTokenizeShares } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgDisableTokenizeShares) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgDisableTokenizeShares) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgDisableTokenizeShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +// NewMsgEnableTokenizeShares creates a new MsgEnableTokenizeShares instance. +// +//nolint:interfacer +func NewMsgEnableTokenizeShares(delAddr sdk.AccAddress) *MsgEnableTokenizeShares { + return &MsgEnableTokenizeShares{ + DelegatorAddress: delAddr.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgEnableTokenizeShares) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgEnableTokenizeShares) Type() string { return TypeMsgEnableTokenizeShares } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgEnableTokenizeShares) GetSigners() []sdk.AccAddress { + sender, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{sender} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgEnableTokenizeShares) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgEnableTokenizeShares) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid sender address: %s", err) + } + + return nil +} + +// NewMsgValidatorBond creates a new MsgValidatorBond instance. +// +//nolint:interfacer +func NewMsgValidatorBond(delAddr sdk.AccAddress, valAddr sdk.ValAddress) *MsgValidatorBond { + return &MsgValidatorBond{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + } +} + +// Route implements the sdk.Msg interface. +func (msg MsgValidatorBond) Route() string { return RouterKey } + +// Type implements the sdk.Msg interface. +func (msg MsgValidatorBond) Type() string { return TypeMsgValidatorBond } + +// GetSigners implements the sdk.Msg interface. +func (msg MsgValidatorBond) GetSigners() []sdk.AccAddress { + delegator, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{delegator} +} + +// GetSignBytes implements the sdk.Msg interface. +func (msg MsgValidatorBond) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgValidatorBond) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.DelegatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid delegator address: %s", err) + } + if _, err := sdk.ValAddressFromBech32(msg.ValidatorAddress); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid validator address: %s", err) + } + + return nil +} diff --git a/x/staking/types/params.go b/x/staking/types/params.go index f4e24e3f1767..330132058f48 100644 --- a/x/staking/types/params.go +++ b/x/staking/types/params.go @@ -32,18 +32,43 @@ const ( DefaultHistoricalEntries uint32 = 10000 ) -// DefaultMinCommissionRate is set to 0% -var DefaultMinCommissionRate = math.LegacyZeroDec() +var ( + // DefaultMinCommissionRate is set to 0% + DefaultMinCommissionRate = math.LegacyZeroDec() + + // ValidatorBondFactor of -1 indicates that it's disabled + ValidatorBondCapDisabled = sdk.NewDecFromInt(sdk.NewInt(-1)) + + // DefaultValidatorBondFactor is set to -1 (disabled) + DefaultValidatorBondFactor = ValidatorBondCapDisabled + // DefaultGlobalLiquidStakingCap is set to 100% + DefaultGlobalLiquidStakingCap = sdk.OneDec() + // DefaultValidatorLiquidStakingCap is set to 100% + DefaultValidatorLiquidStakingCap = sdk.OneDec() +) // NewParams creates a new Params instance -func NewParams(unbondingTime time.Duration, maxValidators, maxEntries, historicalEntries uint32, bondDenom string, minCommissionRate sdk.Dec) Params { +func NewParams(unbondingTime time.Duration, + maxValidators, + maxEntries, + historicalEntries uint32, + bondDenom string, + minCommissionRate sdk.Dec, + validatorBondFactor sdk.Dec, + globalLiquidStakingCap sdk.Dec, + validatorLiquidStakingCap sdk.Dec, +) Params { return Params{ UnbondingTime: unbondingTime, MaxValidators: maxValidators, MaxEntries: maxEntries, HistoricalEntries: historicalEntries, - BondDenom: bondDenom, - MinCommissionRate: minCommissionRate, + + BondDenom: bondDenom, + MinCommissionRate: minCommissionRate, + ValidatorBondFactor: validatorBondFactor, + GlobalLiquidStakingCap: globalLiquidStakingCap, + ValidatorLiquidStakingCap: validatorLiquidStakingCap, } } @@ -56,6 +81,9 @@ func DefaultParams() Params { DefaultHistoricalEntries, sdk.DefaultBondDenom, DefaultMinCommissionRate, + DefaultValidatorBondFactor, + DefaultGlobalLiquidStakingCap, + DefaultValidatorLiquidStakingCap, ) } @@ -111,6 +139,18 @@ func (p Params) Validate() error { return err } + if err := validateValidatorBondFactor(p.ValidatorBondFactor); err != nil { + return err + } + + if err := validateGlobalLiquidStakingCap(p.GlobalLiquidStakingCap); err != nil { + return err + } + + if err := validateValidatorLiquidStakingCap(p.ValidatorLiquidStakingCap); err != nil { + return err + } + return nil } @@ -210,3 +250,48 @@ func validateMinCommissionRate(i interface{}) error { return nil } + +func validateValidatorBondFactor(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() && !v.Equal(sdk.NewDec(-1)) { + return fmt.Errorf("invalid validator bond factor: %s", v) + } + + return nil +} + +func validateGlobalLiquidStakingCap(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() { + return fmt.Errorf("global liquid staking cap cannot be negative: %s", v) + } + if v.GT(sdk.OneDec()) { + return fmt.Errorf("global liquid staking cap cannot be greater than 100%%: %s", v) + } + + return nil +} + +func validateValidatorLiquidStakingCap(i interface{}) error { + v, ok := i.(sdk.Dec) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNegative() { + return fmt.Errorf("validator liquid staking cap cannot be negative: %s", v) + } + if v.GT(sdk.OneDec()) { + return fmt.Errorf("validator liquid staking cap cannot be greater than 100%%: %s", v) + } + + return nil +} diff --git a/x/staking/types/params_legacy.go b/x/staking/types/params_legacy.go index df474c02ffa1..95487c9408a4 100644 --- a/x/staking/types/params_legacy.go +++ b/x/staking/types/params_legacy.go @@ -3,12 +3,15 @@ package types import paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" var ( - KeyUnbondingTime = []byte("UnbondingTime") - KeyMaxValidators = []byte("MaxValidators") - KeyMaxEntries = []byte("MaxEntries") - KeyBondDenom = []byte("BondDenom") - KeyHistoricalEntries = []byte("HistoricalEntries") - KeyMinCommissionRate = []byte("MinCommissionRate") + KeyUnbondingTime = []byte("UnbondingTime") + KeyMaxValidators = []byte("MaxValidators") + KeyMaxEntries = []byte("MaxEntries") + KeyBondDenom = []byte("BondDenom") + KeyHistoricalEntries = []byte("HistoricalEntries") + KeyMinCommissionRate = []byte("MinCommissionRate") + KeyValidatorBondFactor = []byte("ValidatorBondFactor") + KeyGlobalLiquidStakingCap = []byte("GlobalLiquidStakingCap") + KeyValidatorLiquidStakingCap = []byte("ValidatorLiquidStakingCap") ) var _ paramtypes.ParamSet = (*Params)(nil) @@ -29,5 +32,8 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyHistoricalEntries, &p.HistoricalEntries, validateHistoricalEntries), paramtypes.NewParamSetPair(KeyBondDenom, &p.BondDenom, validateBondDenom), paramtypes.NewParamSetPair(KeyMinCommissionRate, &p.MinCommissionRate, validateMinCommissionRate), + paramtypes.NewParamSetPair(KeyValidatorBondFactor, &p.ValidatorBondFactor, validateValidatorBondFactor), + paramtypes.NewParamSetPair(KeyGlobalLiquidStakingCap, &p.GlobalLiquidStakingCap, validateGlobalLiquidStakingCap), + paramtypes.NewParamSetPair(KeyValidatorLiquidStakingCap, &p.ValidatorLiquidStakingCap, validateValidatorLiquidStakingCap), } } diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index 5c5ec4c1d3e5..f8467933380b 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -58,8 +58,9 @@ func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, descriptio UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), Commission: NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), - MinSelfDelegation: math.OneInt(), UnbondingOnHoldRefCount: 0, + ValidatorBondShares: sdk.ZeroDec(), + LiquidShares: sdk.ZeroDec(), }, nil } @@ -454,7 +455,6 @@ func (v *Validator) MinEqual(other *Validator) bool { v.Description.Equal(other.Description) && v.Commission.Equal(other.Commission) && v.Jailed == other.Jailed && - v.MinSelfDelegation.Equal(other.MinSelfDelegation) && v.ConsensusPubkey.Equal(other.ConsensusPubkey) } @@ -520,8 +520,9 @@ func (v Validator) GetConsensusPower(r math.Int) int64 { return v.ConsensusPower(r) } func (v Validator) GetCommission() math.LegacyDec { return v.Commission.Rate } -func (v Validator) GetMinSelfDelegation() math.Int { return v.MinSelfDelegation } +func (v Validator) GetMinSelfDelegation() math.Int { return sdk.ZeroInt() } func (v Validator) GetDelegatorShares() math.LegacyDec { return v.DelegatorShares } +func (v Validator) GetLiquidShares() sdk.Dec { return v.LiquidShares } // UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces func (v Validator) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { From 41042c2ebfd39922f768bfd25cdbdf5701d9ddc5 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 29 Nov 2023 12:20:47 +0100 Subject: [PATCH 12/31] tag LSM test to be refactored --- tests/e2e/staking/suite.go | 30 +- tests/e2e/staking/test_helpers.go | 16 + tests/integration/gov/keeper/common_test.go | 19 +- .../staking/keeper/genesis_test.go | 1 + .../staking/keeper/msg_server_test.go | 1409 ++++++++++++++++- x/staking/client/cli/tx_test.go | 20 +- x/staking/keeper/delegation_test.go | 242 ++- x/staking/keeper/genesis.go | 62 +- x/staking/keeper/grpc_query.go | 1 + x/staking/keeper/liquid_stake_test.go | 2 + x/staking/keeper/msg_server.go | 12 +- x/staking/keeper/slash.go | 11 + .../keeper/tokenize_share_record_test.go | 51 +- x/staking/simulation/genesis.go | 61 +- x/staking/simulation/genesis_test.go | 7 +- x/staking/simulation/operations.go | 570 ++++++- x/staking/simulation/operations_test.go | 6 + x/staking/testutil/expected_keepers_mocks.go | 14 + x/staking/types/codec.go | 14 + x/staking/types/delegation.go | 11 +- x/staking/types/delegation_test.go | 4 +- x/staking/types/expected_keepers.go | 1 + x/staking/types/exported.go | 1 + x/staking/types/msg.go | 9 + x/staking/types/msg_test.go | 4 - 25 files changed, 2417 insertions(+), 161 deletions(-) diff --git a/tests/e2e/staking/suite.go b/tests/e2e/staking/suite.go index 05b806cc3054..03ccfb656748 100644 --- a/tests/e2e/staking/suite.go +++ b/tests/e2e/staking/suite.go @@ -49,7 +49,10 @@ func (s *E2ETestSuite) SetupSuite() { s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) s.Require().NoError(err) - unbond, err := sdk.ParseCoinNormalized("10stake") + unbondCoin, err := sdk.ParseCoinNormalized("10stake") + s.Require().NoError(err) + + tokenizeCoin, err := sdk.ParseCoinNormalized("1000stake") s.Require().NoError(err) val := s.network.Validators[0] @@ -61,7 +64,7 @@ func (s *E2ETestSuite) SetupSuite() { val.Address, val.ValAddress, val2.ValAddress, - unbond, + unbondCoin, fmt.Sprintf("--%s=%d", flags.FlagGas, 300000), ) s.Require().NoError(err) @@ -70,15 +73,32 @@ func (s *E2ETestSuite) SetupSuite() { s.Require().Equal(uint32(0), txRes.Code) s.Require().NoError(s.network.WaitForNextBlock()) - unbondingAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)) - // unbonding the amount - out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondingAmount) + out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondCoin) s.Require().NoError(err) s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txRes)) s.Require().Equal(uint32(0), txRes.Code) s.Require().NoError(s.network.WaitForNextBlock()) + // tokenize shares twice (once for the transfer and one for the redeem) + for i := 1; i <= 2; i++ { + MsgTokenizeSharesExec( + val.ClientCtx, + val.Address, + val.ValAddress, + val.Address, + tokenizeCoin, + fmt.Sprintf("--%s=%d", flags.FlagGas, 1000000), + ) + + s.Require().NoError(err) + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &txRes)) + s.Require().Equal(uint32(0), txRes.Code) + s.Require().NoError(s.network.WaitForNextBlock()) + } + + unbondingAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5)) + // unbonding the amount out, err = MsgUnbondExec(val.ClientCtx, val.Address, val.ValAddress, unbondingAmount) s.Require().NoError(err) diff --git a/tests/e2e/staking/test_helpers.go b/tests/e2e/staking/test_helpers.go index c1358319ca7f..cfa66fe6c9fe 100644 --- a/tests/e2e/staking/test_helpers.go +++ b/tests/e2e/staking/test_helpers.go @@ -46,3 +46,19 @@ func MsgUnbondExec(clientCtx client.Context, from fmt.Stringer, valAddress, args = append(args, extraArgs...) return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewUnbondCmd(), args) } + +// MsgTokenizeSharesExec creates a delegation message. +func MsgTokenizeSharesExec(clientCtx client.Context, from fmt.Stringer, valAddress, + rewardOwner, amount fmt.Stringer, extraArgs ...string, +) (testutil.BufferWriter, error) { + args := []string{ + valAddress.String(), + amount.String(), + rewardOwner.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, from.String()), + } + + args = append(args, commonArgs...) + args = append(args, extraArgs...) + return clitestutil.ExecTestCLICmd(clientCtx, stakingcli.NewTokenizeSharesCmd(), args) +} diff --git a/tests/integration/gov/keeper/common_test.go b/tests/integration/gov/keeper/common_test.go index 91574fa19772..f187ddfcb5a2 100644 --- a/tests/integration/gov/keeper/common_test.go +++ b/tests/integration/gov/keeper/common_test.go @@ -62,17 +62,22 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) app.StakingKeeper.SetValidator(ctx, val3) - app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) - app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) - app.StakingKeeper.SetValidatorByConsAddr(ctx, val3) + err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + require.NoError(t, err) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) + require.NoError(t, err) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val3) + require.NoError(t, err) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val1) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val2) app.StakingKeeper.SetNewValidatorByPowerIndex(ctx, val3) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), stakingtypes.Unbonded, val1, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), stakingtypes.Unbonded, val2, true) - _, _ = app.StakingKeeper.Delegate(ctx, addrs[2], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), stakingtypes.Unbonded, val3, true) - + _, err = app.StakingKeeper.Delegate(ctx, addrs[0], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[0]), stakingtypes.Unbonded, val1, true) + require.NoError(t, err) + _, err = app.StakingKeeper.Delegate(ctx, addrs[1], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[1]), stakingtypes.Unbonded, val2, true) + require.NoError(t, err) + _, err = app.StakingKeeper.Delegate(ctx, addrs[2], app.StakingKeeper.TokensFromConsensusPower(ctx, powers[2]), stakingtypes.Unbonded, val3, true) + require.NoError(t, err) _ = staking.EndBlocker(ctx, app.StakingKeeper) return addrs, valAddrs diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 4e3409f4e9fa..57639ccbbf6d 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -220,6 +220,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { require.Equal(t, abcivals, vals) } +// TODO: review LSM TEST func TestInitExportLiquidStakingGenesis(t *testing.T) { app, ctx, addrs := bootstrapGenesisTest(t, 2) address1, address2 := addrs[0], addrs[1] diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 84a11e461e21..3420180468c9 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -1,42 +1,54 @@ package keeper_test import ( + "fmt" "testing" "time" - "cosmossdk.io/simapp" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" + + simapp "github.com/cosmos/cosmos-sdk/simapp" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" + sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" ) func TestCancelUnbondingDelegation(t *testing.T) { // setup the app - app := simapp.Setup(t, false) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + _, app, ctx := createTestInput() msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) bondDenom := app.StakingKeeper.BondDenom(ctx) // set the not bonded pool module account notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 5) + startCoin := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) + require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoin)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) moduleBalance := app.BankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)) require.Equal(t, sdk.NewInt64Coin(bondDenom, startTokens.Int64()), moduleBalance) - // accounts - delAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000)) - validators := app.StakingKeeper.GetValidators(ctx, 10) - require.Equal(t, len(validators), 1) + // create a validator + validatorPubKey := simapp.CreateTestPubKeys(1)[0] + validatorAddr := sdk.ValAddress(validatorPubKey.Address()) - validatorAddr, err := sdk.ValAddressFromBech32(validators[0].OperatorAddress) - require.NoError(t, err) + validator := teststaking.NewValidator(t, validatorAddr, validatorPubKey) + validator.Tokens = startTokens + validator.DelegatorShares = sdk.NewDecFromInt(startTokens) + validator.Status = types.Bonded + app.StakingKeeper.SetValidator(ctx, validator) + + // create a delegator + delAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000)) delegatorAddr := delAddrs[0] // setting the ubd entry @@ -45,7 +57,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { delegatorAddr, validatorAddr, 10, ctx.BlockTime().Add(time.Minute*10), unbondingAmount.Amount, - 0, + 1, ) // set and retrieve a record @@ -69,16 +81,6 @@ func TestCancelUnbondingDelegation(t *testing.T) { CreationHeight: 0, }, }, - { - Name: "invalid coin", - ExceptErr: true, - req: types.MsgCancelUnbondingDelegation{ - DelegatorAddress: resUnbond.DelegatorAddress, - ValidatorAddress: resUnbond.ValidatorAddress, - Amount: sdk.NewCoin("dump_coin", sdk.NewInt(4)), - CreationHeight: 0, - }, - }, { Name: "validator not exists", ExceptErr: true, @@ -133,7 +135,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.Name, func(t *testing.T) { - _, err := msgServer.CancelUnbondingDelegation(ctx, &testCase.req) + _, err := msgServer.CancelUnbondingDelegation(sdk.WrapSDKContext(ctx), &testCase.req) if testCase.ExceptErr { require.Error(t, err) } else { @@ -145,3 +147,1362 @@ func TestCancelUnbondingDelegation(t *testing.T) { }) } } + +func TestTokenizeSharesAndRedeemTokens(t *testing.T) { + _, app, ctx := createTestInput() + + liquidStakingCapStrict := sdk.ZeroDec() + liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") + liquidStakingCapDisabled := sdk.OneDec() + + validatorBondStrict := sdk.OneDec() + validatorBondConservative := sdk.NewDec(10) + validatorBondDisabled := sdk.NewDec(-1) + + testCases := []struct { + name string + vestingAmount sdk.Int + delegationAmount sdk.Int + tokenizeShareAmount sdk.Int + redeemAmount sdk.Int + targetVestingDelAfterShare sdk.Int + targetVestingDelAfterRedeem sdk.Int + globalLiquidStakingCap sdk.Dec + slashFactor sdk.Dec + validatorLiquidStakingCap sdk.Dec + validatorBondFactor sdk.Dec + validatorBondDelegation bool + validatorBondDelegatorIndex int + delegatorIsLSTP bool + expTokenizeErr bool + expRedeemErr bool + prevAccountDelegationExists bool + recordAccountDelegationExists bool + }{ + { + name: "full amount tokenize and redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: false, + }, + { + name: "full amount tokenize and partial redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: true, + }, + { + name: "partial amount tokenize and full redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + recordAccountDelegationExists: false, + }, + { + name: "tokenize and redeem with slash", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.MustNewDecFromStr("0.1"), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: true, + }, + { + name: "over tokenize", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 30), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + }, + { + name: "over redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 40), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: true, + }, + { + name: "vesting account tokenize share failure", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "vesting account tokenize share success", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "try tokenize share for a validator-bond delegation", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 1, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict validator-bond - tokenization fails", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondStrict, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative validator-bond - successful tokenization", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict global liquid staking cap - tokenization fails", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapStrict, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative global liquid staking cap - successful tokenization", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict validator liquid staking cap - tokenization fails", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapStrict, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative validator liquid staking cap - successful tokenization", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "all caps set conservatively - successful tokenize share", + vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "delegator is a liquid staking provider - accounting should not update", + vestingAmount: sdk.ZeroInt(), + delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondConservative, + delegatorIsLSTP: true, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, app, ctx = createTestInput() + addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1, addrAcc2 := addrs[0], addrs[1] + addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) + + // Create ICA module account + icaAccountAddress := createICAAccount(app, ctx) + + // Fund module account + delegationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.delegationAmount) + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) + require.NoError(t, err) + + // set the delegator address depending on whether the delegator should be a liquid staking provider + delegatorAccount := addrAcc2 + if tc.delegatorIsLSTP { + delegatorAccount = icaAccountAddress + } + + // set validator bond factor and global liquid staking cap + params := app.StakingKeeper.GetParams(ctx) + params.ValidatorBondFactor = tc.validatorBondFactor + params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap + params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap + app.StakingKeeper.SetParams(ctx, params) + + // set the total liquid staked tokens + app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.ZeroInt()) + + if !tc.vestingAmount.IsZero() { + // create vesting account + pubkey := secp256k1.GenPrivKey().PubKey() + baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) + initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) + baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) + delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) + app.AccountKeeper.SetAccount(ctx, delayedVestingAccount) + } + + pubKeys := simapp.CreateTestPubKeys(2) + pk1, pk2 := pubKeys[0], pubKeys[1] + + // Create Validators and Delegation + val1 := teststaking.NewValidator(t, addrVal1, pk1) + val1.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, val1) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + require.NoError(t, err) + + val2 := teststaking.NewValidator(t, addrVal2, pk2) + val2.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, val2) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) + require.NoError(t, err) + + // Delegate from both the main delegator as well as a random account so there is a + // non-zero delegation after redemption + err = delegateCoinsFromAccount(ctx, app, delegatorAccount, tc.delegationAmount, val1) + require.NoError(t, err) + + // apply TM updates + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + require.True(t, found, "delegation not found after delegate") + + lastRecordID := app.StakingKeeper.GetLastTokenizeShareRecordID(ctx) + oldValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + if tc.validatorBondDelegation { + err := delegateCoinsFromAccount(ctx, app, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) + require.NoError(t, err) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), + ValidatorAddress: addrVal1.String(), + }) + require.NoError(t, err) + } + + resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAccount.String(), + ValidatorAddress: addrVal1.String(), + Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), + TokenizedShareOwner: delegatorAccount.String(), + }) + if tc.expTokenizeErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // check last record id increase + require.Equal(t, lastRecordID+1, app.StakingKeeper.GetLastTokenizeShareRecordID(ctx)) + + // ensure validator's total tokens is consistent + newValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased + totalLiquidTokensAfterTokenization := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) + validatorLiquidSharesAfterTokenization := newValidator.LiquidShares + if !tc.delegatorIsLSTP { + require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") + require.Equal(t, tc.tokenizeShareAmount.String(), validatorLiquidSharesAfterTokenization.TruncateInt().String(), "validator liquid shares after tokenization") + } else { + require.True(t, totalLiquidTokensAfterTokenization.IsZero(), "zero liquid tokens after tokenization") + require.True(t, validatorLiquidSharesAfterTokenization.IsZero(), "zero liquid validator shares after tokenization") + } + + if tc.vestingAmount.IsPositive() { + acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) + } + + if tc.prevAccountDelegationExists { + _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + require.True(t, found, "delegation found after partial tokenize share") + } else { + _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + require.False(t, found, "delegation found after full tokenize share") + } + + shareToken := app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) + require.Equal(t, resp.Amount, shareToken) + _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found, true, "validator not found") + + records := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 1) + delegation, found := app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after tokenize share") + + // slash before redeem + slashedTokens := sdk.ZeroInt() + redeemedShares := tc.redeemAmount + redeemedTokens := tc.redeemAmount + if tc.slashFactor.IsPositive() { + consAddr, err := val1.GetConsAddr() + require.NoError(t, err) + ctx = ctx.WithBlockHeight(100) + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + power := app.StakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) + app.StakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor, 0) + slashedTokens = sdk.NewDecFromInt(val1.Tokens).Mul(tc.slashFactor).TruncateInt() + + val1, _ := app.StakingKeeper.GetValidator(ctx, addrVal1) + redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() + } + + // get deletagor balance and delegation + bondDenomAmountBefore := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountBefore := val1.TokensFromShares(delegation.Shares) + oldValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAccount.String(), + Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), + }) + if tc.expRedeemErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // ensure validator's total tokens is consistent + newValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // if the delegator was not a liuqid staking provider, check that the total liquid staked + // and liquid shares decreased + totalLiquidTokensAfterRedemption := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) + validatorLiquidSharesAfterRedemption := newValidator.LiquidShares + expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) + expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) + if !tc.delegatorIsLSTP { + require.Equal(t, expectedLiquidTokens.String(), totalLiquidTokensAfterRedemption.String(), "total liquid tokens after redemption") + require.Equal(t, expectedLiquidShares.String(), validatorLiquidSharesAfterRedemption.String(), "validator liquid shares after tokenization") + } else { + require.True(t, totalLiquidTokensAfterRedemption.IsZero(), "zero liquid tokens after redemption") + require.True(t, validatorLiquidSharesAfterRedemption.IsZero(), "zero liquid validator shares after redemption") + } + + if tc.vestingAmount.IsPositive() { + acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) + } + + expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) + delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + require.True(t, found, "delegation not found after redeem tokens") + require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) + require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) + require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") + + // check delegator balance is not changed + bondDenomAmountAfter := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) + require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) + + // get delegation amount is changed correctly + val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountAfter := val1.TokensFromShares(delegation.Shares) + require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) + + shareToken = app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) + require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) + _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found, true, "validator not found") + + if tc.recordAccountDelegationExists { + _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") + + records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 1) + } else { + _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + require.False(t, found, "delegation found from tokenize share module account after redeem full amount") + + records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + require.Len(t, records, 0) + } + }) + } +} + +// Helper function to setup a delegator and validator for the Tokenize/Redeem conversion tests +func setupTestTokenizeAndRedeemConversion( + t *testing.T, + app *simapp.SimApp, + ctx sdk.Context, +) (delAddress sdk.AccAddress, valAddress sdk.ValAddress) { + addresses := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1_000_000)) + pubKeys := simapp.CreateTestPubKeys(1) + + delegatorAddress := addresses[0] + validatorAddress := sdk.ValAddress(addresses[1]) + + validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.LiquidShares = sdk.NewDec(0) + validator.Status = types.Bonded + + app.StakingKeeper.SetValidator(ctx, validator) + app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) + + return delegatorAddress, validatorAddress +} + +// Simulate a slash by decrementing the validator's tokens +// We'll do this in a way such that the exchange rate is not an even integer +// and the shares associated with a delegation will have a long decimal +func simulateSlashWithImprecision(t *testing.T, app *simapp.SimApp, ctx sdk.Context, valAddress sdk.ValAddress) { + validator, found := app.StakingKeeper.GetValidator(ctx, valAddress) + require.True(t, found) + + slashMagnitude := sdk.MustNewDecFromStr("0.1111111111") + slashTokens := validator.Tokens.ToDec().Mul(slashMagnitude).TruncateInt() + validator.Tokens = validator.Tokens.Sub(slashTokens) + + app.StakingKeeper.SetValidator(ctx, validator) +} + +// Tests the conversion from tokenization and redemption from the following scenario: +// Slash -> Delegate -> Tokenize -> Redeem +// Note, in this example, there 2 tokens are lost during the decimal to int conversion +// during the unbonding step within tokenization and redemption +func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // slash the validator + simulateSlashWithImprecision(t, app, ctx, validatorAddress) + validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Tokenize the full delegation amount + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // Confirm the number of shareTokens equals the number of shares truncated + // Note: 1 token is lost during unbonding due to rounding + shareDenom := validatorAddress.String() + "/1" + shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens := delegation.Shares.TruncateInt().Int64() - 1 // 1 token was lost during unbonding + require.Equal(t, expectedShareTokens, shareToken.Amount.Int64(), "share token amount") + + // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm (almost) the full delegation was recovered - minus the 2 tokens from the precision error + // (1 occurs during tokenization, and 1 occurs during redemption) + newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + expectedDelegationTokens := delegateAmount.Int64() - 2 + require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") +} + +// Tests the conversion from tokenization and redemption from the following scenario: +// Delegate -> Slash -> Tokenize -> Redeem +// Note, in this example, there 1 token lost during the decimal to int conversion +// during the unbonding step within tokenization +func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // slash the validator + simulateSlashWithImprecision(t, app, ctx, validatorAddress) + validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Tokenize the new amount after the slash + delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt() + tokenizationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmountAfterSlash) + + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: tokenizationCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // The number of share tokens should line up with the **new** number of shares associated + // with the original delegated amount + // Note: 1 token is lost during unbonding due to rounding + shareDenom := validatorAddress.String() + "/1" + shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens, err := validator.SharesFromTokens(tokenizationCoin.Amount) + require.Equal(t, expectedShareTokens.TruncateInt().Int64()-1, shareToken.Amount.Int64(), "share token amount") + + // // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm the full tokenization amount was recovered - minus the 1 token from the precision error + newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + expectedDelegationTokens := delegationAmountAfterSlash.Int64() - 1 + require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") +} + +// Tests the conversion from tokenization and redemption from the following scenario: +// Delegate -> Tokenize -> Slash -> Redeem +// Note, in this example, there 1 token lost during the decimal to int conversion +// during the unbonding step within redemption +func TestTokenizeAndRedeemConversion_SlashBeforeRedemptino(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Tokenize the full delegation amount + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // The number of share tokens should line up 1:1 with the number of issued shares + // Since the validator has not been slashed, the shares also line up 1;1 + // with the original delegation amount + shareDenom := validatorAddress.String() + "/1" + shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens := delegateAmount + require.Equal(t, expectedShareTokens.Int64(), shareToken.Amount.Int64(), "share token amount") + + // slash the validator + simulateSlashWithImprecision(t, app, ctx, validatorAddress) + validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm the original delegation, minus the slash, was recovered + // There's an additional 1 token lost from precision error during unbonding + delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt().Int64() + newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") +} + +func TestTransferTokenizeShareRecord(t *testing.T) { + _, app, ctx := createTestInput() + + addrs := simapp.AddTestAddrs(app, ctx, 3, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] + addrVal := sdk.ValAddress(valAcc) + + pubKeys := simapp.CreateTestPubKeys(1) + pk := pubKeys[0] + + val := teststaking.NewValidator(t, addrVal, pk) + app.StakingKeeper.SetValidator(ctx, val) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val) + + // apply TM updates + applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + err := app.StakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ + Id: 1, + Owner: addrAcc1.String(), + ModuleAccount: "module_account", + Validator: val.String(), + }) + require.NoError(t, err) + + _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: 1, + Sender: addrAcc1.String(), + NewOwner: addrAcc2.String(), + }) + require.NoError(t, err) + + record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) + require.NoError(t, err) + require.Equal(t, record.Owner, addrAcc2.String()) + + records := app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) + require.Len(t, records, 0) + records = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) + require.Len(t, records, 1) +} + +func TestValidatorBond(t *testing.T) { + _, app, ctx := createTestInput() + + testCases := []struct { + name string + createValidator bool + createDelegation bool + alreadyValidatorBond bool + delegatorIsLSTP bool + expectedErr error + }{ + { + name: "successful validator bond", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + }, + { + name: "successful with existing validator bond", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: true, + delegatorIsLSTP: false, + }, + { + name: "validator does not not exist", + createValidator: false, + createDelegation: false, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + expectedErr: sdkstaking.ErrNoValidatorFound, + }, + { + name: "delegation not exist case", + createValidator: true, + createDelegation: false, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + expectedErr: sdkstaking.ErrNoDelegation, + }, + { + name: "delegator is a liquid staking provider", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: false, + delegatorIsLSTP: true, + expectedErr: types.ErrValidatorBondNotAllowedFromModuleAccount, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + _, app, ctx = createTestInput() + + pubKeys := simapp.CreateTestPubKeys(2) + validatorPubKey := pubKeys[0] + delegatorPubKey := pubKeys[1] + + delegatorAddress := sdk.AccAddress(delegatorPubKey.Address()) + validatorAddress := sdk.ValAddress(validatorPubKey.Address()) + icaAccountAddress := createICAAccount(app, ctx) + + // Set the delegator address to either be a user account or an ICA account depending on the test case + if tc.delegatorIsLSTP { + delegatorAddress = icaAccountAddress + } + + // Fund the delegator + delegationAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) + coins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmount)) + + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + require.NoError(t, err, "no error expected when minting") + + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) + require.NoError(t, err, "no error expected when funding account") + + // Create Validator and delegation + if tc.createValidator { + validator := teststaking.NewValidator(t, validatorAddress, validatorPubKey) + validator.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, validator) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(t, err) + + // Optionally create the delegation, depending on the test case + if tc.createDelegation { + _, err = app.StakingKeeper.Delegate(ctx, delegatorAddress, delegationAmount, sdkstaking.Unbonded, validator, true) + require.NoError(t, err, "no error expected when delegating") + + // Optionally, convert the delegation into a validator bond + if tc.alreadyValidatorBond { + delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + delegation.ValidatorBond = true + app.StakingKeeper.SetDelegation(ctx, delegation) + } + } + } + + // Call ValidatorBond + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + }) + + if tc.expectedErr != nil { + require.ErrorContains(t, err, tc.expectedErr.Error()) + } else { + require.NoError(t, err, "no error expected from validator bond transaction") + + // check validator bond true + delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found after validator bond") + require.True(t, delegation.ValidatorBond, "delegation should be marked as a validator bond") + + // check validator bond shares + validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found after validator bond") + + if tc.alreadyValidatorBond { + require.True(t, validator.ValidatorBondShares.IsZero(), "validator bond shares should still be zero") + } else { + require.Equal(t, delegation.Shares.String(), validator.ValidatorBondShares.String(), + "validator total shares should have increased") + } + } + }) + } +} + +func TestChangeValidatorBond(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { + validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") + } + + // Create a delegator and 3 validators + addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1_000_000)) + pubKeys := simapp.CreateTestPubKeys(4) + + validatorAPubKey := pubKeys[1] + validatorBPubKey := pubKeys[2] + validatorCPubKey := pubKeys[3] + + delegatorAddress := addresses[0] + validatorAAddress := sdk.ValAddress(validatorAPubKey.Address()) + validatorBAddress := sdk.ValAddress(validatorBPubKey.Address()) + validatorCAddress := sdk.ValAddress(validatorCPubKey.Address()) + + validatorA := teststaking.NewValidator(t, validatorAAddress, validatorAPubKey) + validatorB := teststaking.NewValidator(t, validatorBAddress, validatorBPubKey) + validatorC := teststaking.NewValidator(t, validatorCAddress, validatorCPubKey) + + validatorA.Tokens = sdk.NewInt(1_000_000) + validatorB.Tokens = sdk.NewInt(1_000_000) + validatorC.Tokens = sdk.NewInt(1_000_000) + validatorA.DelegatorShares = sdk.NewDec(1_000_000) + validatorB.DelegatorShares = sdk.NewDec(1_000_000) + validatorC.DelegatorShares = sdk.NewDec(1_000_000) + + app.StakingKeeper.SetValidator(ctx, validatorA) + app.StakingKeeper.SetValidator(ctx, validatorB) + app.StakingKeeper.SetValidator(ctx, validatorC) + + // The test will go through Delegate/Redelegate/Undelegate messages with the following + delegation1Amount := sdk.NewInt(1000) + delegation2Amount := sdk.NewInt(1000) + redelegateAmount := sdk.NewInt(500) + undelegateAmount := sdk.NewInt(500) + + delegate1Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation1Amount) + delegate2Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation2Amount) + redelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), redelegateAmount) + undelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), undelegateAmount) + + // Delegate to validator's A and C - validator bond shares should not change + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: delegate1Coin, + }) + require.NoError(t, err, "no error expected during first delegation") + + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorCAddress.String(), + Amount: delegate1Coin, + }) + require.NoError(t, err, "no error expected during first delegation") + + checkValidatorBondShares(validatorAAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, sdk.ZeroInt()) + + // Flag the the delegations to validator A and C validator bond's + // Their bond shares should increase + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + }) + require.NoError(t, err, "no error expected during validator bond") + + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorCAddress.String(), + }) + require.NoError(t, err, "no error expected during validator bond") + + checkValidatorBondShares(validatorAAddress, delegation1Amount) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Delegate more to validator A - it should increase the validator bond shares + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: delegate2Coin, + }) + require.NoError(t, err, "no error expected during second delegation") + + checkValidatorBondShares(validatorAAddress, delegation1Amount.Add(delegation2Amount)) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Redelegate partially from A to B (where A is a validator bond and B is not) + // It should remove the bond shares from A, and B's validator bond shares should not change + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorAAddress.String(), + ValidatorDstAddress: validatorBAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + expectedBondSharesA := delegation1Amount.Add(delegation2Amount).Sub(redelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Now redelegate from B to C (where B is not a validator bond, but C is) + // Validator B's bond shares should remain at zero, but C's bond shares should increase + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorBAddress.String(), + ValidatorDstAddress: validatorCAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount.Add(redelegateAmount)) + + // Redelegate partially from A to C (where C is a validator bond delegation) + // It should remove the bond shares from A, and increase the bond shares on validator C + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorAAddress.String(), + ValidatorDstAddress: validatorCAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + expectedBondSharesA = expectedBondSharesA.Sub(redelegateAmount) + expectedBondSharesC := delegation1Amount.Add(redelegateAmount).Add(redelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, expectedBondSharesC) + + // Undelegate from validator A - it should remove shares + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: undelegateCoin, + }) + require.NoError(t, err, "no error expected during undelegation") + + expectedBondSharesA = expectedBondSharesA.Sub(undelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, expectedBondSharesC) +} + +func TestEnableDisableTokenizeShares(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // Create a delegator and validator + stakeAmount := sdk.NewInt(1000) + stakeToken := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), stakeAmount) + + addresses := simapp.AddTestAddrs(app, ctx, 2, stakeAmount) + delegatorAddress := addresses[0] + + pubKeys := simapp.CreateTestPubKeys(1) + validatorAddress := sdk.ValAddress(addresses[1]) + validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) + + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.Status = types.Bonded + app.StakingKeeper.SetValidator(ctx, validator) + + // Fix block time and set unbonding period to 1 day + blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + ctx = ctx.WithBlockTime(blockTime) + + unbondingPeriod := time.Hour * 24 + params := app.StakingKeeper.GetParams(ctx) + params.UnbondingTime = unbondingPeriod + app.StakingKeeper.SetParams(ctx, params) + unlockTime := blockTime.Add(unbondingPeriod) + + // Build test messages (some of which will be reused) + delegateMsg := types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: stakeToken, + } + tokenizeMsg := types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: stakeToken, + TokenizedShareOwner: delegatorAddress.String(), + } + redeemMsg := types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + } + disableMsg := types.MsgDisableTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + } + enableMsg := types.MsgEnableTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + } + + // Delegate normally + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + require.NoError(t, err, "no error expected when delegating") + + // Tokenize shares - it should succeed + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.NoError(t, err, "no error expected when tokenizing shares for the first time") + + liquidToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, validatorAddress.String()+"/1") + require.Equal(t, stakeAmount.Int64(), liquidToken.Amount.Int64(), "user received token after tokenizing share") + + // Redeem to remove all tokenized shares + redeemMsg.Amount = liquidToken + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &redeemMsg) + require.NoError(t, err, "no error expected when redeeming") + + // Attempt to enable tokenizing shares when there is no lock in place, it should error + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyEnabledForAccount) + + // Attempt to disable when no lock is in place, it should succeed + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.NoError(t, err, "no error expected when disabling tokenization") + + // Disabling again while the lock is already in place, should error + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyDisabledForAccount) + + // Attempt to tokenize, it should fail since tokenization is disabled + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + + // Now enable tokenization + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.NoError(t, err, "no error expected when enabling tokenization") + + // Attempt to tokenize again, it should still fail since the unbonding period has + // not passed and the lock is still active + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + require.ErrorContains(t, err, fmt.Sprintf("tokenization will be allowed at %s", + blockTime.Add(unbondingPeriod))) + + // Confirm the unlock is queued + authorizations := app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + require.Equal(t, []string{delegatorAddress.String()}, authorizations.Addresses, + "pending tokenize share authorizations") + + // Disable tokenization again - it should remove the pending record from the queue + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.NoError(t, err, "no error expected when re-enabling tokenization") + + authorizations = app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + require.Empty(t, authorizations.Addresses, "there should be no pending authorizations in the queue") + + // Enable one more time + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.NoError(t, err, "no error expected when enabling tokenization again") + + // Increment the block time by the unbonding period and remove the expired locks + ctx = ctx.WithBlockTime(unlockTime) + app.StakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) + + // Attempt to tokenize again, it should succeed this time since the lock has expired + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.NoError(t, err, "no error expected when tokenizing after lock has expired") +} + +func TestUnbondValidator(t *testing.T) { + _, app, ctx := createTestInput() + addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1 := addrs[0] + addrVal1 := sdk.ValAddress(addrAcc1) + + pubKeys := simapp.CreateTestPubKeys(1) + pk1 := pubKeys[0] + + // Create Validators and Delegation + val1 := teststaking.NewValidator(t, addrVal1, pk1) + val1.Status = sdkstaking.Bonded + app.StakingKeeper.SetValidator(ctx, val1) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + require.NoError(t, err) + + // try unbonding not available validator + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + }) + require.Error(t, err) + + // unbond validator + _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + ValidatorAddress: addrVal1.String(), + }) + require.NoError(t, err) + + // check if validator is jailed + validator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.True(t, validator.Jailed) +} + +// TestICADelegateUndelegate tests that an ICA account can undelegate +// sequentially right after delegating. +func TestICADelegateUndelegate(t *testing.T) { + _, app, ctx := createTestInput() + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // Create a delegator and validator (the delegator will be an ICA account) + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + icaAccountAddress := createICAAccount(app, ctx) + + // Fund ICA account + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) + require.NoError(t, err) + + addresses := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(0)) + pubKeys := simapp.CreateTestPubKeys(1) + validatorAddress := sdk.ValAddress(addresses[0]) + validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) + + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.LiquidShares = sdk.NewDec(0) + app.StakingKeeper.SetValidator(ctx, validator) + + delegateMsg := types.MsgDelegate{ + DelegatorAddress: icaAccountAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + } + + undelegateMsg := types.MsgUndelegate{ + DelegatorAddress: icaAccountAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + } + + // Delegate normally + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + require.NoError(t, err, "no error expected when delegating") + + // Confirm delegation record + _, found := app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Confirm liquid staking totals were incremented + expectedTotalLiquidStaked := delegateAmount.Int64() + actualTotalLiquidStaked := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked, "total liquid staked tokens after delegation") + + validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, delegateAmount.ToDec(), validator.LiquidShares, "validator liquid shares after delegation") + + // Try to undelegate + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &undelegateMsg) + require.NoError(t, err, "no error expected when sequentially undelegating") + + // Confirm delegation record was removed + _, found = app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + require.False(t, found, "delegation not have been found") + + // Confirm liquid staking totals were decremented + actualTotalLiquidStaked = app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + require.Zero(t, actualTotalLiquidStaked, "total liquid staked tokens after undelegation") + + validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, sdk.ZeroDec(), validator.LiquidShares, "validator liquid shares after undelegation") +} diff --git a/x/staking/client/cli/tx_test.go b/x/staking/client/cli/tx_test.go index e0810b4f0ecb..e8d7e5195a85 100644 --- a/x/staking/client/cli/tx_test.go +++ b/x/staking/client/cli/tx_test.go @@ -108,28 +108,40 @@ func (s *CLITestSuite) TestPrepareConfigForTxCreateValidator() { { name: "Custom amount", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagAmount, "2000stake") + err := fs.Set(cli.FlagAmount, "2000stake") + if err != nil { + panic(err) + } }, expectedCfg: mkTxValCfg("2000stake", "0.1", "0.2", "0.01"), }, { name: "Custom commission rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionRate, "0.54") + err := fs.Set(cli.FlagCommissionRate, "0.54") + if err != nil { + panic(err) + } }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.54", "0.2", "0.01"), }, { name: "Custom commission max rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionMaxRate, "0.89") + err := fs.Set(cli.FlagCommissionMaxRate, "0.89") + if err != nil { + panic(err) + } }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.1", "0.89", "0.01"), }, { name: "Custom commission max change rate", fsModify: func(fs *pflag.FlagSet) { - fs.Set(cli.FlagCommissionMaxChangeRate, "0.55") + err := fs.Set(cli.FlagCommissionMaxChangeRate, "0.55") + if err != nil { + panic(err) + } }, expectedCfg: mkTxValCfg(cli.DefaultTokens.String()+sdk.DefaultBondDenom, "0.1", "0.2", "0.55"), }, diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 6a5782c9fca3..98ed2aa9378d 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -224,56 +224,6 @@ func (s *KeeperTestSuite) TestUnbondDelegation() { require.Equal(remainingTokens, validator.BondedTokens()) } -// // test undelegating self delegation from a validator pushing it below MinSelfDelegation -// // shift it from the bonded to unbonding state and jailed -func (s *KeeperTestSuite) TestUndelegateSelfDelegationBelowMinSelfDelegation() { - ctx, keeper := s.ctx, s.stakingKeeper - require := s.Require() - - addrDels, addrVals := createValAddrs(1) - delTokens := keeper.TokensFromConsensusPower(ctx, 10) - - // create a validator with a self-delegation - validator := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) - - validator.MinSelfDelegation = delTokens - validator, issuedShares := validator.AddTokensFromDel(delTokens) - require.Equal(delTokens, issuedShares.RoundInt()) - - s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) - validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - keeper.SetValidatorByConsAddr(ctx, validator) - require.True(validator.IsBonded()) - - selfDelegation := stakingtypes.NewDelegation(sdk.AccAddress(addrVals[0].Bytes()), addrVals[0], issuedShares) - keeper.SetDelegation(ctx, selfDelegation) - - // create a second delegation to this validator - keeper.DeleteValidatorByPowerIndex(ctx, validator) - validator, issuedShares = validator.AddTokensFromDel(delTokens) - require.True(validator.IsBonded()) - require.Equal(delTokens, issuedShares.RoundInt()) - - validator = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator, true) - delegation := stakingtypes.NewDelegation(addrDels[0], addrVals[0], issuedShares) - keeper.SetDelegation(ctx, delegation) - - val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) - s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) - _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(keeper.TokensFromConsensusPower(ctx, 6))) - require.NoError(err) - - // end block - s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) - s.applyValidatorSetUpdates(ctx, keeper, 1) - - validator, found := keeper.GetValidator(ctx, addrVals[0]) - require.True(found) - require.Equal(keeper.TokensFromConsensusPower(ctx, 14), validator.Tokens) - require.Equal(stakingtypes.Unbonding, validator.Status) - require.True(validator.Jailed) -} - func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { ctx, keeper := s.ctx, s.stakingKeeper require := s.Require() @@ -312,11 +262,12 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondingValidator() { header.Time = blockTime ctx = ctx.WithBlockHeader(header) - // unbond the all self-delegation to put validator in unbonding state + // unbond the and jail the validator to put it in an unbonding state val0AccAddr := sdk.AccAddress(addrVals[0]) s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) require.NoError(err) + keeper.Jail(ctx, sdk.GetConsAddress(PKs[0])) // end block s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) @@ -380,9 +331,10 @@ func (s *KeeperTestSuite) TestUndelegateFromUnbondedValidator() { ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) - // unbond the all self-delegation to put validator in unbonding state + // unbond the and jail the validator to put it in an unbonding state s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(valTokens)) + keeper.Jail(ctx, sdk.GetConsAddress(PKs[0])) require.NoError(err) // end block @@ -456,10 +408,11 @@ func (s *KeeperTestSuite) TestUnbondingAllDelegationFromValidator() { ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) - // unbond the all self-delegation to put validator in unbonding state + // unbond the and jail the validator to put it in an unbonding state s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(valTokens)) require.NoError(err) + keeper.Jail(ctx, sdk.GetConsAddress(PKs[0])) // end block s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) @@ -742,10 +695,11 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { header.Time = blockTime ctx = ctx.WithBlockHeader(header) - // unbond the all self-delegation to put validator in unbonding state + // unbond the and jail the validator to put it in an unbonding state s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) require.NoError(err) + keeper.Jail(ctx, sdk.GetConsAddress(PKs[0])) // end block s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) @@ -846,3 +800,183 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { red, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) require.False(found, "%v", red) } + +/*TODO refactor LSM tests: + +- Note that in v0.45.16-lsm the redelegation tests are renamed such that: +TestRedelegateFromUnbondingValidator -> TestValidatorBondUndelegate and +TestRedelegateFromUnbondedValidator -> TestValidatorBondUndelegate + +- Note that in v0.45.16-lsm the keeper tests are still using testing.T +and simapp, which should updated to unit test with gomock, see tests above. + +*/ +// func TestValidatorBondUndelegate(t *testing.T) { +// _, app, ctx := createTestInput() + +// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) +// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) + +// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + +// bondDenom := app.StakingKeeper.BondDenom(ctx) +// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) + +// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) +// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) + +// // create a validator and a delegator to that validator +// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) +// validator.Status = types.Bonded +// app.StakingKeeper.SetValidator(ctx, validator) + +// // set validator bond factor +// params := app.StakingKeeper.GetParams(ctx) +// params.ValidatorBondFactor = sdk.NewDec(1) +// app.StakingKeeper.SetParams(ctx, params) + +// // convert to validator self-bond +// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) +// require.NoError(t, err) +// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorAddress: addrVals[0].String(), +// }) +// require.NoError(t, err) + +// // tokenize share for 2nd account delegation +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) +// require.NoError(t, err) +// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ +// DelegatorAddress: addrDels[1].String(), +// ValidatorAddress: addrVals[0].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// TokenizedShareOwner: addrDels[0].String(), +// }) +// require.NoError(t, err) + +// // try undelegating +// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorAddress: addrVals[0].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// }) +// require.Error(t, err) + +// // redeem full amount on 2nd account and try undelegation +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) +// require.NoError(t, err) +// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ +// DelegatorAddress: addrDels[1].String(), +// Amount: tokenizeShareResp.Amount, +// }) +// require.NoError(t, err) + +// // try undelegating +// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorAddress: addrVals[0].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// }) +// require.NoError(t, err) + +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) +// } + +// func TestValidatorBondRedelegate(t *testing.T) { +// _, app, ctx := createTestInput() + +// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) +// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) + +// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + +// bondDenom := app.StakingKeeper.BondDenom(ctx) +// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) + +// startPoolToken := sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens.Mul(sdk.NewInt(2)))) +// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startPoolToken)) +// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) + +// // create a validator and a delegator to that validator +// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) +// validator.Status = types.Bonded +// app.StakingKeeper.SetValidator(ctx, validator) +// validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) +// validator.Status = types.Bonded +// app.StakingKeeper.SetValidator(ctx, validator2) + +// // set validator bond factor +// params := app.StakingKeeper.GetParams(ctx) +// params.ValidatorBondFactor = sdk.NewDec(1) +// app.StakingKeeper.SetParams(ctx, params) + +// // set total liquid stake +// app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(100)) + +// // delegate to each validator +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) +// require.NoError(t, err) + +// validator2, _ = app.StakingKeeper.GetValidator(ctx, addrVals[1]) +// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator2) +// require.NoError(t, err) + +// // convert to validator self-bond +// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) +// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorAddress: addrVals[0].String(), +// }) +// require.NoError(t, err) + +// // tokenize share for 2nd account delegation +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) +// require.NoError(t, err) +// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ +// DelegatorAddress: addrDels[1].String(), +// ValidatorAddress: addrVals[0].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// TokenizedShareOwner: addrDels[0].String(), +// }) +// require.NoError(t, err) + +// // try undelegating +// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorSrcAddress: addrVals[0].String(), +// ValidatorDstAddress: addrVals[1].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// }) +// require.Error(t, err) + +// // redeem full amount on 2nd account and try undelegation +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) +// require.NoError(t, err) +// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ +// DelegatorAddress: addrDels[1].String(), +// Amount: tokenizeShareResp.Amount, +// }) +// require.NoError(t, err) + +// // try undelegating +// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ +// DelegatorAddress: addrDels[0].String(), +// ValidatorSrcAddress: addrVals[0].String(), +// ValidatorDstAddress: addrVals[1].String(), +// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), +// }) +// require.NoError(t, err) + +// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) +// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) +// } diff --git a/x/staking/keeper/genesis.go b/x/staking/keeper/genesis.go index 1d88367290ce..52e8bd5fd561 100644 --- a/x/staking/keeper/genesis.go +++ b/x/staking/keeper/genesis.go @@ -165,6 +165,48 @@ func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) (res []ab } } + // Set the total liquid staked tokens + k.SetTotalLiquidStakedTokens(ctx, data.TotalLiquidStakedTokens) + + // Set each tokenize share record, as well as the last tokenize share record ID + latestId := uint64(0) + for _, tokenizeShareRecord := range data.TokenizeShareRecords { + if err := k.AddTokenizeShareRecord(ctx, tokenizeShareRecord); err != nil { + panic(err) + } + if tokenizeShareRecord.Id > latestId { + latestId = tokenizeShareRecord.Id + } + } + if data.LastTokenizeShareRecordId < latestId { + panic("Tokenize share record specified with ID greater than the latest ID") + } + k.SetLastTokenizeShareRecordID(ctx, data.LastTokenizeShareRecordId) + + // Set the tokenize shares locks for accounts that have disabled tokenizing shares + // The lock can either be in status LOCKED or LOCK_EXPIRING + // If it is in status LOCK_EXPIRING, a the unlocking must also be queued + for _, tokenizeShareLock := range data.TokenizeShareLocks { + address := sdk.MustAccAddressFromBech32(tokenizeShareLock.Address) + + switch tokenizeShareLock.Status { + case types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(): + k.AddTokenizeSharesLock(ctx, address) + + case types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(): + completionTime := tokenizeShareLock.CompletionTime + + authorizations := k.GetPendingTokenizeShareAuthorizations(ctx, completionTime) + authorizations.Addresses = append(authorizations.Addresses, address.String()) + + k.SetPendingTokenizeShareAuthorizations(ctx, completionTime, authorizations) + k.SetTokenizeSharesUnlockTime(ctx, address, completionTime) + + default: + panic(fmt.Sprintf("Unsupported tokenize share lock status %s", tokenizeShareLock.Status)) + } + } + return res } @@ -194,13 +236,17 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { }) return &types.GenesisState{ - Params: k.GetParams(ctx), - LastTotalPower: k.GetLastTotalPower(ctx), - LastValidatorPowers: lastValidatorPowers, - Validators: k.GetAllValidators(ctx), - Delegations: k.GetAllDelegations(ctx), - UnbondingDelegations: unbondingDelegations, - Redelegations: redelegations, - Exported: true, + Params: k.GetParams(ctx), + LastTotalPower: k.GetLastTotalPower(ctx), + LastValidatorPowers: lastValidatorPowers, + Validators: k.GetAllValidators(ctx), + Delegations: k.GetAllDelegations(ctx), + UnbondingDelegations: unbondingDelegations, + Redelegations: redelegations, + Exported: true, + TokenizeShareRecords: k.GetAllTokenizeShareRecords(ctx), + LastTokenizeShareRecordId: k.GetLastTokenizeShareRecordID(ctx), + TotalLiquidStakedTokens: k.GetTotalLiquidStakedTokens(ctx), + TokenizeShareLocks: k.GetAllTokenizeSharesLocks(ctx), } } diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 87bb4539723b..e4ba090779fe 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -551,6 +551,7 @@ func DelegationToDelegationResponse(ctx sdk.Context, k *Keeper, del types.Delega delegatorAddress, del.GetValidatorAddr(), del.Shares, + false, sdk.NewCoin(k.BondDenom(ctx), val.TokensFromShares(del.Shares).TruncateInt()), ), nil } diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index 5717fd7c0640..abeba9b9343b 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -1,5 +1,7 @@ package keeper_test +// TODO refactor LSM tests + // import ( // "fmt" // "testing" diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index b9aa4b7ffddd..f3086fdc3f66 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -7,16 +7,16 @@ import ( "time" "github.com/armon/go-metrics" - vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) type msgServer struct { @@ -482,6 +482,8 @@ func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) ( }, nil } +// CancelUnbondingDelegation defines a method for canceling the unbonding delegation +// and delegate back to the validator. func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.MsgCancelUnbondingDelegation) (*types.MsgCancelUnbondingDelegationResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) @@ -852,7 +854,7 @@ func (k msgServer) RedeemTokensForShares(goCtx context.Context, msg *types.MsgRe // Similar to undelegations, if the account is attempting to tokenize the full delegation, // but there's a precision error due to the decimal to int conversion, round up to the // full decimal amount before modifying the delegation - shares := shareToken.Amount.ToDec() + shares := shareToken.Amount.ToLegacyDec() if shareToken.Amount.Equal(delegation.Shares.TruncateInt()) { shares = delegation.Shares } diff --git a/x/staking/keeper/slash.go b/x/staking/keeper/slash.go index e5b4e1f87e61..cd0318c933c2 100644 --- a/x/staking/keeper/slash.go +++ b/x/staking/keeper/slash.go @@ -132,8 +132,19 @@ func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeigh // Deduct from validator's bonded tokens and update the validator. // Burn the slashed tokens from the pool account and decrease the total supply. + initialLiquidTokens := validator.TokensFromShares(validator.LiquidShares).TruncateInt() validator = k.RemoveValidatorTokens(ctx, validator, tokensToBurn) + // Proportionally deduct any liquid tokens from the global total + updatedLiquidTokens := validator.TokensFromShares(validator.LiquidShares).TruncateInt() + slashedLiquidTokens := initialLiquidTokens.Sub(updatedLiquidTokens) + if err := k.DecreaseTotalLiquidStakedTokens(ctx, slashedLiquidTokens); err != nil { + // This only error's if the total liquid staked tokens underflows + // which would indicate there's a corrupted state where the validator has + // liquid tokens that are not accounted for in the global total + panic(err) + } + switch validator.GetStatus() { case types.Bonded: if err := k.burnBondedTokens(ctx, tokensToBurn); err != nil { diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go index 3f0bc7679a5c..9977c13c58ac 100644 --- a/x/staking/keeper/tokenize_share_record_test.go +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -9,6 +9,51 @@ func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { suite.Equal(lastTokenizeShareRecordID, uint64(100)) } -func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { - // TODO add LSM test -} +// TODO: refactor LSM test +// Note it might be moved to integration test +// func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { +// app, ctx := suite.app, suite.ctx +// owner1, owner2 := suite.addrs[0], suite.addrs[1] + +// tokenizeShareRecord1 := types.TokenizeShareRecord{ +// Id: 0, +// Owner: owner1.String(), +// ModuleAccount: "test-module-account-1", +// Validator: "test-validator", +// } +// tokenizeShareRecord2 := types.TokenizeShareRecord{ +// Id: 1, +// Owner: owner2.String(), +// ModuleAccount: "test-module-account-2", +// Validator: "test-validator", +// } +// tokenizeShareRecord3 := types.TokenizeShareRecord{ +// Id: 2, +// Owner: owner1.String(), +// ModuleAccount: "test-module-account-3", +// Validator: "test-validator", +// } +// err := app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord1) +// suite.NoError(err) +// err = app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord2) +// suite.NoError(err) +// err = app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord3) +// suite.NoError(err) + +// tokenizeShareRecord, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 2) +// suite.NoError(err) +// suite.Equal(tokenizeShareRecord, tokenizeShareRecord3) + +// tokenizeShareRecord, err = app.StakingKeeper.GetTokenizeShareRecordByDenom(ctx, tokenizeShareRecord2.GetShareTokenDenom()) +// suite.NoError(err) +// suite.Equal(tokenizeShareRecord, tokenizeShareRecord2) + +// tokenizeShareRecords := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) +// suite.Equal(len(tokenizeShareRecords), 3) + +// tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner1) +// suite.Equal(len(tokenizeShareRecords), 2) + +// tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner2) +// suite.Equal(len(tokenizeShareRecords), 1) +// } diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index 6e0c372a54d5..6a6de6a408bb 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -11,14 +11,15 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/staking/types" ) // Simulation parameter constants const ( - unbondingTime = "unbonding_time" - maxValidators = "max_validators" - historicalEntries = "historical_entries" + UnbondingTime = "unbonding_time" + MaxValidators = "max_validators" + HistoricalEntries = "historical_entries" ValidatorBondFactor = "validator_bond_factor" GlobalLiquidStakingCap = "global_liquid_staking_cap" ValidatorLiquidStakingCap = "validator_liquid_staking_cap" @@ -39,13 +40,28 @@ func getHistEntries(r *rand.Rand) uint32 { return uint32(r.Intn(int(types.DefaultHistoricalEntries + 1))) } +// getGlobalLiquidStakingCap returns randomized GlobalLiquidStakingCap between 0-1. +func getGlobalLiquidStakingCap(r *rand.Rand) sdk.Dec { + return simtypes.RandomDecAmount(r, sdk.OneDec()) +} + +// getValidatorLiquidStakingCap returns randomized ValidatorLiquidStakingCap between 0-1. +func getValidatorLiquidStakingCap(r *rand.Rand) sdk.Dec { + return simtypes.RandomDecAmount(r, sdk.OneDec()) +} + +// getValidatorBondFactor returns randomized ValidatorBondCap between -1 and 300. +func getValidatorBondFactor(r *rand.Rand) sdk.Dec { + return sdk.NewDec(int64(simtypes.RandIntBetween(r, -1, 300))) +} + // RandomizedGenState generates a random GenesisState for staking func RandomizedGenState(simState *module.SimulationState) { // params var ( - unbondTime time.Duration - maxVals uint32 - histEntries uint32 + unbondingTime time.Duration + maxValidators uint32 + historicalEntries uint32 minCommissionRate sdk.Dec validatorBondFactor sdk.Dec globalLiquidStakingCap sdk.Dec @@ -53,26 +69,41 @@ func RandomizedGenState(simState *module.SimulationState) { ) simState.AppParams.GetOrGenerate( - simState.Cdc, unbondingTime, &unbondTime, simState.Rand, - func(r *rand.Rand) { unbondTime = genUnbondingTime(r) }, + simState.Cdc, UnbondingTime, &unbondingTime, simState.Rand, + func(r *rand.Rand) { unbondingTime = genUnbondingTime(r) }, ) simState.AppParams.GetOrGenerate( - simState.Cdc, maxValidators, &maxVals, simState.Rand, - func(r *rand.Rand) { maxVals = genMaxValidators(r) }, + simState.Cdc, MaxValidators, &maxValidators, simState.Rand, + func(r *rand.Rand) { maxValidators = genMaxValidators(r) }, ) simState.AppParams.GetOrGenerate( - simState.Cdc, historicalEntries, &histEntries, simState.Rand, - func(r *rand.Rand) { histEntries = getHistEntries(r) }, + simState.Cdc, HistoricalEntries, &historicalEntries, simState.Rand, + func(r *rand.Rand) { historicalEntries = getHistEntries(r) }, + ) + + simState.AppParams.GetOrGenerate( + simState.Cdc, ValidatorBondFactor, &validatorBondFactor, simState.Rand, + func(r *rand.Rand) { validatorBondFactor = getValidatorBondFactor(r) }, + ) + simState.AppParams.GetOrGenerate( + simState.Cdc, GlobalLiquidStakingCap, &globalLiquidStakingCap, simState.Rand, + func(r *rand.Rand) { globalLiquidStakingCap = getGlobalLiquidStakingCap(r) }, + ) + simState.AppParams.GetOrGenerate( + simState.Cdc, ValidatorLiquidStakingCap, &validatorLiquidStakingCap, simState.Rand, + func(r *rand.Rand) { validatorLiquidStakingCap = getValidatorLiquidStakingCap(r) }, ) // NOTE: the slashing module need to be defined after the staking module on the // NewSimulationManager constructor for this to work - simState.UnbondTime = unbondTime - params := types.NewParams(simState.UnbondTime, maxVals, + simState.UnbondTime = unbondingTime + params := types.NewParams( + simState.UnbondTime, + maxValidators, 7, - histEntries, + historicalEntries, sdk.DefaultBondDenom, minCommissionRate, validatorBondFactor, diff --git a/x/staking/simulation/genesis_test.go b/x/staking/simulation/genesis_test.go index dd60652a87bb..809009a6eba1 100644 --- a/x/staking/simulation/genesis_test.go +++ b/x/staking/simulation/genesis_test.go @@ -61,10 +61,9 @@ func TestRandomizedGenState(t *testing.T) { require.Equal(t, "BOND_STATUS_UNBONDED", stakingGenesis.Validators[2].Status.String()) require.Equal(t, "1000", stakingGenesis.Validators[2].Tokens.String()) require.Equal(t, "1000.000000000000000000", stakingGenesis.Validators[2].DelegatorShares.String()) - require.Equal(t, "0.292059246265731326", stakingGenesis.Validators[2].Commission.CommissionRates.Rate.String()) - require.Equal(t, "0.330000000000000000", stakingGenesis.Validators[2].Commission.CommissionRates.MaxRate.String()) - require.Equal(t, "0.038337453731274481", stakingGenesis.Validators[2].Commission.CommissionRates.MaxChangeRate.String()) - require.Equal(t, "1", stakingGenesis.Validators[2].MinSelfDelegation.String()) + require.Equal(t, "0.019527679037870745", stakingGenesis.Validators[2].Commission.CommissionRates.Rate.String()) + require.Equal(t, "0.240000000000000000", stakingGenesis.Validators[2].Commission.CommissionRates.MaxRate.String()) + require.Equal(t, "0.240000000000000000", stakingGenesis.Validators[2].Commission.CommissionRates.MaxChangeRate.String()) } // TestRandomizedGenState1 tests abnormal scenarios of applying RandomizedGenState. diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 15ad194a09a5..b4cd0fa11a06 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -19,19 +20,33 @@ import ( // //nolint:gosec // these are not hardcoded credentials const ( - DefaultWeightMsgCreateValidator int = 100 - DefaultWeightMsgEditValidator int = 5 - DefaultWeightMsgDelegate int = 100 - DefaultWeightMsgUndelegate int = 100 - DefaultWeightMsgBeginRedelegate int = 100 - DefaultWeightMsgCancelUnbondingDelegation int = 100 - - OpWeightMsgCreateValidator = "op_weight_msg_create_validator" - OpWeightMsgEditValidator = "op_weight_msg_edit_validator" - OpWeightMsgDelegate = "op_weight_msg_delegate" - OpWeightMsgUndelegate = "op_weight_msg_undelegate" - OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" - OpWeightMsgCancelUnbondingDelegation = "op_weight_msg_cancel_unbonding_delegation" + DefaultWeightMsgCreateValidator int = 100 + DefaultWeightMsgEditValidator int = 5 + DefaultWeightMsgDelegate int = 100 + DefaultWeightMsgUndelegate int = 100 + DefaultWeightMsgBeginRedelegate int = 100 + DefaultWeightMsgCancelUnbondingDelegation int = 100 + DefaultWeightMsgValidatorBond int = 100 + DefaultWeightMsgTokenizeShares int = 25 + DefaultWeightMsgRedeemTokensforShares int = 25 + DefaultWeightMsgTransferTokenizeShareRecord int = 5 + DefaultWeightMsgEnableTokenizeShares int = 1 + DefaultWeightMsgDisableTokenizeShares int = 1 + DefaultWeightMsgWithdrawAllTokenizeShareRecordReward int = 50 + + OpWeightMsgCreateValidator = "op_weight_msg_create_validator" + OpWeightMsgEditValidator = "op_weight_msg_edit_validator" + OpWeightMsgDelegate = "op_weight_msg_delegate" + OpWeightMsgUndelegate = "op_weight_msg_undelegate" + OpWeightMsgBeginRedelegate = "op_weight_msg_begin_redelegate" + OpWeightMsgCancelUnbondingDelegation = "op_weight_msg_cancel_unbonding_delegation" + OpWeightMsgValidatorBond = "op_weight_msg_validator_bond" //nolint:gosec + OpWeightMsgTokenizeShares = "op_weight_msg_tokenize_shares" //nolint:gosec + OpWeightMsgRedeemTokensforShares = "op_weight_msg_redeem_tokens_for_shares" //nolint:gosec + OpWeightMsgTransferTokenizeShareRecord = "op_weight_msg_transfer_tokenize_share_record" //nolint:gosec + OpWeightMsgDisableTokenizeShares = "op_weight_msg_disable_tokenize_shares" //nolint:gosec + OpWeightMsgEnableTokenizeShares = "op_weight_msg_enable_tokenize_shares" //nolint:gosec + ) // WeightedOperations returns all the operations from the module with their respective weights @@ -40,12 +55,18 @@ func WeightedOperations( bk types.BankKeeper, k *keeper.Keeper, ) simulation.WeightedOperations { var ( - weightMsgCreateValidator int - weightMsgEditValidator int - weightMsgDelegate int - weightMsgUndelegate int - weightMsgBeginRedelegate int - weightMsgCancelUnbondingDelegation int + weightMsgCreateValidator int + weightMsgEditValidator int + weightMsgDelegate int + weightMsgUndelegate int + weightMsgBeginRedelegate int + weightMsgCancelUnbondingDelegation int + weightMsgValidatorBond int + weightMsgTokenizeShares int + weightMsgRedeemTokensforShares int + weightMsgTransferTokenizeShareRecord int + weightMsgDisableTokenizeShares int + weightMsgEnableTokenizeShares int ) appParams.GetOrGenerate(cdc, OpWeightMsgCreateValidator, &weightMsgCreateValidator, nil, @@ -84,6 +105,42 @@ func WeightedOperations( }, ) + appParams.GetOrGenerate(cdc, OpWeightMsgValidatorBond, &weightMsgValidatorBond, nil, + func(_ *rand.Rand) { + weightMsgValidatorBond = DefaultWeightMsgValidatorBond + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgTokenizeShares, &weightMsgTokenizeShares, nil, + func(_ *rand.Rand) { + weightMsgTokenizeShares = DefaultWeightMsgTokenizeShares + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgRedeemTokensforShares, &weightMsgRedeemTokensforShares, nil, + func(_ *rand.Rand) { + weightMsgRedeemTokensforShares = DefaultWeightMsgRedeemTokensforShares + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgTransferTokenizeShareRecord, &weightMsgTransferTokenizeShareRecord, nil, + func(_ *rand.Rand) { + weightMsgTransferTokenizeShareRecord = DefaultWeightMsgTransferTokenizeShareRecord + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgDisableTokenizeShares, &weightMsgDisableTokenizeShares, nil, + func(_ *rand.Rand) { + weightMsgDisableTokenizeShares = DefaultWeightMsgDisableTokenizeShares + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgEnableTokenizeShares, &weightMsgEnableTokenizeShares, nil, + func(_ *rand.Rand) { + weightMsgEnableTokenizeShares = DefaultWeightMsgEnableTokenizeShares + }, + ) + return simulation.WeightedOperations{ simulation.NewWeightedOperation( weightMsgCreateValidator, @@ -109,6 +166,30 @@ func WeightedOperations( weightMsgCancelUnbondingDelegation, SimulateMsgCancelUnbondingDelegate(ak, bk, k), ), + simulation.NewWeightedOperation( + weightMsgValidatorBond, + SimulateMsgValidatorBond(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgTokenizeShares, + SimulateMsgTokenizeShares(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgRedeemTokensforShares, + SimulateMsgRedeemTokensforShares(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgTransferTokenizeShareRecord, + SimulateMsgTransferTokenizeShareRecord(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgDisableTokenizeShares, + SimulateMsgDisableTokenizeShares(ak, bk, k), + ), + simulation.NewWeightedOperation( + weightMsgEnableTokenizeShares, + SimulateMsgEnableTokenizeShares(ak, bk, k), + ), } } @@ -319,13 +400,13 @@ func SimulateMsgUndelegate(ak types.AccountKeeper, bk types.BankKeeper, k *keepe return func( r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { - val, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + validator, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) if !ok { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "validator is not ok"), nil, nil } - valAddr := val.GetOperator() - delegations := k.GetValidatorDelegations(ctx, val.GetOperator()) + valAddr := validator.GetOperator() + delegations := k.GetValidatorDelegations(ctx, validator.GetOperator()) if delegations == nil { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "keeper does have any delegation entries"), nil, nil } @@ -338,7 +419,7 @@ func SimulateMsgUndelegate(ak types.AccountKeeper, bk types.BankKeeper, k *keepe return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "keeper does have a max unbonding delegation entries"), nil, nil } - totalBond := val.TokensFromShares(delegation.GetShares()).TruncateInt() + totalBond := validator.TokensFromShares(delegation.GetShares()).TruncateInt() if !totalBond.IsPositive() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "total bond is negative"), nil, nil } @@ -352,6 +433,19 @@ func SimulateMsgUndelegate(ak types.AccountKeeper, bk types.BankKeeper, k *keepe return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "unbond amount is zero"), nil, nil } + // if delegation is a validator bond, make sure the decrease wont cause the validator bond cap to be exceeded + if delegation.ValidatorBond { + shares, err := validator.SharesFromTokens(unbondAmt) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "unable to calculate shares from tokens"), nil, nil + } + + maxValTotalShare := validator.ValidatorBondShares.Sub(shares).Mul(k.ValidatorBondFactor(ctx)) + if validator.LiquidShares.GT(maxValTotalShare) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgUndelegate, "unbonding validator bond exceeds cap"), nil, nil + } + } + msg := types.NewMsgUndelegate( delAddr, valAddr, sdk.NewCoin(k.BondDenom(ctx), unbondAmt), ) @@ -532,6 +626,14 @@ func SimulateMsgBeginRedelegate(ak types.AccountKeeper, bk types.BankKeeper, k * return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgBeginRedelegate, "shares truncate to zero"), nil, nil // skip } + // if delegation is a validator bond, make sure the decrease wont cause the validator bond cap to be exceeded + if delegation.ValidatorBond { + maxValTotalShare := srcVal.ValidatorBondShares.Sub(shares).Mul(k.ValidatorBondFactor(ctx)) + if srcVal.LiquidShares.GT(maxValTotalShare) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgBeginRedelegate, "source validator bond exceeds cap"), nil, nil + } + } + // need to retrieve the simulation account associated with delegation to retrieve PrivKey var simAccount simtypes.Account @@ -573,3 +675,425 @@ func SimulateMsgBeginRedelegate(ak types.AccountKeeper, bk types.BankKeeper, k * return simulation.GenAndDeliverTxWithRandFees(txCtx) } } + +func SimulateMsgValidatorBond(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + // get random validator + validator, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + if !ok { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgValidatorBond, "unable to pick validator"), nil, nil + } + + valAddr := validator.GetOperator() + delegations := k.GetValidatorDelegations(ctx, validator.GetOperator()) + if delegations == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgValidatorBond, "keeper does have any delegation entries"), nil, nil + } + + // get random delegator from validator + delegation := delegations[r.Intn(len(delegations))] + delAddr := delegation.GetDelegatorAddr() + + totalBond := validator.TokensFromShares(delegation.GetShares()).TruncateInt() + if !totalBond.IsPositive() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgValidatorBond, "total bond is negative"), nil, nil + } + + // submit validator bond + msg := &types.MsgValidatorBond{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: valAddr.String(), + } + + // need to retrieve the simulation account associated with delegation to retrieve PrivKey + var simAccount simtypes.Account + + for _, simAcc := range accs { + if simAcc.Address.Equals(delAddr) { + simAccount = simAcc + break + } + } + // if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "account private key is nil"), nil, nil + } + + account := ak.GetAccount(ctx, delAddr) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgTokenizeShares generates a MsgTokenizeShares with random values +func SimulateMsgTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + // get random source validator + validator, ok := testutil.RandSliceElem(r, k.GetAllValidators(ctx)) + if !ok { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "unable to pick validator"), nil, nil + } + + srcAddr := validator.GetOperator() + delegations := k.GetValidatorDelegations(ctx, srcAddr) + if delegations == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "keeper does have any delegation entries"), nil, nil + } + + // get random delegator from src validator + delegation := delegations[r.Intn(len(delegations))] + delAddr := delegation.GetDelegatorAddr() + + // make sure delegation is not a validator bond + if delegation.ValidatorBond { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "can't tokenize a validator bond"), nil, nil + } + + // make sure tokenizations are not disabled + lockStatus, _ := k.GetTokenizeSharesLock(ctx, delAddr) + if lockStatus != types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "tokenize shares disabled"), nil, nil + } + + // get random destination validator + totalBond := validator.TokensFromShares(delegation.GetShares()).TruncateInt() + if !totalBond.IsPositive() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "total bond is negative"), nil, nil + } + + tokenizeShareAmt, err := simtypes.RandPositiveInt(r, totalBond) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "unable to generate positive amount"), nil, err + } + + if tokenizeShareAmt.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "amount is zero"), nil, nil + } + + account := ak.GetAccount(ctx, delAddr) + if account, ok := account.(vesting.VestingAccount); ok { + if tokenizeShareAmt.GT(account.GetDelegatedFree().AmountOf(k.BondDenom(ctx))) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "account vests and amount exceeds free portion"), nil, nil + } + } + + // check if the shares truncate to zero + shares, err := validator.SharesFromTokens(tokenizeShareAmt) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "invalid shares"), nil, err + } + + if validator.TokensFromShares(shares).TruncateInt().IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "shares truncate to zero"), nil, nil // skip + } + + // check that tokenization would not exceed global cap + params := k.GetParams(ctx) + totalStaked := k.TotalBondedTokens(ctx).ToLegacyDec() + if totalStaked.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "cannot happened - no validators bonded if stake is 0.0"), nil, nil // skip + } + totalLiquidStaked := k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt).ToLegacyDec() + liquidStakedPercent := totalLiquidStaked.Quo(totalStaked) + if liquidStakedPercent.GT(params.GlobalLiquidStakingCap) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "global liquid staking cap exceeded"), nil, nil + } + + // check that tokenization would not exceed validator liquid staking cap + validatorTotalShares := validator.DelegatorShares.Add(shares) + validatorLiquidShares := validator.LiquidShares.Add(shares) + validatorLiquidSharesPercent := validatorLiquidShares.Quo(validatorTotalShares) + if validatorLiquidSharesPercent.GT(params.ValidatorLiquidStakingCap) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "validator liquid staking cap exceeded"), nil, nil + } + + // check that tokenization would not exceed validator bond cap + maxValidatorLiquidShares := validator.ValidatorBondShares.Mul(params.ValidatorBondFactor) + if validator.LiquidShares.Add(shares).GT(maxValidatorLiquidShares) { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "validator bond cap exceeded"), nil, nil + } + + // need to retrieve the simulation account associated with delegation to retrieve PrivKey + var simAccount simtypes.Account + + for _, simAcc := range accs { + if simAcc.Address.Equals(delAddr) { + simAccount = simAcc + break + } + } + + // if simaccount.PrivKey == nil, delegation address does not exist in accs. Return error + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "account private key is nil"), nil, nil + } + + msg := &types.MsgTokenizeShares{ + DelegatorAddress: delAddr.String(), + ValidatorAddress: srcAddr.String(), + Amount: sdk.NewCoin(k.BondDenom(ctx), tokenizeShareAmt), + TokenizedShareOwner: delAddr.String(), + } + + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgRedeemTokensforShares generates a MsgRedeemTokensforShares with random values +func SimulateMsgRedeemTokensforShares(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + redeemUser := simtypes.Account{} + redeemCoin := sdk.Coin{} + tokenizeShareRecord := types.TokenizeShareRecord{} + + records := k.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + balance := bk.GetBalance(ctx, acc.Address, record.GetShareTokenDenom()) + if balance.Amount.IsPositive() { + redeemUser = acc + redeemAmount, err := simtypes.RandPositiveInt(r, balance.Amount) + if err == nil { + redeemCoin = sdk.NewCoin(record.GetShareTokenDenom(), redeemAmount) + tokenizeShareRecord = record + } + break + } + } + } + + // if redeemUser.PrivKey == nil, redeem user does not exist in accs + if redeemUser.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "account private key is nil"), nil, nil + } + + if redeemCoin.Amount.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "empty balance in tokens"), nil, nil + } + + valAddress, err := sdk.ValAddressFromBech32(tokenizeShareRecord.Validator) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "invalid validator address"), nil, fmt.Errorf("invalid validator address") + } + validator, found := k.GetValidator(ctx, valAddress) + if !found { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "validator not found"), nil, fmt.Errorf("validator not found") + } + delegation, found := k.GetDelegation(ctx, tokenizeShareRecord.GetModuleAddress(), valAddress) + if !found { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "delegation not found"), nil, fmt.Errorf("delegation not found") + } + + // prevent redemption that returns a 0 amount + shareDenomSupply := bk.GetSupply(ctx, tokenizeShareRecord.GetShareTokenDenom()) + shares := delegation.Shares.Mul(sdk.NewDecFromInt(redeemCoin.Amount)).QuoInt(shareDenomSupply.Amount) + + if validator.TokensFromShares(shares).TruncateInt().IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgRedeemTokensForShares, "zero tokens returned"), nil, nil + } + + account := ak.GetAccount(ctx, redeemUser.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + msg := &types.MsgRedeemTokensForShares{ + DelegatorAddress: redeemUser.Address.String(), + Amount: redeemCoin, + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: redeemUser, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// SimulateMsgTransferTokenizeShareRecord generates a MsgTransferTokenizeShareRecord with random values +func SimulateMsgTransferTokenizeShareRecord(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + destAccount, _ := simtypes.RandomAcc(r, accs) + transferRecord := types.TokenizeShareRecord{} + + records := k.GetAllTokenizeShareRecords(ctx) + if len(records) > 0 { + record := records[r.Intn(len(records))] + for _, acc := range accs { + if record.Owner == acc.Address.String() { + simAccount = acc + transferRecord = record + break + } + } + } + + // if simAccount.PrivKey == nil, record owner does not exist in accs + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferTokenizeShareRecord, "account private key is nil"), nil, nil + } + + if transferRecord.Id == 0 { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTransferTokenizeShareRecord, "share record not found"), nil, nil + } + + account := ak.GetAccount(ctx, simAccount.Address) + spendable := bk.SpendableCoins(ctx, account.GetAddress()) + + msg := &types.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: transferRecord.Id, + Sender: simAccount.Address.String(), + NewOwner: destAccount.Address.String(), + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: spendable, + } + + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +func SimulateMsgDisableTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDisableTokenizeShares, "account private key is nil"), nil, nil + } + + balance := bk.GetBalance(ctx, simAccount.Address, k.GetParams(ctx).BondDenom).Amount + if !balance.IsPositive() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDisableTokenizeShares, "balance is negative"), nil, nil + } + + lockStatus, _ := k.GetTokenizeSharesLock(ctx, simAccount.Address) + if lockStatus == types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgDisableTokenizeShares, "account already locked"), nil, nil + } + + msg := &types.MsgDisableTokenizeShares{ + DelegatorAddress: simAccount.Address.String(), + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + } + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +func SimulateMsgEnableTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k *keeper.Keeper) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + + if simAccount.PrivKey == nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEnableTokenizeShares, "account private key is nil"), nil, nil + } + + balance := bk.GetBalance(ctx, simAccount.Address, k.GetParams(ctx).BondDenom).Amount + if !balance.IsPositive() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEnableTokenizeShares, "balance is negative"), nil, nil + } + + lockStatus, _ := k.GetTokenizeSharesLock(ctx, simAccount.Address) + if lockStatus != types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgEnableTokenizeShares, "account is not locked"), nil, nil + } + + msg := &types.MsgEnableTokenizeShares{ + DelegatorAddress: simAccount.Address.String(), + } + + txCtx := simulation.OperationInput{ + R: r, + App: app, + TxGen: moduletestutil.MakeTestEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + } + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index de7bbb4f05ee..05b780be9565 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -137,6 +137,12 @@ func (s *SimTestSuite) TestWeightedOperations() { {simulation.DefaultWeightMsgUndelegate, types.ModuleName, types.TypeMsgUndelegate}, {simulation.DefaultWeightMsgBeginRedelegate, types.ModuleName, types.TypeMsgBeginRedelegate}, {simulation.DefaultWeightMsgCancelUnbondingDelegation, types.ModuleName, types.TypeMsgCancelUnbondingDelegation}, + {simulation.DefaultWeightMsgValidatorBond, types.ModuleName, types.TypeMsgValidatorBond}, + {simulation.DefaultWeightMsgTokenizeShares, types.ModuleName, types.TypeMsgTokenizeShares}, + {simulation.DefaultWeightMsgRedeemTokensforShares, types.ModuleName, types.TypeMsgRedeemTokensForShares}, + {simulation.DefaultWeightMsgTransferTokenizeShareRecord, types.ModuleName, types.TypeMsgTransferTokenizeShareRecord}, + {simulation.DefaultWeightMsgDisableTokenizeShares, types.ModuleName, types.TypeMsgDisableTokenizeShares}, + {simulation.DefaultWeightMsgEnableTokenizeShares, types.ModuleName, types.TypeMsgEnableTokenizeShares}, } for i, w := range weightesOps { diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index e15eb1eb57ed..225c6ca0deac 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -289,6 +289,20 @@ func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) } +// SendCoinsFromAccountToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx types.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} + // SendCoinsFromModuleToAccount mocks base method. func (m *MockBankKeeper) SendCoinsFromModuleToAccount(ctx types.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { m.ctrl.T.Helper() diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 11c9aec9e860..9a8813bde2ac 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -23,6 +23,13 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate") legacy.RegisterAminoMsg(cdc, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation") legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/staking/MsgUpdateParams") + legacy.RegisterAminoMsg(cdc, &MsgValidatorBond{}, "cosmos-sdk/MsgValidatorBond") + legacy.RegisterAminoMsg(cdc, &MsgUnbondValidator{}, "cosmos-sdk/MsgUnbondValidator") + legacy.RegisterAminoMsg(cdc, &MsgTokenizeShares{}, "cosmos-sdk/MsgTokenizeShares") + legacy.RegisterAminoMsg(cdc, &MsgRedeemTokensForShares{}, "cosmos-sdk/MsgRedeemTokensForShares") + legacy.RegisterAminoMsg(cdc, &MsgTransferTokenizeShareRecord{}, "cosmos-sdk/MsgTransferTokenizeRecord") + legacy.RegisterAminoMsg(cdc, &MsgDisableTokenizeShares{}, "cosmos-sdk/MsgDisableTokenizeShares") + legacy.RegisterAminoMsg(cdc, &MsgEnableTokenizeShares{}, "cosmos-sdk/MsgEnableTokenizeShares") cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil) cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil) @@ -41,6 +48,13 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { &MsgBeginRedelegate{}, &MsgCancelUnbondingDelegation{}, &MsgUpdateParams{}, + &MsgValidatorBond{}, + &MsgUnbondValidator{}, + &MsgTokenizeShares{}, + &MsgRedeemTokensForShares{}, + &MsgTransferTokenizeShareRecord{}, + &MsgDisableTokenizeShares{}, + &MsgEnableTokenizeShares{}, ) registry.RegisterImplementations( (*authz.Authorization)(nil), diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index 1242e1c46182..513eb6974ab5 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -351,11 +351,16 @@ func (d Redelegations) String() (out string) { // NewDelegationResp creates a new DelegationResponse instance func NewDelegationResp( - delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, balance sdk.Coin, + delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, shares sdk.Dec, validatorBond bool, balance sdk.Coin, ) DelegationResponse { return DelegationResponse{ - Delegation: NewDelegation(delegatorAddr, validatorAddr, shares), - Balance: balance, + Delegation: Delegation{ + DelegatorAddress: delegatorAddr.String(), + ValidatorAddress: validatorAddr.String(), + Shares: shares, + ValidatorBond: validatorBond, + }, + Balance: balance, } } diff --git a/x/staking/types/delegation_test.go b/x/staking/types/delegation_test.go index ae1519baa347..7dd7cd202dd7 100644 --- a/x/staking/types/delegation_test.go +++ b/x/staking/types/delegation_test.go @@ -82,9 +82,9 @@ func TestRedelegationString(t *testing.T) { func TestDelegationResponses(t *testing.T) { cdc := codec.NewLegacyAmino() - dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr2, math.LegacyNewDec(5), + dr1 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr2, math.LegacyNewDec(5), false, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5))) - dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr3, math.LegacyNewDec(5), + dr2 := types.NewDelegationResp(sdk.AccAddress(valAddr1), valAddr3, math.LegacyNewDec(5), false, sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(5))) drs := types.DelegationResponses{dr1, dr2} diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 0220dfa1e79f..4a465895f1f7 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -36,6 +36,7 @@ type BankKeeper interface { SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error DelegateCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error diff --git a/x/staking/types/exported.go b/x/staking/types/exported.go index bf83ab09a76a..b9963ec61ad2 100644 --- a/x/staking/types/exported.go +++ b/x/staking/types/exported.go @@ -33,6 +33,7 @@ type ValidatorI interface { GetCommission() math.LegacyDec // validator commission rate GetMinSelfDelegation() math.Int // validator minimum self delegation GetDelegatorShares() math.LegacyDec // total outstanding delegator shares + GetLiquidShares() sdk.Dec // total shares earmarked from liquid staking TokensFromShares(sdk.Dec) math.LegacyDec // token worth of provided delegator shares TokensFromSharesTruncated(sdk.Dec) math.LegacyDec // token worth of provided delegator shares, truncated TokensFromSharesRoundUp(sdk.Dec) math.LegacyDec // token worth of provided delegator shares, rounded up diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index e435c1069c70..64c08233db64 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -9,6 +9,8 @@ import ( ) // staking message types +// +//nolint:gosec // these are not hard coded credentials const ( TypeMsgUndelegate = "begin_unbonding" TypeMsgUnbondValidator = "unbond_validator" @@ -33,9 +35,16 @@ var ( _ sdk.Msg = &MsgEditValidator{} _ sdk.Msg = &MsgDelegate{} _ sdk.Msg = &MsgUndelegate{} + _ sdk.Msg = &MsgUnbondValidator{} _ sdk.Msg = &MsgBeginRedelegate{} _ sdk.Msg = &MsgCancelUnbondingDelegation{} _ sdk.Msg = &MsgUpdateParams{} + _ sdk.Msg = &MsgTokenizeShares{} + _ sdk.Msg = &MsgRedeemTokensForShares{} + _ sdk.Msg = &MsgTransferTokenizeShareRecord{} + _ sdk.Msg = &MsgDisableTokenizeShares{} + _ sdk.Msg = &MsgEnableTokenizeShares{} + _ sdk.Msg = &MsgValidatorBond{} ) // NewMsgCreateValidator creates a new MsgCreateValidator instance. diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index a32fd2d7905d..eaab8093046e 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -77,9 +77,6 @@ func TestMsgCreateValidator(t *testing.T) { {"empty pubkey", "a", "b", "c", "d", "e", commission1, math.OneInt(), valAddr1, emptyPubkey, coinPos, false}, {"empty bond", "a", "b", "c", "d", "e", commission2, math.OneInt(), valAddr1, pk1, coinZero, false}, {"nil bond", "a", "b", "c", "d", "e", commission2, math.OneInt(), valAddr1, pk1, sdk.Coin{}, false}, - {"zero min self delegation", "a", "b", "c", "d", "e", commission1, math.ZeroInt(), valAddr1, pk1, coinPos, false}, - {"negative min self delegation", "a", "b", "c", "d", "e", commission1, sdk.NewInt(-1), valAddr1, pk1, coinPos, false}, - {"delegation less than min self delegation", "a", "b", "c", "d", "e", commission1, coinPos.Amount.Add(math.OneInt()), valAddr1, pk1, coinPos, false}, } for _, tc := range tests { @@ -106,7 +103,6 @@ func TestMsgEditValidator(t *testing.T) { {"partial description", "", "", "c", "", "", valAddr1, true, math.OneInt()}, {"empty description", "", "", "", "", "", valAddr1, false, math.OneInt()}, {"empty address", "a", "b", "c", "d", "e", emptyAddr, false, math.OneInt()}, - {"nil int", "a", "b", "c", "d", "e", emptyAddr, false, math.Int{}}, } for _, tc := range tests { From a32c875ed41a170b00698ee9ba4475d27255fc71 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 29 Nov 2023 15:20:33 +0100 Subject: [PATCH 13/31] Merge with feat/lsm/v0.47.x tag LSM tests to be refactored Fix nits --- .../cosmos-sdk/client/grpc/node/query.pb.go | 533 ++ .../client/grpc/node/query.pb.gw.go | 153 + .../client/grpc/reflection/reflection.pb.go | 936 +++ .../grpc/reflection/reflection.pb.gw.go | 254 + .../client/grpc/tmservice/query.pb.go | 5457 ++++++++++++++++ .../client/grpc/tmservice/query.pb.gw.go | 669 ++ .../client/grpc/tmservice/types.pb.go | 1371 ++++ .../cosmos/cosmos-sdk/crypto/hd/hd.pb.go | 426 ++ .../cosmos-sdk/crypto/keyring/record.pb.go | 1332 ++++ .../cosmos-sdk/crypto/keys/ed25519/keys.pb.go | 505 ++ .../crypto/keys/multisig/keys.pb.go | 362 ++ .../crypto/keys/secp256k1/keys.pb.go | 503 ++ .../crypto/keys/secp256r1/keys.pb.go | 503 ++ .../cosmos-sdk/crypto/types/multisig.pb.go | 550 ++ .../grpc/reflection/v2alpha1/reflection.pb.go | 5613 +++++++++++++++++ .../reflection/v2alpha1/reflection.pb.gw.go | 478 ++ .../cosmos-sdk/snapshots/types/snapshot.pb.go | 2595 ++++++++ .../cosmos-sdk/store/types/commit_info.pb.go | 866 +++ .../cosmos-sdk/store/types/listening.pb.go | 1212 ++++ github.com/cosmos/cosmos-sdk/types/abci.pb.go | 3278 ++++++++++ github.com/cosmos/cosmos-sdk/types/coin.pb.go | 983 +++ .../cosmos/cosmos-sdk/types/kv/kv.pb.go | 557 ++ .../cosmos-sdk/types/query/pagination.pb.go | 719 +++ .../cosmos-sdk/types/tx/amino/amino.pb.go | 99 + .../cosmos/cosmos-sdk/x/auth/types/auth.pb.go | 1285 ++++ .../cosmos-sdk/x/auth/types/genesis.pb.go | 391 ++ .../cosmos-sdk/x/auth/types/query.pb.go | 4117 ++++++++++++ .../cosmos-sdk/x/auth/types/query.pb.gw.go | 990 +++ .../cosmos/cosmos-sdk/x/auth/types/tx.pb.go | 606 ++ .../cosmos/cosmos-sdk/x/authz/authz.pb.go | 1046 +++ .../cosmos/cosmos-sdk/x/authz/event.pb.go | 703 +++ .../cosmos/cosmos-sdk/x/authz/genesis.pb.go | 334 + .../cosmos/cosmos-sdk/x/authz/query.pb.go | 1873 ++++++ .../cosmos/cosmos-sdk/x/authz/query.pb.gw.go | 409 ++ github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go | 1489 +++++ .../cosmos-sdk/x/bank/types/authz.pb.go | 405 ++ .../cosmos/cosmos-sdk/x/bank/types/bank.pb.go | 2122 +++++++ .../cosmos-sdk/x/bank/types/genesis.pb.go | 818 +++ .../cosmos-sdk/x/bank/types/query.pb.go | 5508 ++++++++++++++++ .../cosmos-sdk/x/bank/types/query.pb.gw.go | 1181 ++++ .../cosmos/cosmos-sdk/x/bank/types/tx.pb.go | 1924 ++++++ .../x/capability/types/capability.pb.go | 702 +++ .../x/capability/types/genesis.pb.go | 586 ++ .../cosmos-sdk/x/consensus/types/query.pb.go | 544 ++ .../x/consensus/types/query.pb.gw.go | 153 + .../cosmos-sdk/x/consensus/types/tx.pb.go | 732 +++ .../cosmos-sdk/x/crisis/types/genesis.pb.go | 330 + .../cosmos/cosmos-sdk/x/crisis/types/tx.pb.go | 1028 +++ .../x/distribution/types/distribution.pb.go | 3585 +++++++++++ .../x/distribution/types/genesis.pb.go | 2477 ++++++++ .../x/distribution/types/query.pb.go | 4882 ++++++++++++++ .../x/distribution/types/query.pb.gw.go | 1167 ++++ .../cosmos-sdk/x/distribution/types/tx.pb.go | 3615 +++++++++++ .../x/evidence/types/evidence.pb.go | 434 ++ .../cosmos-sdk/x/evidence/types/genesis.pb.go | 333 + .../cosmos-sdk/x/evidence/types/query.pb.go | 1134 ++++ .../x/evidence/types/query.pb.gw.go | 290 + .../cosmos-sdk/x/evidence/types/tx.pb.go | 673 ++ .../cosmos-sdk/x/feegrant/feegrant.pb.go | 1349 ++++ .../cosmos-sdk/x/feegrant/genesis.pb.go | 334 + .../cosmos/cosmos-sdk/x/feegrant/query.pb.go | 1700 +++++ .../cosmos-sdk/x/feegrant/query.pb.gw.go | 449 ++ .../cosmos/cosmos-sdk/x/feegrant/tx.pb.go | 1043 +++ .../cosmos-sdk/x/genutil/types/genesis.pb.go | 331 + .../cosmos-sdk/x/gov/types/v1/genesis.pb.go | 754 +++ .../cosmos-sdk/x/gov/types/v1/gov.pb.go | 3618 +++++++++++ .../cosmos-sdk/x/gov/types/v1/query.pb.go | 4036 ++++++++++++ .../cosmos-sdk/x/gov/types/v1/query.pb.gw.go | 958 +++ .../cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go | 3054 +++++++++ .../x/gov/types/v1beta1/genesis.pb.go | 669 ++ .../cosmos-sdk/x/gov/types/v1beta1/gov.pb.go | 2852 +++++++++ .../x/gov/types/v1beta1/query.pb.go | 3866 ++++++++++++ .../x/gov/types/v1beta1/query.pb.gw.go | 958 +++ .../cosmos-sdk/x/gov/types/v1beta1/tx.pb.go | 1908 ++++++ .../cosmos/cosmos-sdk/x/group/events.pb.go | 1992 ++++++ .../cosmos/cosmos-sdk/x/group/genesis.pb.go | 702 +++ .../slashing/keeper/keeper_test.go | 62 - x/slashing/keeper/hooks.go | 2 +- x/slashing/keeper/unjail.go | 9 - x/slashing/simulation/operations_test.go | 6 +- x/staking/keeper/params.go | 1 - .../keeper/tokenize_share_record_test.go | 3 +- 82 files changed, 108400 insertions(+), 76 deletions(-) create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/store/types/listening.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/types/abci.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/types/coin.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/event.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go create mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/group/events.pb.go create mode 100644 github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go new file mode 100644 index 000000000000..e0c097fd8ef6 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/node/v1beta1/query.proto + +package node + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// ConfigRequest defines the request structure for the Config gRPC query. +type ConfigRequest struct { +} + +func (m *ConfigRequest) Reset() { *m = ConfigRequest{} } +func (m *ConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ConfigRequest) ProtoMessage() {} +func (*ConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8324226a07064341, []int{0} +} +func (m *ConfigRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigRequest.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 *ConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigRequest.Merge(m, src) +} +func (m *ConfigRequest) XXX_Size() int { + return m.Size() +} +func (m *ConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo + +// ConfigResponse defines the response structure for the Config gRPC query. +type ConfigResponse struct { + MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` +} + +func (m *ConfigResponse) Reset() { *m = ConfigResponse{} } +func (m *ConfigResponse) String() string { return proto.CompactTextString(m) } +func (*ConfigResponse) ProtoMessage() {} +func (*ConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8324226a07064341, []int{1} +} +func (m *ConfigResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigResponse.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 *ConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigResponse.Merge(m, src) +} +func (m *ConfigResponse) XXX_Size() int { + return m.Size() +} +func (m *ConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigResponse proto.InternalMessageInfo + +func (m *ConfigResponse) GetMinimumGasPrice() string { + if m != nil { + return m.MinimumGasPrice + } + return "" +} + +func init() { + proto.RegisterType((*ConfigRequest)(nil), "cosmos.base.node.v1beta1.ConfigRequest") + proto.RegisterType((*ConfigResponse)(nil), "cosmos.base.node.v1beta1.ConfigResponse") +} + +func init() { + proto.RegisterFile("cosmos/base/node/v1beta1/query.proto", fileDescriptor_8324226a07064341) +} + +var fileDescriptor_8324226a07064341 = []byte{ + // 282 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4b, 0xc3, 0x40, + 0x18, 0xc5, 0x73, 0x0e, 0x15, 0x0f, 0xb4, 0x98, 0xa9, 0x14, 0x39, 0x4a, 0x10, 0x0c, 0x42, 0xef, + 0xa8, 0xae, 0x4e, 0x3a, 0x74, 0x95, 0xba, 0xb9, 0x94, 0xcb, 0xf5, 0xf3, 0x3c, 0x6c, 0xee, 0x4b, + 0x73, 0x97, 0x82, 0xab, 0xe0, 0xae, 0xf8, 0x4f, 0x39, 0x16, 0x5c, 0x1c, 0x25, 0xf1, 0x0f, 0x91, + 0x24, 0xed, 0xe0, 0x50, 0x3a, 0x1d, 0xbc, 0xfb, 0xbd, 0xf7, 0x3d, 0x1e, 0x3d, 0x55, 0xe8, 0x52, + 0x74, 0x22, 0x91, 0x0e, 0x84, 0xc5, 0x19, 0x88, 0xe5, 0x28, 0x01, 0x2f, 0x47, 0x62, 0x51, 0x40, + 0xfe, 0xcc, 0xb3, 0x1c, 0x3d, 0x86, 0xbd, 0x96, 0xe2, 0x35, 0xc5, 0x6b, 0x8a, 0xaf, 0xa9, 0xfe, + 0x89, 0x46, 0xd4, 0x73, 0x10, 0x32, 0x33, 0x42, 0x5a, 0x8b, 0x5e, 0x7a, 0x83, 0xd6, 0xb5, 0xbe, + 0xa8, 0x4b, 0x0f, 0x6f, 0xd0, 0x3e, 0x18, 0x3d, 0x81, 0x45, 0x01, 0xce, 0x47, 0x57, 0xf4, 0x68, + 0x23, 0xb8, 0x0c, 0xad, 0x83, 0xf0, 0x9c, 0x1e, 0xa7, 0xc6, 0x9a, 0xb4, 0x48, 0xa7, 0x5a, 0xba, + 0x69, 0x96, 0x1b, 0x05, 0x3d, 0x32, 0x20, 0xf1, 0xc1, 0xa4, 0xbb, 0xfe, 0x18, 0x4b, 0x77, 0x5b, + 0xcb, 0x17, 0xef, 0x84, 0xee, 0xdf, 0x41, 0xbe, 0x34, 0x0a, 0xc2, 0x57, 0x42, 0x3b, 0x6d, 0x54, + 0x78, 0xc6, 0xb7, 0xd5, 0xe3, 0xff, 0xae, 0xf7, 0xe3, 0xdd, 0x60, 0xdb, 0x2a, 0x8a, 0x5f, 0xbe, + 0x7e, 0x3f, 0xf6, 0xa2, 0x70, 0x20, 0xb6, 0xee, 0xa3, 0x1a, 0xc7, 0xf5, 0xf8, 0xb3, 0x64, 0x64, + 0x55, 0x32, 0xf2, 0x53, 0x32, 0xf2, 0x56, 0xb1, 0x60, 0x55, 0xb1, 0xe0, 0xbb, 0x62, 0xc1, 0xfd, + 0x50, 0x1b, 0xff, 0x58, 0x24, 0x5c, 0x61, 0xba, 0x49, 0x69, 0x9f, 0xa1, 0x9b, 0x3d, 0x09, 0x35, + 0x37, 0x60, 0xbd, 0xd0, 0x79, 0xa6, 0x9a, 0xdc, 0xa4, 0xd3, 0x4c, 0x76, 0xf9, 0x17, 0x00, 0x00, + 0xff, 0xff, 0x7d, 0x46, 0xb4, 0x93, 0x92, 0x01, 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 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServiceClient interface { + // Config queries for the operator configuration. + Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) +} + +type serviceClient struct { + cc grpc1.ClientConn +} + +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) { + out := new(ConfigResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.node.v1beta1.Service/Config", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +type ServiceServer interface { + // Config queries for the operator configuration. + Config(context.Context, *ConfigRequest) (*ConfigResponse, error) +} + +// UnimplementedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (*UnimplementedServiceServer) Config(ctx context.Context, req *ConfigRequest) (*ConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") +} + +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Config(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.node.v1beta1.Service/Config", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Config(ctx, req.(*ConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.node.v1beta1.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Config", + Handler: _Service_Config_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/node/v1beta1/query.proto", +} + +func (m *ConfigRequest) 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 *ConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ConfigResponse) 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 *ConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MinimumGasPrice) > 0 { + i -= len(m.MinimumGasPrice) + copy(dAtA[i:], m.MinimumGasPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MinimumGasPrice))) + 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 *ConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MinimumGasPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + 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 *ConfigRequest) 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: ConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigResponse) 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: ConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", 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.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go new file mode 100644 index 000000000000..c579f6e54575 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/base/node/v1beta1/query.proto + +/* +Package node is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package node + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfigRequest + var metadata runtime.ServerMetadata + + msg, err := client.Config(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfigRequest + var metadata runtime.ServerMetadata + + msg, err := server.Config(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterServiceHandlerServer registers the http handlers for service Service to "mux". +// UnaryRPC :call ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. +func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { + + mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_Config_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterServiceHandler(ctx, mux, conn) +} + +// RegisterServiceHandler registers the http handlers for service Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) +} + +// RegisterServiceHandlerClient registers the http handlers for service Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ServiceClient" to call the correct interceptors. +func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { + + mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_Config_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Service_Config_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v1beta1", "config"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Service_Config_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go new file mode 100644 index 000000000000..3c207e94fefc --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go @@ -0,0 +1,936 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/reflection/v1beta1/reflection.proto + +package reflection + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +type ListAllInterfacesRequest struct { +} + +func (m *ListAllInterfacesRequest) Reset() { *m = ListAllInterfacesRequest{} } +func (m *ListAllInterfacesRequest) String() string { return proto.CompactTextString(m) } +func (*ListAllInterfacesRequest) ProtoMessage() {} +func (*ListAllInterfacesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d48c054165687f5c, []int{0} +} +func (m *ListAllInterfacesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListAllInterfacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListAllInterfacesRequest.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 *ListAllInterfacesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAllInterfacesRequest.Merge(m, src) +} +func (m *ListAllInterfacesRequest) XXX_Size() int { + return m.Size() +} +func (m *ListAllInterfacesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListAllInterfacesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAllInterfacesRequest proto.InternalMessageInfo + +// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +type ListAllInterfacesResponse struct { + // interface_names is an array of all the registered interfaces. + InterfaceNames []string `protobuf:"bytes,1,rep,name=interface_names,json=interfaceNames,proto3" json:"interface_names,omitempty"` +} + +func (m *ListAllInterfacesResponse) Reset() { *m = ListAllInterfacesResponse{} } +func (m *ListAllInterfacesResponse) String() string { return proto.CompactTextString(m) } +func (*ListAllInterfacesResponse) ProtoMessage() {} +func (*ListAllInterfacesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d48c054165687f5c, []int{1} +} +func (m *ListAllInterfacesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListAllInterfacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListAllInterfacesResponse.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 *ListAllInterfacesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAllInterfacesResponse.Merge(m, src) +} +func (m *ListAllInterfacesResponse) XXX_Size() int { + return m.Size() +} +func (m *ListAllInterfacesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListAllInterfacesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAllInterfacesResponse proto.InternalMessageInfo + +func (m *ListAllInterfacesResponse) GetInterfaceNames() []string { + if m != nil { + return m.InterfaceNames + } + return nil +} + +// ListImplementationsRequest is the request type of the ListImplementations +// RPC. +type ListImplementationsRequest struct { + // interface_name defines the interface to query the implementations for. + InterfaceName string `protobuf:"bytes,1,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"` +} + +func (m *ListImplementationsRequest) Reset() { *m = ListImplementationsRequest{} } +func (m *ListImplementationsRequest) String() string { return proto.CompactTextString(m) } +func (*ListImplementationsRequest) ProtoMessage() {} +func (*ListImplementationsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d48c054165687f5c, []int{2} +} +func (m *ListImplementationsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListImplementationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListImplementationsRequest.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 *ListImplementationsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListImplementationsRequest.Merge(m, src) +} +func (m *ListImplementationsRequest) XXX_Size() int { + return m.Size() +} +func (m *ListImplementationsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListImplementationsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListImplementationsRequest proto.InternalMessageInfo + +func (m *ListImplementationsRequest) GetInterfaceName() string { + if m != nil { + return m.InterfaceName + } + return "" +} + +// ListImplementationsResponse is the response type of the ListImplementations +// RPC. +type ListImplementationsResponse struct { + ImplementationMessageNames []string `protobuf:"bytes,1,rep,name=implementation_message_names,json=implementationMessageNames,proto3" json:"implementation_message_names,omitempty"` +} + +func (m *ListImplementationsResponse) Reset() { *m = ListImplementationsResponse{} } +func (m *ListImplementationsResponse) String() string { return proto.CompactTextString(m) } +func (*ListImplementationsResponse) ProtoMessage() {} +func (*ListImplementationsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d48c054165687f5c, []int{3} +} +func (m *ListImplementationsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListImplementationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListImplementationsResponse.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 *ListImplementationsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListImplementationsResponse.Merge(m, src) +} +func (m *ListImplementationsResponse) XXX_Size() int { + return m.Size() +} +func (m *ListImplementationsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ListImplementationsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ListImplementationsResponse proto.InternalMessageInfo + +func (m *ListImplementationsResponse) GetImplementationMessageNames() []string { + if m != nil { + return m.ImplementationMessageNames + } + return nil +} + +func init() { + proto.RegisterType((*ListAllInterfacesRequest)(nil), "cosmos.base.reflection.v1beta1.ListAllInterfacesRequest") + proto.RegisterType((*ListAllInterfacesResponse)(nil), "cosmos.base.reflection.v1beta1.ListAllInterfacesResponse") + proto.RegisterType((*ListImplementationsRequest)(nil), "cosmos.base.reflection.v1beta1.ListImplementationsRequest") + proto.RegisterType((*ListImplementationsResponse)(nil), "cosmos.base.reflection.v1beta1.ListImplementationsResponse") +} + +func init() { + proto.RegisterFile("cosmos/base/reflection/v1beta1/reflection.proto", fileDescriptor_d48c054165687f5c) +} + +var fileDescriptor_d48c054165687f5c = []byte{ + // 395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x4a, 0x4d, 0xcb, 0x49, 0x4d, 0x2e, 0xc9, + 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x12, 0xd2, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x92, 0x83, 0x68, 0xd0, 0x03, 0x69, 0xd0, 0x43, 0x92, 0x85, 0x6a, 0x90, 0x92, + 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, + 0x49, 0x04, 0x49, 0x17, 0x43, 0x74, 0x2b, 0x49, 0x71, 0x49, 0xf8, 0x64, 0x16, 0x97, 0x38, 0xe6, + 0xe4, 0x78, 0xe6, 0x95, 0xa4, 0x16, 0xa5, 0x25, 0x26, 0xa7, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6, + 0x16, 0x97, 0x28, 0xb9, 0x70, 0x49, 0x62, 0x91, 0x2b, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, + 0xe7, 0xe2, 0xcf, 0x84, 0x89, 0xc6, 0xe7, 0x25, 0xe6, 0xa6, 0x16, 0x4b, 0x30, 0x2a, 0x30, 0x6b, + 0x70, 0x06, 0xf1, 0xc1, 0x85, 0xfd, 0x40, 0xa2, 0x4a, 0xce, 0x5c, 0x52, 0x20, 0x53, 0x3c, 0x73, + 0x0b, 0x72, 0x52, 0x73, 0x53, 0xf3, 0xa0, 0xd6, 0x43, 0xed, 0x10, 0x52, 0xe5, 0xe2, 0x43, 0x35, + 0x46, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0x17, 0xc5, 0x14, 0xa5, 0x78, 0x2e, 0x69, 0xac, + 0x86, 0x40, 0x1d, 0xe3, 0xc0, 0x25, 0x93, 0x89, 0x22, 0x15, 0x9f, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, + 0x8e, 0xea, 0x32, 0x29, 0x54, 0x35, 0xbe, 0x10, 0x25, 0x60, 0x57, 0x1a, 0xed, 0x60, 0xe6, 0x12, + 0x0c, 0x82, 0x07, 0x5e, 0x70, 0x6a, 0x51, 0x59, 0x66, 0x72, 0xaa, 0xd0, 0x1e, 0x46, 0x2e, 0x41, + 0x8c, 0x20, 0x10, 0xb2, 0xd0, 0xc3, 0x1f, 0xe4, 0x7a, 0xb8, 0x42, 0x54, 0xca, 0x92, 0x0c, 0x9d, + 0x10, 0x2f, 0x2a, 0x19, 0x35, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x47, 0x48, 0x8b, 0x50, 0x02, 0xc9, + 0x44, 0x38, 0xf4, 0x31, 0x23, 0x97, 0x30, 0x96, 0x60, 0x13, 0xb2, 0x22, 0xc6, 0x19, 0xd8, 0x23, + 0x4c, 0xca, 0x9a, 0x2c, 0xbd, 0x50, 0x4f, 0x04, 0x83, 0x3d, 0xe1, 0x2b, 0xe4, 0x4d, 0xbc, 0x27, + 0xf4, 0xab, 0x51, 0xd3, 0x47, 0xad, 0x3e, 0x6a, 0x2c, 0x16, 0x3b, 0xf9, 0x9e, 0x78, 0x24, 0xc7, + 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, + 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x71, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, + 0x7e, 0x2e, 0xcc, 0x42, 0x08, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x9f, 0x9c, 0x93, 0x99, 0x9a, 0x57, + 0xa2, 0x9f, 0x5e, 0x54, 0x90, 0x8c, 0xe4, 0x84, 0x24, 0x36, 0x70, 0xc6, 0x30, 0x06, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x32, 0x5b, 0x2b, 0x51, 0x89, 0x03, 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 + +// ReflectionServiceClient is the client API for ReflectionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ReflectionServiceClient interface { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + ListAllInterfaces(ctx context.Context, in *ListAllInterfacesRequest, opts ...grpc.CallOption) (*ListAllInterfacesResponse, error) + // ListImplementations list all the concrete types that implement a given + // interface. + ListImplementations(ctx context.Context, in *ListImplementationsRequest, opts ...grpc.CallOption) (*ListImplementationsResponse, error) +} + +type reflectionServiceClient struct { + cc grpc1.ClientConn +} + +func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { + return &reflectionServiceClient{cc} +} + +func (c *reflectionServiceClient) ListAllInterfaces(ctx context.Context, in *ListAllInterfacesRequest, opts ...grpc.CallOption) (*ListAllInterfacesResponse, error) { + out := new(ListAllInterfacesResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) ListImplementations(ctx context.Context, in *ListImplementationsRequest, opts ...grpc.CallOption) (*ListImplementationsResponse, error) { + out := new(ListImplementationsResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReflectionServiceServer is the server API for ReflectionService service. +type ReflectionServiceServer interface { + // ListAllInterfaces lists all the interfaces registered in the interface + // registry. + ListAllInterfaces(context.Context, *ListAllInterfacesRequest) (*ListAllInterfacesResponse, error) + // ListImplementations list all the concrete types that implement a given + // interface. + ListImplementations(context.Context, *ListImplementationsRequest) (*ListImplementationsResponse, error) +} + +// UnimplementedReflectionServiceServer can be embedded to have forward compatible implementations. +type UnimplementedReflectionServiceServer struct { +} + +func (*UnimplementedReflectionServiceServer) ListAllInterfaces(ctx context.Context, req *ListAllInterfacesRequest) (*ListAllInterfacesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListAllInterfaces not implemented") +} +func (*UnimplementedReflectionServiceServer) ListImplementations(ctx context.Context, req *ListImplementationsRequest) (*ListImplementationsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListImplementations not implemented") +} + +func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { + s.RegisterService(&_ReflectionService_serviceDesc, srv) +} + +func _ReflectionService_ListAllInterfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListAllInterfacesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).ListAllInterfaces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).ListAllInterfaces(ctx, req.(*ListAllInterfacesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_ListImplementations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListImplementationsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).ListImplementations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).ListImplementations(ctx, req.(*ListImplementationsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReflectionService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.reflection.v1beta1.ReflectionService", + HandlerType: (*ReflectionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListAllInterfaces", + Handler: _ReflectionService_ListAllInterfaces_Handler, + }, + { + MethodName: "ListImplementations", + Handler: _ReflectionService_ListImplementations_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/reflection/v1beta1/reflection.proto", +} + +func (m *ListAllInterfacesRequest) 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 *ListAllInterfacesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListAllInterfacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ListAllInterfacesResponse) 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 *ListAllInterfacesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListAllInterfacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InterfaceNames) > 0 { + for iNdEx := len(m.InterfaceNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.InterfaceNames[iNdEx]) + copy(dAtA[i:], m.InterfaceNames[iNdEx]) + i = encodeVarintReflection(dAtA, i, uint64(len(m.InterfaceNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ListImplementationsRequest) 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 *ListImplementationsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListImplementationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InterfaceName) > 0 { + i -= len(m.InterfaceName) + copy(dAtA[i:], m.InterfaceName) + i = encodeVarintReflection(dAtA, i, uint64(len(m.InterfaceName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ListImplementationsResponse) 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 *ListImplementationsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListImplementationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ImplementationMessageNames) > 0 { + for iNdEx := len(m.ImplementationMessageNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ImplementationMessageNames[iNdEx]) + copy(dAtA[i:], m.ImplementationMessageNames[iNdEx]) + i = encodeVarintReflection(dAtA, i, uint64(len(m.ImplementationMessageNames[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintReflection(dAtA []byte, offset int, v uint64) int { + offset -= sovReflection(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ListAllInterfacesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ListAllInterfacesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InterfaceNames) > 0 { + for _, s := range m.InterfaceNames { + l = len(s) + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *ListImplementationsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.InterfaceName) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *ListImplementationsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ImplementationMessageNames) > 0 { + for _, s := range m.ImplementationMessageNames { + l = len(s) + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func sovReflection(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozReflection(x uint64) (n int) { + return sovReflection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ListAllInterfacesRequest) 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 ErrIntOverflowReflection + } + 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: ListAllInterfacesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListAllInterfacesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListAllInterfacesResponse) 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 ErrIntOverflowReflection + } + 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: ListAllInterfacesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListAllInterfacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterfaceNames = append(m.InterfaceNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListImplementationsRequest) 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 ErrIntOverflowReflection + } + 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: ListImplementationsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListImplementationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterfaceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListImplementationsResponse) 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 ErrIntOverflowReflection + } + 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: ListImplementationsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListImplementationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ImplementationMessageNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ImplementationMessageNames = append(m.ImplementationMessageNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipReflection(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, ErrIntOverflowReflection + } + 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, ErrIntOverflowReflection + } + 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, ErrIntOverflowReflection + } + 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, ErrInvalidLengthReflection + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupReflection + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthReflection + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthReflection = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowReflection = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupReflection = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go new file mode 100644 index 000000000000..5f4cad169cf0 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go @@ -0,0 +1,254 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/base/reflection/v1beta1/reflection.proto + +/* +Package reflection is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package reflection + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_ReflectionService_ListAllInterfaces_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAllInterfacesRequest + var metadata runtime.ServerMetadata + + msg, err := client.ListAllInterfaces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_ListAllInterfaces_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListAllInterfacesRequest + var metadata runtime.ServerMetadata + + msg, err := server.ListAllInterfaces(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_ListImplementations_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListImplementationsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["interface_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "interface_name") + } + + protoReq.InterfaceName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "interface_name", err) + } + + msg, err := client.ListImplementations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_ListImplementations_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListImplementationsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["interface_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "interface_name") + } + + protoReq.InterfaceName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "interface_name", err) + } + + msg, err := server.ListImplementations(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterReflectionServiceHandlerServer registers the http handlers for service ReflectionService to "mux". +// UnaryRPC :call ReflectionServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReflectionServiceHandlerFromEndpoint instead. +func RegisterReflectionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReflectionServiceServer) error { + + mux.Handle("GET", pattern_ReflectionService_ListAllInterfaces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_ListAllInterfaces_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_ListAllInterfaces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_ListImplementations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_ListImplementations_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_ListImplementations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterReflectionServiceHandlerFromEndpoint is same as RegisterReflectionServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterReflectionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterReflectionServiceHandler(ctx, mux, conn) +} + +// RegisterReflectionServiceHandler registers the http handlers for service ReflectionService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterReflectionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterReflectionServiceHandlerClient(ctx, mux, NewReflectionServiceClient(conn)) +} + +// RegisterReflectionServiceHandlerClient registers the http handlers for service ReflectionService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReflectionServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReflectionServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ReflectionServiceClient" to call the correct interceptors. +func RegisterReflectionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReflectionServiceClient) error { + + mux.Handle("GET", pattern_ReflectionService_ListAllInterfaces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_ListAllInterfaces_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_ListAllInterfaces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_ListImplementations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_ListImplementations_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_ListImplementations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ReflectionService_ListAllInterfaces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "reflection", "v1beta1", "interfaces"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_ListImplementations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"cosmos", "base", "reflection", "v1beta1", "interfaces", "interface_name", "implementations"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_ReflectionService_ListAllInterfaces_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_ListImplementations_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go new file mode 100644 index 000000000000..a94b274ac04a --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go @@ -0,0 +1,5457 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/tendermint/v1beta1/query.proto + +package tmservice + +import ( + context "context" + fmt "fmt" + p2p "github.com/cometbft/cometbft/proto/tendermint/p2p" + types1 "github.com/cometbft/cometbft/proto/tendermint/types" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +type GetValidatorSetByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *GetValidatorSetByHeightRequest) Reset() { *m = GetValidatorSetByHeightRequest{} } +func (m *GetValidatorSetByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*GetValidatorSetByHeightRequest) ProtoMessage() {} +func (*GetValidatorSetByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{0} +} +func (m *GetValidatorSetByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetValidatorSetByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetValidatorSetByHeightRequest.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 *GetValidatorSetByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetValidatorSetByHeightRequest.Merge(m, src) +} +func (m *GetValidatorSetByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *GetValidatorSetByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetValidatorSetByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetValidatorSetByHeightRequest proto.InternalMessageInfo + +func (m *GetValidatorSetByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *GetValidatorSetByHeightRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +type GetValidatorSetByHeightResponse struct { + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *GetValidatorSetByHeightResponse) Reset() { *m = GetValidatorSetByHeightResponse{} } +func (m *GetValidatorSetByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*GetValidatorSetByHeightResponse) ProtoMessage() {} +func (*GetValidatorSetByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{1} +} +func (m *GetValidatorSetByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetValidatorSetByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetValidatorSetByHeightResponse.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 *GetValidatorSetByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetValidatorSetByHeightResponse.Merge(m, src) +} +func (m *GetValidatorSetByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *GetValidatorSetByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetValidatorSetByHeightResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetValidatorSetByHeightResponse proto.InternalMessageInfo + +func (m *GetValidatorSetByHeightResponse) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *GetValidatorSetByHeightResponse) GetValidators() []*Validator { + if m != nil { + return m.Validators + } + return nil +} + +func (m *GetValidatorSetByHeightResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +type GetLatestValidatorSetRequest struct { + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *GetLatestValidatorSetRequest) Reset() { *m = GetLatestValidatorSetRequest{} } +func (m *GetLatestValidatorSetRequest) String() string { return proto.CompactTextString(m) } +func (*GetLatestValidatorSetRequest) ProtoMessage() {} +func (*GetLatestValidatorSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{2} +} +func (m *GetLatestValidatorSetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetLatestValidatorSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetLatestValidatorSetRequest.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 *GetLatestValidatorSetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestValidatorSetRequest.Merge(m, src) +} +func (m *GetLatestValidatorSetRequest) XXX_Size() int { + return m.Size() +} +func (m *GetLatestValidatorSetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestValidatorSetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestValidatorSetRequest proto.InternalMessageInfo + +func (m *GetLatestValidatorSetRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +type GetLatestValidatorSetResponse struct { + BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *GetLatestValidatorSetResponse) Reset() { *m = GetLatestValidatorSetResponse{} } +func (m *GetLatestValidatorSetResponse) String() string { return proto.CompactTextString(m) } +func (*GetLatestValidatorSetResponse) ProtoMessage() {} +func (*GetLatestValidatorSetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{3} +} +func (m *GetLatestValidatorSetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetLatestValidatorSetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetLatestValidatorSetResponse.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 *GetLatestValidatorSetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestValidatorSetResponse.Merge(m, src) +} +func (m *GetLatestValidatorSetResponse) XXX_Size() int { + return m.Size() +} +func (m *GetLatestValidatorSetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestValidatorSetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestValidatorSetResponse proto.InternalMessageInfo + +func (m *GetLatestValidatorSetResponse) GetBlockHeight() int64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +func (m *GetLatestValidatorSetResponse) GetValidators() []*Validator { + if m != nil { + return m.Validators + } + return nil +} + +func (m *GetLatestValidatorSetResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// Validator is the type for the validator-set. +type Validator struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` + ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` +} + +func (m *Validator) Reset() { *m = Validator{} } +func (m *Validator) String() string { return proto.CompactTextString(m) } +func (*Validator) ProtoMessage() {} +func (*Validator) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{4} +} +func (m *Validator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Validator.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 *Validator) XXX_Merge(src proto.Message) { + xxx_messageInfo_Validator.Merge(m, src) +} +func (m *Validator) XXX_Size() int { + return m.Size() +} +func (m *Validator) XXX_DiscardUnknown() { + xxx_messageInfo_Validator.DiscardUnknown(m) +} + +var xxx_messageInfo_Validator proto.InternalMessageInfo + +func (m *Validator) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Validator) GetPubKey() *types.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *Validator) GetVotingPower() int64 { + if m != nil { + return m.VotingPower + } + return 0 +} + +func (m *Validator) GetProposerPriority() int64 { + if m != nil { + return m.ProposerPriority + } + return 0 +} + +// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +type GetBlockByHeightRequest struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *GetBlockByHeightRequest) Reset() { *m = GetBlockByHeightRequest{} } +func (m *GetBlockByHeightRequest) String() string { return proto.CompactTextString(m) } +func (*GetBlockByHeightRequest) ProtoMessage() {} +func (*GetBlockByHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{5} +} +func (m *GetBlockByHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetBlockByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetBlockByHeightRequest.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 *GetBlockByHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockByHeightRequest.Merge(m, src) +} +func (m *GetBlockByHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *GetBlockByHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockByHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockByHeightRequest proto.InternalMessageInfo + +func (m *GetBlockByHeightRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +type GetBlockByHeightResponse struct { + BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + // Deprecated: please use `sdk_block` instead + Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + // Since: cosmos-sdk 0.47 + SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` +} + +func (m *GetBlockByHeightResponse) Reset() { *m = GetBlockByHeightResponse{} } +func (m *GetBlockByHeightResponse) String() string { return proto.CompactTextString(m) } +func (*GetBlockByHeightResponse) ProtoMessage() {} +func (*GetBlockByHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{6} +} +func (m *GetBlockByHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetBlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetBlockByHeightResponse.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 *GetBlockByHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBlockByHeightResponse.Merge(m, src) +} +func (m *GetBlockByHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *GetBlockByHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetBlockByHeightResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBlockByHeightResponse proto.InternalMessageInfo + +func (m *GetBlockByHeightResponse) GetBlockId() *types1.BlockID { + if m != nil { + return m.BlockId + } + return nil +} + +func (m *GetBlockByHeightResponse) GetBlock() *types1.Block { + if m != nil { + return m.Block + } + return nil +} + +func (m *GetBlockByHeightResponse) GetSdkBlock() *Block { + if m != nil { + return m.SdkBlock + } + return nil +} + +// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +type GetLatestBlockRequest struct { +} + +func (m *GetLatestBlockRequest) Reset() { *m = GetLatestBlockRequest{} } +func (m *GetLatestBlockRequest) String() string { return proto.CompactTextString(m) } +func (*GetLatestBlockRequest) ProtoMessage() {} +func (*GetLatestBlockRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{7} +} +func (m *GetLatestBlockRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetLatestBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetLatestBlockRequest.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 *GetLatestBlockRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestBlockRequest.Merge(m, src) +} +func (m *GetLatestBlockRequest) XXX_Size() int { + return m.Size() +} +func (m *GetLatestBlockRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestBlockRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestBlockRequest proto.InternalMessageInfo + +// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +type GetLatestBlockResponse struct { + BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` + // Deprecated: please use `sdk_block` instead + Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + // Since: cosmos-sdk 0.47 + SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` +} + +func (m *GetLatestBlockResponse) Reset() { *m = GetLatestBlockResponse{} } +func (m *GetLatestBlockResponse) String() string { return proto.CompactTextString(m) } +func (*GetLatestBlockResponse) ProtoMessage() {} +func (*GetLatestBlockResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{8} +} +func (m *GetLatestBlockResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetLatestBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetLatestBlockResponse.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 *GetLatestBlockResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestBlockResponse.Merge(m, src) +} +func (m *GetLatestBlockResponse) XXX_Size() int { + return m.Size() +} +func (m *GetLatestBlockResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestBlockResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestBlockResponse proto.InternalMessageInfo + +func (m *GetLatestBlockResponse) GetBlockId() *types1.BlockID { + if m != nil { + return m.BlockId + } + return nil +} + +func (m *GetLatestBlockResponse) GetBlock() *types1.Block { + if m != nil { + return m.Block + } + return nil +} + +func (m *GetLatestBlockResponse) GetSdkBlock() *Block { + if m != nil { + return m.SdkBlock + } + return nil +} + +// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +type GetSyncingRequest struct { +} + +func (m *GetSyncingRequest) Reset() { *m = GetSyncingRequest{} } +func (m *GetSyncingRequest) String() string { return proto.CompactTextString(m) } +func (*GetSyncingRequest) ProtoMessage() {} +func (*GetSyncingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{9} +} +func (m *GetSyncingRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetSyncingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetSyncingRequest.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 *GetSyncingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSyncingRequest.Merge(m, src) +} +func (m *GetSyncingRequest) XXX_Size() int { + return m.Size() +} +func (m *GetSyncingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetSyncingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSyncingRequest proto.InternalMessageInfo + +// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +type GetSyncingResponse struct { + Syncing bool `protobuf:"varint,1,opt,name=syncing,proto3" json:"syncing,omitempty"` +} + +func (m *GetSyncingResponse) Reset() { *m = GetSyncingResponse{} } +func (m *GetSyncingResponse) String() string { return proto.CompactTextString(m) } +func (*GetSyncingResponse) ProtoMessage() {} +func (*GetSyncingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{10} +} +func (m *GetSyncingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetSyncingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetSyncingResponse.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 *GetSyncingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSyncingResponse.Merge(m, src) +} +func (m *GetSyncingResponse) XXX_Size() int { + return m.Size() +} +func (m *GetSyncingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetSyncingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSyncingResponse proto.InternalMessageInfo + +func (m *GetSyncingResponse) GetSyncing() bool { + if m != nil { + return m.Syncing + } + return false +} + +// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +type GetNodeInfoRequest struct { +} + +func (m *GetNodeInfoRequest) Reset() { *m = GetNodeInfoRequest{} } +func (m *GetNodeInfoRequest) String() string { return proto.CompactTextString(m) } +func (*GetNodeInfoRequest) ProtoMessage() {} +func (*GetNodeInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{11} +} +func (m *GetNodeInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNodeInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNodeInfoRequest.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 *GetNodeInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeInfoRequest.Merge(m, src) +} +func (m *GetNodeInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *GetNodeInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNodeInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNodeInfoRequest proto.InternalMessageInfo + +// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. +type GetNodeInfoResponse struct { + DefaultNodeInfo *p2p.DefaultNodeInfo `protobuf:"bytes,1,opt,name=default_node_info,json=defaultNodeInfo,proto3" json:"default_node_info,omitempty"` + ApplicationVersion *VersionInfo `protobuf:"bytes,2,opt,name=application_version,json=applicationVersion,proto3" json:"application_version,omitempty"` +} + +func (m *GetNodeInfoResponse) Reset() { *m = GetNodeInfoResponse{} } +func (m *GetNodeInfoResponse) String() string { return proto.CompactTextString(m) } +func (*GetNodeInfoResponse) ProtoMessage() {} +func (*GetNodeInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{12} +} +func (m *GetNodeInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNodeInfoResponse.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 *GetNodeInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNodeInfoResponse.Merge(m, src) +} +func (m *GetNodeInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *GetNodeInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNodeInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNodeInfoResponse proto.InternalMessageInfo + +func (m *GetNodeInfoResponse) GetDefaultNodeInfo() *p2p.DefaultNodeInfo { + if m != nil { + return m.DefaultNodeInfo + } + return nil +} + +func (m *GetNodeInfoResponse) GetApplicationVersion() *VersionInfo { + if m != nil { + return m.ApplicationVersion + } + return nil +} + +// VersionInfo is the type for the GetNodeInfoResponse message. +type VersionInfo struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + GitCommit string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"` + BuildTags string `protobuf:"bytes,5,opt,name=build_tags,json=buildTags,proto3" json:"build_tags,omitempty"` + GoVersion string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` + BuildDeps []*Module `protobuf:"bytes,7,rep,name=build_deps,json=buildDeps,proto3" json:"build_deps,omitempty"` + // Since: cosmos-sdk 0.43 + CosmosSdkVersion string `protobuf:"bytes,8,opt,name=cosmos_sdk_version,json=cosmosSdkVersion,proto3" json:"cosmos_sdk_version,omitempty"` +} + +func (m *VersionInfo) Reset() { *m = VersionInfo{} } +func (m *VersionInfo) String() string { return proto.CompactTextString(m) } +func (*VersionInfo) ProtoMessage() {} +func (*VersionInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{13} +} +func (m *VersionInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VersionInfo.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 *VersionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_VersionInfo.Merge(m, src) +} +func (m *VersionInfo) XXX_Size() int { + return m.Size() +} +func (m *VersionInfo) XXX_DiscardUnknown() { + xxx_messageInfo_VersionInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_VersionInfo proto.InternalMessageInfo + +func (m *VersionInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *VersionInfo) GetAppName() string { + if m != nil { + return m.AppName + } + return "" +} + +func (m *VersionInfo) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *VersionInfo) GetGitCommit() string { + if m != nil { + return m.GitCommit + } + return "" +} + +func (m *VersionInfo) GetBuildTags() string { + if m != nil { + return m.BuildTags + } + return "" +} + +func (m *VersionInfo) GetGoVersion() string { + if m != nil { + return m.GoVersion + } + return "" +} + +func (m *VersionInfo) GetBuildDeps() []*Module { + if m != nil { + return m.BuildDeps + } + return nil +} + +func (m *VersionInfo) GetCosmosSdkVersion() string { + if m != nil { + return m.CosmosSdkVersion + } + return "" +} + +// Module is the type for VersionInfo +type Module struct { + // module path + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + // module version + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // checksum + Sum string `protobuf:"bytes,3,opt,name=sum,proto3" json:"sum,omitempty"` +} + +func (m *Module) Reset() { *m = Module{} } +func (m *Module) String() string { return proto.CompactTextString(m) } +func (*Module) ProtoMessage() {} +func (*Module) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{14} +} +func (m *Module) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Module.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 *Module) XXX_Merge(src proto.Message) { + xxx_messageInfo_Module.Merge(m, src) +} +func (m *Module) XXX_Size() int { + return m.Size() +} +func (m *Module) XXX_DiscardUnknown() { + xxx_messageInfo_Module.DiscardUnknown(m) +} + +var xxx_messageInfo_Module proto.InternalMessageInfo + +func (m *Module) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *Module) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Module) GetSum() string { + if m != nil { + return m.Sum + } + return "" +} + +// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +type ABCIQueryRequest struct { + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` +} + +func (m *ABCIQueryRequest) Reset() { *m = ABCIQueryRequest{} } +func (m *ABCIQueryRequest) String() string { return proto.CompactTextString(m) } +func (*ABCIQueryRequest) ProtoMessage() {} +func (*ABCIQueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{15} +} +func (m *ABCIQueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ABCIQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ABCIQueryRequest.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 *ABCIQueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABCIQueryRequest.Merge(m, src) +} +func (m *ABCIQueryRequest) XXX_Size() int { + return m.Size() +} +func (m *ABCIQueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ABCIQueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ABCIQueryRequest proto.InternalMessageInfo + +func (m *ABCIQueryRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +func (m *ABCIQueryRequest) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ABCIQueryRequest) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *ABCIQueryRequest) GetProve() bool { + if m != nil { + return m.Prove + } + return false +} + +// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +// +// Note: This type is a duplicate of the ResponseQuery proto type defined in +// Tendermint. +type ABCIQueryResponse struct { + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` + Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` + ProofOps *ProofOps `protobuf:"bytes,8,opt,name=proof_ops,json=proofOps,proto3" json:"proof_ops,omitempty"` + Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` + Codespace string `protobuf:"bytes,10,opt,name=codespace,proto3" json:"codespace,omitempty"` +} + +func (m *ABCIQueryResponse) Reset() { *m = ABCIQueryResponse{} } +func (m *ABCIQueryResponse) String() string { return proto.CompactTextString(m) } +func (*ABCIQueryResponse) ProtoMessage() {} +func (*ABCIQueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{16} +} +func (m *ABCIQueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ABCIQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ABCIQueryResponse.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 *ABCIQueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABCIQueryResponse.Merge(m, src) +} +func (m *ABCIQueryResponse) XXX_Size() int { + return m.Size() +} +func (m *ABCIQueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ABCIQueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ABCIQueryResponse proto.InternalMessageInfo + +func (m *ABCIQueryResponse) GetCode() uint32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *ABCIQueryResponse) GetLog() string { + if m != nil { + return m.Log + } + return "" +} + +func (m *ABCIQueryResponse) GetInfo() string { + if m != nil { + return m.Info + } + return "" +} + +func (m *ABCIQueryResponse) GetIndex() int64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *ABCIQueryResponse) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *ABCIQueryResponse) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *ABCIQueryResponse) GetProofOps() *ProofOps { + if m != nil { + return m.ProofOps + } + return nil +} + +func (m *ABCIQueryResponse) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *ABCIQueryResponse) GetCodespace() string { + if m != nil { + return m.Codespace + } + return "" +} + +// ProofOp defines an operation used for calculating Merkle root. The data could +// be arbitrary format, providing necessary data for example neighbouring node +// hash. +// +// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +type ProofOp struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *ProofOp) Reset() { *m = ProofOp{} } +func (m *ProofOp) String() string { return proto.CompactTextString(m) } +func (*ProofOp) ProtoMessage() {} +func (*ProofOp) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{17} +} +func (m *ProofOp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProofOp.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 *ProofOp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProofOp.Merge(m, src) +} +func (m *ProofOp) XXX_Size() int { + return m.Size() +} +func (m *ProofOp) XXX_DiscardUnknown() { + xxx_messageInfo_ProofOp.DiscardUnknown(m) +} + +var xxx_messageInfo_ProofOp proto.InternalMessageInfo + +func (m *ProofOp) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *ProofOp) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *ProofOp) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// ProofOps is Merkle proof defined by the list of ProofOps. +// +// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +type ProofOps struct { + Ops []ProofOp `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"` +} + +func (m *ProofOps) Reset() { *m = ProofOps{} } +func (m *ProofOps) String() string { return proto.CompactTextString(m) } +func (*ProofOps) ProtoMessage() {} +func (*ProofOps) Descriptor() ([]byte, []int) { + return fileDescriptor_40c93fb3ef485c5d, []int{18} +} +func (m *ProofOps) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProofOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProofOps.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 *ProofOps) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProofOps.Merge(m, src) +} +func (m *ProofOps) XXX_Size() int { + return m.Size() +} +func (m *ProofOps) XXX_DiscardUnknown() { + xxx_messageInfo_ProofOps.DiscardUnknown(m) +} + +var xxx_messageInfo_ProofOps proto.InternalMessageInfo + +func (m *ProofOps) GetOps() []ProofOp { + if m != nil { + return m.Ops + } + return nil +} + +func init() { + proto.RegisterType((*GetValidatorSetByHeightRequest)(nil), "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest") + proto.RegisterType((*GetValidatorSetByHeightResponse)(nil), "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse") + proto.RegisterType((*GetLatestValidatorSetRequest)(nil), "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest") + proto.RegisterType((*GetLatestValidatorSetResponse)(nil), "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse") + proto.RegisterType((*Validator)(nil), "cosmos.base.tendermint.v1beta1.Validator") + proto.RegisterType((*GetBlockByHeightRequest)(nil), "cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest") + proto.RegisterType((*GetBlockByHeightResponse)(nil), "cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse") + proto.RegisterType((*GetLatestBlockRequest)(nil), "cosmos.base.tendermint.v1beta1.GetLatestBlockRequest") + proto.RegisterType((*GetLatestBlockResponse)(nil), "cosmos.base.tendermint.v1beta1.GetLatestBlockResponse") + proto.RegisterType((*GetSyncingRequest)(nil), "cosmos.base.tendermint.v1beta1.GetSyncingRequest") + proto.RegisterType((*GetSyncingResponse)(nil), "cosmos.base.tendermint.v1beta1.GetSyncingResponse") + proto.RegisterType((*GetNodeInfoRequest)(nil), "cosmos.base.tendermint.v1beta1.GetNodeInfoRequest") + proto.RegisterType((*GetNodeInfoResponse)(nil), "cosmos.base.tendermint.v1beta1.GetNodeInfoResponse") + proto.RegisterType((*VersionInfo)(nil), "cosmos.base.tendermint.v1beta1.VersionInfo") + proto.RegisterType((*Module)(nil), "cosmos.base.tendermint.v1beta1.Module") + proto.RegisterType((*ABCIQueryRequest)(nil), "cosmos.base.tendermint.v1beta1.ABCIQueryRequest") + proto.RegisterType((*ABCIQueryResponse)(nil), "cosmos.base.tendermint.v1beta1.ABCIQueryResponse") + proto.RegisterType((*ProofOp)(nil), "cosmos.base.tendermint.v1beta1.ProofOp") + proto.RegisterType((*ProofOps)(nil), "cosmos.base.tendermint.v1beta1.ProofOps") +} + +func init() { + proto.RegisterFile("cosmos/base/tendermint/v1beta1/query.proto", fileDescriptor_40c93fb3ef485c5d) +} + +var fileDescriptor_40c93fb3ef485c5d = []byte{ + // 1398 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xee, 0xff, 0x4f, 0x32, 0x0d, 0xad, 0x63, 0xa5, 0x6e, 0x59, + 0x89, 0x36, 0x7d, 0xc9, 0x2e, 0x76, 0x5f, 0x0f, 0xa5, 0xa8, 0x6e, 0x4a, 0x1a, 0x5a, 0x4a, 0xd8, + 0x20, 0x0e, 0x08, 0x69, 0xb5, 0xf6, 0x4e, 0x36, 0xab, 0xd8, 0x3b, 0xd3, 0x9d, 0xb1, 0xc1, 0x42, + 0x48, 0x88, 0x0f, 0x80, 0x90, 0xf8, 0x0a, 0x3d, 0x94, 0x13, 0x1c, 0x10, 0xc7, 0x0a, 0xc4, 0xa5, + 0xc7, 0xaa, 0x48, 0xa8, 0xe2, 0x80, 0x50, 0x8b, 0xc4, 0xd7, 0x40, 0xf3, 0xb2, 0xf6, 0x6e, 0x9b, + 0xd4, 0x4e, 0x6e, 0xbd, 0x24, 0xb3, 0xcf, 0xeb, 0xef, 0xf7, 0x3c, 0x33, 0xcf, 0x8c, 0xe1, 0x74, + 0x9b, 0xb0, 0x2e, 0x61, 0x76, 0xcb, 0x63, 0xd8, 0xe6, 0x38, 0xf2, 0x71, 0xdc, 0x0d, 0x23, 0x6e, + 0xf7, 0xeb, 0x2d, 0xcc, 0xbd, 0xba, 0x7d, 0xb7, 0x87, 0xe3, 0x81, 0x45, 0x63, 0xc2, 0x09, 0xaa, + 0x29, 0x5b, 0x4b, 0xd8, 0x5a, 0x23, 0x5b, 0x4b, 0xdb, 0x56, 0xe7, 0x03, 0x12, 0x10, 0x69, 0x6a, + 0x8b, 0x95, 0xf2, 0xaa, 0x2e, 0x04, 0x84, 0x04, 0x1d, 0x6c, 0xcb, 0xaf, 0x56, 0x6f, 0xd3, 0xf6, + 0x22, 0x1d, 0xb0, 0xba, 0xa8, 0x55, 0x1e, 0x0d, 0x6d, 0x2f, 0x8a, 0x08, 0xf7, 0x78, 0x48, 0x22, + 0xa6, 0xb5, 0xd5, 0x14, 0x1c, 0xda, 0xa0, 0x36, 0x1f, 0x50, 0x9c, 0xe8, 0x16, 0x53, 0x3a, 0x29, + 0xcf, 0x68, 0x33, 0xa4, 0x24, 0x83, 0x21, 0x1f, 0xea, 0x05, 0x61, 0x24, 0xd3, 0xec, 0x64, 0xbb, + 0x43, 0x01, 0xd2, 0x71, 0x17, 0x94, 0xad, 0xab, 0x38, 0xea, 0x6a, 0xec, 0x06, 0xa8, 0xd5, 0x21, + 0xed, 0x6d, 0xad, 0x9d, 0xf3, 0xba, 0x61, 0x44, 0x6c, 0xf9, 0x57, 0x89, 0xcc, 0xaf, 0x0c, 0xa8, + 0xad, 0x62, 0xfe, 0xb1, 0xd7, 0x09, 0x7d, 0x8f, 0x93, 0x78, 0x03, 0xf3, 0xe6, 0xe0, 0x26, 0x0e, + 0x83, 0x2d, 0xee, 0xe0, 0xbb, 0x3d, 0xcc, 0x38, 0x3a, 0x0c, 0x33, 0x5b, 0x52, 0x50, 0x31, 0x8e, + 0x1b, 0x4b, 0x79, 0x47, 0x7f, 0xa1, 0x77, 0x01, 0x46, 0x34, 0x2a, 0xb9, 0xe3, 0xc6, 0x52, 0xb9, + 0x71, 0xc2, 0x4a, 0x37, 0x47, 0x75, 0x4d, 0x53, 0xb0, 0xd6, 0xbd, 0x00, 0xeb, 0x98, 0x4e, 0xca, + 0xd3, 0x7c, 0x62, 0xc0, 0xb1, 0x5d, 0x21, 0x30, 0x4a, 0x22, 0x86, 0xd1, 0x1b, 0x70, 0x50, 0x12, + 0x71, 0x33, 0x48, 0xca, 0x52, 0xa6, 0x4c, 0xd1, 0x1a, 0x40, 0x3f, 0x09, 0xc1, 0x2a, 0xb9, 0xe3, + 0xf9, 0xa5, 0x72, 0xe3, 0x94, 0xf5, 0xf2, 0xbd, 0x62, 0x0d, 0x93, 0x3a, 0x29, 0x67, 0xb4, 0x9a, + 0x61, 0x96, 0x97, 0xcc, 0x4e, 0x8e, 0x65, 0xa6, 0xa0, 0x66, 0xa8, 0x6d, 0xc2, 0xe2, 0x2a, 0xe6, + 0xb7, 0x3d, 0x8e, 0x59, 0x86, 0x5f, 0x52, 0xda, 0x6c, 0x09, 0x8d, 0x7d, 0x97, 0xf0, 0x0f, 0x03, + 0x8e, 0xee, 0x92, 0xe8, 0xd5, 0x2e, 0xe0, 0x03, 0x03, 0x4a, 0xc3, 0x14, 0xa8, 0x01, 0x05, 0xcf, + 0xf7, 0x63, 0xcc, 0x98, 0xc4, 0x5f, 0x6a, 0x56, 0x1e, 0xff, 0xb4, 0x3c, 0xaf, 0xc3, 0x5e, 0x53, + 0x9a, 0x0d, 0x1e, 0x87, 0x51, 0xe0, 0x24, 0x86, 0x68, 0x19, 0x0a, 0xb4, 0xd7, 0x72, 0xb7, 0xf1, + 0x40, 0x6f, 0xd1, 0x79, 0x4b, 0x1d, 0x77, 0x2b, 0x99, 0x04, 0xd6, 0xb5, 0x68, 0xe0, 0xcc, 0xd0, + 0x5e, 0xeb, 0x16, 0x1e, 0x88, 0x3a, 0xf5, 0x09, 0x0f, 0xa3, 0xc0, 0xa5, 0xe4, 0x33, 0x1c, 0x4b, + 0xec, 0x79, 0xa7, 0xac, 0x64, 0xeb, 0x42, 0x84, 0xce, 0xc0, 0x1c, 0x8d, 0x09, 0x25, 0x0c, 0xc7, + 0x2e, 0x8d, 0x43, 0x12, 0x87, 0x7c, 0x50, 0x99, 0x96, 0x76, 0xb3, 0x89, 0x62, 0x5d, 0xcb, 0xcd, + 0x3a, 0x1c, 0x59, 0xc5, 0xbc, 0x29, 0xca, 0x3c, 0xe1, 0xb9, 0x32, 0x7f, 0x33, 0xa0, 0xf2, 0xa2, + 0x8f, 0xee, 0xe3, 0x79, 0x28, 0xaa, 0x3e, 0x86, 0xbe, 0xde, 0x2f, 0x0b, 0xe9, 0xb6, 0xa8, 0x31, + 0x21, 0x5d, 0xd7, 0x56, 0x9c, 0x82, 0x34, 0x5d, 0xf3, 0xd1, 0x32, 0x1c, 0x90, 0x4b, 0x5d, 0x82, + 0x23, 0xbb, 0xb8, 0x38, 0xca, 0x0a, 0x35, 0xa1, 0xc4, 0xfc, 0x6d, 0x57, 0xb9, 0xa8, 0xee, 0xbd, + 0x39, 0x6e, 0x23, 0xa8, 0x00, 0x45, 0xe6, 0x6f, 0xcb, 0x95, 0x79, 0x04, 0x5e, 0x1f, 0xee, 0x48, + 0xa5, 0x53, 0xb4, 0xcd, 0x5f, 0x0d, 0x38, 0xfc, 0xbc, 0xe6, 0x55, 0x23, 0x77, 0x08, 0xe6, 0x56, + 0x31, 0xdf, 0x18, 0x44, 0x6d, 0xb1, 0xd7, 0x34, 0x31, 0x0b, 0x50, 0x5a, 0xa8, 0x39, 0x55, 0xa0, + 0xc0, 0x94, 0x48, 0x52, 0x2a, 0x3a, 0xc9, 0xa7, 0x39, 0x2f, 0xed, 0xef, 0x10, 0x1f, 0xaf, 0x45, + 0x9b, 0x24, 0x89, 0xf2, 0x8b, 0x01, 0x87, 0x32, 0x62, 0x1d, 0xe7, 0x16, 0xcc, 0xf9, 0x78, 0xd3, + 0xeb, 0x75, 0xb8, 0x1b, 0x11, 0x1f, 0xbb, 0x61, 0xb4, 0x49, 0x74, 0x91, 0x8e, 0xa5, 0x21, 0xd3, + 0x06, 0xb5, 0x56, 0x94, 0xe1, 0x30, 0xc6, 0x6b, 0x7e, 0x56, 0x80, 0x3e, 0x85, 0x43, 0x1e, 0xa5, + 0x9d, 0xb0, 0x2d, 0x4f, 0x99, 0xdb, 0xc7, 0x31, 0x1b, 0xcd, 0xf0, 0x33, 0x63, 0xcf, 0xbc, 0x32, + 0x97, 0xa1, 0x51, 0x2a, 0x8e, 0x96, 0x9b, 0xf7, 0x73, 0x50, 0x4e, 0xd9, 0x20, 0x04, 0xd3, 0x91, + 0xd7, 0xc5, 0xea, 0xcc, 0x3a, 0x72, 0x8d, 0x16, 0xa0, 0xe8, 0x51, 0xea, 0x4a, 0x79, 0x4e, 0xca, + 0x0b, 0x1e, 0xa5, 0x77, 0x84, 0xaa, 0x02, 0x85, 0x04, 0x50, 0x5e, 0x69, 0xf4, 0x27, 0x3a, 0x0a, + 0x10, 0x84, 0xdc, 0x6d, 0x93, 0x6e, 0x37, 0xe4, 0xf2, 0xc8, 0x95, 0x9c, 0x52, 0x10, 0xf2, 0xeb, + 0x52, 0x20, 0xd4, 0xad, 0x5e, 0xd8, 0xf1, 0x5d, 0xee, 0x05, 0xac, 0x72, 0x40, 0xa9, 0xa5, 0xe4, + 0x23, 0x2f, 0x60, 0xd2, 0x9b, 0x0c, 0xb9, 0xce, 0x68, 0x6f, 0xa2, 0x91, 0xa2, 0x1b, 0x89, 0xb7, + 0x8f, 0x29, 0xab, 0x14, 0xe4, 0xf8, 0x3b, 0x31, 0xae, 0x14, 0xef, 0x13, 0xbf, 0xd7, 0xc1, 0x3a, + 0xcb, 0x0a, 0xa6, 0x0c, 0x9d, 0x05, 0xa4, 0xaf, 0x67, 0xb1, 0xcb, 0x92, 0x6c, 0x45, 0x99, 0x6d, + 0x56, 0x69, 0x36, 0xfc, 0xed, 0xa4, 0x54, 0x37, 0x61, 0x46, 0x85, 0x10, 0x45, 0xa2, 0x1e, 0xdf, + 0x4a, 0x8a, 0x24, 0xd6, 0xe9, 0x4a, 0xe4, 0xb2, 0x95, 0x98, 0x85, 0x3c, 0xeb, 0x75, 0x75, 0x7d, + 0xc4, 0xd2, 0xdc, 0x82, 0xd9, 0x6b, 0xcd, 0xeb, 0x6b, 0x1f, 0x8a, 0xb9, 0x9a, 0x4c, 0x18, 0x04, + 0xd3, 0xbe, 0xc7, 0x3d, 0x19, 0xf3, 0xa0, 0x23, 0xd7, 0xc3, 0x3c, 0xb9, 0x54, 0x9e, 0xd1, 0x24, + 0xca, 0x67, 0x6e, 0xf8, 0x79, 0x38, 0x40, 0x63, 0xd2, 0xc7, 0xb2, 0xd4, 0x45, 0x47, 0x7d, 0x98, + 0xdf, 0xe4, 0x60, 0x2e, 0x95, 0x4a, 0xef, 0x4f, 0x04, 0xd3, 0x6d, 0xe2, 0xab, 0x26, 0xff, 0xcf, + 0x91, 0x6b, 0x81, 0xb2, 0x43, 0x82, 0x04, 0x65, 0x87, 0x04, 0xc2, 0x4a, 0x6e, 0x5c, 0xd5, 0x3b, + 0xb9, 0x16, 0x59, 0xc2, 0xc8, 0xc7, 0x9f, 0xcb, 0x8e, 0xe5, 0x1d, 0xf5, 0x21, 0x7c, 0xc5, 0xcc, + 0x9e, 0x91, 0xd0, 0xc5, 0x52, 0xd8, 0xf5, 0xbd, 0x4e, 0x0f, 0x57, 0x0a, 0x52, 0xa6, 0x3e, 0xd0, + 0x0d, 0x28, 0xd1, 0x98, 0x90, 0x4d, 0x97, 0x50, 0x26, 0xcb, 0x5c, 0x6e, 0x2c, 0x8d, 0xeb, 0xda, + 0xba, 0x70, 0xf8, 0x80, 0x32, 0xa7, 0x48, 0xf5, 0x2a, 0x55, 0x82, 0x52, 0xa6, 0x04, 0x8b, 0x50, + 0x12, 0x54, 0x18, 0xf5, 0xda, 0xb8, 0x02, 0x6a, 0xcf, 0x0c, 0x05, 0xef, 0x4d, 0x17, 0x73, 0xb3, + 0x79, 0xf3, 0x3a, 0x14, 0x74, 0x44, 0xc1, 0x4f, 0x8c, 0x9c, 0xa4, 0x8b, 0x62, 0x9d, 0x30, 0xc9, + 0x8d, 0x98, 0x24, 0x7d, 0xc9, 0x8f, 0xfa, 0x62, 0xae, 0x43, 0x31, 0x81, 0x85, 0x56, 0x20, 0x2f, + 0xd8, 0x18, 0x72, 0x0f, 0x9e, 0x9c, 0x90, 0x4d, 0xb3, 0xf4, 0xf0, 0xaf, 0x63, 0x53, 0xf7, 0xff, + 0xfd, 0xf1, 0xb4, 0xe1, 0x08, 0xf7, 0xc6, 0x0f, 0x00, 0x85, 0x0d, 0x1c, 0xf7, 0xc3, 0x36, 0x46, + 0xdf, 0x1b, 0x50, 0x4e, 0x4d, 0x15, 0xd4, 0x18, 0x17, 0xf4, 0xc5, 0xc9, 0x54, 0x3d, 0xb7, 0x27, + 0x1f, 0xb5, 0x2d, 0xcc, 0xfa, 0xd7, 0xbf, 0xff, 0xf3, 0x5d, 0xee, 0x0c, 0x3a, 0x65, 0x8f, 0x79, + 0xe0, 0x0e, 0x87, 0x1a, 0xba, 0x67, 0x00, 0x8c, 0x06, 0x29, 0xaa, 0x4f, 0x90, 0x36, 0x3b, 0x89, + 0xab, 0x8d, 0xbd, 0xb8, 0x68, 0xa0, 0xb6, 0x04, 0x7a, 0x0a, 0x9d, 0x1c, 0x07, 0x54, 0x8f, 0x6f, + 0xf4, 0xb3, 0x01, 0xff, 0xcf, 0xde, 0x63, 0xe8, 0xc2, 0x04, 0x79, 0x5f, 0xbc, 0x11, 0xab, 0x17, + 0xf7, 0xea, 0xa6, 0x21, 0x5f, 0x90, 0x90, 0x6d, 0xb4, 0x3c, 0x0e, 0xb2, 0xbc, 0xeb, 0x98, 0xdd, + 0x91, 0x31, 0xd0, 0x03, 0x03, 0x66, 0x9f, 0x7f, 0x5f, 0xa0, 0x4b, 0x13, 0x60, 0xd8, 0xe9, 0x15, + 0x53, 0xbd, 0xbc, 0x77, 0x47, 0x0d, 0xff, 0x92, 0x84, 0x5f, 0x47, 0xf6, 0x84, 0xf0, 0xbf, 0x50, + 0x47, 0xf2, 0x4b, 0xf4, 0xd8, 0x48, 0xbd, 0x2d, 0xd2, 0xaf, 0x5d, 0x74, 0x65, 0xe2, 0x4a, 0xee, + 0xf0, 0x1a, 0xaf, 0xbe, 0xbd, 0x4f, 0x6f, 0xcd, 0xe7, 0x8a, 0xe4, 0x73, 0x11, 0x9d, 0x1f, 0xc7, + 0x67, 0xf4, 0x50, 0xc6, 0x7c, 0xd8, 0x95, 0x3f, 0x0d, 0xf9, 0x52, 0xdc, 0xe9, 0x57, 0x10, 0xba, + 0x3a, 0x01, 0xb0, 0x97, 0xfc, 0x82, 0xab, 0xbe, 0xb3, 0x6f, 0x7f, 0x4d, 0xed, 0xaa, 0xa4, 0x76, + 0x19, 0x5d, 0xdc, 0x1b, 0xb5, 0x61, 0xc7, 0xee, 0x19, 0x50, 0x1a, 0x5e, 0x19, 0xe8, 0xad, 0x71, + 0x70, 0x9e, 0xbf, 0xc8, 0xaa, 0xf5, 0x3d, 0x78, 0x68, 0xc8, 0x0d, 0x09, 0xf9, 0x2c, 0x3a, 0x3d, + 0x0e, 0xb2, 0xd7, 0x6a, 0x87, 0xae, 0xfc, 0x39, 0xd2, 0xbc, 0xfd, 0xf0, 0x69, 0xcd, 0x78, 0xf4, + 0xb4, 0x66, 0xfc, 0xfd, 0xb4, 0x66, 0x7c, 0xfb, 0xac, 0x36, 0xf5, 0xe8, 0x59, 0x6d, 0xea, 0xc9, + 0xb3, 0xda, 0xd4, 0x27, 0x8d, 0x20, 0xe4, 0x5b, 0xbd, 0x96, 0xd5, 0x26, 0xdd, 0x24, 0x9e, 0xfa, + 0xb7, 0xcc, 0xfc, 0x6d, 0xbb, 0xdd, 0x09, 0x71, 0xc4, 0xed, 0x20, 0xa6, 0x6d, 0x9b, 0x77, 0x99, + 0x9a, 0xb9, 0xad, 0x19, 0xf9, 0x03, 0xe3, 0xdc, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xfd, + 0xd4, 0xde, 0xdc, 0x10, 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 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServiceClient interface { + // GetNodeInfo queries the current node info. + GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) + // GetSyncing queries node syncing. + GetSyncing(ctx context.Context, in *GetSyncingRequest, opts ...grpc.CallOption) (*GetSyncingResponse, error) + // GetLatestBlock returns the latest block. + GetLatestBlock(ctx context.Context, in *GetLatestBlockRequest, opts ...grpc.CallOption) (*GetLatestBlockResponse, error) + // GetBlockByHeight queries block for given height. + GetBlockByHeight(ctx context.Context, in *GetBlockByHeightRequest, opts ...grpc.CallOption) (*GetBlockByHeightResponse, error) + // GetLatestValidatorSet queries latest validator-set. + GetLatestValidatorSet(ctx context.Context, in *GetLatestValidatorSetRequest, opts ...grpc.CallOption) (*GetLatestValidatorSetResponse, error) + // GetValidatorSetByHeight queries validator-set at a given height. + GetValidatorSetByHeight(ctx context.Context, in *GetValidatorSetByHeightRequest, opts ...grpc.CallOption) (*GetValidatorSetByHeightResponse, error) + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opts ...grpc.CallOption) (*ABCIQueryResponse, error) +} + +type serviceClient struct { + cc grpc1.ClientConn +} + +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) { + out := new(GetNodeInfoResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) GetSyncing(ctx context.Context, in *GetSyncingRequest, opts ...grpc.CallOption) (*GetSyncingResponse, error) { + out := new(GetSyncingResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetSyncing", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) GetLatestBlock(ctx context.Context, in *GetLatestBlockRequest, opts ...grpc.CallOption) (*GetLatestBlockResponse, error) { + out := new(GetLatestBlockResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) GetBlockByHeight(ctx context.Context, in *GetBlockByHeightRequest, opts ...grpc.CallOption) (*GetBlockByHeightResponse, error) { + out := new(GetBlockByHeightResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) GetLatestValidatorSet(ctx context.Context, in *GetLatestValidatorSetRequest, opts ...grpc.CallOption) (*GetLatestValidatorSetResponse, error) { + out := new(GetLatestValidatorSetResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) GetValidatorSetByHeight(ctx context.Context, in *GetValidatorSetByHeightRequest, opts ...grpc.CallOption) (*GetValidatorSetByHeightResponse, error) { + out := new(GetValidatorSetByHeightResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opts ...grpc.CallOption) (*ABCIQueryResponse, error) { + out := new(ABCIQueryResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +type ServiceServer interface { + // GetNodeInfo queries the current node info. + GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) + // GetSyncing queries node syncing. + GetSyncing(context.Context, *GetSyncingRequest) (*GetSyncingResponse, error) + // GetLatestBlock returns the latest block. + GetLatestBlock(context.Context, *GetLatestBlockRequest) (*GetLatestBlockResponse, error) + // GetBlockByHeight queries block for given height. + GetBlockByHeight(context.Context, *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) + // GetLatestValidatorSet queries latest validator-set. + GetLatestValidatorSet(context.Context, *GetLatestValidatorSetRequest) (*GetLatestValidatorSetResponse, error) + // GetValidatorSetByHeight queries validator-set at a given height. + GetValidatorSetByHeight(context.Context, *GetValidatorSetByHeightRequest) (*GetValidatorSetByHeightResponse, error) + // ABCIQuery defines a query handler that supports ABCI queries directly to the + // application, bypassing Tendermint completely. The ABCI query must contain + // a valid and supported path, including app, custom, p2p, and store. + // + // Since: cosmos-sdk 0.46 + ABCIQuery(context.Context, *ABCIQueryRequest) (*ABCIQueryResponse, error) +} + +// UnimplementedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (*UnimplementedServiceServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") +} +func (*UnimplementedServiceServer) GetSyncing(ctx context.Context, req *GetSyncingRequest) (*GetSyncingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSyncing not implemented") +} +func (*UnimplementedServiceServer) GetLatestBlock(ctx context.Context, req *GetLatestBlockRequest) (*GetLatestBlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestBlock not implemented") +} +func (*UnimplementedServiceServer) GetBlockByHeight(ctx context.Context, req *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBlockByHeight not implemented") +} +func (*UnimplementedServiceServer) GetLatestValidatorSet(ctx context.Context, req *GetLatestValidatorSetRequest) (*GetLatestValidatorSetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLatestValidatorSet not implemented") +} +func (*UnimplementedServiceServer) GetValidatorSetByHeight(ctx context.Context, req *GetValidatorSetByHeightRequest) (*GetValidatorSetByHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetValidatorSetByHeight not implemented") +} +func (*UnimplementedServiceServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ABCIQuery not implemented") +} + +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNodeInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetNodeInfo(ctx, req.(*GetNodeInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_GetSyncing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSyncingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetSyncing(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetSyncing", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetSyncing(ctx, req.(*GetSyncingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_GetLatestBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestBlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetLatestBlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetLatestBlock(ctx, req.(*GetLatestBlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_GetBlockByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBlockByHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetBlockByHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetBlockByHeight(ctx, req.(*GetBlockByHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_GetLatestValidatorSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestValidatorSetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetLatestValidatorSet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetLatestValidatorSet(ctx, req.(*GetLatestValidatorSetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_GetValidatorSetByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetValidatorSetByHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).GetValidatorSetByHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).GetValidatorSetByHeight(ctx, req.(*GetValidatorSetByHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_ABCIQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ABCIQueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).ABCIQuery(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).ABCIQuery(ctx, req.(*ABCIQueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.tendermint.v1beta1.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetNodeInfo", + Handler: _Service_GetNodeInfo_Handler, + }, + { + MethodName: "GetSyncing", + Handler: _Service_GetSyncing_Handler, + }, + { + MethodName: "GetLatestBlock", + Handler: _Service_GetLatestBlock_Handler, + }, + { + MethodName: "GetBlockByHeight", + Handler: _Service_GetBlockByHeight_Handler, + }, + { + MethodName: "GetLatestValidatorSet", + Handler: _Service_GetLatestValidatorSet_Handler, + }, + { + MethodName: "GetValidatorSetByHeight", + Handler: _Service_GetValidatorSetByHeight_Handler, + }, + { + MethodName: "ABCIQuery", + Handler: _Service_ABCIQuery_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/tendermint/v1beta1/query.proto", +} + +func (m *GetValidatorSetByHeightRequest) 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 *GetValidatorSetByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetValidatorSetByHeightRequest) 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 m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetValidatorSetByHeightResponse) 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 *GetValidatorSetByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetValidatorSetByHeightResponse) 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] = 0x1a + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetResponse) 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 *GetLatestValidatorSetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatestValidatorSetResponse) 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] = 0x1a + } + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Validator) 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 *Validator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposerPriority != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposerPriority)) + i-- + dAtA[i] = 0x20 + } + if m.VotingPower != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.VotingPower)) + i-- + dAtA[i] = 0x18 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetBlockByHeightRequest) 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 *GetBlockByHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetBlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetBlockByHeightResponse) 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 *GetBlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetBlockByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SdkBlock != nil { + { + size, err := m.SdkBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Block != nil { + { + size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockId != nil { + { + size, err := m.BlockId.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 *GetLatestBlockRequest) 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 *GetLatestBlockRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatestBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetLatestBlockResponse) 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 *GetLatestBlockResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetLatestBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SdkBlock != nil { + { + size, err := m.SdkBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Block != nil { + { + size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.BlockId != nil { + { + size, err := m.BlockId.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 *GetSyncingRequest) 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 *GetSyncingRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSyncingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetSyncingResponse) 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 *GetSyncingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetSyncingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Syncing { + i-- + if m.Syncing { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GetNodeInfoRequest) 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 *GetNodeInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetNodeInfoResponse) 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 *GetNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ApplicationVersion != nil { + { + size, err := m.ApplicationVersion.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.DefaultNodeInfo != nil { + { + size, err := m.DefaultNodeInfo.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 *VersionInfo) 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 *VersionInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VersionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CosmosSdkVersion) > 0 { + i -= len(m.CosmosSdkVersion) + copy(dAtA[i:], m.CosmosSdkVersion) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CosmosSdkVersion))) + i-- + dAtA[i] = 0x42 + } + if len(m.BuildDeps) > 0 { + for iNdEx := len(m.BuildDeps) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BuildDeps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.GoVersion) > 0 { + i -= len(m.GoVersion) + copy(dAtA[i:], m.GoVersion) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GoVersion))) + i-- + dAtA[i] = 0x32 + } + if len(m.BuildTags) > 0 { + i -= len(m.BuildTags) + copy(dAtA[i:], m.BuildTags) + i = encodeVarintQuery(dAtA, i, uint64(len(m.BuildTags))) + i-- + dAtA[i] = 0x2a + } + if len(m.GitCommit) > 0 { + i -= len(m.GitCommit) + copy(dAtA[i:], m.GitCommit) + i = encodeVarintQuery(dAtA, i, uint64(len(m.GitCommit))) + i-- + dAtA[i] = 0x22 + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + } + if len(m.AppName) > 0 { + i -= len(m.AppName) + copy(dAtA[i:], m.AppName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AppName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Module) 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 *Module) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Module) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sum) > 0 { + i -= len(m.Sum) + copy(dAtA[i:], m.Sum) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Sum))) + i-- + dAtA[i] = 0x1a + } + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ABCIQueryRequest) 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 *ABCIQueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ABCIQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Prove { + i-- + if m.Prove { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ABCIQueryResponse) 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 *ABCIQueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ABCIQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Codespace) > 0 { + i -= len(m.Codespace) + copy(dAtA[i:], m.Codespace) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Codespace))) + i-- + dAtA[i] = 0x52 + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x48 + } + if m.ProofOps != nil { + { + size, err := m.ProofOps.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x3a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x32 + } + if m.Index != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x28 + } + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x22 + } + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x1a + } + if m.Code != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProofOp) 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 *ProofOp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x1a + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ProofOps) 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 *ProofOps) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProofOps) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Ops) > 0 { + for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ops[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 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 *GetValidatorSetByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *GetValidatorSetByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + 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 *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + if len(m.Validators) > 0 { + for _, e := range m.Validators { + 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 *Validator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.VotingPower != 0 { + n += 1 + sovQuery(uint64(m.VotingPower)) + } + if m.ProposerPriority != 0 { + n += 1 + sovQuery(uint64(m.ProposerPriority)) + } + return n +} + +func (m *GetBlockByHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + return n +} + +func (m *GetBlockByHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockId != nil { + l = m.BlockId.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.SdkBlock != nil { + l = m.SdkBlock.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *GetLatestBlockRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetLatestBlockResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockId != nil { + l = m.BlockId.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.SdkBlock != nil { + l = m.SdkBlock.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *GetSyncingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetSyncingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Syncing { + n += 2 + } + return n +} + +func (m *GetNodeInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetNodeInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DefaultNodeInfo != nil { + l = m.DefaultNodeInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.ApplicationVersion != nil { + l = m.ApplicationVersion.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *VersionInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AppName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.GitCommit) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.BuildTags) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.GoVersion) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.BuildDeps) > 0 { + for _, e := range m.BuildDeps { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + l = len(m.CosmosSdkVersion) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *Module) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Sum) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *ABCIQueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Prove { + n += 2 + } + return n +} + +func (m *ABCIQueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Code != 0 { + n += 1 + sovQuery(uint64(m.Code)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Index != 0 { + n += 1 + sovQuery(uint64(m.Index)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.ProofOps != nil { + l = m.ProofOps.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + l = len(m.Codespace) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *ProofOp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *ProofOps) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Ops) > 0 { + for _, e := range m.Ops { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + 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 *GetValidatorSetByHeightRequest) 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: GetValidatorSetByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetValidatorSetByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetValidatorSetByHeightResponse) 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: GetValidatorSetByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetValidatorSetByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, &Validator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetLatestValidatorSetRequest) 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: GetLatestValidatorSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetLatestValidatorSetRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetLatestValidatorSetResponse) 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: GetLatestValidatorSetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetLatestValidatorSetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, &Validator{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Validator) 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: Validator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) + } + m.VotingPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VotingPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType) + } + m.ProposerPriority = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposerPriority |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBlockByHeightRequest) 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: GetBlockByHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlockByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBlockByHeightResponse) 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: GetBlockByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBlockByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockId", 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.BlockId == nil { + m.BlockId = &types1.BlockID{} + } + if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block == nil { + m.Block = &types1.Block{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SdkBlock", 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.SdkBlock == nil { + m.SdkBlock = &Block{} + } + if err := m.SdkBlock.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetLatestBlockRequest) 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: GetLatestBlockRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetLatestBlockRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetLatestBlockResponse) 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: GetLatestBlockResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetLatestBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockId", 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.BlockId == nil { + m.BlockId = &types1.BlockID{} + } + if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block == nil { + m.Block = &types1.Block{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SdkBlock", 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.SdkBlock == nil { + m.SdkBlock = &Block{} + } + if err := m.SdkBlock.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetSyncingRequest) 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: GetSyncingRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetSyncingRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetSyncingResponse) 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: GetSyncingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetSyncingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Syncing", 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.Syncing = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNodeInfoRequest) 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: GetNodeInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNodeInfoRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNodeInfoResponse) 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: GetNodeInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeInfo", 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.DefaultNodeInfo == nil { + m.DefaultNodeInfo = &p2p.DefaultNodeInfo{} + } + if err := m.DefaultNodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationVersion", 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.ApplicationVersion == nil { + m.ApplicationVersion = &VersionInfo{} + } + if err := m.ApplicationVersion.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VersionInfo) 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: VersionInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VersionInfo: 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 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppName", 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.AppName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GitCommit", 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.GitCommit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildTags", 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.BuildTags = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GoVersion", 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.GoVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildDeps", 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.BuildDeps = append(m.BuildDeps, &Module{}) + if err := m.BuildDeps[len(m.BuildDeps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmosSdkVersion", 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.CosmosSdkVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Module) 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: Module: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Module: 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 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.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sum", 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.Sum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ABCIQueryRequest) 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: ABCIQueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ABCIQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + 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 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.Path = string(dAtA[iNdEx:postIndex]) + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Prove", 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.Prove = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ABCIQueryResponse) 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: ABCIQueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ABCIQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", 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.Log = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + 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 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.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofOps", 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.ProofOps == nil { + m.ProofOps = &ProofOps{} + } + if err := m.ProofOps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Codespace", 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.Codespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProofOp) 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: ProofOp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProofOps) 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: ProofOps: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProofOps: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ops", 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.Ops = append(m.Ops, ProofOp{}) + if err := m.Ops[len(m.Ops)-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) || (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/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go new file mode 100644 index 000000000000..36727c4ca4e7 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go @@ -0,0 +1,669 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/base/tendermint/v1beta1/query.proto + +/* +Package tmservice is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package tmservice + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNodeInfoRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetNodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNodeInfoRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetNodeInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetSyncingRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetSyncing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetSyncingRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetSyncing(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetLatestBlockRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetLatestBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetLatestBlockRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetLatestBlock(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBlockByHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") + } + + protoReq.Height, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) + } + + msg, err := client.GetBlockByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetBlockByHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") + } + + protoReq.Height, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) + } + + msg, err := server.GetBlockByHeight(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Service_GetLatestValidatorSet_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetLatestValidatorSetRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetLatestValidatorSet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetLatestValidatorSetRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetLatestValidatorSet(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Service_GetValidatorSetByHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{"height": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetValidatorSetByHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") + } + + protoReq.Height, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetValidatorSetByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetValidatorSetByHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["height"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") + } + + protoReq.Height, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetValidatorSetByHeight(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Service_ABCIQuery_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Service_ABCIQuery_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ABCIQueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ABCIQuery_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ABCIQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_ABCIQuery_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ABCIQueryRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ABCIQuery_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ABCIQuery(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterServiceHandlerServer registers the http handlers for service Service to "mux". +// UnaryRPC :call ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. +func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { + + mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetNodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetSyncing_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetLatestBlock_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_ABCIQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_ABCIQuery_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_ABCIQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterServiceHandler(ctx, mux, conn) +} + +// RegisterServiceHandler registers the http handlers for service Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) +} + +// RegisterServiceHandlerClient registers the http handlers for service Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ServiceClient" to call the correct interceptors. +func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { + + mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetNodeInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetSyncing_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetLatestBlock_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_ABCIQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_ABCIQuery_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_ABCIQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Service_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "node_info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_GetSyncing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "syncing"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_GetLatestBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "blocks", "latest"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_GetBlockByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "blocks", "height"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_GetLatestValidatorSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "latest"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_GetValidatorSetByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "height"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_ABCIQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "abci_query"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Service_GetNodeInfo_0 = runtime.ForwardResponseMessage + + forward_Service_GetSyncing_0 = runtime.ForwardResponseMessage + + forward_Service_GetLatestBlock_0 = runtime.ForwardResponseMessage + + forward_Service_GetBlockByHeight_0 = runtime.ForwardResponseMessage + + forward_Service_GetLatestValidatorSet_0 = runtime.ForwardResponseMessage + + forward_Service_GetValidatorSetByHeight_0 = runtime.ForwardResponseMessage + + forward_Service_ABCIQuery_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go new file mode 100644 index 000000000000..79e12e42b0b3 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go @@ -0,0 +1,1371 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/tendermint/v1beta1/types.proto + +package tmservice + +import ( + fmt "fmt" + types "github.com/cometbft/cometbft/proto/tendermint/types" + version "github.com/cometbft/cometbft/proto/tendermint/version" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "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 + +// Block is tendermint type Block, with the Header proposer address +// field converted to bech32 string. +type Block struct { + Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` + Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` + Evidence types.EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` + LastCommit *types.Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` +} + +func (m *Block) Reset() { *m = Block{} } +func (m *Block) String() string { return proto.CompactTextString(m) } +func (*Block) ProtoMessage() {} +func (*Block) Descriptor() ([]byte, []int) { + return fileDescriptor_bb9931519c08e0d6, []int{0} +} +func (m *Block) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Block.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 *Block) XXX_Merge(src proto.Message) { + xxx_messageInfo_Block.Merge(m, src) +} +func (m *Block) XXX_Size() int { + return m.Size() +} +func (m *Block) XXX_DiscardUnknown() { + xxx_messageInfo_Block.DiscardUnknown(m) +} + +var xxx_messageInfo_Block proto.InternalMessageInfo + +func (m *Block) GetHeader() Header { + if m != nil { + return m.Header + } + return Header{} +} + +func (m *Block) GetData() types.Data { + if m != nil { + return m.Data + } + return types.Data{} +} + +func (m *Block) GetEvidence() types.EvidenceList { + if m != nil { + return m.Evidence + } + return types.EvidenceList{} +} + +func (m *Block) GetLastCommit() *types.Commit { + if m != nil { + return m.LastCommit + } + return nil +} + +// Header defines the structure of a Tendermint block header. +type Header struct { + // basic block info + Version version.Consensus `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` + ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` + // prev block info + LastBlockId types.BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` + // hashes of block data + LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` + DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` + // hashes from the app output from the prev block + ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` + NextValidatorsHash []byte `protobuf:"bytes,9,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` + ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` + AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` + // consensus info + EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` + // proposer_address is the original block proposer address, formatted as a Bech32 string. + // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + // for better UX. + ProposerAddress string `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` +} + +func (m *Header) Reset() { *m = Header{} } +func (m *Header) String() string { return proto.CompactTextString(m) } +func (*Header) ProtoMessage() {} +func (*Header) Descriptor() ([]byte, []int) { + return fileDescriptor_bb9931519c08e0d6, []int{1} +} +func (m *Header) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Header.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 *Header) XXX_Merge(src proto.Message) { + xxx_messageInfo_Header.Merge(m, src) +} +func (m *Header) XXX_Size() int { + return m.Size() +} +func (m *Header) XXX_DiscardUnknown() { + xxx_messageInfo_Header.DiscardUnknown(m) +} + +var xxx_messageInfo_Header proto.InternalMessageInfo + +func (m *Header) GetVersion() version.Consensus { + if m != nil { + return m.Version + } + return version.Consensus{} +} + +func (m *Header) GetChainID() string { + if m != nil { + return m.ChainID + } + return "" +} + +func (m *Header) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Header) GetTime() time.Time { + if m != nil { + return m.Time + } + return time.Time{} +} + +func (m *Header) GetLastBlockId() types.BlockID { + if m != nil { + return m.LastBlockId + } + return types.BlockID{} +} + +func (m *Header) GetLastCommitHash() []byte { + if m != nil { + return m.LastCommitHash + } + return nil +} + +func (m *Header) GetDataHash() []byte { + if m != nil { + return m.DataHash + } + return nil +} + +func (m *Header) GetValidatorsHash() []byte { + if m != nil { + return m.ValidatorsHash + } + return nil +} + +func (m *Header) GetNextValidatorsHash() []byte { + if m != nil { + return m.NextValidatorsHash + } + return nil +} + +func (m *Header) GetConsensusHash() []byte { + if m != nil { + return m.ConsensusHash + } + return nil +} + +func (m *Header) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +func (m *Header) GetLastResultsHash() []byte { + if m != nil { + return m.LastResultsHash + } + return nil +} + +func (m *Header) GetEvidenceHash() []byte { + if m != nil { + return m.EvidenceHash + } + return nil +} + +func (m *Header) GetProposerAddress() string { + if m != nil { + return m.ProposerAddress + } + return "" +} + +func init() { + proto.RegisterType((*Block)(nil), "cosmos.base.tendermint.v1beta1.Block") + proto.RegisterType((*Header)(nil), "cosmos.base.tendermint.v1beta1.Header") +} + +func init() { + proto.RegisterFile("cosmos/base/tendermint/v1beta1/types.proto", fileDescriptor_bb9931519c08e0d6) +} + +var fileDescriptor_bb9931519c08e0d6 = []byte{ + // 645 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xcd, 0x6e, 0xd3, 0x4e, + 0x14, 0xc5, 0xe3, 0x36, 0xcd, 0xc7, 0xa4, 0xe9, 0xc7, 0xa8, 0xaa, 0xdc, 0xfc, 0xff, 0x38, 0x55, + 0x11, 0xa5, 0x54, 0xc2, 0xa6, 0x45, 0x2c, 0x58, 0xb0, 0x20, 0x6d, 0xa5, 0x46, 0xea, 0xca, 0x42, + 0x2c, 0xd8, 0x44, 0x13, 0x7b, 0xb0, 0x47, 0xb5, 0x3d, 0x96, 0x67, 0x12, 0xc1, 0x33, 0xb0, 0xe9, + 0x63, 0xb0, 0xe4, 0x31, 0xba, 0xec, 0x92, 0x55, 0x41, 0xe9, 0x82, 0x27, 0x60, 0x8f, 0xe6, 0xce, + 0xb8, 0x75, 0x88, 0xc4, 0x26, 0xb1, 0xcf, 0xfd, 0xdd, 0x93, 0xb9, 0xe7, 0x8e, 0x82, 0x0e, 0x03, + 0x2e, 0x52, 0x2e, 0xbc, 0x31, 0x11, 0xd4, 0x93, 0x34, 0x0b, 0x69, 0x91, 0xb2, 0x4c, 0x7a, 0xd3, + 0xa3, 0x31, 0x95, 0xe4, 0xc8, 0x93, 0x9f, 0x73, 0x2a, 0xdc, 0xbc, 0xe0, 0x92, 0x63, 0x47, 0xb3, + 0xae, 0x62, 0xdd, 0x07, 0xd6, 0x35, 0x6c, 0x6f, 0x2b, 0xe2, 0x11, 0x07, 0xd4, 0x53, 0x4f, 0xba, + 0xab, 0xf7, 0x7f, 0xc5, 0x15, 0xdc, 0xaa, 0x9e, 0xbd, 0xfe, 0x42, 0x95, 0x4e, 0x59, 0x48, 0xb3, + 0x80, 0x1a, 0xc0, 0xa9, 0x1e, 0x8a, 0x16, 0x82, 0xf1, 0x6c, 0xde, 0x20, 0xe2, 0x3c, 0x4a, 0xa8, + 0x07, 0x6f, 0xe3, 0xc9, 0x47, 0x4f, 0xb2, 0x94, 0x0a, 0x49, 0xd2, 0xdc, 0x00, 0x9b, 0x24, 0x65, + 0x19, 0xf7, 0xe0, 0x53, 0x4b, 0x7b, 0x5f, 0x96, 0xd0, 0xca, 0x20, 0xe1, 0xc1, 0x25, 0x1e, 0xa2, + 0x46, 0x4c, 0x49, 0x48, 0x0b, 0xdb, 0xda, 0xb5, 0x0e, 0x3a, 0xc7, 0xfb, 0xee, 0xbf, 0x67, 0x74, + 0xcf, 0x81, 0x1e, 0xb4, 0xaf, 0x6f, 0xfb, 0xb5, 0xaf, 0xbf, 0xbe, 0x1d, 0x5a, 0xbe, 0x31, 0xc0, + 0xaf, 0x50, 0x3d, 0x24, 0x92, 0xd8, 0x4b, 0x60, 0xb4, 0x5d, 0x6d, 0xd6, 0xe7, 0x3d, 0x25, 0x92, + 0x54, 0x1b, 0x01, 0xc7, 0x67, 0xa8, 0x55, 0x4e, 0x6c, 0x2f, 0x43, 0xab, 0xb3, 0xd8, 0x7a, 0x66, + 0x88, 0x0b, 0x26, 0x64, 0xd5, 0xe2, 0xbe, 0x15, 0xbf, 0x46, 0x9d, 0x84, 0x08, 0x39, 0x0a, 0x78, + 0x9a, 0x32, 0x69, 0xd7, 0xc1, 0xc9, 0x5e, 0x74, 0x3a, 0x81, 0xba, 0x8f, 0x14, 0xac, 0x9f, 0xf7, + 0x7e, 0xd7, 0x51, 0x43, 0x8f, 0x85, 0x07, 0xa8, 0x69, 0x32, 0x36, 0x79, 0x3c, 0x9a, 0xcb, 0x40, + 0x97, 0xdc, 0x13, 0x9e, 0x09, 0x9a, 0x89, 0x89, 0xa8, 0x1e, 0xa5, 0x6c, 0xc4, 0xfb, 0xa8, 0x15, + 0xc4, 0x84, 0x65, 0x23, 0x16, 0x42, 0x16, 0xed, 0x41, 0x67, 0x76, 0xdb, 0x6f, 0x9e, 0x28, 0x6d, + 0x78, 0xea, 0x37, 0xa1, 0x38, 0x0c, 0xf1, 0xb6, 0x8a, 0x9e, 0x45, 0xb1, 0x84, 0xb1, 0x97, 0x7d, + 0xf3, 0x86, 0xdf, 0xa0, 0xba, 0x5a, 0xa1, 0x19, 0xa1, 0xe7, 0xea, 0xfd, 0xba, 0xe5, 0x7e, 0xdd, + 0x77, 0xe5, 0x7e, 0x07, 0x5d, 0xf5, 0xeb, 0x57, 0x3f, 0xfa, 0x96, 0xc9, 0x53, 0xb5, 0xe1, 0x73, + 0xd4, 0x85, 0x20, 0xc6, 0x6a, 0xbf, 0xea, 0x0c, 0x2b, 0xe0, 0xb3, 0xb3, 0x18, 0x05, 0xdc, 0x80, + 0xe1, 0x69, 0x75, 0x08, 0xc8, 0x50, 0xeb, 0x21, 0x3e, 0x40, 0x1b, 0x95, 0x48, 0x47, 0x31, 0x11, + 0xb1, 0xdd, 0xd8, 0xb5, 0x0e, 0x56, 0xfd, 0xb5, 0x87, 0xf4, 0xce, 0x89, 0x88, 0xf1, 0x7f, 0xa8, + 0xad, 0x76, 0xa9, 0x91, 0x26, 0x20, 0x2d, 0x25, 0x40, 0xf1, 0x29, 0x5a, 0x9f, 0x92, 0x84, 0x85, + 0x44, 0xf2, 0x42, 0x68, 0xa4, 0xa5, 0x5d, 0x1e, 0x64, 0x00, 0x5f, 0xa0, 0xad, 0x8c, 0x7e, 0x92, + 0xa3, 0xbf, 0xe9, 0x36, 0xd0, 0x58, 0xd5, 0xde, 0xcf, 0x77, 0x3c, 0x41, 0x6b, 0x41, 0xb9, 0x0b, + 0xcd, 0x22, 0x60, 0xbb, 0xf7, 0x2a, 0x60, 0x3b, 0xa8, 0x45, 0xf2, 0x5c, 0x03, 0x1d, 0x00, 0x9a, + 0x24, 0xcf, 0xa1, 0x74, 0x88, 0x36, 0x61, 0xc6, 0x82, 0x8a, 0x49, 0x22, 0x8d, 0xc9, 0x2a, 0x30, + 0xeb, 0xaa, 0xe0, 0x6b, 0x1d, 0xd8, 0xc7, 0xa8, 0x5b, 0x5e, 0x37, 0xcd, 0x75, 0x81, 0x5b, 0x2d, + 0x45, 0x80, 0x9e, 0xa1, 0x8d, 0xbc, 0xe0, 0x39, 0x17, 0xb4, 0x18, 0x91, 0x30, 0x2c, 0xa8, 0x10, + 0xf6, 0x9a, 0xba, 0x05, 0xfe, 0x7a, 0xa9, 0xbf, 0xd5, 0xf2, 0xe0, 0xe2, 0x7a, 0xe6, 0x58, 0x37, + 0x33, 0xc7, 0xfa, 0x39, 0x73, 0xac, 0xab, 0x3b, 0xa7, 0x76, 0x73, 0xe7, 0xd4, 0xbe, 0xdf, 0x39, + 0xb5, 0x0f, 0xc7, 0x11, 0x93, 0xf1, 0x64, 0xec, 0x06, 0x3c, 0xf5, 0xcc, 0xff, 0x93, 0xfe, 0x7a, + 0x2e, 0xc2, 0x4b, 0x2f, 0x48, 0x18, 0xcd, 0xa4, 0x17, 0x15, 0x79, 0xe0, 0xc9, 0x54, 0xd0, 0x62, + 0xca, 0x02, 0x3a, 0x6e, 0xc0, 0x05, 0x79, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x84, 0x6d, + 0xe8, 0xd1, 0x04, 0x00, 0x00, +} + +func (m *Block) 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 *Block) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastCommit != nil { + { + size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Header) 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 *Header) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProposerAddress) > 0 { + i -= len(m.ProposerAddress) + copy(dAtA[i:], m.ProposerAddress) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) + i-- + dAtA[i] = 0x72 + } + if len(m.EvidenceHash) > 0 { + i -= len(m.EvidenceHash) + copy(dAtA[i:], m.EvidenceHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) + i-- + dAtA[i] = 0x6a + } + if len(m.LastResultsHash) > 0 { + i -= len(m.LastResultsHash) + copy(dAtA[i:], m.LastResultsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) + i-- + dAtA[i] = 0x62 + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x5a + } + if len(m.ConsensusHash) > 0 { + i -= len(m.ConsensusHash) + copy(dAtA[i:], m.ConsensusHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) + i-- + dAtA[i] = 0x52 + } + if len(m.NextValidatorsHash) > 0 { + i -= len(m.NextValidatorsHash) + copy(dAtA[i:], m.NextValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) + i-- + dAtA[i] = 0x4a + } + if len(m.ValidatorsHash) > 0 { + i -= len(m.ValidatorsHash) + copy(dAtA[i:], m.ValidatorsHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) + i-- + dAtA[i] = 0x42 + } + if len(m.DataHash) > 0 { + i -= len(m.DataHash) + copy(dAtA[i:], m.DataHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.DataHash))) + i-- + dAtA[i] = 0x3a + } + if len(m.LastCommitHash) > 0 { + i -= len(m.LastCommitHash) + copy(dAtA[i:], m.LastCommitHash) + i = encodeVarintTypes(dAtA, i, uint64(len(m.LastCommitHash))) + i-- + dAtA[i] = 0x32 + } + { + size, err := m.LastBlockId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTypes(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x22 + if m.Height != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Block) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Header.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.Data.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.Evidence.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.LastCommit != nil { + l = m.LastCommit.Size() + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func (m *Header) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Version.Size() + n += 1 + l + sovTypes(uint64(l)) + l = len(m.ChainID) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovTypes(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovTypes(uint64(l)) + l = m.LastBlockId.Size() + n += 1 + l + sovTypes(uint64(l)) + l = len(m.LastCommitHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.DataHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.NextValidatorsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ConsensusHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.LastResultsHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.EvidenceHash) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ProposerAddress) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Block) 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 ErrIntOverflowTypes + } + 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: Block: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LastCommit == nil { + m.LastCommit = &types.Commit{} + } + if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Header) 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 ErrIntOverflowTypes + } + 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: Header: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChainID = string(dAtA[iNdEx:postIndex]) + 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 ErrIntOverflowTypes + } + 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 Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastCommitHash == nil { + m.LastCommitHash = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) + if m.DataHash == nil { + m.DataHash = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorsHash == nil { + m.ValidatorsHash = []byte{} + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextValidatorsHash == nil { + m.NextValidatorsHash = []byte{} + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) + if m.ConsensusHash == nil { + m.ConsensusHash = []byte{} + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) + if m.LastResultsHash == nil { + m.LastResultsHash = []byte{} + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) + if m.EvidenceHash == nil { + m.EvidenceHash = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go b/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go new file mode 100644 index 000000000000..a5c466a354e4 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go @@ -0,0 +1,426 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/hd/v1/hd.proto + +package hd + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// BIP44Params is used as path field in ledger item in Record. +type BIP44Params struct { + // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + Purpose uint32 `protobuf:"varint,1,opt,name=purpose,proto3" json:"purpose,omitempty"` + // coin_type is a constant that improves privacy + CoinType uint32 `protobuf:"varint,2,opt,name=coin_type,json=coinType,proto3" json:"coin_type,omitempty"` + // account splits the key space into independent user identities + Account uint32 `protobuf:"varint,3,opt,name=account,proto3" json:"account,omitempty"` + // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + // chain. + Change bool `protobuf:"varint,4,opt,name=change,proto3" json:"change,omitempty"` + // address_index is used as child index in BIP32 derivation + AddressIndex uint32 `protobuf:"varint,5,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` +} + +func (m *BIP44Params) Reset() { *m = BIP44Params{} } +func (*BIP44Params) ProtoMessage() {} +func (*BIP44Params) Descriptor() ([]byte, []int) { + return fileDescriptor_cf10f1fb5e778a8d, []int{0} +} +func (m *BIP44Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BIP44Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BIP44Params.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 *BIP44Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_BIP44Params.Merge(m, src) +} +func (m *BIP44Params) XXX_Size() int { + return m.Size() +} +func (m *BIP44Params) XXX_DiscardUnknown() { + xxx_messageInfo_BIP44Params.DiscardUnknown(m) +} + +var xxx_messageInfo_BIP44Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*BIP44Params)(nil), "cosmos.crypto.hd.v1.BIP44Params") +} + +func init() { proto.RegisterFile("cosmos/crypto/hd/v1/hd.proto", fileDescriptor_cf10f1fb5e778a8d) } + +var fileDescriptor_cf10f1fb5e778a8d = []byte{ + // 294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x48, 0xd1, 0x2f, 0x33, 0xd4, + 0xcf, 0x48, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x41, 0x64, 0xf5, + 0x32, 0x52, 0xf4, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, + 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x0e, 0x30, + 0x72, 0x71, 0x3b, 0x79, 0x06, 0x98, 0x98, 0x04, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x0b, 0x49, 0x70, + 0xb1, 0x17, 0x94, 0x16, 0x15, 0xe4, 0x17, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x06, 0xc1, + 0xb8, 0x42, 0xd2, 0x5c, 0x9c, 0xc9, 0xf9, 0x99, 0x79, 0xf1, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x4c, + 0x60, 0x39, 0x0e, 0x90, 0x40, 0x48, 0x65, 0x41, 0x2a, 0x48, 0x5b, 0x62, 0x72, 0x72, 0x7e, 0x69, + 0x5e, 0x89, 0x04, 0x33, 0x44, 0x1b, 0x94, 0x2b, 0x24, 0xc6, 0xc5, 0x96, 0x9c, 0x91, 0x98, 0x97, + 0x9e, 0x2a, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x11, 0x04, 0xe5, 0x09, 0x29, 0x73, 0xf1, 0x26, 0xa6, + 0xa4, 0x14, 0xa5, 0x16, 0x17, 0xc7, 0x67, 0xe6, 0xa5, 0xa4, 0x56, 0x48, 0xb0, 0x82, 0xf5, 0xf1, + 0x40, 0x05, 0x3d, 0x41, 0x62, 0x56, 0xca, 0x33, 0x16, 0xc8, 0x33, 0x74, 0x3d, 0xdf, 0xa0, 0x25, + 0x05, 0xf5, 0x7b, 0x76, 0x6a, 0x65, 0x31, 0x28, 0x00, 0x90, 0x9c, 0xec, 0xe4, 0x72, 0xe2, 0xa1, + 0x1c, 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, + 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa5, 0x67, 0x96, + 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xc2, 0x11, 0x4c, 0xe9, 0x16, 0xa7, 0x64, + 0x23, 0x82, 0x34, 0x89, 0x0d, 0x1c, 0x1e, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x0c, + 0x7a, 0x26, 0x6d, 0x01, 0x00, 0x00, +} + +func (m *BIP44Params) 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 *BIP44Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BIP44Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressIndex != 0 { + i = encodeVarintHd(dAtA, i, uint64(m.AddressIndex)) + i-- + dAtA[i] = 0x28 + } + if m.Change { + i-- + if m.Change { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Account != 0 { + i = encodeVarintHd(dAtA, i, uint64(m.Account)) + i-- + dAtA[i] = 0x18 + } + if m.CoinType != 0 { + i = encodeVarintHd(dAtA, i, uint64(m.CoinType)) + i-- + dAtA[i] = 0x10 + } + if m.Purpose != 0 { + i = encodeVarintHd(dAtA, i, uint64(m.Purpose)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintHd(dAtA []byte, offset int, v uint64) int { + offset -= sovHd(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BIP44Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Purpose != 0 { + n += 1 + sovHd(uint64(m.Purpose)) + } + if m.CoinType != 0 { + n += 1 + sovHd(uint64(m.CoinType)) + } + if m.Account != 0 { + n += 1 + sovHd(uint64(m.Account)) + } + if m.Change { + n += 2 + } + if m.AddressIndex != 0 { + n += 1 + sovHd(uint64(m.AddressIndex)) + } + return n +} + +func sovHd(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozHd(x uint64) (n int) { + return sovHd(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BIP44Params) 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 ErrIntOverflowHd + } + 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: BIP44Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BIP44Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Purpose", wireType) + } + m.Purpose = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Purpose |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) + } + m.CoinType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CoinType |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) + } + m.Account = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Account |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Change = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) + } + m.AddressIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHd + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AddressIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipHd(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthHd + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipHd(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, ErrIntOverflowHd + } + 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, ErrIntOverflowHd + } + 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, ErrIntOverflowHd + } + 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, ErrInvalidLengthHd + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupHd + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthHd + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthHd = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowHd = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupHd = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go new file mode 100644 index 000000000000..081b456bea20 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go @@ -0,0 +1,1332 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/keyring/v1/record.proto + +package keyring + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + hd "github.com/cosmos/cosmos-sdk/crypto/hd" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package + +// Record is used for representing a key in the keyring. +type Record struct { + // name represents a name of Record + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // pub_key represents a public key in any format + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + // Record contains one of the following items + // + // Types that are valid to be assigned to Item: + // *Record_Local_ + // *Record_Ledger_ + // *Record_Multi_ + // *Record_Offline_ + Item isRecord_Item `protobuf_oneof:"item"` +} + +func (m *Record) Reset() { *m = Record{} } +func (m *Record) String() string { return proto.CompactTextString(m) } +func (*Record) ProtoMessage() {} +func (*Record) Descriptor() ([]byte, []int) { + return fileDescriptor_36d640103edea005, []int{0} +} +func (m *Record) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record.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 *Record) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record.Merge(m, src) +} +func (m *Record) XXX_Size() int { + return m.Size() +} +func (m *Record) XXX_DiscardUnknown() { + xxx_messageInfo_Record.DiscardUnknown(m) +} + +var xxx_messageInfo_Record proto.InternalMessageInfo + +type isRecord_Item interface { + isRecord_Item() + MarshalTo([]byte) (int, error) + Size() int +} + +type Record_Local_ struct { + Local *Record_Local `protobuf:"bytes,3,opt,name=local,proto3,oneof" json:"local,omitempty"` +} +type Record_Ledger_ struct { + Ledger *Record_Ledger `protobuf:"bytes,4,opt,name=ledger,proto3,oneof" json:"ledger,omitempty"` +} +type Record_Multi_ struct { + Multi *Record_Multi `protobuf:"bytes,5,opt,name=multi,proto3,oneof" json:"multi,omitempty"` +} +type Record_Offline_ struct { + Offline *Record_Offline `protobuf:"bytes,6,opt,name=offline,proto3,oneof" json:"offline,omitempty"` +} + +func (*Record_Local_) isRecord_Item() {} +func (*Record_Ledger_) isRecord_Item() {} +func (*Record_Multi_) isRecord_Item() {} +func (*Record_Offline_) isRecord_Item() {} + +func (m *Record) GetItem() isRecord_Item { + if m != nil { + return m.Item + } + return nil +} + +func (m *Record) GetLocal() *Record_Local { + if x, ok := m.GetItem().(*Record_Local_); ok { + return x.Local + } + return nil +} + +func (m *Record) GetLedger() *Record_Ledger { + if x, ok := m.GetItem().(*Record_Ledger_); ok { + return x.Ledger + } + return nil +} + +func (m *Record) GetMulti() *Record_Multi { + if x, ok := m.GetItem().(*Record_Multi_); ok { + return x.Multi + } + return nil +} + +func (m *Record) GetOffline() *Record_Offline { + if x, ok := m.GetItem().(*Record_Offline_); ok { + return x.Offline + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Record) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Record_Local_)(nil), + (*Record_Ledger_)(nil), + (*Record_Multi_)(nil), + (*Record_Offline_)(nil), + } +} + +// Item is a keyring item stored in a keyring backend. +// Local item +type Record_Local struct { + PrivKey *types.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"` +} + +func (m *Record_Local) Reset() { *m = Record_Local{} } +func (m *Record_Local) String() string { return proto.CompactTextString(m) } +func (*Record_Local) ProtoMessage() {} +func (*Record_Local) Descriptor() ([]byte, []int) { + return fileDescriptor_36d640103edea005, []int{0, 0} +} +func (m *Record_Local) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record_Local.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 *Record_Local) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record_Local.Merge(m, src) +} +func (m *Record_Local) XXX_Size() int { + return m.Size() +} +func (m *Record_Local) XXX_DiscardUnknown() { + xxx_messageInfo_Record_Local.DiscardUnknown(m) +} + +var xxx_messageInfo_Record_Local proto.InternalMessageInfo + +// Ledger item +type Record_Ledger struct { + Path *hd.BIP44Params `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` +} + +func (m *Record_Ledger) Reset() { *m = Record_Ledger{} } +func (m *Record_Ledger) String() string { return proto.CompactTextString(m) } +func (*Record_Ledger) ProtoMessage() {} +func (*Record_Ledger) Descriptor() ([]byte, []int) { + return fileDescriptor_36d640103edea005, []int{0, 1} +} +func (m *Record_Ledger) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record_Ledger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record_Ledger.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 *Record_Ledger) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record_Ledger.Merge(m, src) +} +func (m *Record_Ledger) XXX_Size() int { + return m.Size() +} +func (m *Record_Ledger) XXX_DiscardUnknown() { + xxx_messageInfo_Record_Ledger.DiscardUnknown(m) +} + +var xxx_messageInfo_Record_Ledger proto.InternalMessageInfo + +// Multi item +type Record_Multi struct { +} + +func (m *Record_Multi) Reset() { *m = Record_Multi{} } +func (m *Record_Multi) String() string { return proto.CompactTextString(m) } +func (*Record_Multi) ProtoMessage() {} +func (*Record_Multi) Descriptor() ([]byte, []int) { + return fileDescriptor_36d640103edea005, []int{0, 2} +} +func (m *Record_Multi) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record_Multi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record_Multi.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 *Record_Multi) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record_Multi.Merge(m, src) +} +func (m *Record_Multi) XXX_Size() int { + return m.Size() +} +func (m *Record_Multi) XXX_DiscardUnknown() { + xxx_messageInfo_Record_Multi.DiscardUnknown(m) +} + +var xxx_messageInfo_Record_Multi proto.InternalMessageInfo + +// Offline item +type Record_Offline struct { +} + +func (m *Record_Offline) Reset() { *m = Record_Offline{} } +func (m *Record_Offline) String() string { return proto.CompactTextString(m) } +func (*Record_Offline) ProtoMessage() {} +func (*Record_Offline) Descriptor() ([]byte, []int) { + return fileDescriptor_36d640103edea005, []int{0, 3} +} +func (m *Record_Offline) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record_Offline) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record_Offline.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 *Record_Offline) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record_Offline.Merge(m, src) +} +func (m *Record_Offline) XXX_Size() int { + return m.Size() +} +func (m *Record_Offline) XXX_DiscardUnknown() { + xxx_messageInfo_Record_Offline.DiscardUnknown(m) +} + +var xxx_messageInfo_Record_Offline proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Record)(nil), "cosmos.crypto.keyring.v1.Record") + proto.RegisterType((*Record_Local)(nil), "cosmos.crypto.keyring.v1.Record.Local") + proto.RegisterType((*Record_Ledger)(nil), "cosmos.crypto.keyring.v1.Record.Ledger") + proto.RegisterType((*Record_Multi)(nil), "cosmos.crypto.keyring.v1.Record.Multi") + proto.RegisterType((*Record_Offline)(nil), "cosmos.crypto.keyring.v1.Record.Offline") +} + +func init() { + proto.RegisterFile("cosmos/crypto/keyring/v1/record.proto", fileDescriptor_36d640103edea005) +} + +var fileDescriptor_36d640103edea005 = []byte{ + // 411 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbd, 0xae, 0xd3, 0x30, + 0x1c, 0xc5, 0x1d, 0x6e, 0x3e, 0xb8, 0x66, 0xb3, 0xee, 0x10, 0x22, 0x64, 0x55, 0x48, 0x40, 0x25, + 0x54, 0x5b, 0x85, 0x0e, 0x4c, 0x95, 0x5a, 0x31, 0x14, 0x95, 0x8a, 0x2a, 0x23, 0x0b, 0xca, 0x87, + 0x9b, 0x44, 0x4d, 0xe2, 0xc8, 0x49, 0x2a, 0xe5, 0x2d, 0x18, 0x79, 0xa4, 0x8e, 0x1d, 0x19, 0xa1, + 0xd9, 0x78, 0x0a, 0x64, 0x3b, 0x1d, 0xa8, 0x04, 0x65, 0x8a, 0x23, 0xff, 0xce, 0xff, 0x9c, 0x63, + 0xfd, 0xe1, 0x8b, 0x88, 0xd7, 0x05, 0xaf, 0x69, 0x24, 0xba, 0xaa, 0xe1, 0x74, 0xcf, 0x3a, 0x91, + 0x95, 0x09, 0x3d, 0x4c, 0xa9, 0x60, 0x11, 0x17, 0x31, 0xa9, 0x04, 0x6f, 0x38, 0x72, 0x35, 0x46, + 0x34, 0x46, 0x06, 0x8c, 0x1c, 0xa6, 0xde, 0x43, 0xc2, 0x13, 0xae, 0x20, 0x2a, 0x4f, 0x9a, 0xf7, + 0x9e, 0x26, 0x9c, 0x27, 0x39, 0xa3, 0xea, 0x2f, 0x6c, 0x77, 0x34, 0x28, 0xbb, 0xe1, 0xea, 0xd9, + 0x9f, 0x8e, 0x69, 0x2c, 0xcd, 0xd2, 0xc1, 0xe8, 0xf9, 0xaf, 0x3b, 0x68, 0xfb, 0xca, 0x19, 0x21, + 0x68, 0x96, 0x41, 0xc1, 0x5c, 0x63, 0x64, 0x8c, 0xef, 0x7d, 0x75, 0x46, 0x13, 0xe8, 0x54, 0x6d, + 0xf8, 0x65, 0xcf, 0x3a, 0xf7, 0xd1, 0xc8, 0x18, 0x3f, 0x79, 0xf3, 0x40, 0xb4, 0x13, 0xb9, 0x38, + 0x91, 0x45, 0xd9, 0xf9, 0x76, 0xd5, 0x86, 0x6b, 0xd6, 0xa1, 0x39, 0xb4, 0x72, 0x1e, 0x05, 0xb9, + 0x7b, 0xa7, 0xe0, 0x97, 0xe4, 0x6f, 0x35, 0x88, 0xf6, 0x24, 0x1f, 0x25, 0xbd, 0x02, 0xbe, 0x96, + 0xa1, 0x05, 0xb4, 0x73, 0x16, 0x27, 0x4c, 0xb8, 0xa6, 0x1a, 0xf0, 0xea, 0xf6, 0x00, 0x85, 0xaf, + 0x80, 0x3f, 0x08, 0x65, 0x84, 0xa2, 0xcd, 0x9b, 0xcc, 0xb5, 0xfe, 0x33, 0xc2, 0x46, 0xd2, 0x32, + 0x82, 0x92, 0xa1, 0xf7, 0xd0, 0xe1, 0xbb, 0x5d, 0x9e, 0x95, 0xcc, 0xb5, 0xd5, 0x84, 0xf1, 0xcd, + 0x09, 0x9f, 0x34, 0xbf, 0x02, 0xfe, 0x45, 0xea, 0xbd, 0x83, 0x96, 0xaa, 0x86, 0x28, 0x7c, 0x5c, + 0x89, 0xec, 0xa0, 0x5e, 0xd0, 0xf8, 0xc7, 0x0b, 0x3a, 0x92, 0x5a, 0xb3, 0xce, 0x9b, 0x43, 0x5b, + 0x77, 0x42, 0x33, 0x68, 0x56, 0x41, 0x93, 0x0e, 0xb2, 0xd1, 0x55, 0x8c, 0x34, 0x96, 0x09, 0x96, + 0x1f, 0xb6, 0xb3, 0xd9, 0x36, 0x10, 0x41, 0x51, 0xfb, 0x8a, 0xf6, 0x1c, 0x68, 0xa9, 0x46, 0xde, + 0x3d, 0x74, 0x86, 0x60, 0x4b, 0x1b, 0x9a, 0x59, 0xc3, 0x8a, 0xe5, 0xe6, 0xf8, 0x13, 0x83, 0xe3, + 0x19, 0x1b, 0xa7, 0x33, 0x36, 0x7e, 0x9c, 0xb1, 0xf1, 0xb5, 0xc7, 0xe0, 0x5b, 0x8f, 0xc1, 0xa9, + 0xc7, 0xe0, 0x7b, 0x8f, 0xc1, 0xe7, 0xd7, 0x49, 0xd6, 0xa4, 0x6d, 0x48, 0x22, 0x5e, 0xd0, 0xcb, + 0xde, 0xa8, 0xcf, 0xa4, 0x8e, 0xf7, 0x57, 0x4b, 0x1b, 0xda, 0xaa, 0xc1, 0xdb, 0xdf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x47, 0x24, 0x2f, 0xa9, 0xd4, 0x02, 0x00, 0x00, +} + +func (m *Record) 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 *Record) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Item != nil { + { + size := m.Item.Size() + i -= size + if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintRecord(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Record_Local_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Local_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Local != nil { + { + size, err := m.Local.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *Record_Ledger_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Ledger_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Ledger != nil { + { + size, err := m.Ledger.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Record_Multi_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Multi_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Multi != nil { + { + size, err := m.Multi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Record_Offline_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Offline_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Offline != nil { + { + size, err := m.Offline.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *Record_Local) 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 *Record_Local) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Local) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PrivKey != nil { + { + size, err := m.PrivKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Record_Ledger) 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 *Record_Ledger) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Ledger) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Path != nil { + { + size, err := m.Path.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRecord(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Record_Multi) 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 *Record_Multi) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Multi) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *Record_Offline) 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 *Record_Offline) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record_Offline) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintRecord(dAtA []byte, offset int, v uint64) int { + offset -= sovRecord(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Record) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovRecord(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovRecord(uint64(l)) + } + if m.Item != nil { + n += m.Item.Size() + } + return n +} + +func (m *Record_Local_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Local != nil { + l = m.Local.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} +func (m *Record_Ledger_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Ledger != nil { + l = m.Ledger.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} +func (m *Record_Multi_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Multi != nil { + l = m.Multi.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} +func (m *Record_Offline_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Offline != nil { + l = m.Offline.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} +func (m *Record_Local) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PrivKey != nil { + l = m.PrivKey.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} + +func (m *Record_Ledger) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Path != nil { + l = m.Path.Size() + n += 1 + l + sovRecord(uint64(l)) + } + return n +} + +func (m *Record_Multi) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *Record_Offline) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovRecord(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRecord(x uint64) (n int) { + return sovRecord(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Record) 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 ErrIntOverflowRecord + } + 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: Record: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Record: 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 ErrIntOverflowRecord + } + 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 ErrInvalidLengthRecord + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + 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 PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Record_Local{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &Record_Local_{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ledger", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Record_Ledger{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &Record_Ledger_{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Multi", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Record_Multi{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &Record_Multi_{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Offline", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &Record_Offline{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &Record_Offline_{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecord(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecord + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Record_Local) 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 ErrIntOverflowRecord + } + 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: Local: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Local: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PrivKey == nil { + m.PrivKey = &types.Any{} + } + if err := m.PrivKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecord(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecord + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Record_Ledger) 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 ErrIntOverflowRecord + } + 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: Ledger: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Ledger: 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 msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRecord + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRecord + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Path == nil { + m.Path = &hd.BIP44Params{} + } + if err := m.Path.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRecord(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecord + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Record_Multi) 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 ErrIntOverflowRecord + } + 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: Multi: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Multi: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRecord(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecord + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Record_Offline) 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 ErrIntOverflowRecord + } + 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: Offline: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Offline: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipRecord(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRecord + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRecord(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, ErrIntOverflowRecord + } + 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, ErrIntOverflowRecord + } + 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, ErrIntOverflowRecord + } + 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, ErrInvalidLengthRecord + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRecord + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRecord + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRecord = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go new file mode 100644 index 000000000000..1280647df3ec --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go @@ -0,0 +1,505 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/ed25519/keys.proto + +package ed25519 + +import ( + crypto_ed25519 "crypto/ed25519" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +// It's needed for Any serialization and SDK compatibility. +// It must not be used in a non Tendermint key context because it doesn't implement +// ADR-28. Nevertheless, you will like to use ed25519 in app user level +// then you must create a new proto message and follow ADR-28 for Address construction. +type PubKey struct { + Key crypto_ed25519.PublicKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PublicKey" json:"key,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_48fe3336771e732d, []int{0} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetKey() crypto_ed25519.PublicKey { + if m != nil { + return m.Key + } + return nil +} + +// Deprecated: PrivKey defines a ed25519 private key. +// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +type PrivKey struct { + Key crypto_ed25519.PrivateKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PrivateKey" json:"key,omitempty"` +} + +func (m *PrivKey) Reset() { *m = PrivKey{} } +func (m *PrivKey) String() string { return proto.CompactTextString(m) } +func (*PrivKey) ProtoMessage() {} +func (*PrivKey) Descriptor() ([]byte, []int) { + return fileDescriptor_48fe3336771e732d, []int{1} +} +func (m *PrivKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrivKey.Merge(m, src) +} +func (m *PrivKey) XXX_Size() int { + return m.Size() +} +func (m *PrivKey) XXX_DiscardUnknown() { + xxx_messageInfo_PrivKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PrivKey proto.InternalMessageInfo + +func (m *PrivKey) GetKey() crypto_ed25519.PrivateKey { + if m != nil { + return m.Key + } + return nil +} + +func init() { + proto.RegisterType((*PubKey)(nil), "cosmos.crypto.ed25519.PubKey") + proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.ed25519.PrivKey") +} + +func init() { proto.RegisterFile("cosmos/crypto/ed25519/keys.proto", fileDescriptor_48fe3336771e732d) } + +var fileDescriptor_48fe3336771e732d = []byte{ + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x4f, 0x4d, 0x31, 0x32, 0x35, 0x35, + 0xb4, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, + 0xd0, 0x83, 0xa8, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, + 0x10, 0x95, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xca, + 0xe4, 0x62, 0x0b, 0x28, 0x4d, 0xf2, 0x4e, 0xad, 0x14, 0xd2, 0xe3, 0x62, 0xce, 0x4e, 0xad, 0x94, + 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x71, 0x92, 0xf9, 0x75, 0x4f, 0x5e, 0x02, 0xd5, 0x56, 0xbd, 0x80, + 0xd2, 0xa4, 0x9c, 0xcc, 0x64, 0xef, 0xd4, 0xca, 0x20, 0x90, 0x42, 0x2b, 0xfd, 0x19, 0x0b, 0xe4, + 0x19, 0xba, 0x9e, 0x6f, 0xd0, 0x92, 0x28, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, + 0xd1, 0x87, 0x98, 0xe5, 0x0a, 0xd1, 0x31, 0xe9, 0xf9, 0x06, 0x2d, 0xce, 0xec, 0xd4, 0xca, 0xf8, + 0xb4, 0xcc, 0xd4, 0x9c, 0x14, 0xa5, 0x0c, 0x2e, 0xf6, 0x80, 0xa2, 0xcc, 0x32, 0x90, 0x5d, 0xfa, + 0xc8, 0x76, 0xc9, 0xfe, 0xba, 0x27, 0x2f, 0x89, 0x6e, 0x57, 0x51, 0x66, 0x59, 0x62, 0x49, 0x2a, + 0xdc, 0x32, 0x1d, 0x90, 0x45, 0x92, 0xc8, 0x16, 0x41, 0x4c, 0xc2, 0x6a, 0x93, 0x93, 0xd7, 0x89, + 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, + 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xc2, 0x16, 0x4c, 0xe9, 0x16, 0xa7, 0x64, 0xc3, 0x82, 0x19, + 0x14, 0xbc, 0x30, 0x97, 0x24, 0xb1, 0x81, 0xc3, 0xc9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8e, + 0xcd, 0xa4, 0x67, 0x8b, 0x01, 0x00, 0x00, +} + +func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func (m *PrivKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PubKey) 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 ErrIntOverflowKeys + } + 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: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrivKey) 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 ErrIntOverflowKeys + } + 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: PrivKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go new file mode 100644 index 000000000000..b181232634fd --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go @@ -0,0 +1,362 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/multisig/keys.proto + +package multisig + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// LegacyAminoPubKey specifies a public key type +// which nests multiple public keys and a threshold, +// it uses legacy amino address rules. +type LegacyAminoPubKey struct { + Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` + PubKeys []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"` +} + +func (m *LegacyAminoPubKey) Reset() { *m = LegacyAminoPubKey{} } +func (m *LegacyAminoPubKey) String() string { return proto.CompactTextString(m) } +func (*LegacyAminoPubKey) ProtoMessage() {} +func (*LegacyAminoPubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_46b57537e097d47d, []int{0} +} +func (m *LegacyAminoPubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyAminoPubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyAminoPubKey.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 *LegacyAminoPubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyAminoPubKey.Merge(m, src) +} +func (m *LegacyAminoPubKey) XXX_Size() int { + return m.Size() +} +func (m *LegacyAminoPubKey) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyAminoPubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyAminoPubKey proto.InternalMessageInfo + +func init() { + proto.RegisterType((*LegacyAminoPubKey)(nil), "cosmos.crypto.multisig.LegacyAminoPubKey") +} + +func init() { proto.RegisterFile("cosmos/crypto/multisig/keys.proto", fileDescriptor_46b57537e097d47d) } + +var fileDescriptor_46b57537e097d47d = []byte{ + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x2d, 0xcd, 0x29, 0xc9, 0x2c, + 0xce, 0x4c, 0xd7, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, + 0x28, 0xd1, 0x83, 0x28, 0xd1, 0x83, 0x29, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd1, + 0x07, 0xb1, 0x20, 0xaa, 0xa5, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, + 0xd2, 0x34, 0xfd, 0xc4, 0xbc, 0x4a, 0xa8, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, + 0x84, 0x08, 0x29, 0x1d, 0x66, 0xe4, 0x12, 0xf4, 0x49, 0x4d, 0x4f, 0x4c, 0xae, 0x74, 0x04, 0x89, + 0x06, 0x94, 0x26, 0x79, 0xa7, 0x56, 0x0a, 0xc9, 0x70, 0x71, 0x96, 0x64, 0x14, 0xa5, 0x16, 0x67, + 0xe4, 0xe7, 0xa4, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x06, 0x21, 0x04, 0x84, 0xfc, 0xb8, 0xb8, + 0x0b, 0x4a, 0x93, 0x72, 0x32, 0x93, 0xe3, 0x41, 0x8e, 0x94, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, + 0x12, 0xd1, 0x83, 0xd8, 0xab, 0x07, 0xb3, 0x57, 0xcf, 0x31, 0xaf, 0xd2, 0x49, 0xfc, 0xd1, 0x3d, + 0x79, 0x76, 0x88, 0xa1, 0xc5, 0x8b, 0x9e, 0x6f, 0xd0, 0x62, 0x2f, 0x28, 0x4d, 0x02, 0x69, 0x0a, + 0xe2, 0x82, 0x98, 0x00, 0x12, 0xb7, 0x72, 0xe8, 0x58, 0x20, 0xcf, 0xd0, 0xf5, 0x7c, 0x83, 0x96, + 0x52, 0x49, 0x6a, 0x5e, 0x4a, 0x6a, 0x51, 0x6e, 0x66, 0x5e, 0x89, 0x3e, 0x44, 0x93, 0x2f, 0xd4, + 0xaf, 0x21, 0x30, 0xcb, 0x27, 0x3d, 0xdf, 0xa0, 0x25, 0x00, 0x77, 0x4a, 0x7c, 0x71, 0x49, 0x51, + 0x66, 0x5e, 0xba, 0x93, 0xf7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, + 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, + 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0x42, 0x1a, 0x4c, 0xe9, + 0x16, 0xa7, 0x64, 0xc3, 0x02, 0x1d, 0xe4, 0x22, 0x78, 0xc8, 0x27, 0xb1, 0x81, 0x7d, 0x60, 0x0c, + 0x08, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x78, 0xf0, 0xbc, 0x9a, 0x01, 0x00, 0x00, +} + +func (m *LegacyAminoPubKey) 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 *LegacyAminoPubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyAminoPubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PubKeys) > 0 { + for iNdEx := len(m.PubKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PubKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintKeys(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Threshold != 0 { + i = encodeVarintKeys(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LegacyAminoPubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Threshold != 0 { + n += 1 + sovKeys(uint64(m.Threshold)) + } + if len(m.PubKeys) > 0 { + for _, e := range m.PubKeys { + l = e.Size() + n += 1 + l + sovKeys(uint64(l)) + } + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LegacyAminoPubKey) 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 ErrIntOverflowKeys + } + 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: LegacyAminoPubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LegacyAminoPubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKeys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PubKeys = append(m.PubKeys, &types.Any{}) + if err := m.PubKeys[len(m.PubKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go new file mode 100644 index 000000000000..24ab774e36d4 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/secp256k1/keys.proto + +package secp256k1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PubKey defines a secp256k1 public key +// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +// if the y-coordinate is the lexicographically largest of the two associated with +// the x-coordinate. Otherwise the first byte is a 0x03. +// This prefix is followed with the x-coordinate. +type PubKey struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_e0835e68ebdcb224, []int{0} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (m *PubKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +// PrivKey defines a secp256k1 private key. +type PrivKey struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *PrivKey) Reset() { *m = PrivKey{} } +func (m *PrivKey) String() string { return proto.CompactTextString(m) } +func (*PrivKey) ProtoMessage() {} +func (*PrivKey) Descriptor() ([]byte, []int) { + return fileDescriptor_e0835e68ebdcb224, []int{1} +} +func (m *PrivKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrivKey.Merge(m, src) +} +func (m *PrivKey) XXX_Size() int { + return m.Size() +} +func (m *PrivKey) XXX_DiscardUnknown() { + xxx_messageInfo_PrivKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PrivKey proto.InternalMessageInfo + +func (m *PrivKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func init() { + proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256k1.PubKey") + proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256k1.PrivKey") +} + +func init() { + proto.RegisterFile("cosmos/crypto/secp256k1/keys.proto", fileDescriptor_e0835e68ebdcb224) +} + +var fileDescriptor_e0835e68ebdcb224 = []byte{ + // 244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32, + 0x35, 0xcb, 0x36, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, + 0x07, 0x93, 0x10, 0xb5, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, + 0x55, 0xf2, 0xe5, 0x62, 0x0b, 0x28, 0x4d, 0xf2, 0x4e, 0xad, 0x14, 0x12, 0xe0, 0x62, 0xce, 0x4e, + 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0x31, 0xad, 0x0c, 0x67, 0x2c, 0x90, 0x67, + 0xe8, 0x7a, 0xbe, 0x41, 0x4b, 0xaa, 0x24, 0x35, 0x2f, 0x25, 0xb5, 0x28, 0x37, 0x33, 0xaf, 0x44, + 0x1f, 0xa2, 0x3a, 0x18, 0x66, 0xd3, 0xa4, 0xe7, 0x1b, 0xb4, 0x38, 0xb3, 0x53, 0x2b, 0xe3, 0xd3, + 0x32, 0x53, 0x73, 0x52, 0x94, 0xbc, 0xb9, 0xd8, 0x03, 0x8a, 0x32, 0xcb, 0xb0, 0x9b, 0xa7, 0x07, + 0x32, 0x4b, 0x1a, 0xd9, 0x2c, 0x88, 0x52, 0x1c, 0x86, 0x39, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, + 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, + 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, + 0xae, 0x3e, 0x2c, 0x98, 0xc0, 0x94, 0x6e, 0x71, 0x4a, 0x36, 0x2c, 0xc4, 0x40, 0xe1, 0x84, 0x08, + 0xb6, 0x24, 0x36, 0xb0, 0x87, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0x42, 0xbc, 0x00, + 0x58, 0x01, 0x00, 0x00, +} + +func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func (m *PrivKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PubKey) 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 ErrIntOverflowKeys + } + 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: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrivKey) 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 ErrIntOverflowKeys + } + 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: PrivKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go new file mode 100644 index 000000000000..7bfb79ff77d4 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go @@ -0,0 +1,503 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/secp256r1/keys.proto + +package secp256r1 + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PubKey defines a secp256r1 ECDSA public key. +type PubKey struct { + // Point on secp256r1 curve in a compressed representation as specified in section + // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 + Key *ecdsaPK `protobuf:"bytes,1,opt,name=key,proto3,customtype=ecdsaPK" json:"key,omitempty"` +} + +func (m *PubKey) Reset() { *m = PubKey{} } +func (*PubKey) ProtoMessage() {} +func (*PubKey) Descriptor() ([]byte, []int) { + return fileDescriptor_b90c18415095c0c3, []int{0} +} +func (m *PubKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PubKey.Merge(m, src) +} +func (m *PubKey) XXX_Size() int { + return m.Size() +} +func (m *PubKey) XXX_DiscardUnknown() { + xxx_messageInfo_PubKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PubKey proto.InternalMessageInfo + +func (*PubKey) XXX_MessageName() string { + return "cosmos.crypto.secp256r1.PubKey" +} + +// PrivKey defines a secp256r1 ECDSA private key. +type PrivKey struct { + // secret number serialized using big-endian encoding + Secret *ecdsaSK `protobuf:"bytes,1,opt,name=secret,proto3,customtype=ecdsaSK" json:"secret,omitempty"` +} + +func (m *PrivKey) Reset() { *m = PrivKey{} } +func (*PrivKey) ProtoMessage() {} +func (*PrivKey) Descriptor() ([]byte, []int) { + return fileDescriptor_b90c18415095c0c3, []int{1} +} +func (m *PrivKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_PrivKey.Merge(m, src) +} +func (m *PrivKey) XXX_Size() int { + return m.Size() +} +func (m *PrivKey) XXX_DiscardUnknown() { + xxx_messageInfo_PrivKey.DiscardUnknown(m) +} + +var xxx_messageInfo_PrivKey proto.InternalMessageInfo + +func (*PrivKey) XXX_MessageName() string { + return "cosmos.crypto.secp256r1.PrivKey" +} +func init() { + proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256r1.PubKey") + proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256r1.PrivKey") +} + +func init() { + proto.RegisterFile("cosmos/crypto/secp256r1/keys.proto", fileDescriptor_b90c18415095c0c3) +} + +var fileDescriptor_b90c18415095c0c3 = []byte{ + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32, + 0x35, 0x2b, 0x32, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, + 0xd1, 0x07, 0xb1, 0x20, 0xca, 0x95, 0xd4, 0xb9, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, + 0x64, 0xb9, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0xb8, 0x6f, 0xdd, + 0x93, 0x67, 0x4f, 0x4d, 0x4e, 0x29, 0x4e, 0x0c, 0xf0, 0x0e, 0x02, 0x89, 0x2b, 0xe9, 0x71, 0xb1, + 0x07, 0x14, 0x65, 0x96, 0x81, 0x54, 0x2a, 0x73, 0xb1, 0x15, 0xa7, 0x26, 0x17, 0xa5, 0x96, 0x60, + 0x28, 0x0e, 0xf6, 0x0e, 0x82, 0x4a, 0x39, 0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, + 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, + 0x1c, 0xc3, 0x89, 0xc7, 0x72, 0x8c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, + 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xf3, 0x1c, 0x98, 0xd2, + 0x2d, 0x4e, 0xc9, 0x86, 0xf9, 0x13, 0xe4, 0x3b, 0x84, 0x67, 0x93, 0xd8, 0xc0, 0x2e, 0x37, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x65, 0x08, 0x5c, 0x0e, 0x01, 0x00, 0x00, +} + +func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Key != nil { + { + size := m.Key.Size() + i -= size + if _, err := m.Key.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintKeys(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Secret != nil { + { + size := m.Secret.Size() + i -= size + if _, err := m.Secret.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintKeys(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { + offset -= sovKeys(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PubKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Key != nil { + l = m.Key.Size() + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func (m *PrivKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Secret != nil { + l = m.Secret.Size() + n += 1 + l + sovKeys(uint64(l)) + } + return n +} + +func sovKeys(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKeys(x uint64) (n int) { + return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PubKey) 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 ErrIntOverflowKeys + } + 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: PubKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v ecdsaPK + m.Key = &v + if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PrivKey) 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 ErrIntOverflowKeys + } + 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: PrivKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKeys + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKeys + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKeys + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v ecdsaSK + m.Secret = &v + if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKeys(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKeys + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKeys(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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrIntOverflowKeys + } + 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, ErrInvalidLengthKeys + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKeys + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKeys + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go b/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go new file mode 100644 index 000000000000..a5b750a17fbc --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go @@ -0,0 +1,550 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crypto/multisig/v1beta1/multisig.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +// signed and with which modes. +type MultiSignature struct { + Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MultiSignature) Reset() { *m = MultiSignature{} } +func (m *MultiSignature) String() string { return proto.CompactTextString(m) } +func (*MultiSignature) ProtoMessage() {} +func (*MultiSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_1177bdf7025769be, []int{0} +} +func (m *MultiSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MultiSignature.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 *MultiSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignature.Merge(m, src) +} +func (m *MultiSignature) XXX_Size() int { + return m.Size() +} +func (m *MultiSignature) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiSignature proto.InternalMessageInfo + +func (m *MultiSignature) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +// CompactBitArray is an implementation of a space efficient bit array. +// This is used to ensure that the encoded data takes up a minimal amount of +// space after proto encoding. +// This is not thread safe, and is not intended for concurrent usage. +type CompactBitArray struct { + ExtraBitsStored uint32 `protobuf:"varint,1,opt,name=extra_bits_stored,json=extraBitsStored,proto3" json:"extra_bits_stored,omitempty"` + Elems []byte `protobuf:"bytes,2,opt,name=elems,proto3" json:"elems,omitempty"` +} + +func (m *CompactBitArray) Reset() { *m = CompactBitArray{} } +func (*CompactBitArray) ProtoMessage() {} +func (*CompactBitArray) Descriptor() ([]byte, []int) { + return fileDescriptor_1177bdf7025769be, []int{1} +} +func (m *CompactBitArray) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CompactBitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CompactBitArray.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 *CompactBitArray) XXX_Merge(src proto.Message) { + xxx_messageInfo_CompactBitArray.Merge(m, src) +} +func (m *CompactBitArray) XXX_Size() int { + return m.Size() +} +func (m *CompactBitArray) XXX_DiscardUnknown() { + xxx_messageInfo_CompactBitArray.DiscardUnknown(m) +} + +var xxx_messageInfo_CompactBitArray proto.InternalMessageInfo + +func (m *CompactBitArray) GetExtraBitsStored() uint32 { + if m != nil { + return m.ExtraBitsStored + } + return 0 +} + +func (m *CompactBitArray) GetElems() []byte { + if m != nil { + return m.Elems + } + return nil +} + +func init() { + proto.RegisterType((*MultiSignature)(nil), "cosmos.crypto.multisig.v1beta1.MultiSignature") + proto.RegisterType((*CompactBitArray)(nil), "cosmos.crypto.multisig.v1beta1.CompactBitArray") +} + +func init() { + proto.RegisterFile("cosmos/crypto/multisig/v1beta1/multisig.proto", fileDescriptor_1177bdf7025769be) +} + +var fileDescriptor_1177bdf7025769be = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x31, 0x4f, 0x83, 0x50, + 0x14, 0x85, 0x79, 0x5a, 0x1d, 0x5e, 0xaa, 0x8d, 0xa4, 0x03, 0x71, 0x78, 0x25, 0x9d, 0xd0, 0xa4, + 0x90, 0xc6, 0xc4, 0xa1, 0x9b, 0x74, 0x76, 0xa1, 0x93, 0x2e, 0x0d, 0xd0, 0x17, 0x7c, 0xb1, 0x78, + 0xc9, 0xbb, 0x17, 0x23, 0xff, 0xc2, 0xd1, 0x51, 0xff, 0x8d, 0x23, 0xa3, 0xa3, 0x81, 0x3f, 0x62, + 0xfa, 0x90, 0xa6, 0xd3, 0xbd, 0xe7, 0x9c, 0xef, 0x0e, 0xf7, 0xf0, 0x59, 0x0a, 0x98, 0x03, 0x06, + 0xa9, 0xae, 0x0a, 0x82, 0x20, 0x2f, 0xb7, 0xa4, 0x50, 0x65, 0xc1, 0xeb, 0x3c, 0x91, 0x14, 0xcf, + 0xf7, 0x86, 0x5f, 0x68, 0x20, 0xb0, 0x45, 0x87, 0xfb, 0x1d, 0xee, 0xef, 0xd3, 0x7f, 0xfc, 0x72, + 0x9c, 0x41, 0x06, 0x06, 0x0d, 0x76, 0x5b, 0x77, 0x35, 0xbd, 0xe5, 0xe7, 0xf7, 0x3b, 0x72, 0xa5, + 0xb2, 0x97, 0x98, 0x4a, 0x2d, 0x6d, 0xc1, 0x39, 0xf6, 0x02, 0x1d, 0xe6, 0x1e, 0x7b, 0xc3, 0xe8, + 0xc0, 0x59, 0x0c, 0xea, 0xaf, 0x09, 0x9b, 0x3e, 0xf0, 0xd1, 0x12, 0xf2, 0x22, 0x4e, 0x29, 0x54, + 0x74, 0xa7, 0x75, 0x5c, 0xd9, 0xd7, 0xfc, 0x42, 0xbe, 0x91, 0x8e, 0xd7, 0x89, 0x22, 0x5c, 0x23, + 0x81, 0x96, 0x1b, 0x87, 0xb9, 0xcc, 0x3b, 0x8b, 0x46, 0x26, 0x08, 0x15, 0xe1, 0xca, 0xd8, 0xf6, + 0x98, 0x9f, 0xc8, 0xad, 0xcc, 0xd1, 0x39, 0x72, 0x99, 0x37, 0x8c, 0x3a, 0xb1, 0x18, 0x7c, 0x7c, + 0x4e, 0xac, 0x70, 0xf9, 0xdd, 0x08, 0x56, 0x37, 0x82, 0xfd, 0x36, 0x82, 0xbd, 0xb7, 0xc2, 0xaa, + 0x5b, 0x61, 0xfd, 0xb4, 0xc2, 0x7a, 0xbc, 0xca, 0x14, 0x3d, 0x95, 0x89, 0x9f, 0x42, 0x1e, 0xf4, + 0xe5, 0x98, 0x31, 0xc3, 0xcd, 0x73, 0xdf, 0x13, 0x55, 0x85, 0xc4, 0xe4, 0xd4, 0xbc, 0x77, 0xf3, + 0x17, 0x00, 0x00, 0xff, 0xff, 0xba, 0x52, 0xb5, 0x1f, 0x45, 0x01, 0x00, 0x00, +} + +func (m *MultiSignature) 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 *MultiSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Signatures[iNdEx]) + copy(dAtA[i:], m.Signatures[iNdEx]) + i = encodeVarintMultisig(dAtA, i, uint64(len(m.Signatures[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *CompactBitArray) 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 *CompactBitArray) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CompactBitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Elems) > 0 { + i -= len(m.Elems) + copy(dAtA[i:], m.Elems) + i = encodeVarintMultisig(dAtA, i, uint64(len(m.Elems))) + i-- + dAtA[i] = 0x12 + } + if m.ExtraBitsStored != 0 { + i = encodeVarintMultisig(dAtA, i, uint64(m.ExtraBitsStored)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintMultisig(dAtA []byte, offset int, v uint64) int { + offset -= sovMultisig(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MultiSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovMultisig(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CompactBitArray) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExtraBitsStored != 0 { + n += 1 + sovMultisig(uint64(m.ExtraBitsStored)) + } + l = len(m.Elems) + if l > 0 { + n += 1 + l + sovMultisig(uint64(l)) + } + return n +} + +func sovMultisig(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMultisig(x uint64) (n int) { + return sovMultisig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MultiSignature) 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 ErrIntOverflowMultisig + } + 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: MultiSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultisig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMultisig + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMultisig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) + copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMultisig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMultisig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CompactBitArray) 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 ErrIntOverflowMultisig + } + 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: CompactBitArray: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CompactBitArray: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraBitsStored", wireType) + } + m.ExtraBitsStored = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultisig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExtraBitsStored |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMultisig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMultisig + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMultisig + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Elems = append(m.Elems[:0], dAtA[iNdEx:postIndex]...) + if m.Elems == nil { + m.Elems = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMultisig(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMultisig + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMultisig(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, ErrIntOverflowMultisig + } + 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, ErrIntOverflowMultisig + } + 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, ErrIntOverflowMultisig + } + 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, ErrInvalidLengthMultisig + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMultisig + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMultisig + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMultisig = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMultisig = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMultisig = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go new file mode 100644 index 000000000000..360e4440e8f6 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go @@ -0,0 +1,5613 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/reflection/v2alpha1/reflection.proto + +package v2alpha1 + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// AppDescriptor describes a cosmos-sdk based application +type AppDescriptor struct { + // AuthnDescriptor provides information on how to authenticate transactions on the application + // NOTE: experimental and subject to change in future releases. + Authn *AuthnDescriptor `protobuf:"bytes,1,opt,name=authn,proto3" json:"authn,omitempty"` + // chain provides the chain descriptor + Chain *ChainDescriptor `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` + // codec provides metadata information regarding codec related types + Codec *CodecDescriptor `protobuf:"bytes,3,opt,name=codec,proto3" json:"codec,omitempty"` + // configuration provides metadata information regarding the sdk.Config type + Configuration *ConfigurationDescriptor `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` + // query_services provides metadata information regarding the available queriable endpoints + QueryServices *QueryServicesDescriptor `protobuf:"bytes,5,opt,name=query_services,json=queryServices,proto3" json:"query_services,omitempty"` + // tx provides metadata information regarding how to send transactions to the given application + Tx *TxDescriptor `protobuf:"bytes,6,opt,name=tx,proto3" json:"tx,omitempty"` +} + +func (m *AppDescriptor) Reset() { *m = AppDescriptor{} } +func (m *AppDescriptor) String() string { return proto.CompactTextString(m) } +func (*AppDescriptor) ProtoMessage() {} +func (*AppDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{0} +} +func (m *AppDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AppDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AppDescriptor.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 *AppDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_AppDescriptor.Merge(m, src) +} +func (m *AppDescriptor) XXX_Size() int { + return m.Size() +} +func (m *AppDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_AppDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_AppDescriptor proto.InternalMessageInfo + +func (m *AppDescriptor) GetAuthn() *AuthnDescriptor { + if m != nil { + return m.Authn + } + return nil +} + +func (m *AppDescriptor) GetChain() *ChainDescriptor { + if m != nil { + return m.Chain + } + return nil +} + +func (m *AppDescriptor) GetCodec() *CodecDescriptor { + if m != nil { + return m.Codec + } + return nil +} + +func (m *AppDescriptor) GetConfiguration() *ConfigurationDescriptor { + if m != nil { + return m.Configuration + } + return nil +} + +func (m *AppDescriptor) GetQueryServices() *QueryServicesDescriptor { + if m != nil { + return m.QueryServices + } + return nil +} + +func (m *AppDescriptor) GetTx() *TxDescriptor { + if m != nil { + return m.Tx + } + return nil +} + +// TxDescriptor describes the accepted transaction type +type TxDescriptor struct { + // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) + // it is not meant to support polymorphism of transaction types, it is supposed to be used by + // reflection clients to understand if they can handle a specific transaction type in an application. + Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` + // msgs lists the accepted application messages (sdk.Msg) + Msgs []*MsgDescriptor `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *TxDescriptor) Reset() { *m = TxDescriptor{} } +func (m *TxDescriptor) String() string { return proto.CompactTextString(m) } +func (*TxDescriptor) ProtoMessage() {} +func (*TxDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{1} +} +func (m *TxDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxDescriptor.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 *TxDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxDescriptor.Merge(m, src) +} +func (m *TxDescriptor) XXX_Size() int { + return m.Size() +} +func (m *TxDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_TxDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_TxDescriptor proto.InternalMessageInfo + +func (m *TxDescriptor) GetFullname() string { + if m != nil { + return m.Fullname + } + return "" +} + +func (m *TxDescriptor) GetMsgs() []*MsgDescriptor { + if m != nil { + return m.Msgs + } + return nil +} + +// AuthnDescriptor provides information on how to sign transactions without relying +// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +type AuthnDescriptor struct { + // sign_modes defines the supported signature algorithm + SignModes []*SigningModeDescriptor `protobuf:"bytes,1,rep,name=sign_modes,json=signModes,proto3" json:"sign_modes,omitempty"` +} + +func (m *AuthnDescriptor) Reset() { *m = AuthnDescriptor{} } +func (m *AuthnDescriptor) String() string { return proto.CompactTextString(m) } +func (*AuthnDescriptor) ProtoMessage() {} +func (*AuthnDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{2} +} +func (m *AuthnDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthnDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthnDescriptor.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 *AuthnDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthnDescriptor.Merge(m, src) +} +func (m *AuthnDescriptor) XXX_Size() int { + return m.Size() +} +func (m *AuthnDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_AuthnDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthnDescriptor proto.InternalMessageInfo + +func (m *AuthnDescriptor) GetSignModes() []*SigningModeDescriptor { + if m != nil { + return m.SignModes + } + return nil +} + +// SigningModeDescriptor provides information on a signing flow of the application +// NOTE(fdymylja): here we could go as far as providing an entire flow on how +// to sign a message given a SigningModeDescriptor, but it's better to think about +// this another time +type SigningModeDescriptor struct { + // name defines the unique name of the signing mode + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // number is the unique int32 identifier for the sign_mode enum + Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` + // authn_info_provider_method_fullname defines the fullname of the method to call to get + // the metadata required to authenticate using the provided sign_modes + AuthnInfoProviderMethodFullname string `protobuf:"bytes,3,opt,name=authn_info_provider_method_fullname,json=authnInfoProviderMethodFullname,proto3" json:"authn_info_provider_method_fullname,omitempty"` +} + +func (m *SigningModeDescriptor) Reset() { *m = SigningModeDescriptor{} } +func (m *SigningModeDescriptor) String() string { return proto.CompactTextString(m) } +func (*SigningModeDescriptor) ProtoMessage() {} +func (*SigningModeDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{3} +} +func (m *SigningModeDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SigningModeDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SigningModeDescriptor.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 *SigningModeDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_SigningModeDescriptor.Merge(m, src) +} +func (m *SigningModeDescriptor) XXX_Size() int { + return m.Size() +} +func (m *SigningModeDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_SigningModeDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_SigningModeDescriptor proto.InternalMessageInfo + +func (m *SigningModeDescriptor) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SigningModeDescriptor) GetNumber() int32 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *SigningModeDescriptor) GetAuthnInfoProviderMethodFullname() string { + if m != nil { + return m.AuthnInfoProviderMethodFullname + } + return "" +} + +// ChainDescriptor describes chain information of the application +type ChainDescriptor struct { + // id is the chain id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *ChainDescriptor) Reset() { *m = ChainDescriptor{} } +func (m *ChainDescriptor) String() string { return proto.CompactTextString(m) } +func (*ChainDescriptor) ProtoMessage() {} +func (*ChainDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{4} +} +func (m *ChainDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChainDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChainDescriptor.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 *ChainDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChainDescriptor.Merge(m, src) +} +func (m *ChainDescriptor) XXX_Size() int { + return m.Size() +} +func (m *ChainDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_ChainDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_ChainDescriptor proto.InternalMessageInfo + +func (m *ChainDescriptor) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// CodecDescriptor describes the registered interfaces and provides metadata information on the types +type CodecDescriptor struct { + // interfaces is a list of the registerted interfaces descriptors + Interfaces []*InterfaceDescriptor `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` +} + +func (m *CodecDescriptor) Reset() { *m = CodecDescriptor{} } +func (m *CodecDescriptor) String() string { return proto.CompactTextString(m) } +func (*CodecDescriptor) ProtoMessage() {} +func (*CodecDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{5} +} +func (m *CodecDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CodecDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CodecDescriptor.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 *CodecDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_CodecDescriptor.Merge(m, src) +} +func (m *CodecDescriptor) XXX_Size() int { + return m.Size() +} +func (m *CodecDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_CodecDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_CodecDescriptor proto.InternalMessageInfo + +func (m *CodecDescriptor) GetInterfaces() []*InterfaceDescriptor { + if m != nil { + return m.Interfaces + } + return nil +} + +// InterfaceDescriptor describes the implementation of an interface +type InterfaceDescriptor struct { + // fullname is the name of the interface + Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` + // interface_accepting_messages contains information regarding the proto messages which contain the interface as + // google.protobuf.Any field + InterfaceAcceptingMessages []*InterfaceAcceptingMessageDescriptor `protobuf:"bytes,2,rep,name=interface_accepting_messages,json=interfaceAcceptingMessages,proto3" json:"interface_accepting_messages,omitempty"` + // interface_implementers is a list of the descriptors of the interface implementers + InterfaceImplementers []*InterfaceImplementerDescriptor `protobuf:"bytes,3,rep,name=interface_implementers,json=interfaceImplementers,proto3" json:"interface_implementers,omitempty"` +} + +func (m *InterfaceDescriptor) Reset() { *m = InterfaceDescriptor{} } +func (m *InterfaceDescriptor) String() string { return proto.CompactTextString(m) } +func (*InterfaceDescriptor) ProtoMessage() {} +func (*InterfaceDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{6} +} +func (m *InterfaceDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InterfaceDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InterfaceDescriptor.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 *InterfaceDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceDescriptor.Merge(m, src) +} +func (m *InterfaceDescriptor) XXX_Size() int { + return m.Size() +} +func (m *InterfaceDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_InterfaceDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_InterfaceDescriptor proto.InternalMessageInfo + +func (m *InterfaceDescriptor) GetFullname() string { + if m != nil { + return m.Fullname + } + return "" +} + +func (m *InterfaceDescriptor) GetInterfaceAcceptingMessages() []*InterfaceAcceptingMessageDescriptor { + if m != nil { + return m.InterfaceAcceptingMessages + } + return nil +} + +func (m *InterfaceDescriptor) GetInterfaceImplementers() []*InterfaceImplementerDescriptor { + if m != nil { + return m.InterfaceImplementers + } + return nil +} + +// InterfaceImplementerDescriptor describes an interface implementer +type InterfaceImplementerDescriptor struct { + // fullname is the protobuf queryable name of the interface implementer + Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` + // type_url defines the type URL used when marshalling the type as any + // this is required so we can provide type safe google.protobuf.Any marshalling and + // unmarshalling, making sure that we don't accept just 'any' type + // in our interface fields + TypeUrl string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` +} + +func (m *InterfaceImplementerDescriptor) Reset() { *m = InterfaceImplementerDescriptor{} } +func (m *InterfaceImplementerDescriptor) String() string { return proto.CompactTextString(m) } +func (*InterfaceImplementerDescriptor) ProtoMessage() {} +func (*InterfaceImplementerDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{7} +} +func (m *InterfaceImplementerDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InterfaceImplementerDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InterfaceImplementerDescriptor.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 *InterfaceImplementerDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceImplementerDescriptor.Merge(m, src) +} +func (m *InterfaceImplementerDescriptor) XXX_Size() int { + return m.Size() +} +func (m *InterfaceImplementerDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_InterfaceImplementerDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_InterfaceImplementerDescriptor proto.InternalMessageInfo + +func (m *InterfaceImplementerDescriptor) GetFullname() string { + if m != nil { + return m.Fullname + } + return "" +} + +func (m *InterfaceImplementerDescriptor) GetTypeUrl() string { + if m != nil { + return m.TypeUrl + } + return "" +} + +// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains +// an interface represented as a google.protobuf.Any +type InterfaceAcceptingMessageDescriptor struct { + // fullname is the protobuf fullname of the type containing the interface + Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` + // field_descriptor_names is a list of the protobuf name (not fullname) of the field + // which contains the interface as google.protobuf.Any (the interface is the same, but + // it can be in multiple fields of the same proto message) + FieldDescriptorNames []string `protobuf:"bytes,2,rep,name=field_descriptor_names,json=fieldDescriptorNames,proto3" json:"field_descriptor_names,omitempty"` +} + +func (m *InterfaceAcceptingMessageDescriptor) Reset() { *m = InterfaceAcceptingMessageDescriptor{} } +func (m *InterfaceAcceptingMessageDescriptor) String() string { return proto.CompactTextString(m) } +func (*InterfaceAcceptingMessageDescriptor) ProtoMessage() {} +func (*InterfaceAcceptingMessageDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{8} +} +func (m *InterfaceAcceptingMessageDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InterfaceAcceptingMessageDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InterfaceAcceptingMessageDescriptor.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 *InterfaceAcceptingMessageDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterfaceAcceptingMessageDescriptor.Merge(m, src) +} +func (m *InterfaceAcceptingMessageDescriptor) XXX_Size() int { + return m.Size() +} +func (m *InterfaceAcceptingMessageDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_InterfaceAcceptingMessageDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_InterfaceAcceptingMessageDescriptor proto.InternalMessageInfo + +func (m *InterfaceAcceptingMessageDescriptor) GetFullname() string { + if m != nil { + return m.Fullname + } + return "" +} + +func (m *InterfaceAcceptingMessageDescriptor) GetFieldDescriptorNames() []string { + if m != nil { + return m.FieldDescriptorNames + } + return nil +} + +// ConfigurationDescriptor contains metadata information on the sdk.Config +type ConfigurationDescriptor struct { + // bech32_account_address_prefix is the account address prefix + Bech32AccountAddressPrefix string `protobuf:"bytes,1,opt,name=bech32_account_address_prefix,json=bech32AccountAddressPrefix,proto3" json:"bech32_account_address_prefix,omitempty"` +} + +func (m *ConfigurationDescriptor) Reset() { *m = ConfigurationDescriptor{} } +func (m *ConfigurationDescriptor) String() string { return proto.CompactTextString(m) } +func (*ConfigurationDescriptor) ProtoMessage() {} +func (*ConfigurationDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{9} +} +func (m *ConfigurationDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigurationDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigurationDescriptor.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 *ConfigurationDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigurationDescriptor.Merge(m, src) +} +func (m *ConfigurationDescriptor) XXX_Size() int { + return m.Size() +} +func (m *ConfigurationDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigurationDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigurationDescriptor proto.InternalMessageInfo + +func (m *ConfigurationDescriptor) GetBech32AccountAddressPrefix() string { + if m != nil { + return m.Bech32AccountAddressPrefix + } + return "" +} + +// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +type MsgDescriptor struct { + // msg_type_url contains the TypeURL of a sdk.Msg. + MsgTypeUrl string `protobuf:"bytes,1,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` +} + +func (m *MsgDescriptor) Reset() { *m = MsgDescriptor{} } +func (m *MsgDescriptor) String() string { return proto.CompactTextString(m) } +func (*MsgDescriptor) ProtoMessage() {} +func (*MsgDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{10} +} +func (m *MsgDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDescriptor.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 *MsgDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDescriptor.Merge(m, src) +} +func (m *MsgDescriptor) XXX_Size() int { + return m.Size() +} +func (m *MsgDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDescriptor proto.InternalMessageInfo + +func (m *MsgDescriptor) GetMsgTypeUrl() string { + if m != nil { + return m.MsgTypeUrl + } + return "" +} + +// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +type GetAuthnDescriptorRequest struct { +} + +func (m *GetAuthnDescriptorRequest) Reset() { *m = GetAuthnDescriptorRequest{} } +func (m *GetAuthnDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetAuthnDescriptorRequest) ProtoMessage() {} +func (*GetAuthnDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{11} +} +func (m *GetAuthnDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAuthnDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAuthnDescriptorRequest.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 *GetAuthnDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAuthnDescriptorRequest.Merge(m, src) +} +func (m *GetAuthnDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetAuthnDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAuthnDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAuthnDescriptorRequest proto.InternalMessageInfo + +// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +type GetAuthnDescriptorResponse struct { + // authn describes how to authenticate to the application when sending transactions + Authn *AuthnDescriptor `protobuf:"bytes,1,opt,name=authn,proto3" json:"authn,omitempty"` +} + +func (m *GetAuthnDescriptorResponse) Reset() { *m = GetAuthnDescriptorResponse{} } +func (m *GetAuthnDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetAuthnDescriptorResponse) ProtoMessage() {} +func (*GetAuthnDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{12} +} +func (m *GetAuthnDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetAuthnDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetAuthnDescriptorResponse.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 *GetAuthnDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAuthnDescriptorResponse.Merge(m, src) +} +func (m *GetAuthnDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetAuthnDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetAuthnDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAuthnDescriptorResponse proto.InternalMessageInfo + +func (m *GetAuthnDescriptorResponse) GetAuthn() *AuthnDescriptor { + if m != nil { + return m.Authn + } + return nil +} + +// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +type GetChainDescriptorRequest struct { +} + +func (m *GetChainDescriptorRequest) Reset() { *m = GetChainDescriptorRequest{} } +func (m *GetChainDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetChainDescriptorRequest) ProtoMessage() {} +func (*GetChainDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{13} +} +func (m *GetChainDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetChainDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetChainDescriptorRequest.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 *GetChainDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetChainDescriptorRequest.Merge(m, src) +} +func (m *GetChainDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetChainDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetChainDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetChainDescriptorRequest proto.InternalMessageInfo + +// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +type GetChainDescriptorResponse struct { + // chain describes application chain information + Chain *ChainDescriptor `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` +} + +func (m *GetChainDescriptorResponse) Reset() { *m = GetChainDescriptorResponse{} } +func (m *GetChainDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetChainDescriptorResponse) ProtoMessage() {} +func (*GetChainDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{14} +} +func (m *GetChainDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetChainDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetChainDescriptorResponse.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 *GetChainDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetChainDescriptorResponse.Merge(m, src) +} +func (m *GetChainDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetChainDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetChainDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetChainDescriptorResponse proto.InternalMessageInfo + +func (m *GetChainDescriptorResponse) GetChain() *ChainDescriptor { + if m != nil { + return m.Chain + } + return nil +} + +// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +type GetCodecDescriptorRequest struct { +} + +func (m *GetCodecDescriptorRequest) Reset() { *m = GetCodecDescriptorRequest{} } +func (m *GetCodecDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetCodecDescriptorRequest) ProtoMessage() {} +func (*GetCodecDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{15} +} +func (m *GetCodecDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCodecDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCodecDescriptorRequest.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 *GetCodecDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCodecDescriptorRequest.Merge(m, src) +} +func (m *GetCodecDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetCodecDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCodecDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCodecDescriptorRequest proto.InternalMessageInfo + +// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +type GetCodecDescriptorResponse struct { + // codec describes the application codec such as registered interfaces and implementations + Codec *CodecDescriptor `protobuf:"bytes,1,opt,name=codec,proto3" json:"codec,omitempty"` +} + +func (m *GetCodecDescriptorResponse) Reset() { *m = GetCodecDescriptorResponse{} } +func (m *GetCodecDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetCodecDescriptorResponse) ProtoMessage() {} +func (*GetCodecDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{16} +} +func (m *GetCodecDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetCodecDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetCodecDescriptorResponse.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 *GetCodecDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCodecDescriptorResponse.Merge(m, src) +} +func (m *GetCodecDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetCodecDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetCodecDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetCodecDescriptorResponse proto.InternalMessageInfo + +func (m *GetCodecDescriptorResponse) GetCodec() *CodecDescriptor { + if m != nil { + return m.Codec + } + return nil +} + +// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +type GetConfigurationDescriptorRequest struct { +} + +func (m *GetConfigurationDescriptorRequest) Reset() { *m = GetConfigurationDescriptorRequest{} } +func (m *GetConfigurationDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetConfigurationDescriptorRequest) ProtoMessage() {} +func (*GetConfigurationDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{17} +} +func (m *GetConfigurationDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetConfigurationDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetConfigurationDescriptorRequest.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 *GetConfigurationDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConfigurationDescriptorRequest.Merge(m, src) +} +func (m *GetConfigurationDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetConfigurationDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetConfigurationDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConfigurationDescriptorRequest proto.InternalMessageInfo + +// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +type GetConfigurationDescriptorResponse struct { + // config describes the application's sdk.Config + Config *ConfigurationDescriptor `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (m *GetConfigurationDescriptorResponse) Reset() { *m = GetConfigurationDescriptorResponse{} } +func (m *GetConfigurationDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetConfigurationDescriptorResponse) ProtoMessage() {} +func (*GetConfigurationDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{18} +} +func (m *GetConfigurationDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetConfigurationDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetConfigurationDescriptorResponse.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 *GetConfigurationDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetConfigurationDescriptorResponse.Merge(m, src) +} +func (m *GetConfigurationDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetConfigurationDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetConfigurationDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetConfigurationDescriptorResponse proto.InternalMessageInfo + +func (m *GetConfigurationDescriptorResponse) GetConfig() *ConfigurationDescriptor { + if m != nil { + return m.Config + } + return nil +} + +// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +type GetQueryServicesDescriptorRequest struct { +} + +func (m *GetQueryServicesDescriptorRequest) Reset() { *m = GetQueryServicesDescriptorRequest{} } +func (m *GetQueryServicesDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetQueryServicesDescriptorRequest) ProtoMessage() {} +func (*GetQueryServicesDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{19} +} +func (m *GetQueryServicesDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetQueryServicesDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetQueryServicesDescriptorRequest.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 *GetQueryServicesDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetQueryServicesDescriptorRequest.Merge(m, src) +} +func (m *GetQueryServicesDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetQueryServicesDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetQueryServicesDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetQueryServicesDescriptorRequest proto.InternalMessageInfo + +// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +type GetQueryServicesDescriptorResponse struct { + // queries provides information on the available queryable services + Queries *QueryServicesDescriptor `protobuf:"bytes,1,opt,name=queries,proto3" json:"queries,omitempty"` +} + +func (m *GetQueryServicesDescriptorResponse) Reset() { *m = GetQueryServicesDescriptorResponse{} } +func (m *GetQueryServicesDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetQueryServicesDescriptorResponse) ProtoMessage() {} +func (*GetQueryServicesDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{20} +} +func (m *GetQueryServicesDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetQueryServicesDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetQueryServicesDescriptorResponse.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 *GetQueryServicesDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetQueryServicesDescriptorResponse.Merge(m, src) +} +func (m *GetQueryServicesDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetQueryServicesDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetQueryServicesDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetQueryServicesDescriptorResponse proto.InternalMessageInfo + +func (m *GetQueryServicesDescriptorResponse) GetQueries() *QueryServicesDescriptor { + if m != nil { + return m.Queries + } + return nil +} + +// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +type GetTxDescriptorRequest struct { +} + +func (m *GetTxDescriptorRequest) Reset() { *m = GetTxDescriptorRequest{} } +func (m *GetTxDescriptorRequest) String() string { return proto.CompactTextString(m) } +func (*GetTxDescriptorRequest) ProtoMessage() {} +func (*GetTxDescriptorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{21} +} +func (m *GetTxDescriptorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetTxDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetTxDescriptorRequest.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 *GetTxDescriptorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTxDescriptorRequest.Merge(m, src) +} +func (m *GetTxDescriptorRequest) XXX_Size() int { + return m.Size() +} +func (m *GetTxDescriptorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetTxDescriptorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTxDescriptorRequest proto.InternalMessageInfo + +// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +type GetTxDescriptorResponse struct { + // tx provides information on msgs that can be forwarded to the application + // alongside the accepted transaction protobuf type + Tx *TxDescriptor `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` +} + +func (m *GetTxDescriptorResponse) Reset() { *m = GetTxDescriptorResponse{} } +func (m *GetTxDescriptorResponse) String() string { return proto.CompactTextString(m) } +func (*GetTxDescriptorResponse) ProtoMessage() {} +func (*GetTxDescriptorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{22} +} +func (m *GetTxDescriptorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetTxDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetTxDescriptorResponse.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 *GetTxDescriptorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetTxDescriptorResponse.Merge(m, src) +} +func (m *GetTxDescriptorResponse) XXX_Size() int { + return m.Size() +} +func (m *GetTxDescriptorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetTxDescriptorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetTxDescriptorResponse proto.InternalMessageInfo + +func (m *GetTxDescriptorResponse) GetTx() *TxDescriptor { + if m != nil { + return m.Tx + } + return nil +} + +// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +type QueryServicesDescriptor struct { + // query_services is a list of cosmos-sdk QueryServiceDescriptor + QueryServices []*QueryServiceDescriptor `protobuf:"bytes,1,rep,name=query_services,json=queryServices,proto3" json:"query_services,omitempty"` +} + +func (m *QueryServicesDescriptor) Reset() { *m = QueryServicesDescriptor{} } +func (m *QueryServicesDescriptor) String() string { return proto.CompactTextString(m) } +func (*QueryServicesDescriptor) ProtoMessage() {} +func (*QueryServicesDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{23} +} +func (m *QueryServicesDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServicesDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServicesDescriptor.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 *QueryServicesDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServicesDescriptor.Merge(m, src) +} +func (m *QueryServicesDescriptor) XXX_Size() int { + return m.Size() +} +func (m *QueryServicesDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServicesDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServicesDescriptor proto.InternalMessageInfo + +func (m *QueryServicesDescriptor) GetQueryServices() []*QueryServiceDescriptor { + if m != nil { + return m.QueryServices + } + return nil +} + +// QueryServiceDescriptor describes a cosmos-sdk queryable service +type QueryServiceDescriptor struct { + // fullname is the protobuf fullname of the service descriptor + Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` + // is_module describes if this service is actually exposed by an application's module + IsModule bool `protobuf:"varint,2,opt,name=is_module,json=isModule,proto3" json:"is_module,omitempty"` + // methods provides a list of query service methods + Methods []*QueryMethodDescriptor `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty"` +} + +func (m *QueryServiceDescriptor) Reset() { *m = QueryServiceDescriptor{} } +func (m *QueryServiceDescriptor) String() string { return proto.CompactTextString(m) } +func (*QueryServiceDescriptor) ProtoMessage() {} +func (*QueryServiceDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{24} +} +func (m *QueryServiceDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryServiceDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryServiceDescriptor.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 *QueryServiceDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryServiceDescriptor.Merge(m, src) +} +func (m *QueryServiceDescriptor) XXX_Size() int { + return m.Size() +} +func (m *QueryServiceDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_QueryServiceDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryServiceDescriptor proto.InternalMessageInfo + +func (m *QueryServiceDescriptor) GetFullname() string { + if m != nil { + return m.Fullname + } + return "" +} + +func (m *QueryServiceDescriptor) GetIsModule() bool { + if m != nil { + return m.IsModule + } + return false +} + +func (m *QueryServiceDescriptor) GetMethods() []*QueryMethodDescriptor { + if m != nil { + return m.Methods + } + return nil +} + +// QueryMethodDescriptor describes a queryable method of a query service +// no other info is provided beside method name and tendermint queryable path +// because it would be redundant with the grpc reflection service +type QueryMethodDescriptor struct { + // name is the protobuf name (not fullname) of the method + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // full_query_path is the path that can be used to query + // this method via tendermint abci.Query + FullQueryPath string `protobuf:"bytes,2,opt,name=full_query_path,json=fullQueryPath,proto3" json:"full_query_path,omitempty"` +} + +func (m *QueryMethodDescriptor) Reset() { *m = QueryMethodDescriptor{} } +func (m *QueryMethodDescriptor) String() string { return proto.CompactTextString(m) } +func (*QueryMethodDescriptor) ProtoMessage() {} +func (*QueryMethodDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_15c91f0b8d6bf3d0, []int{25} +} +func (m *QueryMethodDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryMethodDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryMethodDescriptor.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 *QueryMethodDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryMethodDescriptor.Merge(m, src) +} +func (m *QueryMethodDescriptor) XXX_Size() int { + return m.Size() +} +func (m *QueryMethodDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_QueryMethodDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryMethodDescriptor proto.InternalMessageInfo + +func (m *QueryMethodDescriptor) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *QueryMethodDescriptor) GetFullQueryPath() string { + if m != nil { + return m.FullQueryPath + } + return "" +} + +func init() { + proto.RegisterType((*AppDescriptor)(nil), "cosmos.base.reflection.v2alpha1.AppDescriptor") + proto.RegisterType((*TxDescriptor)(nil), "cosmos.base.reflection.v2alpha1.TxDescriptor") + proto.RegisterType((*AuthnDescriptor)(nil), "cosmos.base.reflection.v2alpha1.AuthnDescriptor") + proto.RegisterType((*SigningModeDescriptor)(nil), "cosmos.base.reflection.v2alpha1.SigningModeDescriptor") + proto.RegisterType((*ChainDescriptor)(nil), "cosmos.base.reflection.v2alpha1.ChainDescriptor") + proto.RegisterType((*CodecDescriptor)(nil), "cosmos.base.reflection.v2alpha1.CodecDescriptor") + proto.RegisterType((*InterfaceDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceDescriptor") + proto.RegisterType((*InterfaceImplementerDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor") + proto.RegisterType((*InterfaceAcceptingMessageDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor") + proto.RegisterType((*ConfigurationDescriptor)(nil), "cosmos.base.reflection.v2alpha1.ConfigurationDescriptor") + proto.RegisterType((*MsgDescriptor)(nil), "cosmos.base.reflection.v2alpha1.MsgDescriptor") + proto.RegisterType((*GetAuthnDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest") + proto.RegisterType((*GetAuthnDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse") + proto.RegisterType((*GetChainDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest") + proto.RegisterType((*GetChainDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse") + proto.RegisterType((*GetCodecDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest") + proto.RegisterType((*GetCodecDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse") + proto.RegisterType((*GetConfigurationDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest") + proto.RegisterType((*GetConfigurationDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse") + proto.RegisterType((*GetQueryServicesDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest") + proto.RegisterType((*GetQueryServicesDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse") + proto.RegisterType((*GetTxDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest") + proto.RegisterType((*GetTxDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse") + proto.RegisterType((*QueryServicesDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryServicesDescriptor") + proto.RegisterType((*QueryServiceDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryServiceDescriptor") + proto.RegisterType((*QueryMethodDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryMethodDescriptor") +} + +func init() { + proto.RegisterFile("cosmos/base/reflection/v2alpha1/reflection.proto", fileDescriptor_15c91f0b8d6bf3d0) +} + +var fileDescriptor_15c91f0b8d6bf3d0 = []byte{ + // 1155 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x3a, 0xbf, 0x5f, 0x9b, 0x46, 0x0c, 0x24, 0x71, 0xdd, 0xe2, 0xa6, 0x1b, 0x09, 0xf5, + 0x52, 0xbb, 0x49, 0xa3, 0xb4, 0x82, 0x94, 0xca, 0x69, 0x68, 0x15, 0x89, 0xa0, 0xe0, 0xa4, 0x80, + 0x10, 0xea, 0x6a, 0xbd, 0x3b, 0x5e, 0x8f, 0xf0, 0xee, 0x6c, 0x76, 0xc6, 0xc1, 0xb9, 0x72, 0xe0, + 0x0c, 0xe2, 0x4f, 0xe0, 0xc0, 0x9d, 0xbf, 0x02, 0xc1, 0xa5, 0x12, 0x17, 0x8e, 0x28, 0x41, 0xe2, + 0x00, 0x7f, 0x04, 0x9a, 0x1f, 0x76, 0xc6, 0xce, 0xda, 0xde, 0x24, 0x3d, 0x25, 0xb3, 0xef, 0xbd, + 0x6f, 0xbe, 0xef, 0xed, 0xe8, 0x7d, 0xb3, 0x86, 0x07, 0x1e, 0x65, 0x21, 0x65, 0xe5, 0x9a, 0xcb, + 0x70, 0x39, 0xc1, 0xf5, 0x26, 0xf6, 0x38, 0xa1, 0x51, 0xf9, 0x68, 0xcd, 0x6d, 0xc6, 0x0d, 0x77, + 0xd5, 0x78, 0x56, 0x8a, 0x13, 0xca, 0x29, 0xba, 0xa3, 0x2a, 0x4a, 0xa2, 0xa2, 0x64, 0x44, 0x3b, + 0x15, 0x85, 0xdb, 0x01, 0xa5, 0x41, 0x13, 0x97, 0xdd, 0x98, 0x94, 0xdd, 0x28, 0xa2, 0xdc, 0x15, + 0x71, 0xa6, 0xca, 0xed, 0x7f, 0xc6, 0x61, 0xae, 0x12, 0xc7, 0xdb, 0x98, 0x79, 0x09, 0x89, 0x39, + 0x4d, 0xd0, 0x73, 0x98, 0x74, 0x5b, 0xbc, 0x11, 0xe5, 0xad, 0x65, 0xeb, 0xde, 0xb5, 0xb5, 0x07, + 0xa5, 0x11, 0x1b, 0x94, 0x2a, 0x22, 0xfb, 0x0c, 0xa0, 0xaa, 0xca, 0x05, 0x8e, 0xd7, 0x70, 0x49, + 0x94, 0xcf, 0x65, 0xc4, 0x79, 0x26, 0xb2, 0x4d, 0x1c, 0x59, 0x2e, 0x71, 0xa8, 0x8f, 0xbd, 0xfc, + 0x78, 0x56, 0x1c, 0x91, 0xdd, 0x83, 0x23, 0x1e, 0xa0, 0x57, 0x30, 0xe7, 0xd1, 0xa8, 0x4e, 0x82, + 0x56, 0x22, 0x3b, 0x90, 0x9f, 0x90, 0x78, 0x8f, 0x33, 0xe0, 0x19, 0x55, 0x06, 0x6e, 0x2f, 0x1c, + 0x72, 0xe0, 0xc6, 0x61, 0x0b, 0x27, 0xc7, 0x0e, 0xc3, 0xc9, 0x11, 0xf1, 0x30, 0xcb, 0x4f, 0x66, + 0xdc, 0xe0, 0x53, 0x51, 0xb6, 0xaf, 0xab, 0xcc, 0x0d, 0x0e, 0xcd, 0x00, 0x7a, 0x02, 0x39, 0xde, + 0xce, 0x4f, 0x49, 0xd0, 0xfb, 0x23, 0x41, 0x0f, 0xda, 0x06, 0x52, 0x8e, 0xb7, 0xed, 0x08, 0xae, + 0x9b, 0xcf, 0x50, 0x01, 0x66, 0xea, 0xad, 0x66, 0x33, 0x72, 0x43, 0x2c, 0x5f, 0xf5, 0x6c, 0xb5, + 0xbb, 0x46, 0x5b, 0x30, 0x11, 0xb2, 0x80, 0xe5, 0x73, 0xcb, 0xe3, 0xf7, 0xae, 0xad, 0x95, 0x46, + 0x6e, 0xb6, 0xcb, 0x02, 0x63, 0x37, 0x59, 0x6b, 0x37, 0x60, 0xbe, 0xef, 0x64, 0xa0, 0x97, 0x00, + 0x8c, 0x04, 0x91, 0x13, 0x52, 0x1f, 0xb3, 0xbc, 0x25, 0xc1, 0x37, 0x46, 0x82, 0xef, 0x93, 0x20, + 0x22, 0x51, 0xb0, 0x4b, 0x7d, 0x6c, 0x6c, 0x32, 0x2b, 0x90, 0xc4, 0x33, 0x66, 0xff, 0x60, 0xc1, + 0x42, 0x6a, 0x12, 0x42, 0x30, 0x61, 0xe8, 0x93, 0xff, 0xa3, 0x45, 0x98, 0x8a, 0x5a, 0x61, 0x0d, + 0x27, 0xf2, 0x60, 0x4e, 0x56, 0xf5, 0x0a, 0x7d, 0x0c, 0x2b, 0xf2, 0xe0, 0x3a, 0x24, 0xaa, 0x53, + 0x27, 0x4e, 0xe8, 0x11, 0xf1, 0x71, 0xe2, 0x84, 0x98, 0x37, 0xa8, 0xef, 0x74, 0x5b, 0x35, 0x2e, + 0xa1, 0xee, 0xc8, 0xd4, 0x9d, 0xa8, 0x4e, 0xf7, 0x74, 0xe2, 0xae, 0xcc, 0x7b, 0xae, 0xd3, 0xec, + 0xbb, 0x30, 0xdf, 0x77, 0x9e, 0xd1, 0x0d, 0xc8, 0x11, 0x5f, 0x53, 0xc9, 0x11, 0xdf, 0x0e, 0x60, + 0xbe, 0xef, 0xa8, 0xa2, 0x03, 0x00, 0x12, 0x71, 0x9c, 0xd4, 0x5d, 0xaf, 0xdb, 0xa0, 0xf5, 0x91, + 0x0d, 0xda, 0xe9, 0x94, 0x18, 0xed, 0x31, 0x70, 0xec, 0x5f, 0x72, 0xf0, 0x76, 0x4a, 0xce, 0xd0, + 0x13, 0xf0, 0x9d, 0x05, 0xb7, 0xbb, 0x10, 0x8e, 0xeb, 0x79, 0x38, 0xe6, 0x24, 0x0a, 0x9c, 0x10, + 0x33, 0xe6, 0x06, 0xb8, 0x73, 0x34, 0xb6, 0xb3, 0x93, 0xab, 0x74, 0x30, 0x76, 0x15, 0x84, 0x41, + 0xb6, 0x40, 0x06, 0x25, 0x31, 0x74, 0x04, 0x8b, 0x67, 0x3c, 0x48, 0x18, 0x37, 0x71, 0x88, 0xc5, + 0x9a, 0xe5, 0xc7, 0x25, 0x83, 0xa7, 0xd9, 0x19, 0xec, 0x9c, 0x55, 0x1b, 0x9b, 0x2f, 0x90, 0x94, + 0x38, 0xb3, 0x3f, 0x87, 0xe2, 0xf0, 0xc2, 0xa1, 0xed, 0xbb, 0x09, 0x33, 0xfc, 0x38, 0xc6, 0x4e, + 0x2b, 0x69, 0xca, 0x63, 0x36, 0x5b, 0x9d, 0x16, 0xeb, 0x97, 0x49, 0xd3, 0xfe, 0x06, 0x56, 0x32, + 0xf4, 0x64, 0x28, 0xfa, 0x3a, 0x2c, 0xd6, 0x09, 0x6e, 0xfa, 0x8e, 0xdf, 0xcd, 0x77, 0x44, 0x40, + 0xbd, 0x95, 0xd9, 0xea, 0x3b, 0x32, 0x7a, 0x06, 0xf6, 0x89, 0x88, 0xd9, 0x5f, 0xc1, 0xd2, 0x80, + 0x51, 0x86, 0x2a, 0xf0, 0x6e, 0x0d, 0x7b, 0x8d, 0x87, 0x6b, 0xe2, 0x4d, 0xd3, 0x56, 0xc4, 0x1d, + 0xd7, 0xf7, 0x13, 0xcc, 0x98, 0x13, 0x27, 0xb8, 0x4e, 0xda, 0x9a, 0x41, 0x41, 0x25, 0x55, 0x54, + 0x4e, 0x45, 0xa5, 0xec, 0xc9, 0x0c, 0x7b, 0x15, 0xe6, 0x7a, 0xa6, 0x00, 0x5a, 0x86, 0xeb, 0x21, + 0x0b, 0x9c, 0x6e, 0x1b, 0x14, 0x04, 0x84, 0x2c, 0x38, 0xd0, 0x9d, 0xb8, 0x05, 0x37, 0x5f, 0x60, + 0xde, 0x6f, 0x1f, 0xf8, 0xb0, 0x85, 0x19, 0xb7, 0x7d, 0x28, 0xa4, 0x05, 0x59, 0x4c, 0x23, 0x86, + 0xdf, 0x94, 0x49, 0x69, 0x0a, 0xfd, 0xce, 0xd3, 0x43, 0xe1, 0x5c, 0xf0, 0x8c, 0x82, 0xf2, 0x37, + 0xeb, 0x4a, 0xfe, 0xd6, 0xa1, 0xd0, 0x67, 0x5a, 0xbd, 0x14, 0xfa, 0x83, 0x06, 0x05, 0x69, 0x8d, + 0xd6, 0x95, 0xac, 0xd1, 0x5e, 0x81, 0xbb, 0x72, 0x97, 0x74, 0x9f, 0xd3, 0x54, 0x8e, 0xc0, 0x1e, + 0x96, 0xa4, 0x29, 0xed, 0xc1, 0x94, 0xb2, 0x45, 0xcd, 0xe9, 0xf2, 0xf6, 0xaa, 0x71, 0x34, 0xb9, + 0x41, 0x1e, 0xa9, 0xc9, 0xb5, 0x25, 0xb9, 0x81, 0x49, 0x9a, 0x5c, 0x15, 0xa6, 0x85, 0xa5, 0x12, + 0x39, 0x5b, 0xaf, 0xe6, 0xcd, 0x1d, 0x20, 0x3b, 0x0f, 0x8b, 0x2f, 0x30, 0xef, 0x71, 0x5b, 0xcd, + 0xe9, 0x0b, 0x58, 0x3a, 0x17, 0xd1, 0x44, 0x94, 0x95, 0x5b, 0x97, 0xb5, 0xf2, 0x63, 0x58, 0x1a, + 0xc0, 0x0b, 0xbd, 0x3a, 0x77, 0x0b, 0x51, 0x2e, 0xf2, 0xe8, 0x42, 0x4a, 0x07, 0x5e, 0x42, 0xec, + 0x9f, 0x2c, 0x58, 0x4c, 0xcf, 0x1c, 0x3a, 0xb1, 0x6e, 0xc1, 0x2c, 0x61, 0xc2, 0xf7, 0x5b, 0x4d, + 0x2c, 0x07, 0xe2, 0x4c, 0x75, 0x86, 0xb0, 0x5d, 0xb9, 0x46, 0x7b, 0x30, 0xad, 0x5c, 0xb6, 0x33, + 0xd3, 0x37, 0xb2, 0x91, 0x55, 0x96, 0x6b, 0xbe, 0x14, 0x0d, 0x63, 0xef, 0xc3, 0x42, 0x6a, 0x46, + 0xea, 0x85, 0xe0, 0x3d, 0x98, 0x17, 0x3c, 0x1d, 0xd5, 0xb7, 0xd8, 0xe5, 0x0d, 0x3d, 0xb2, 0xe7, + 0xc4, 0x63, 0x89, 0xb3, 0xe7, 0xf2, 0xc6, 0xda, 0xcf, 0x00, 0x6f, 0x55, 0xbb, 0x5c, 0xb4, 0x7e, + 0xf4, 0xbb, 0x05, 0xe8, 0xfc, 0xa0, 0x42, 0xef, 0x8f, 0x94, 0x30, 0x70, 0xf4, 0x15, 0x3e, 0xb8, + 0x54, 0xad, 0x3a, 0x5a, 0xf6, 0xe6, 0xb7, 0x7f, 0xfc, 0xfd, 0x63, 0x6e, 0x03, 0xad, 0x97, 0x07, + 0x7d, 0x4a, 0xac, 0xd6, 0x30, 0x77, 0x57, 0xcb, 0x6e, 0x1c, 0x1b, 0xfe, 0x51, 0x56, 0x97, 0x76, + 0xad, 0xa6, 0xff, 0xea, 0x92, 0x49, 0x4d, 0xfa, 0x14, 0xcd, 0xa6, 0x66, 0xc0, 0x90, 0xbd, 0xb4, + 0x1a, 0xf5, 0xe9, 0xd0, 0x51, 0xd3, 0x77, 0xcb, 0xca, 0xa6, 0x26, 0x75, 0x20, 0x67, 0x54, 0x93, + 0x3e, 0xaf, 0x2f, 0xaf, 0x46, 0x7e, 0xc0, 0xfc, 0x6b, 0x69, 0x33, 0x48, 0xf7, 0xf0, 0xad, 0x6c, + 0xcc, 0x86, 0xcd, 0xf8, 0xc2, 0xb3, 0x2b, 0x61, 0x68, 0x95, 0xdb, 0x52, 0xe5, 0x87, 0x68, 0xf3, + 0xc2, 0x2a, 0xcd, 0xcf, 0xa9, 0xff, 0x94, 0xda, 0x41, 0x73, 0x2e, 0x93, 0xda, 0xe1, 0xa6, 0x91, + 0x4d, 0xed, 0x08, 0x4f, 0xb1, 0x3f, 0x92, 0x6a, 0x9f, 0xa2, 0x27, 0x17, 0x54, 0xdb, 0x3b, 0xa5, + 0xd1, 0x6f, 0x16, 0xcc, 0xf7, 0xb9, 0x05, 0x7a, 0x94, 0x85, 0x5f, 0x8a, 0xf3, 0x14, 0x1e, 0x5f, + 0xbc, 0xf0, 0x8a, 0xef, 0x8e, 0xb7, 0x8d, 0xd5, 0xd6, 0x67, 0xbf, 0x9e, 0x14, 0xad, 0xd7, 0x27, + 0x45, 0xeb, 0xaf, 0x93, 0xa2, 0xf5, 0xfd, 0x69, 0x71, 0xec, 0xf5, 0x69, 0x71, 0xec, 0xcf, 0xd3, + 0xe2, 0xd8, 0x97, 0x9b, 0x01, 0xe1, 0x8d, 0x56, 0xad, 0xe4, 0xd1, 0xb0, 0xb3, 0x83, 0xfa, 0x73, + 0x9f, 0xf9, 0x5f, 0x97, 0x45, 0x37, 0x70, 0x52, 0x0e, 0x92, 0xd8, 0x4b, 0xfb, 0xf1, 0xa3, 0x36, + 0x25, 0x7f, 0xb3, 0x78, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xdb, 0xec, 0xac, 0x26, + 0x11, 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 + +// ReflectionServiceClient is the client API for ReflectionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ReflectionServiceClient interface { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + GetAuthnDescriptor(ctx context.Context, in *GetAuthnDescriptorRequest, opts ...grpc.CallOption) (*GetAuthnDescriptorResponse, error) + // GetChainDescriptor returns the description of the chain + GetChainDescriptor(ctx context.Context, in *GetChainDescriptorRequest, opts ...grpc.CallOption) (*GetChainDescriptorResponse, error) + // GetCodecDescriptor returns the descriptor of the codec of the application + GetCodecDescriptor(ctx context.Context, in *GetCodecDescriptorRequest, opts ...grpc.CallOption) (*GetCodecDescriptorResponse, error) + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + GetConfigurationDescriptor(ctx context.Context, in *GetConfigurationDescriptorRequest, opts ...grpc.CallOption) (*GetConfigurationDescriptorResponse, error) + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + GetQueryServicesDescriptor(ctx context.Context, in *GetQueryServicesDescriptorRequest, opts ...grpc.CallOption) (*GetQueryServicesDescriptorResponse, error) + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + GetTxDescriptor(ctx context.Context, in *GetTxDescriptorRequest, opts ...grpc.CallOption) (*GetTxDescriptorResponse, error) +} + +type reflectionServiceClient struct { + cc grpc1.ClientConn +} + +func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { + return &reflectionServiceClient{cc} +} + +func (c *reflectionServiceClient) GetAuthnDescriptor(ctx context.Context, in *GetAuthnDescriptorRequest, opts ...grpc.CallOption) (*GetAuthnDescriptorResponse, error) { + out := new(GetAuthnDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) GetChainDescriptor(ctx context.Context, in *GetChainDescriptorRequest, opts ...grpc.CallOption) (*GetChainDescriptorResponse, error) { + out := new(GetChainDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) GetCodecDescriptor(ctx context.Context, in *GetCodecDescriptorRequest, opts ...grpc.CallOption) (*GetCodecDescriptorResponse, error) { + out := new(GetCodecDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) GetConfigurationDescriptor(ctx context.Context, in *GetConfigurationDescriptorRequest, opts ...grpc.CallOption) (*GetConfigurationDescriptorResponse, error) { + out := new(GetConfigurationDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) GetQueryServicesDescriptor(ctx context.Context, in *GetQueryServicesDescriptorRequest, opts ...grpc.CallOption) (*GetQueryServicesDescriptorResponse, error) { + out := new(GetQueryServicesDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *reflectionServiceClient) GetTxDescriptor(ctx context.Context, in *GetTxDescriptorRequest, opts ...grpc.CallOption) (*GetTxDescriptorResponse, error) { + out := new(GetTxDescriptorResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ReflectionServiceServer is the server API for ReflectionService service. +type ReflectionServiceServer interface { + // GetAuthnDescriptor returns information on how to authenticate transactions in the application + // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in + // future releases of the cosmos-sdk. + GetAuthnDescriptor(context.Context, *GetAuthnDescriptorRequest) (*GetAuthnDescriptorResponse, error) + // GetChainDescriptor returns the description of the chain + GetChainDescriptor(context.Context, *GetChainDescriptorRequest) (*GetChainDescriptorResponse, error) + // GetCodecDescriptor returns the descriptor of the codec of the application + GetCodecDescriptor(context.Context, *GetCodecDescriptorRequest) (*GetCodecDescriptorResponse, error) + // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application + GetConfigurationDescriptor(context.Context, *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) + // GetQueryServicesDescriptor returns the available gRPC queryable services of the application + GetQueryServicesDescriptor(context.Context, *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) + // GetTxDescriptor returns information on the used transaction object and available msgs that can be used + GetTxDescriptor(context.Context, *GetTxDescriptorRequest) (*GetTxDescriptorResponse, error) +} + +// UnimplementedReflectionServiceServer can be embedded to have forward compatible implementations. +type UnimplementedReflectionServiceServer struct { +} + +func (*UnimplementedReflectionServiceServer) GetAuthnDescriptor(ctx context.Context, req *GetAuthnDescriptorRequest) (*GetAuthnDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAuthnDescriptor not implemented") +} +func (*UnimplementedReflectionServiceServer) GetChainDescriptor(ctx context.Context, req *GetChainDescriptorRequest) (*GetChainDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChainDescriptor not implemented") +} +func (*UnimplementedReflectionServiceServer) GetCodecDescriptor(ctx context.Context, req *GetCodecDescriptorRequest) (*GetCodecDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCodecDescriptor not implemented") +} +func (*UnimplementedReflectionServiceServer) GetConfigurationDescriptor(ctx context.Context, req *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfigurationDescriptor not implemented") +} +func (*UnimplementedReflectionServiceServer) GetQueryServicesDescriptor(ctx context.Context, req *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetQueryServicesDescriptor not implemented") +} +func (*UnimplementedReflectionServiceServer) GetTxDescriptor(ctx context.Context, req *GetTxDescriptorRequest) (*GetTxDescriptorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTxDescriptor not implemented") +} + +func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { + s.RegisterService(&_ReflectionService_serviceDesc, srv) +} + +func _ReflectionService_GetAuthnDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAuthnDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetAuthnDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetAuthnDescriptor(ctx, req.(*GetAuthnDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_GetChainDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetChainDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetChainDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetChainDescriptor(ctx, req.(*GetChainDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_GetCodecDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCodecDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetCodecDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetCodecDescriptor(ctx, req.(*GetCodecDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_GetConfigurationDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConfigurationDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetConfigurationDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetConfigurationDescriptor(ctx, req.(*GetConfigurationDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_GetQueryServicesDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetQueryServicesDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetQueryServicesDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetQueryServicesDescriptor(ctx, req.(*GetQueryServicesDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ReflectionService_GetTxDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTxDescriptorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ReflectionServiceServer).GetTxDescriptor(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ReflectionServiceServer).GetTxDescriptor(ctx, req.(*GetTxDescriptorRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ReflectionService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.reflection.v2alpha1.ReflectionService", + HandlerType: (*ReflectionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAuthnDescriptor", + Handler: _ReflectionService_GetAuthnDescriptor_Handler, + }, + { + MethodName: "GetChainDescriptor", + Handler: _ReflectionService_GetChainDescriptor_Handler, + }, + { + MethodName: "GetCodecDescriptor", + Handler: _ReflectionService_GetCodecDescriptor_Handler, + }, + { + MethodName: "GetConfigurationDescriptor", + Handler: _ReflectionService_GetConfigurationDescriptor_Handler, + }, + { + MethodName: "GetQueryServicesDescriptor", + Handler: _ReflectionService_GetQueryServicesDescriptor_Handler, + }, + { + MethodName: "GetTxDescriptor", + Handler: _ReflectionService_GetTxDescriptor_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/reflection/v2alpha1/reflection.proto", +} + +func (m *AppDescriptor) 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 *AppDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AppDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tx != nil { + { + size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.QueryServices != nil { + { + size, err := m.QueryServices.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.Configuration != nil { + { + size, err := m.Configuration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Codec != nil { + { + size, err := m.Codec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Chain != nil { + { + size, err := m.Chain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Authn != nil { + { + size, err := m.Authn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TxDescriptor) 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 *TxDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Fullname) > 0 { + i -= len(m.Fullname) + copy(dAtA[i:], m.Fullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AuthnDescriptor) 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 *AuthnDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthnDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SignModes) > 0 { + for iNdEx := len(m.SignModes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SignModes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SigningModeDescriptor) 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 *SigningModeDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SigningModeDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AuthnInfoProviderMethodFullname) > 0 { + i -= len(m.AuthnInfoProviderMethodFullname) + copy(dAtA[i:], m.AuthnInfoProviderMethodFullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.AuthnInfoProviderMethodFullname))) + i-- + dAtA[i] = 0x1a + } + if m.Number != 0 { + i = encodeVarintReflection(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ChainDescriptor) 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 *ChainDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChainDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CodecDescriptor) 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 *CodecDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CodecDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Interfaces) > 0 { + for iNdEx := len(m.Interfaces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Interfaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *InterfaceDescriptor) 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 *InterfaceDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InterfaceDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InterfaceImplementers) > 0 { + for iNdEx := len(m.InterfaceImplementers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InterfaceImplementers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.InterfaceAcceptingMessages) > 0 { + for iNdEx := len(m.InterfaceAcceptingMessages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InterfaceAcceptingMessages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Fullname) > 0 { + i -= len(m.Fullname) + copy(dAtA[i:], m.Fullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InterfaceImplementerDescriptor) 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 *InterfaceImplementerDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InterfaceImplementerDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TypeUrl) > 0 { + i -= len(m.TypeUrl) + copy(dAtA[i:], m.TypeUrl) + i = encodeVarintReflection(dAtA, i, uint64(len(m.TypeUrl))) + i-- + dAtA[i] = 0x12 + } + if len(m.Fullname) > 0 { + i -= len(m.Fullname) + copy(dAtA[i:], m.Fullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InterfaceAcceptingMessageDescriptor) 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 *InterfaceAcceptingMessageDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InterfaceAcceptingMessageDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FieldDescriptorNames) > 0 { + for iNdEx := len(m.FieldDescriptorNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FieldDescriptorNames[iNdEx]) + copy(dAtA[i:], m.FieldDescriptorNames[iNdEx]) + i = encodeVarintReflection(dAtA, i, uint64(len(m.FieldDescriptorNames[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Fullname) > 0 { + i -= len(m.Fullname) + copy(dAtA[i:], m.Fullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConfigurationDescriptor) 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 *ConfigurationDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigurationDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bech32AccountAddressPrefix) > 0 { + i -= len(m.Bech32AccountAddressPrefix) + copy(dAtA[i:], m.Bech32AccountAddressPrefix) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Bech32AccountAddressPrefix))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDescriptor) 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 *MsgDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintReflection(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetAuthnDescriptorRequest) 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 *GetAuthnDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAuthnDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetAuthnDescriptorResponse) 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 *GetAuthnDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetAuthnDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Authn != nil { + { + size, err := m.Authn.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetChainDescriptorRequest) 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 *GetChainDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetChainDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetChainDescriptorResponse) 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 *GetChainDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetChainDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Chain != nil { + { + size, err := m.Chain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetCodecDescriptorRequest) 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 *GetCodecDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCodecDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetCodecDescriptorResponse) 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 *GetCodecDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetCodecDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Codec != nil { + { + size, err := m.Codec.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetConfigurationDescriptorRequest) 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 *GetConfigurationDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigurationDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetConfigurationDescriptorResponse) 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 *GetConfigurationDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetConfigurationDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetQueryServicesDescriptorRequest) 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 *GetQueryServicesDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetQueryServicesDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetQueryServicesDescriptorResponse) 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 *GetQueryServicesDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetQueryServicesDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Queries != nil { + { + size, err := m.Queries.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetTxDescriptorRequest) 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 *GetTxDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTxDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetTxDescriptorResponse) 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 *GetTxDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetTxDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tx != nil { + { + size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryServicesDescriptor) 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 *QueryServicesDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServicesDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.QueryServices) > 0 { + for iNdEx := len(m.QueryServices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.QueryServices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryServiceDescriptor) 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 *QueryServiceDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryServiceDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Methods) > 0 { + for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintReflection(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.IsModule { + i-- + if m.IsModule { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Fullname) > 0 { + i -= len(m.Fullname) + copy(dAtA[i:], m.Fullname) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryMethodDescriptor) 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 *QueryMethodDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryMethodDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FullQueryPath) > 0 { + i -= len(m.FullQueryPath) + copy(dAtA[i:], m.FullQueryPath) + i = encodeVarintReflection(dAtA, i, uint64(len(m.FullQueryPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintReflection(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintReflection(dAtA []byte, offset int, v uint64) int { + offset -= sovReflection(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AppDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Authn != nil { + l = m.Authn.Size() + n += 1 + l + sovReflection(uint64(l)) + } + if m.Chain != nil { + l = m.Chain.Size() + n += 1 + l + sovReflection(uint64(l)) + } + if m.Codec != nil { + l = m.Codec.Size() + n += 1 + l + sovReflection(uint64(l)) + } + if m.Configuration != nil { + l = m.Configuration.Size() + n += 1 + l + sovReflection(uint64(l)) + } + if m.QueryServices != nil { + l = m.QueryServices.Size() + n += 1 + l + sovReflection(uint64(l)) + } + if m.Tx != nil { + l = m.Tx.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *TxDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *AuthnDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SignModes) > 0 { + for _, e := range m.SignModes { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *SigningModeDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + if m.Number != 0 { + n += 1 + sovReflection(uint64(m.Number)) + } + l = len(m.AuthnInfoProviderMethodFullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *ChainDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *CodecDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Interfaces) > 0 { + for _, e := range m.Interfaces { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *InterfaceDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + if len(m.InterfaceAcceptingMessages) > 0 { + for _, e := range m.InterfaceAcceptingMessages { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + if len(m.InterfaceImplementers) > 0 { + for _, e := range m.InterfaceImplementers { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *InterfaceImplementerDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + l = len(m.TypeUrl) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *InterfaceAcceptingMessageDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + if len(m.FieldDescriptorNames) > 0 { + for _, s := range m.FieldDescriptorNames { + l = len(s) + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *ConfigurationDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bech32AccountAddressPrefix) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *MsgDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetAuthnDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetAuthnDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Authn != nil { + l = m.Authn.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetChainDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetChainDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Chain != nil { + l = m.Chain.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetCodecDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetCodecDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Codec != nil { + l = m.Codec.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetConfigurationDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetConfigurationDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetQueryServicesDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetQueryServicesDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Queries != nil { + l = m.Queries.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *GetTxDescriptorRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetTxDescriptorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tx != nil { + l = m.Tx.Size() + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func (m *QueryServicesDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.QueryServices) > 0 { + for _, e := range m.QueryServices { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *QueryServiceDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Fullname) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + if m.IsModule { + n += 2 + } + if len(m.Methods) > 0 { + for _, e := range m.Methods { + l = e.Size() + n += 1 + l + sovReflection(uint64(l)) + } + } + return n +} + +func (m *QueryMethodDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + l = len(m.FullQueryPath) + if l > 0 { + n += 1 + l + sovReflection(uint64(l)) + } + return n +} + +func sovReflection(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozReflection(x uint64) (n int) { + return sovReflection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AppDescriptor) 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 ErrIntOverflowReflection + } + 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: AppDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AppDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Authn == nil { + m.Authn = &AuthnDescriptor{} + } + if err := m.Authn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Chain == nil { + m.Chain = &ChainDescriptor{} + } + if err := m.Chain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Codec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Codec == nil { + m.Codec = &CodecDescriptor{} + } + if err := m.Codec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Configuration == nil { + m.Configuration = &ConfigurationDescriptor{} + } + if err := m.Configuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryServices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryServices == nil { + m.QueryServices = &QueryServicesDescriptor{} + } + if err := m.QueryServices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tx == nil { + m.Tx = &TxDescriptor{} + } + if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxDescriptor) 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 ErrIntOverflowReflection + } + 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: TxDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msgs = append(m.Msgs, &MsgDescriptor{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthnDescriptor) 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 ErrIntOverflowReflection + } + 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: AuthnDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthnDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SignModes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SignModes = append(m.SignModes, &SigningModeDescriptor{}) + if err := m.SignModes[len(m.SignModes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SigningModeDescriptor) 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 ErrIntOverflowReflection + } + 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: SigningModeDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SigningModeDescriptor: 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 ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + 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 Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthnInfoProviderMethodFullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthnInfoProviderMethodFullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChainDescriptor) 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 ErrIntOverflowReflection + } + 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: ChainDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChainDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CodecDescriptor) 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 ErrIntOverflowReflection + } + 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: CodecDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CodecDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interfaces", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Interfaces = append(m.Interfaces, &InterfaceDescriptor{}) + if err := m.Interfaces[len(m.Interfaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InterfaceDescriptor) 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 ErrIntOverflowReflection + } + 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: InterfaceDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InterfaceDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceAcceptingMessages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterfaceAcceptingMessages = append(m.InterfaceAcceptingMessages, &InterfaceAcceptingMessageDescriptor{}) + if err := m.InterfaceAcceptingMessages[len(m.InterfaceAcceptingMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InterfaceImplementers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InterfaceImplementers = append(m.InterfaceImplementers, &InterfaceImplementerDescriptor{}) + if err := m.InterfaceImplementers[len(m.InterfaceImplementers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InterfaceImplementerDescriptor) 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 ErrIntOverflowReflection + } + 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: InterfaceImplementerDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InterfaceImplementerDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InterfaceAcceptingMessageDescriptor) 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 ErrIntOverflowReflection + } + 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: InterfaceAcceptingMessageDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InterfaceAcceptingMessageDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FieldDescriptorNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FieldDescriptorNames = append(m.FieldDescriptorNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigurationDescriptor) 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 ErrIntOverflowReflection + } + 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: ConfigurationDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigurationDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bech32AccountAddressPrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bech32AccountAddressPrefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDescriptor) 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 ErrIntOverflowReflection + } + 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: MsgDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAuthnDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetAuthnDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAuthnDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetAuthnDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetAuthnDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetAuthnDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authn", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Authn == nil { + m.Authn = &AuthnDescriptor{} + } + if err := m.Authn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetChainDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetChainDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetChainDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetChainDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetChainDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetChainDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Chain == nil { + m.Chain = &ChainDescriptor{} + } + if err := m.Chain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCodecDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetCodecDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCodecDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCodecDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetCodecDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCodecDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Codec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Codec == nil { + m.Codec = &CodecDescriptor{} + } + if err := m.Codec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetConfigurationDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetConfigurationDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetConfigurationDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetConfigurationDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetConfigurationDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetConfigurationDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Config == nil { + m.Config = &ConfigurationDescriptor{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetQueryServicesDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetQueryServicesDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetQueryServicesDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetQueryServicesDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetQueryServicesDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetQueryServicesDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Queries == nil { + m.Queries = &QueryServicesDescriptor{} + } + if err := m.Queries.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetTxDescriptorRequest) 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 ErrIntOverflowReflection + } + 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: GetTxDescriptorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetTxDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetTxDescriptorResponse) 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 ErrIntOverflowReflection + } + 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: GetTxDescriptorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetTxDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tx == nil { + m.Tx = &TxDescriptor{} + } + if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryServicesDescriptor) 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 ErrIntOverflowReflection + } + 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: QueryServicesDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServicesDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryServices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.QueryServices = append(m.QueryServices, &QueryServiceDescriptor{}) + if err := m.QueryServices[len(m.QueryServices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryServiceDescriptor) 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 ErrIntOverflowReflection + } + 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: QueryServiceDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryServiceDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Fullname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsModule", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsModule = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthReflection + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Methods = append(m.Methods, &QueryMethodDescriptor{}) + if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryMethodDescriptor) 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 ErrIntOverflowReflection + } + 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: QueryMethodDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMethodDescriptor: 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 ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + 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 FullQueryPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowReflection + } + 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 ErrInvalidLengthReflection + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthReflection + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FullQueryPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipReflection(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthReflection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipReflection(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, ErrIntOverflowReflection + } + 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, ErrIntOverflowReflection + } + 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, ErrIntOverflowReflection + } + 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, ErrInvalidLengthReflection + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupReflection + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthReflection + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthReflection = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowReflection = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupReflection = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go new file mode 100644 index 000000000000..d53b4fdaeb8c --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go @@ -0,0 +1,478 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/base/reflection/v2alpha1/reflection.proto + +/* +Package v2alpha1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v2alpha1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_ReflectionService_GetAuthnDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAuthnDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetAuthnDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetAuthnDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetAuthnDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetAuthnDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_GetChainDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetChainDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetChainDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetChainDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetChainDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetChainDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_GetCodecDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCodecDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetCodecDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetCodecDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCodecDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetCodecDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_GetConfigurationDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigurationDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetConfigurationDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetConfigurationDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetConfigurationDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetConfigurationDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_GetQueryServicesDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetQueryServicesDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetQueryServicesDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetQueryServicesDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetQueryServicesDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetQueryServicesDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +func request_ReflectionService_GetTxDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTxDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetTxDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ReflectionService_GetTxDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetTxDescriptorRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetTxDescriptor(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterReflectionServiceHandlerServer registers the http handlers for service ReflectionService to "mux". +// UnaryRPC :call ReflectionServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReflectionServiceHandlerFromEndpoint instead. +func RegisterReflectionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReflectionServiceServer) error { + + mux.Handle("GET", pattern_ReflectionService_GetAuthnDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetAuthnDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetAuthnDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetChainDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetChainDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetChainDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetCodecDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetCodecDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetCodecDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetConfigurationDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetConfigurationDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetConfigurationDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetQueryServicesDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetQueryServicesDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetQueryServicesDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetTxDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ReflectionService_GetTxDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetTxDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterReflectionServiceHandlerFromEndpoint is same as RegisterReflectionServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterReflectionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterReflectionServiceHandler(ctx, mux, conn) +} + +// RegisterReflectionServiceHandler registers the http handlers for service ReflectionService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterReflectionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterReflectionServiceHandlerClient(ctx, mux, NewReflectionServiceClient(conn)) +} + +// RegisterReflectionServiceHandlerClient registers the http handlers for service ReflectionService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReflectionServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReflectionServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ReflectionServiceClient" to call the correct interceptors. +func RegisterReflectionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReflectionServiceClient) error { + + mux.Handle("GET", pattern_ReflectionService_GetAuthnDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetAuthnDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetAuthnDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetChainDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetChainDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetChainDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetCodecDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetCodecDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetCodecDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetConfigurationDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetConfigurationDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetConfigurationDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetQueryServicesDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetQueryServicesDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetQueryServicesDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_ReflectionService_GetTxDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ReflectionService_GetTxDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_ReflectionService_GetTxDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_ReflectionService_GetAuthnDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "authn"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_GetChainDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "chain"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_GetCodecDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "codec"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_GetConfigurationDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "configuration"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_GetQueryServicesDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "query_services"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_ReflectionService_GetTxDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "tx_descriptor"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_ReflectionService_GetAuthnDescriptor_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_GetChainDescriptor_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_GetCodecDescriptor_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_GetConfigurationDescriptor_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_GetQueryServicesDescriptor_0 = runtime.ForwardResponseMessage + + forward_ReflectionService_GetTxDescriptor_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go b/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go new file mode 100644 index 000000000000..5821c916143b --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go @@ -0,0 +1,2595 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/snapshots/v1beta1/snapshot.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Snapshot contains Tendermint state sync snapshot info. +type Snapshot struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` + Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` + Metadata Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *Snapshot) Reset() { *m = Snapshot{} } +func (m *Snapshot) String() string { return proto.CompactTextString(m) } +func (*Snapshot) ProtoMessage() {} +func (*Snapshot) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{0} +} +func (m *Snapshot) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Snapshot.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 *Snapshot) XXX_Merge(src proto.Message) { + xxx_messageInfo_Snapshot.Merge(m, src) +} +func (m *Snapshot) XXX_Size() int { + return m.Size() +} +func (m *Snapshot) XXX_DiscardUnknown() { + xxx_messageInfo_Snapshot.DiscardUnknown(m) +} + +var xxx_messageInfo_Snapshot proto.InternalMessageInfo + +func (m *Snapshot) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *Snapshot) GetFormat() uint32 { + if m != nil { + return m.Format + } + return 0 +} + +func (m *Snapshot) GetChunks() uint32 { + if m != nil { + return m.Chunks + } + return 0 +} + +func (m *Snapshot) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func (m *Snapshot) GetMetadata() Metadata { + if m != nil { + return m.Metadata + } + return Metadata{} +} + +// Metadata contains SDK-specific snapshot metadata. +type Metadata struct { + ChunkHashes [][]byte `protobuf:"bytes,1,rep,name=chunk_hashes,json=chunkHashes,proto3" json:"chunk_hashes,omitempty"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{1} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.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 *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetChunkHashes() [][]byte { + if m != nil { + return m.ChunkHashes + } + return nil +} + +// SnapshotItem is an item contained in a rootmulti.Store snapshot. +// +// Since: cosmos-sdk 0.46 +type SnapshotItem struct { + // item is the specific type of snapshot item. + // + // Types that are valid to be assigned to Item: + // + // *SnapshotItem_Store + // *SnapshotItem_IAVL + // *SnapshotItem_Extension + // *SnapshotItem_ExtensionPayload + // *SnapshotItem_KV + // *SnapshotItem_Schema + Item isSnapshotItem_Item `protobuf_oneof:"item"` +} + +func (m *SnapshotItem) Reset() { *m = SnapshotItem{} } +func (m *SnapshotItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotItem) ProtoMessage() {} +func (*SnapshotItem) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{2} +} +func (m *SnapshotItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotItem.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 *SnapshotItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotItem.Merge(m, src) +} +func (m *SnapshotItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotItem proto.InternalMessageInfo + +type isSnapshotItem_Item interface { + isSnapshotItem_Item() + MarshalTo([]byte) (int, error) + Size() int +} + +type SnapshotItem_Store struct { + Store *SnapshotStoreItem `protobuf:"bytes,1,opt,name=store,proto3,oneof" json:"store,omitempty"` +} +type SnapshotItem_IAVL struct { + IAVL *SnapshotIAVLItem `protobuf:"bytes,2,opt,name=iavl,proto3,oneof" json:"iavl,omitempty"` +} +type SnapshotItem_Extension struct { + Extension *SnapshotExtensionMeta `protobuf:"bytes,3,opt,name=extension,proto3,oneof" json:"extension,omitempty"` +} +type SnapshotItem_ExtensionPayload struct { + ExtensionPayload *SnapshotExtensionPayload `protobuf:"bytes,4,opt,name=extension_payload,json=extensionPayload,proto3,oneof" json:"extension_payload,omitempty"` +} +type SnapshotItem_KV struct { + KV *SnapshotKVItem `protobuf:"bytes,5,opt,name=kv,proto3,oneof" json:"kv,omitempty"` +} +type SnapshotItem_Schema struct { + Schema *SnapshotSchema `protobuf:"bytes,6,opt,name=schema,proto3,oneof" json:"schema,omitempty"` +} + +func (*SnapshotItem_Store) isSnapshotItem_Item() {} +func (*SnapshotItem_IAVL) isSnapshotItem_Item() {} +func (*SnapshotItem_Extension) isSnapshotItem_Item() {} +func (*SnapshotItem_ExtensionPayload) isSnapshotItem_Item() {} +func (*SnapshotItem_KV) isSnapshotItem_Item() {} +func (*SnapshotItem_Schema) isSnapshotItem_Item() {} + +func (m *SnapshotItem) GetItem() isSnapshotItem_Item { + if m != nil { + return m.Item + } + return nil +} + +func (m *SnapshotItem) GetStore() *SnapshotStoreItem { + if x, ok := m.GetItem().(*SnapshotItem_Store); ok { + return x.Store + } + return nil +} + +func (m *SnapshotItem) GetIAVL() *SnapshotIAVLItem { + if x, ok := m.GetItem().(*SnapshotItem_IAVL); ok { + return x.IAVL + } + return nil +} + +func (m *SnapshotItem) GetExtension() *SnapshotExtensionMeta { + if x, ok := m.GetItem().(*SnapshotItem_Extension); ok { + return x.Extension + } + return nil +} + +func (m *SnapshotItem) GetExtensionPayload() *SnapshotExtensionPayload { + if x, ok := m.GetItem().(*SnapshotItem_ExtensionPayload); ok { + return x.ExtensionPayload + } + return nil +} + +// Deprecated: Do not use. +func (m *SnapshotItem) GetKV() *SnapshotKVItem { + if x, ok := m.GetItem().(*SnapshotItem_KV); ok { + return x.KV + } + return nil +} + +// Deprecated: Do not use. +func (m *SnapshotItem) GetSchema() *SnapshotSchema { + if x, ok := m.GetItem().(*SnapshotItem_Schema); ok { + return x.Schema + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*SnapshotItem) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*SnapshotItem_Store)(nil), + (*SnapshotItem_IAVL)(nil), + (*SnapshotItem_Extension)(nil), + (*SnapshotItem_ExtensionPayload)(nil), + (*SnapshotItem_KV)(nil), + (*SnapshotItem_Schema)(nil), + } +} + +// SnapshotStoreItem contains metadata about a snapshotted store. +// +// Since: cosmos-sdk 0.46 +type SnapshotStoreItem struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *SnapshotStoreItem) Reset() { *m = SnapshotStoreItem{} } +func (m *SnapshotStoreItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotStoreItem) ProtoMessage() {} +func (*SnapshotStoreItem) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{3} +} +func (m *SnapshotStoreItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotStoreItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotStoreItem.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 *SnapshotStoreItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotStoreItem.Merge(m, src) +} +func (m *SnapshotStoreItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotStoreItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotStoreItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotStoreItem proto.InternalMessageInfo + +func (m *SnapshotStoreItem) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// SnapshotIAVLItem is an exported IAVL node. +// +// Since: cosmos-sdk 0.46 +type SnapshotIAVLItem struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + // version is block height + Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + // height is depth of the tree. + Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *SnapshotIAVLItem) Reset() { *m = SnapshotIAVLItem{} } +func (m *SnapshotIAVLItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotIAVLItem) ProtoMessage() {} +func (*SnapshotIAVLItem) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{4} +} +func (m *SnapshotIAVLItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotIAVLItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotIAVLItem.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 *SnapshotIAVLItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotIAVLItem.Merge(m, src) +} +func (m *SnapshotIAVLItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotIAVLItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotIAVLItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotIAVLItem proto.InternalMessageInfo + +func (m *SnapshotIAVLItem) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *SnapshotIAVLItem) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *SnapshotIAVLItem) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *SnapshotIAVLItem) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +// SnapshotExtensionMeta contains metadata about an external snapshotter. +// +// Since: cosmos-sdk 0.46 +type SnapshotExtensionMeta struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` +} + +func (m *SnapshotExtensionMeta) Reset() { *m = SnapshotExtensionMeta{} } +func (m *SnapshotExtensionMeta) String() string { return proto.CompactTextString(m) } +func (*SnapshotExtensionMeta) ProtoMessage() {} +func (*SnapshotExtensionMeta) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{5} +} +func (m *SnapshotExtensionMeta) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotExtensionMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotExtensionMeta.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 *SnapshotExtensionMeta) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotExtensionMeta.Merge(m, src) +} +func (m *SnapshotExtensionMeta) XXX_Size() int { + return m.Size() +} +func (m *SnapshotExtensionMeta) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotExtensionMeta.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotExtensionMeta proto.InternalMessageInfo + +func (m *SnapshotExtensionMeta) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *SnapshotExtensionMeta) GetFormat() uint32 { + if m != nil { + return m.Format + } + return 0 +} + +// SnapshotExtensionPayload contains payloads of an external snapshotter. +// +// Since: cosmos-sdk 0.46 +type SnapshotExtensionPayload struct { + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *SnapshotExtensionPayload) Reset() { *m = SnapshotExtensionPayload{} } +func (m *SnapshotExtensionPayload) String() string { return proto.CompactTextString(m) } +func (*SnapshotExtensionPayload) ProtoMessage() {} +func (*SnapshotExtensionPayload) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{6} +} +func (m *SnapshotExtensionPayload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotExtensionPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotExtensionPayload.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 *SnapshotExtensionPayload) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotExtensionPayload.Merge(m, src) +} +func (m *SnapshotExtensionPayload) XXX_Size() int { + return m.Size() +} +func (m *SnapshotExtensionPayload) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotExtensionPayload.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotExtensionPayload proto.InternalMessageInfo + +func (m *SnapshotExtensionPayload) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// SnapshotKVItem is an exported Key/Value Pair +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +// +// Deprecated: Do not use. +type SnapshotKVItem struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *SnapshotKVItem) Reset() { *m = SnapshotKVItem{} } +func (m *SnapshotKVItem) String() string { return proto.CompactTextString(m) } +func (*SnapshotKVItem) ProtoMessage() {} +func (*SnapshotKVItem) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{7} +} +func (m *SnapshotKVItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotKVItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotKVItem.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 *SnapshotKVItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotKVItem.Merge(m, src) +} +func (m *SnapshotKVItem) XXX_Size() int { + return m.Size() +} +func (m *SnapshotKVItem) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotKVItem.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotKVItem proto.InternalMessageInfo + +func (m *SnapshotKVItem) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *SnapshotKVItem) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// SnapshotSchema is an exported schema of smt store +// +// Since: cosmos-sdk 0.46 +// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. +// +// Deprecated: Do not use. +type SnapshotSchema struct { + Keys [][]byte `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` +} + +func (m *SnapshotSchema) Reset() { *m = SnapshotSchema{} } +func (m *SnapshotSchema) String() string { return proto.CompactTextString(m) } +func (*SnapshotSchema) ProtoMessage() {} +func (*SnapshotSchema) Descriptor() ([]byte, []int) { + return fileDescriptor_dd7a3c9b0a19e1ee, []int{8} +} +func (m *SnapshotSchema) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotSchema.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 *SnapshotSchema) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotSchema.Merge(m, src) +} +func (m *SnapshotSchema) XXX_Size() int { + return m.Size() +} +func (m *SnapshotSchema) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotSchema.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotSchema proto.InternalMessageInfo + +func (m *SnapshotSchema) GetKeys() [][]byte { + if m != nil { + return m.Keys + } + return nil +} + +func init() { + proto.RegisterType((*Snapshot)(nil), "cosmos.base.snapshots.v1beta1.Snapshot") + proto.RegisterType((*Metadata)(nil), "cosmos.base.snapshots.v1beta1.Metadata") + proto.RegisterType((*SnapshotItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotItem") + proto.RegisterType((*SnapshotStoreItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotStoreItem") + proto.RegisterType((*SnapshotIAVLItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") + proto.RegisterType((*SnapshotExtensionMeta)(nil), "cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") + proto.RegisterType((*SnapshotExtensionPayload)(nil), "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") + proto.RegisterType((*SnapshotKVItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotKVItem") + proto.RegisterType((*SnapshotSchema)(nil), "cosmos.base.snapshots.v1beta1.SnapshotSchema") +} + +func init() { + proto.RegisterFile("cosmos/base/snapshots/v1beta1/snapshot.proto", fileDescriptor_dd7a3c9b0a19e1ee) +} + +var fileDescriptor_dd7a3c9b0a19e1ee = []byte{ + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xf6, 0x3a, 0x4e, 0x48, 0xd7, 0x06, 0xb5, 0xab, 0x82, 0x2c, 0x24, 0xdc, 0xe0, 0x4b, 0x7d, + 0x68, 0x6d, 0x1a, 0x2a, 0x21, 0x21, 0x2e, 0x04, 0x81, 0x1c, 0x05, 0x04, 0xda, 0xa0, 0x1c, 0xb8, + 0x54, 0x9b, 0x64, 0x1b, 0x47, 0x8e, 0xb3, 0x51, 0x76, 0x63, 0x91, 0x27, 0xe0, 0xca, 0xab, 0xf0, + 0x16, 0x3d, 0xf6, 0xc8, 0xa9, 0x42, 0xc9, 0x8b, 0xa0, 0x5d, 0xff, 0xb4, 0x94, 0x16, 0xd2, 0x53, + 0x66, 0x26, 0xdf, 0xf7, 0x79, 0x76, 0xbe, 0x9d, 0x85, 0x07, 0x03, 0xc6, 0x13, 0xc6, 0x83, 0x3e, + 0xe1, 0x34, 0xe0, 0x53, 0x32, 0xe3, 0x11, 0x13, 0x3c, 0x48, 0x8f, 0xfa, 0x54, 0x90, 0xa3, 0xb2, + 0xe2, 0xcf, 0xe6, 0x4c, 0x30, 0xf4, 0x24, 0x43, 0xfb, 0x12, 0xed, 0x97, 0x68, 0x3f, 0x47, 0x3f, + 0xde, 0x1d, 0xb1, 0x11, 0x53, 0xc8, 0x40, 0x46, 0x19, 0xc9, 0xfd, 0x01, 0x60, 0xbd, 0x9b, 0x63, + 0xd1, 0x23, 0x58, 0x8b, 0xe8, 0x78, 0x14, 0x09, 0x1b, 0x34, 0x80, 0x67, 0xe0, 0x3c, 0x93, 0xf5, + 0x53, 0x36, 0x4f, 0x88, 0xb0, 0xf5, 0x06, 0xf0, 0xee, 0xe3, 0x3c, 0x93, 0xf5, 0x41, 0xb4, 0x98, + 0xc6, 0xdc, 0xae, 0x64, 0xf5, 0x2c, 0x43, 0x08, 0x1a, 0x11, 0xe1, 0x91, 0x6d, 0x34, 0x80, 0x67, + 0x61, 0x15, 0xa3, 0x36, 0xac, 0x27, 0x54, 0x90, 0x21, 0x11, 0xc4, 0xae, 0x36, 0x80, 0x67, 0x36, + 0xf7, 0xfd, 0x7f, 0x36, 0xec, 0x7f, 0xc8, 0xe1, 0x2d, 0xe3, 0xec, 0x62, 0x4f, 0xc3, 0x25, 0xdd, + 0x3d, 0x84, 0xf5, 0xe2, 0x3f, 0xf4, 0x14, 0x5a, 0xea, 0xa3, 0x27, 0xf2, 0x23, 0x94, 0xdb, 0xa0, + 0x51, 0xf1, 0x2c, 0x6c, 0xaa, 0x5a, 0xa8, 0x4a, 0xee, 0x37, 0x03, 0x5a, 0xc5, 0x11, 0xdb, 0x82, + 0x26, 0x28, 0x84, 0x55, 0x2e, 0xd8, 0x9c, 0xaa, 0x53, 0x9a, 0xcd, 0x67, 0xff, 0xe9, 0xa3, 0xe0, + 0x76, 0x25, 0x47, 0x0a, 0x84, 0x1a, 0xce, 0x04, 0xd0, 0x47, 0x68, 0x8c, 0x49, 0x3a, 0x51, 0x63, + 0x31, 0x9b, 0xc1, 0x86, 0x42, 0xed, 0xd7, 0xbd, 0xf7, 0x52, 0xa7, 0x55, 0x5f, 0x5d, 0xec, 0x19, + 0x32, 0x0b, 0x35, 0xac, 0x84, 0xd0, 0x67, 0xb8, 0x45, 0xbf, 0x0a, 0x3a, 0xe5, 0x63, 0x36, 0x55, + 0x43, 0x35, 0x9b, 0xc7, 0x1b, 0xaa, 0xbe, 0x2d, 0x78, 0x72, 0x36, 0xa1, 0x86, 0x2f, 0x85, 0xd0, + 0x29, 0xdc, 0x29, 0x93, 0x93, 0x19, 0x59, 0x4e, 0x18, 0x19, 0x2a, 0x73, 0xcc, 0xe6, 0x8b, 0xbb, + 0xaa, 0x7f, 0xca, 0xe8, 0xa1, 0x86, 0xb7, 0xe9, 0xb5, 0x1a, 0x6a, 0x43, 0x3d, 0x4e, 0x73, 0x77, + 0x0f, 0x37, 0x14, 0xee, 0xf4, 0xca, 0x51, 0xe8, 0x9d, 0x9e, 0x0d, 0x42, 0x0d, 0xeb, 0x71, 0x8a, + 0x3a, 0xb0, 0xc6, 0x07, 0x11, 0x4d, 0x88, 0x5d, 0xbb, 0x93, 0x5c, 0x57, 0x91, 0x5a, 0xba, 0x12, + 0xca, 0x25, 0x5a, 0x35, 0x68, 0x8c, 0x05, 0x4d, 0xdc, 0x7d, 0xb8, 0xf3, 0x97, 0x99, 0xf2, 0xb2, + 0x4e, 0x49, 0x92, 0x5d, 0x86, 0x2d, 0xac, 0x62, 0x77, 0x02, 0xb7, 0xaf, 0x9b, 0x85, 0xb6, 0x61, + 0x25, 0xa6, 0x4b, 0x05, 0xb3, 0xb0, 0x0c, 0xd1, 0x2e, 0xac, 0xa6, 0x64, 0xb2, 0xa0, 0xca, 0x7e, + 0x0b, 0x67, 0x09, 0xb2, 0xe1, 0xbd, 0x94, 0xce, 0x4b, 0x03, 0x2b, 0xb8, 0x48, 0xaf, 0xac, 0x97, + 0x9c, 0x7d, 0xb5, 0x58, 0x2f, 0xf7, 0x0d, 0x7c, 0x78, 0xa3, 0x89, 0x37, 0xb5, 0x76, 0xdb, 0x2e, + 0xba, 0xc7, 0xd0, 0xbe, 0xcd, 0x2b, 0xd9, 0x52, 0xe1, 0x7a, 0xd6, 0x7e, 0x91, 0xba, 0xaf, 0xe0, + 0x83, 0x3f, 0x8d, 0xd8, 0xf4, 0x98, 0x2f, 0x75, 0x1b, 0xb8, 0xde, 0x25, 0x3b, 0x9b, 0xbb, 0xec, + 0x38, 0xa6, 0xcb, 0x62, 0x0d, 0x55, 0x2c, 0x91, 0xad, 0x77, 0x67, 0x2b, 0x07, 0x9c, 0xaf, 0x1c, + 0xf0, 0x6b, 0xe5, 0x80, 0xef, 0x6b, 0x47, 0x3b, 0x5f, 0x3b, 0xda, 0xcf, 0xb5, 0xa3, 0x7d, 0x39, + 0x18, 0x8d, 0x45, 0xb4, 0xe8, 0xfb, 0x03, 0x96, 0x04, 0xf9, 0x73, 0x97, 0xfd, 0x1c, 0xf2, 0x61, + 0x7c, 0xe5, 0xd1, 0x13, 0xcb, 0x19, 0xe5, 0xfd, 0x9a, 0x7a, 0xb5, 0x9e, 0xff, 0x0e, 0x00, 0x00, + 0xff, 0xff, 0xe5, 0xb5, 0xd9, 0x60, 0x1a, 0x05, 0x00, 0x00, +} + +func (m *Snapshot) 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 *Snapshot) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 + } + if m.Chunks != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Chunks)) + i-- + dAtA[i] = 0x18 + } + if m.Format != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Format)) + i-- + dAtA[i] = 0x10 + } + if m.Height != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Metadata) 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 *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChunkHashes) > 0 { + for iNdEx := len(m.ChunkHashes) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ChunkHashes[iNdEx]) + copy(dAtA[i:], m.ChunkHashes[iNdEx]) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.ChunkHashes[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SnapshotItem) 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 *SnapshotItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Item != nil { + { + size := m.Item.Size() + i -= size + if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *SnapshotItem_Store) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_Store) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Store != nil { + { + size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_IAVL) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_IAVL) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IAVL != nil { + { + size, err := m.IAVL.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_Extension) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Extension != nil { + { + size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_ExtensionPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_ExtensionPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExtensionPayload != nil { + { + size, err := m.ExtensionPayload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_KV) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.KV != nil { + { + size, err := m.KV.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *SnapshotItem_Schema) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotItem_Schema) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Schema != nil { + { + size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSnapshot(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *SnapshotStoreItem) 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 *SnapshotStoreItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotStoreItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotIAVLItem) 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 *SnapshotIAVLItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotIAVLItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x20 + } + if m.Version != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotExtensionMeta) 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 *SnapshotExtensionMeta) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotExtensionMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Format != 0 { + i = encodeVarintSnapshot(dAtA, i, uint64(m.Format)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotExtensionPayload) 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 *SnapshotExtensionPayload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotExtensionPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Payload) > 0 { + i -= len(m.Payload) + copy(dAtA[i:], m.Payload) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Payload))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotKVItem) 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 *SnapshotKVItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotKVItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotSchema) 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 *SnapshotSchema) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotSchema) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Keys) > 0 { + for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Keys[iNdEx]) + copy(dAtA[i:], m.Keys[iNdEx]) + i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Keys[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { + offset -= sovSnapshot(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Snapshot) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovSnapshot(uint64(m.Height)) + } + if m.Format != 0 { + n += 1 + sovSnapshot(uint64(m.Format)) + } + if m.Chunks != 0 { + n += 1 + sovSnapshot(uint64(m.Chunks)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovSnapshot(uint64(l)) + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ChunkHashes) > 0 { + for _, b := range m.ChunkHashes { + l = len(b) + n += 1 + l + sovSnapshot(uint64(l)) + } + } + return n +} + +func (m *SnapshotItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Item != nil { + n += m.Item.Size() + } + return n +} + +func (m *SnapshotItem_Store) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Store != nil { + l = m.Store.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_IAVL) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IAVL != nil { + l = m.IAVL.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_Extension) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Extension != nil { + l = m.Extension.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_ExtensionPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExtensionPayload != nil { + l = m.ExtensionPayload.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_KV) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.KV != nil { + l = m.KV.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotItem_Schema) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Schema != nil { + l = m.Schema.Size() + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} +func (m *SnapshotStoreItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} + +func (m *SnapshotIAVLItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + if m.Version != 0 { + n += 1 + sovSnapshot(uint64(m.Version)) + } + if m.Height != 0 { + n += 1 + sovSnapshot(uint64(m.Height)) + } + return n +} + +func (m *SnapshotExtensionMeta) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + if m.Format != 0 { + n += 1 + sovSnapshot(uint64(m.Format)) + } + return n +} + +func (m *SnapshotExtensionPayload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Payload) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} + +func (m *SnapshotKVItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovSnapshot(uint64(l)) + } + return n +} + +func (m *SnapshotSchema) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Keys) > 0 { + for _, b := range m.Keys { + l = len(b) + n += 1 + l + sovSnapshot(uint64(l)) + } + } + return n +} + +func sovSnapshot(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSnapshot(x uint64) (n int) { + return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Snapshot) 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 ErrIntOverflowSnapshot + } + 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: Snapshot: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) + } + m.Format = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Format |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) + } + m.Chunks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Chunks |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) 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 ErrIntOverflowSnapshot + } + 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: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChunkHashes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChunkHashes = append(m.ChunkHashes, make([]byte, postIndex-iNdEx)) + copy(m.ChunkHashes[len(m.ChunkHashes)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotItem) 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 ErrIntOverflowSnapshot + } + 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: SnapshotItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotStoreItem{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_Store{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IAVL", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotIAVLItem{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_IAVL{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotExtensionMeta{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_Extension{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtensionPayload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotExtensionPayload{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_ExtensionPayload{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KV", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotKVItem{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_KV{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SnapshotSchema{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Item = &SnapshotItem_Schema{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotStoreItem) 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 ErrIntOverflowSnapshot + } + 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: SnapshotStoreItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotStoreItem: 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 ErrIntOverflowSnapshot + } + 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 ErrInvalidLengthSnapshot + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotIAVLItem) 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 ErrIntOverflowSnapshot + } + 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: SnapshotIAVLItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotIAVLItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + case 3: + 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 ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotExtensionMeta) 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 ErrIntOverflowSnapshot + } + 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: SnapshotExtensionMeta: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotExtensionMeta: 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 ErrIntOverflowSnapshot + } + 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 ErrInvalidLengthSnapshot + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + 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 Format", wireType) + } + m.Format = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Format |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotExtensionPayload) 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 ErrIntOverflowSnapshot + } + 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: SnapshotExtensionPayload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotExtensionPayload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) + if m.Payload == nil { + m.Payload = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotKVItem) 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 ErrIntOverflowSnapshot + } + 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: SnapshotKVItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotKVItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotSchema) 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 ErrIntOverflowSnapshot + } + 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: SnapshotSchema: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotSchema: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSnapshot + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSnapshot + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthSnapshot + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSnapshot(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSnapshot + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSnapshot(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, ErrIntOverflowSnapshot + } + 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, ErrIntOverflowSnapshot + } + 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, ErrIntOverflowSnapshot + } + 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, ErrInvalidLengthSnapshot + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSnapshot + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSnapshot + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go b/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go new file mode 100644 index 000000000000..58111754b431 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go @@ -0,0 +1,866 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/store/v1beta1/commit_info.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "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 + +// CommitInfo defines commit information used by the multi-store when committing +// a version/height. +type CommitInfo struct { + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + StoreInfos []StoreInfo `protobuf:"bytes,2,rep,name=store_infos,json=storeInfos,proto3" json:"store_infos"` + Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` +} + +func (m *CommitInfo) Reset() { *m = CommitInfo{} } +func (m *CommitInfo) String() string { return proto.CompactTextString(m) } +func (*CommitInfo) ProtoMessage() {} +func (*CommitInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_83f4097f6265b52f, []int{0} +} +func (m *CommitInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitInfo.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 *CommitInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitInfo.Merge(m, src) +} +func (m *CommitInfo) XXX_Size() int { + return m.Size() +} +func (m *CommitInfo) XXX_DiscardUnknown() { + xxx_messageInfo_CommitInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitInfo proto.InternalMessageInfo + +func (m *CommitInfo) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *CommitInfo) GetStoreInfos() []StoreInfo { + if m != nil { + return m.StoreInfos + } + return nil +} + +func (m *CommitInfo) GetTimestamp() time.Time { + if m != nil { + return m.Timestamp + } + return time.Time{} +} + +// StoreInfo defines store-specific commit information. It contains a reference +// between a store name and the commit ID. +type StoreInfo struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CommitId CommitID `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id"` +} + +func (m *StoreInfo) Reset() { *m = StoreInfo{} } +func (m *StoreInfo) String() string { return proto.CompactTextString(m) } +func (*StoreInfo) ProtoMessage() {} +func (*StoreInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_83f4097f6265b52f, []int{1} +} +func (m *StoreInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoreInfo.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 *StoreInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoreInfo.Merge(m, src) +} +func (m *StoreInfo) XXX_Size() int { + return m.Size() +} +func (m *StoreInfo) XXX_DiscardUnknown() { + xxx_messageInfo_StoreInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_StoreInfo proto.InternalMessageInfo + +func (m *StoreInfo) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *StoreInfo) GetCommitId() CommitID { + if m != nil { + return m.CommitId + } + return CommitID{} +} + +// CommitID defines the commitment information when a specific store is +// committed. +type CommitID struct { + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *CommitID) Reset() { *m = CommitID{} } +func (*CommitID) ProtoMessage() {} +func (*CommitID) Descriptor() ([]byte, []int) { + return fileDescriptor_83f4097f6265b52f, []int{2} +} +func (m *CommitID) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommitID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommitID.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 *CommitID) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommitID.Merge(m, src) +} +func (m *CommitID) XXX_Size() int { + return m.Size() +} +func (m *CommitID) XXX_DiscardUnknown() { + xxx_messageInfo_CommitID.DiscardUnknown(m) +} + +var xxx_messageInfo_CommitID proto.InternalMessageInfo + +func (m *CommitID) GetVersion() int64 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *CommitID) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func init() { + proto.RegisterType((*CommitInfo)(nil), "cosmos.base.store.v1beta1.CommitInfo") + proto.RegisterType((*StoreInfo)(nil), "cosmos.base.store.v1beta1.StoreInfo") + proto.RegisterType((*CommitID)(nil), "cosmos.base.store.v1beta1.CommitID") +} + +func init() { + proto.RegisterFile("cosmos/base/store/v1beta1/commit_info.proto", fileDescriptor_83f4097f6265b52f) +} + +var fileDescriptor_83f4097f6265b52f = []byte{ + // 354 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xb1, 0x4e, 0xfb, 0x30, + 0x10, 0xc6, 0xe3, 0x36, 0xfa, 0xff, 0x1b, 0x97, 0xc9, 0x62, 0x08, 0x1d, 0x92, 0xaa, 0x30, 0x44, + 0x42, 0xd8, 0x6a, 0xd9, 0x18, 0x18, 0x02, 0x42, 0xaa, 0xd8, 0x02, 0x13, 0x0b, 0x4a, 0x5a, 0x37, + 0x8d, 0xc0, 0xb9, 0xaa, 0x76, 0x2b, 0xf1, 0x16, 0x1d, 0x19, 0x79, 0x0b, 0x5e, 0xa1, 0x63, 0x47, + 0x26, 0x40, 0xcd, 0x8b, 0xa0, 0x38, 0x71, 0x99, 0xe8, 0x94, 0xbb, 0xf8, 0xbb, 0xfb, 0x7e, 0xfa, + 0x74, 0xf8, 0x74, 0x04, 0x52, 0x80, 0x64, 0x49, 0x2c, 0x39, 0x93, 0x0a, 0xe6, 0x9c, 0x2d, 0xfb, + 0x09, 0x57, 0x71, 0x9f, 0x8d, 0x40, 0x88, 0x4c, 0x3d, 0x66, 0xf9, 0x04, 0xe8, 0x6c, 0x0e, 0x0a, + 0xc8, 0x51, 0x25, 0xa6, 0xa5, 0x98, 0x6a, 0x31, 0xad, 0xc5, 0x9d, 0xc3, 0x14, 0x52, 0xd0, 0x2a, + 0x56, 0x56, 0xd5, 0x40, 0xc7, 0x4f, 0x01, 0xd2, 0x67, 0xce, 0x74, 0x97, 0x2c, 0x26, 0x4c, 0x65, + 0x82, 0x4b, 0x15, 0x8b, 0x59, 0x25, 0xe8, 0xbd, 0x23, 0x8c, 0xaf, 0xb4, 0xcf, 0x30, 0x9f, 0x00, + 0x71, 0xf1, 0xff, 0x25, 0x9f, 0xcb, 0x0c, 0x72, 0x17, 0x75, 0x51, 0xd0, 0x8c, 0x4c, 0x4b, 0x6e, + 0x71, 0x5b, 0x1b, 0x6a, 0x1c, 0xe9, 0x36, 0xba, 0xcd, 0xa0, 0x3d, 0x38, 0xa1, 0x7f, 0x02, 0xd1, + 0xbb, 0xb2, 0x2b, 0x97, 0x86, 0xf6, 0xfa, 0xd3, 0xb7, 0x22, 0x2c, 0xcd, 0x0f, 0x49, 0x42, 0xec, + 0xec, 0x40, 0xdc, 0x66, 0x17, 0x05, 0xed, 0x41, 0x87, 0x56, 0xa8, 0xd4, 0xa0, 0xd2, 0x7b, 0xa3, + 0x08, 0x5b, 0xe5, 0x82, 0xd5, 0x97, 0x8f, 0xa2, 0xdf, 0xb1, 0x5e, 0x8a, 0x9d, 0x9d, 0x05, 0x21, + 0xd8, 0xce, 0x63, 0xc1, 0x35, 0xb4, 0x13, 0xe9, 0x9a, 0xdc, 0x60, 0xc7, 0x24, 0x38, 0x76, 0x1b, + 0xda, 0xe4, 0x78, 0x0f, 0x6f, 0x9d, 0xc2, 0x75, 0x8d, 0xdb, 0xaa, 0x66, 0x87, 0xe3, 0xde, 0x25, + 0x6e, 0x99, 0xb7, 0x3d, 0xf9, 0x10, 0x6c, 0x4f, 0x63, 0x39, 0xd5, 0x46, 0x07, 0x91, 0xae, 0x2f, + 0xec, 0xd7, 0x37, 0xdf, 0x0a, 0xc3, 0xf5, 0xd6, 0x43, 0x9b, 0xad, 0x87, 0xbe, 0xb7, 0x1e, 0x5a, + 0x15, 0x9e, 0xb5, 0x29, 0x3c, 0xeb, 0xa3, 0xf0, 0xac, 0x87, 0x20, 0xcd, 0xd4, 0x74, 0x91, 0xd0, + 0x11, 0x08, 0x56, 0x9f, 0x41, 0xf5, 0x39, 0x93, 0xe3, 0xa7, 0xfa, 0x18, 0xd4, 0xcb, 0x8c, 0xcb, + 0xe4, 0x9f, 0x4e, 0xe5, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x46, 0x0e, 0x24, 0xd4, 0x2e, 0x02, + 0x00, 0x00, +} + +func (m *CommitInfo) 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 *CommitInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintCommitInfo(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + if len(m.StoreInfos) > 0 { + for iNdEx := len(m.StoreInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StoreInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Version != 0 { + i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StoreInfo) 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 *StoreInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.CommitId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommitID) 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 *CommitID) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommitID) 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 = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x12 + } + if m.Version != 0 { + i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintCommitInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovCommitInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *CommitInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Version != 0 { + n += 1 + sovCommitInfo(uint64(m.Version)) + } + if len(m.StoreInfos) > 0 { + for _, e := range m.StoreInfos { + l = e.Size() + n += 1 + l + sovCommitInfo(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) + n += 1 + l + sovCommitInfo(uint64(l)) + return n +} + +func (m *StoreInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCommitInfo(uint64(l)) + } + l = m.CommitId.Size() + n += 1 + l + sovCommitInfo(uint64(l)) + return n +} + +func (m *CommitID) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Version != 0 { + n += 1 + sovCommitInfo(uint64(m.Version)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovCommitInfo(uint64(l)) + } + return n +} + +func sovCommitInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCommitInfo(x uint64) (n int) { + return sovCommitInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *CommitInfo) 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 ErrIntOverflowCommitInfo + } + 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: CommitInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoreInfos = append(m.StoreInfos, StoreInfo{}) + if err := m.StoreInfos[len(m.StoreInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StoreInfo) 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 ErrIntOverflowCommitInfo + } + 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: StoreInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreInfo: 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 ErrIntOverflowCommitInfo + } + 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 ErrInvalidLengthCommitInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitInfo + } + 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 CommitId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CommitId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommitID) 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 ErrIntOverflowCommitInfo + } + 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: CommitID: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitID: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthCommitInfo + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthCommitInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCommitInfo(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, ErrIntOverflowCommitInfo + } + 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, ErrIntOverflowCommitInfo + } + 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, ErrIntOverflowCommitInfo + } + 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, ErrInvalidLengthCommitInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCommitInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCommitInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCommitInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCommitInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCommitInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go b/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go new file mode 100644 index 000000000000..fafc6fad93da --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go @@ -0,0 +1,1212 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/store/v1beta1/listening.proto + +package types + +import ( + fmt "fmt" + types "github.com/cometbft/cometbft/abci/types" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +// Deletes +// +// Since: cosmos-sdk 0.43 +type StoreKVPair struct { + StoreKey string `protobuf:"bytes,1,opt,name=store_key,json=storeKey,proto3" json:"store_key,omitempty"` + Delete bool `protobuf:"varint,2,opt,name=delete,proto3" json:"delete,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *StoreKVPair) Reset() { *m = StoreKVPair{} } +func (m *StoreKVPair) String() string { return proto.CompactTextString(m) } +func (*StoreKVPair) ProtoMessage() {} +func (*StoreKVPair) Descriptor() ([]byte, []int) { + return fileDescriptor_a5d350879fe4fecd, []int{0} +} +func (m *StoreKVPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StoreKVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StoreKVPair.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 *StoreKVPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_StoreKVPair.Merge(m, src) +} +func (m *StoreKVPair) XXX_Size() int { + return m.Size() +} +func (m *StoreKVPair) XXX_DiscardUnknown() { + xxx_messageInfo_StoreKVPair.DiscardUnknown(m) +} + +var xxx_messageInfo_StoreKVPair proto.InternalMessageInfo + +func (m *StoreKVPair) GetStoreKey() string { + if m != nil { + return m.StoreKey + } + return "" +} + +func (m *StoreKVPair) GetDelete() bool { + if m != nil { + return m.Delete + } + return false +} + +func (m *StoreKVPair) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *StoreKVPair) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// BlockMetadata contains all the abci event data of a block +// the file streamer dump them into files together with the state changes. +type BlockMetadata struct { + RequestBeginBlock *types.RequestBeginBlock `protobuf:"bytes,1,opt,name=request_begin_block,json=requestBeginBlock,proto3" json:"request_begin_block,omitempty"` + ResponseBeginBlock *types.ResponseBeginBlock `protobuf:"bytes,2,opt,name=response_begin_block,json=responseBeginBlock,proto3" json:"response_begin_block,omitempty"` + DeliverTxs []*BlockMetadata_DeliverTx `protobuf:"bytes,3,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"` + RequestEndBlock *types.RequestEndBlock `protobuf:"bytes,4,opt,name=request_end_block,json=requestEndBlock,proto3" json:"request_end_block,omitempty"` + ResponseEndBlock *types.ResponseEndBlock `protobuf:"bytes,5,opt,name=response_end_block,json=responseEndBlock,proto3" json:"response_end_block,omitempty"` + ResponseCommit *types.ResponseCommit `protobuf:"bytes,6,opt,name=response_commit,json=responseCommit,proto3" json:"response_commit,omitempty"` +} + +func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } +func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } +func (*BlockMetadata) ProtoMessage() {} +func (*BlockMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_a5d350879fe4fecd, []int{1} +} +func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetadata.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 *BlockMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetadata.Merge(m, src) +} +func (m *BlockMetadata) XXX_Size() int { + return m.Size() +} +func (m *BlockMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo + +func (m *BlockMetadata) GetRequestBeginBlock() *types.RequestBeginBlock { + if m != nil { + return m.RequestBeginBlock + } + return nil +} + +func (m *BlockMetadata) GetResponseBeginBlock() *types.ResponseBeginBlock { + if m != nil { + return m.ResponseBeginBlock + } + return nil +} + +func (m *BlockMetadata) GetDeliverTxs() []*BlockMetadata_DeliverTx { + if m != nil { + return m.DeliverTxs + } + return nil +} + +func (m *BlockMetadata) GetRequestEndBlock() *types.RequestEndBlock { + if m != nil { + return m.RequestEndBlock + } + return nil +} + +func (m *BlockMetadata) GetResponseEndBlock() *types.ResponseEndBlock { + if m != nil { + return m.ResponseEndBlock + } + return nil +} + +func (m *BlockMetadata) GetResponseCommit() *types.ResponseCommit { + if m != nil { + return m.ResponseCommit + } + return nil +} + +// DeliverTx encapulate deliver tx request and response. +type BlockMetadata_DeliverTx struct { + Request *types.RequestDeliverTx `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + Response *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` +} + +func (m *BlockMetadata_DeliverTx) Reset() { *m = BlockMetadata_DeliverTx{} } +func (m *BlockMetadata_DeliverTx) String() string { return proto.CompactTextString(m) } +func (*BlockMetadata_DeliverTx) ProtoMessage() {} +func (*BlockMetadata_DeliverTx) Descriptor() ([]byte, []int) { + return fileDescriptor_a5d350879fe4fecd, []int{1, 0} +} +func (m *BlockMetadata_DeliverTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockMetadata_DeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockMetadata_DeliverTx.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 *BlockMetadata_DeliverTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockMetadata_DeliverTx.Merge(m, src) +} +func (m *BlockMetadata_DeliverTx) XXX_Size() int { + return m.Size() +} +func (m *BlockMetadata_DeliverTx) XXX_DiscardUnknown() { + xxx_messageInfo_BlockMetadata_DeliverTx.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockMetadata_DeliverTx proto.InternalMessageInfo + +func (m *BlockMetadata_DeliverTx) GetRequest() *types.RequestDeliverTx { + if m != nil { + return m.Request + } + return nil +} + +func (m *BlockMetadata_DeliverTx) GetResponse() *types.ResponseDeliverTx { + if m != nil { + return m.Response + } + return nil +} + +func init() { + proto.RegisterType((*StoreKVPair)(nil), "cosmos.base.store.v1beta1.StoreKVPair") + proto.RegisterType((*BlockMetadata)(nil), "cosmos.base.store.v1beta1.BlockMetadata") + proto.RegisterType((*BlockMetadata_DeliverTx)(nil), "cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") +} + +func init() { + proto.RegisterFile("cosmos/base/store/v1beta1/listening.proto", fileDescriptor_a5d350879fe4fecd) +} + +var fileDescriptor_a5d350879fe4fecd = []byte{ + // 473 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x4f, 0x6f, 0xd3, 0x40, + 0x10, 0xc5, 0xe3, 0xa6, 0x09, 0xc9, 0x04, 0x68, 0x59, 0x2a, 0x64, 0x5a, 0xc9, 0xb8, 0xe1, 0x62, + 0x0e, 0xac, 0xd5, 0x70, 0x44, 0xe2, 0x10, 0x40, 0x42, 0x2a, 0x08, 0xe4, 0x02, 0x07, 0x2e, 0x96, + 0xff, 0x8c, 0xc2, 0x12, 0xdb, 0x1b, 0x76, 0x37, 0x51, 0x73, 0xe6, 0xc2, 0x91, 0x8f, 0xc5, 0xb1, + 0x47, 0x8e, 0x28, 0xf9, 0x22, 0xc8, 0x6b, 0xc7, 0xa9, 0x43, 0x7d, 0xca, 0xee, 0xe4, 0xbd, 0x9f, + 0xdf, 0xcc, 0x6a, 0xe0, 0x49, 0xc4, 0x65, 0xca, 0xa5, 0x1b, 0x06, 0x12, 0x5d, 0xa9, 0xb8, 0x40, + 0x77, 0x71, 0x16, 0xa2, 0x0a, 0xce, 0xdc, 0x84, 0x49, 0x85, 0x19, 0xcb, 0x26, 0x74, 0x26, 0xb8, + 0xe2, 0xe4, 0x61, 0x21, 0xa5, 0xb9, 0x94, 0x6a, 0x29, 0x2d, 0xa5, 0xc7, 0x27, 0x0a, 0xb3, 0x18, + 0x45, 0xca, 0x32, 0xe5, 0x06, 0x61, 0xc4, 0x5c, 0xb5, 0x9c, 0xa1, 0x2c, 0x7c, 0xc3, 0x6f, 0x30, + 0xb8, 0xc8, 0xd5, 0xe7, 0x9f, 0x3f, 0x04, 0x4c, 0x90, 0x13, 0xe8, 0x6b, 0xb3, 0x3f, 0xc5, 0xa5, + 0x69, 0xd8, 0x86, 0xd3, 0xf7, 0x7a, 0xba, 0x70, 0x8e, 0x4b, 0xf2, 0x00, 0xba, 0x31, 0x26, 0xa8, + 0xd0, 0xdc, 0xb3, 0x0d, 0xa7, 0xe7, 0x95, 0x37, 0x72, 0x08, 0xed, 0x5c, 0xde, 0xb6, 0x0d, 0xe7, + 0xb6, 0x97, 0x1f, 0xc9, 0x11, 0x74, 0x16, 0x41, 0x32, 0x47, 0x73, 0x5f, 0xd7, 0x8a, 0xcb, 0xf0, + 0x47, 0x07, 0xee, 0x8c, 0x13, 0x1e, 0x4d, 0xdf, 0xa1, 0x0a, 0xe2, 0x40, 0x05, 0xc4, 0x83, 0xfb, + 0x02, 0xbf, 0xcf, 0x51, 0x2a, 0x3f, 0xc4, 0x09, 0xcb, 0xfc, 0x30, 0xff, 0x5b, 0x7f, 0x78, 0x30, + 0x1a, 0xd2, 0x6d, 0x70, 0x9a, 0x07, 0xa7, 0x5e, 0xa1, 0x1d, 0xe7, 0x52, 0x0d, 0xf2, 0xee, 0x89, + 0xdd, 0x12, 0xf9, 0x04, 0x47, 0x02, 0xe5, 0x8c, 0x67, 0x12, 0x6b, 0xd0, 0x3d, 0x0d, 0x7d, 0x7c, + 0x03, 0xb4, 0x10, 0x5f, 0xa3, 0x12, 0xf1, 0x5f, 0x8d, 0x5c, 0xc0, 0x20, 0xc6, 0x84, 0x2d, 0x50, + 0xf8, 0xea, 0x52, 0x9a, 0x6d, 0xbb, 0xed, 0x0c, 0x46, 0x23, 0xda, 0x38, 0x76, 0x5a, 0xeb, 0x94, + 0xbe, 0x2a, 0xbc, 0x1f, 0x2f, 0x3d, 0x88, 0x37, 0x47, 0x49, 0xde, 0xc2, 0xa6, 0x01, 0x1f, 0xb3, + 0xb8, 0x0c, 0xba, 0xaf, 0x83, 0xda, 0x4d, 0xdd, 0xbf, 0xce, 0xe2, 0x22, 0xe5, 0x81, 0xa8, 0x17, + 0xc8, 0x7b, 0xa8, 0x82, 0x5f, 0xc3, 0x75, 0x34, 0xee, 0xb4, 0xb1, 0xef, 0x8a, 0x77, 0x28, 0x76, + 0x2a, 0xe4, 0x0d, 0x1c, 0x54, 0xc0, 0x88, 0xa7, 0x29, 0x53, 0x66, 0x57, 0xd3, 0x1e, 0x35, 0xd2, + 0x5e, 0x6a, 0x99, 0x77, 0x57, 0xd4, 0xee, 0xc7, 0x3f, 0x0d, 0xe8, 0x57, 0x23, 0x20, 0xcf, 0xe1, + 0x56, 0x99, 0xbd, 0x7c, 0xea, 0xd3, 0xa6, 0x66, 0xb7, 0x63, 0xdb, 0x38, 0xc8, 0x0b, 0xe8, 0x6d, + 0xe0, 0xe5, 0x9b, 0x0e, 0x1b, 0xd3, 0x6c, 0xed, 0x95, 0x67, 0x3c, 0xfe, 0xbd, 0xb2, 0x8c, 0xab, + 0x95, 0x65, 0xfc, 0x5d, 0x59, 0xc6, 0xaf, 0xb5, 0xd5, 0xba, 0x5a, 0x5b, 0xad, 0x3f, 0x6b, 0xab, + 0xf5, 0xc5, 0x99, 0x30, 0xf5, 0x75, 0x1e, 0xd2, 0x88, 0xa7, 0x6e, 0xb9, 0x79, 0xc5, 0xcf, 0x53, + 0x19, 0x4f, 0xcb, 0xfd, 0xd3, 0xbb, 0x13, 0x76, 0xf5, 0xf2, 0x3c, 0xfb, 0x17, 0x00, 0x00, 0xff, + 0xff, 0x69, 0x5c, 0x8f, 0x23, 0xa1, 0x03, 0x00, 0x00, +} + +func (m *StoreKVPair) 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 *StoreKVPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StoreKVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintListening(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x22 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintListening(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0x1a + } + if m.Delete { + i-- + if m.Delete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.StoreKey) > 0 { + i -= len(m.StoreKey) + copy(dAtA[i:], m.StoreKey) + i = encodeVarintListening(dAtA, i, uint64(len(m.StoreKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetadata) 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 *BlockMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ResponseCommit != nil { + { + size, err := m.ResponseCommit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.ResponseEndBlock != nil { + { + size, err := m.ResponseEndBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RequestEndBlock != nil { + { + size, err := m.RequestEndBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.DeliverTxs) > 0 { + for iNdEx := len(m.DeliverTxs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DeliverTxs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.ResponseBeginBlock != nil { + { + size, err := m.ResponseBeginBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.RequestBeginBlock != nil { + { + size, err := m.RequestBeginBlock.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockMetadata_DeliverTx) 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 *BlockMetadata_DeliverTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockMetadata_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintListening(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintListening(dAtA []byte, offset int, v uint64) int { + offset -= sovListening(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StoreKVPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StoreKey) + if l > 0 { + n += 1 + l + sovListening(uint64(l)) + } + if m.Delete { + n += 2 + } + l = len(m.Key) + if l > 0 { + n += 1 + l + sovListening(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovListening(uint64(l)) + } + return n +} + +func (m *BlockMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RequestBeginBlock != nil { + l = m.RequestBeginBlock.Size() + n += 1 + l + sovListening(uint64(l)) + } + if m.ResponseBeginBlock != nil { + l = m.ResponseBeginBlock.Size() + n += 1 + l + sovListening(uint64(l)) + } + if len(m.DeliverTxs) > 0 { + for _, e := range m.DeliverTxs { + l = e.Size() + n += 1 + l + sovListening(uint64(l)) + } + } + if m.RequestEndBlock != nil { + l = m.RequestEndBlock.Size() + n += 1 + l + sovListening(uint64(l)) + } + if m.ResponseEndBlock != nil { + l = m.ResponseEndBlock.Size() + n += 1 + l + sovListening(uint64(l)) + } + if m.ResponseCommit != nil { + l = m.ResponseCommit.Size() + n += 1 + l + sovListening(uint64(l)) + } + return n +} + +func (m *BlockMetadata_DeliverTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovListening(uint64(l)) + } + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovListening(uint64(l)) + } + return n +} + +func sovListening(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozListening(x uint64) (n int) { + return sovListening(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StoreKVPair) 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 ErrIntOverflowListening + } + 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: StoreKVPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StoreKVPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StoreKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + 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 ErrInvalidLengthListening + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StoreKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Delete = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipListening(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthListening + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetadata) 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 ErrIntOverflowListening + } + 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: BlockMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestBeginBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestBeginBlock == nil { + m.RequestBeginBlock = &types.RequestBeginBlock{} + } + if err := m.RequestBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseBeginBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ResponseBeginBlock == nil { + m.ResponseBeginBlock = &types.ResponseBeginBlock{} + } + if err := m.ResponseBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeliverTxs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeliverTxs = append(m.DeliverTxs, &BlockMetadata_DeliverTx{}) + if err := m.DeliverTxs[len(m.DeliverTxs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestEndBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RequestEndBlock == nil { + m.RequestEndBlock = &types.RequestEndBlock{} + } + if err := m.RequestEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseEndBlock", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ResponseEndBlock == nil { + m.ResponseEndBlock = &types.ResponseEndBlock{} + } + if err := m.ResponseEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCommit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ResponseCommit == nil { + m.ResponseCommit = &types.ResponseCommit{} + } + if err := m.ResponseCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipListening(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthListening + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockMetadata_DeliverTx) 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 ErrIntOverflowListening + } + 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: DeliverTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeliverTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Request == nil { + m.Request = &types.RequestDeliverTx{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowListening + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthListening + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthListening + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &types.ResponseDeliverTx{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipListening(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthListening + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipListening(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, ErrIntOverflowListening + } + 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, ErrIntOverflowListening + } + 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, ErrIntOverflowListening + } + 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, ErrInvalidLengthListening + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupListening + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthListening + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthListening = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowListening = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupListening = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/types/abci.pb.go b/github.com/cosmos/cosmos-sdk/types/abci.pb.go new file mode 100644 index 000000000000..4cc102bc1ac5 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/types/abci.pb.go @@ -0,0 +1,3278 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/abci/v1beta1/abci.proto + +package types + +import ( + fmt "fmt" + types1 "github.com/cometbft/cometbft/abci/types" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" +) + +// 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 + +// TxResponse defines a structure containing relevant tx data and metadata. The +// tags are stringified and the log is JSON decoded. +type TxResponse struct { + // The block height + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // The transaction hash. + TxHash string `protobuf:"bytes,2,opt,name=txhash,proto3" json:"txhash,omitempty"` + // Namespace for the Code + Codespace string `protobuf:"bytes,3,opt,name=codespace,proto3" json:"codespace,omitempty"` + // Response code. + Code uint32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"` + // Result bytes, if any. + Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` + // The output of the application's logger (raw string). May be + // non-deterministic. + RawLog string `protobuf:"bytes,6,opt,name=raw_log,json=rawLog,proto3" json:"raw_log,omitempty"` + // The output of the application's logger (typed). May be non-deterministic. + Logs ABCIMessageLogs `protobuf:"bytes,7,rep,name=logs,proto3,castrepeated=ABCIMessageLogs" json:"logs"` + // Additional information. May be non-deterministic. + Info string `protobuf:"bytes,8,opt,name=info,proto3" json:"info,omitempty"` + // Amount of gas requested for transaction. + GasWanted int64 `protobuf:"varint,9,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + // Amount of gas consumed by transaction. + GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` + // The request transaction bytes. + Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"` + // Time of the previous block. For heights > 1, it's the weighted median of + // the timestamps of the valid votes in the block.LastCommit. For height == 1, + // it's genesis time. + Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` +} + +func (m *TxResponse) Reset() { *m = TxResponse{} } +func (*TxResponse) ProtoMessage() {} +func (*TxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{0} +} +func (m *TxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxResponse.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 *TxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxResponse.Merge(m, src) +} +func (m *TxResponse) XXX_Size() int { + return m.Size() +} +func (m *TxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TxResponse proto.InternalMessageInfo + +// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +type ABCIMessageLog struct { + MsgIndex uint32 `protobuf:"varint,1,opt,name=msg_index,json=msgIndex,proto3" json:"msg_index"` + Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` + // Events contains a slice of Event objects that were emitted during some + // execution. + Events StringEvents `protobuf:"bytes,3,rep,name=events,proto3,castrepeated=StringEvents" json:"events"` +} + +func (m *ABCIMessageLog) Reset() { *m = ABCIMessageLog{} } +func (*ABCIMessageLog) ProtoMessage() {} +func (*ABCIMessageLog) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{1} +} +func (m *ABCIMessageLog) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ABCIMessageLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ABCIMessageLog.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 *ABCIMessageLog) XXX_Merge(src proto.Message) { + xxx_messageInfo_ABCIMessageLog.Merge(m, src) +} +func (m *ABCIMessageLog) XXX_Size() int { + return m.Size() +} +func (m *ABCIMessageLog) XXX_DiscardUnknown() { + xxx_messageInfo_ABCIMessageLog.DiscardUnknown(m) +} + +var xxx_messageInfo_ABCIMessageLog proto.InternalMessageInfo + +func (m *ABCIMessageLog) GetMsgIndex() uint32 { + if m != nil { + return m.MsgIndex + } + return 0 +} + +func (m *ABCIMessageLog) GetLog() string { + if m != nil { + return m.Log + } + return "" +} + +func (m *ABCIMessageLog) GetEvents() StringEvents { + if m != nil { + return m.Events + } + return nil +} + +// StringEvent defines en Event object wrapper where all the attributes +// contain key/value pairs that are strings instead of raw bytes. +type StringEvent struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Attributes []Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes"` +} + +func (m *StringEvent) Reset() { *m = StringEvent{} } +func (*StringEvent) ProtoMessage() {} +func (*StringEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{2} +} +func (m *StringEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StringEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StringEvent.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 *StringEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringEvent.Merge(m, src) +} +func (m *StringEvent) XXX_Size() int { + return m.Size() +} +func (m *StringEvent) XXX_DiscardUnknown() { + xxx_messageInfo_StringEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_StringEvent proto.InternalMessageInfo + +func (m *StringEvent) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *StringEvent) GetAttributes() []Attribute { + if m != nil { + return m.Attributes + } + return nil +} + +// Attribute defines an attribute wrapper where the key and value are +// strings instead of raw bytes. +type Attribute struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Attribute) Reset() { *m = Attribute{} } +func (*Attribute) ProtoMessage() {} +func (*Attribute) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{3} +} +func (m *Attribute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Attribute.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 *Attribute) XXX_Merge(src proto.Message) { + xxx_messageInfo_Attribute.Merge(m, src) +} +func (m *Attribute) XXX_Size() int { + return m.Size() +} +func (m *Attribute) XXX_DiscardUnknown() { + xxx_messageInfo_Attribute.DiscardUnknown(m) +} + +var xxx_messageInfo_Attribute proto.InternalMessageInfo + +func (m *Attribute) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Attribute) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// GasInfo defines tx execution gas context. +type GasInfo struct { + // GasWanted is the maximum units of work we allow this tx to perform. + GasWanted uint64 `protobuf:"varint,1,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` + // GasUsed is the amount of gas actually consumed. + GasUsed uint64 `protobuf:"varint,2,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` +} + +func (m *GasInfo) Reset() { *m = GasInfo{} } +func (*GasInfo) ProtoMessage() {} +func (*GasInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{4} +} +func (m *GasInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GasInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GasInfo.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 *GasInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_GasInfo.Merge(m, src) +} +func (m *GasInfo) XXX_Size() int { + return m.Size() +} +func (m *GasInfo) XXX_DiscardUnknown() { + xxx_messageInfo_GasInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_GasInfo proto.InternalMessageInfo + +func (m *GasInfo) GetGasWanted() uint64 { + if m != nil { + return m.GasWanted + } + return 0 +} + +func (m *GasInfo) GetGasUsed() uint64 { + if m != nil { + return m.GasUsed + } + return 0 +} + +// Result is the union of ResponseFormat and ResponseCheckTx. +type Result struct { + // Data is any data returned from message or handler execution. It MUST be + // length prefixed in order to separate data from multiple message executions. + // Deprecated. This field is still populated, but prefer msg_response instead + // because it also contains the Msg response typeURL. + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // Deprecated: Do not use. + // Log contains the log information from message or handler execution. + Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` + // Events contains a slice of Event objects that were emitted during message + // or handler execution. + Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"` + // msg_responses contains the Msg handler responses type packed in Anys. + // + // Since: cosmos-sdk 0.46 + MsgResponses []*types.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` +} + +func (m *Result) Reset() { *m = Result{} } +func (*Result) ProtoMessage() {} +func (*Result) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{5} +} +func (m *Result) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Result.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 *Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_Result.Merge(m, src) +} +func (m *Result) XXX_Size() int { + return m.Size() +} +func (m *Result) XXX_DiscardUnknown() { + xxx_messageInfo_Result.DiscardUnknown(m) +} + +var xxx_messageInfo_Result proto.InternalMessageInfo + +// SimulationResponse defines the response generated when a transaction is +// successfully simulated. +type SimulationResponse struct { + GasInfo `protobuf:"bytes,1,opt,name=gas_info,json=gasInfo,proto3,embedded=gas_info" json:"gas_info"` + Result *Result `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` +} + +func (m *SimulationResponse) Reset() { *m = SimulationResponse{} } +func (*SimulationResponse) ProtoMessage() {} +func (*SimulationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{6} +} +func (m *SimulationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SimulationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SimulationResponse.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 *SimulationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SimulationResponse.Merge(m, src) +} +func (m *SimulationResponse) XXX_Size() int { + return m.Size() +} +func (m *SimulationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SimulationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SimulationResponse proto.InternalMessageInfo + +func (m *SimulationResponse) GetResult() *Result { + if m != nil { + return m.Result + } + return nil +} + +// MsgData defines the data returned in a Result object during message +// execution. +// +// Deprecated: Do not use. +type MsgData struct { + MsgType string `protobuf:"bytes,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgData) Reset() { *m = MsgData{} } +func (*MsgData) ProtoMessage() {} +func (*MsgData) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{7} +} +func (m *MsgData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgData.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 *MsgData) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgData.Merge(m, src) +} +func (m *MsgData) XXX_Size() int { + return m.Size() +} +func (m *MsgData) XXX_DiscardUnknown() { + xxx_messageInfo_MsgData.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgData proto.InternalMessageInfo + +func (m *MsgData) GetMsgType() string { + if m != nil { + return m.MsgType + } + return "" +} + +func (m *MsgData) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +// for each message. +type TxMsgData struct { + // data field is deprecated and not populated. + Data []*MsgData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // Deprecated: Do not use. + // msg_responses contains the Msg handler responses packed into Anys. + // + // Since: cosmos-sdk 0.46 + MsgResponses []*types.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` +} + +func (m *TxMsgData) Reset() { *m = TxMsgData{} } +func (*TxMsgData) ProtoMessage() {} +func (*TxMsgData) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{8} +} +func (m *TxMsgData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxMsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxMsgData.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 *TxMsgData) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxMsgData.Merge(m, src) +} +func (m *TxMsgData) XXX_Size() int { + return m.Size() +} +func (m *TxMsgData) XXX_DiscardUnknown() { + xxx_messageInfo_TxMsgData.DiscardUnknown(m) +} + +var xxx_messageInfo_TxMsgData proto.InternalMessageInfo + +// Deprecated: Do not use. +func (m *TxMsgData) GetData() []*MsgData { + if m != nil { + return m.Data + } + return nil +} + +func (m *TxMsgData) GetMsgResponses() []*types.Any { + if m != nil { + return m.MsgResponses + } + return nil +} + +// SearchTxsResult defines a structure for querying txs pageable +type SearchTxsResult struct { + // Count of all txs + TotalCount uint64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + // Count of txs in current page + Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + // Index of current page, start from 1 + PageNumber uint64 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` + // Count of total pages + PageTotal uint64 `protobuf:"varint,4,opt,name=page_total,json=pageTotal,proto3" json:"page_total,omitempty"` + // Max count txs per page + Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` + // List of txs in current page + Txs []*TxResponse `protobuf:"bytes,6,rep,name=txs,proto3" json:"txs,omitempty"` +} + +func (m *SearchTxsResult) Reset() { *m = SearchTxsResult{} } +func (*SearchTxsResult) ProtoMessage() {} +func (*SearchTxsResult) Descriptor() ([]byte, []int) { + return fileDescriptor_4e37629bc7eb0df8, []int{9} +} +func (m *SearchTxsResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SearchTxsResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SearchTxsResult.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 *SearchTxsResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_SearchTxsResult.Merge(m, src) +} +func (m *SearchTxsResult) XXX_Size() int { + return m.Size() +} +func (m *SearchTxsResult) XXX_DiscardUnknown() { + xxx_messageInfo_SearchTxsResult.DiscardUnknown(m) +} + +var xxx_messageInfo_SearchTxsResult proto.InternalMessageInfo + +func (m *SearchTxsResult) GetTotalCount() uint64 { + if m != nil { + return m.TotalCount + } + return 0 +} + +func (m *SearchTxsResult) GetCount() uint64 { + if m != nil { + return m.Count + } + return 0 +} + +func (m *SearchTxsResult) GetPageNumber() uint64 { + if m != nil { + return m.PageNumber + } + return 0 +} + +func (m *SearchTxsResult) GetPageTotal() uint64 { + if m != nil { + return m.PageTotal + } + return 0 +} + +func (m *SearchTxsResult) GetLimit() uint64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *SearchTxsResult) GetTxs() []*TxResponse { + if m != nil { + return m.Txs + } + return nil +} + +func init() { + proto.RegisterType((*TxResponse)(nil), "cosmos.base.abci.v1beta1.TxResponse") + proto.RegisterType((*ABCIMessageLog)(nil), "cosmos.base.abci.v1beta1.ABCIMessageLog") + proto.RegisterType((*StringEvent)(nil), "cosmos.base.abci.v1beta1.StringEvent") + proto.RegisterType((*Attribute)(nil), "cosmos.base.abci.v1beta1.Attribute") + proto.RegisterType((*GasInfo)(nil), "cosmos.base.abci.v1beta1.GasInfo") + proto.RegisterType((*Result)(nil), "cosmos.base.abci.v1beta1.Result") + proto.RegisterType((*SimulationResponse)(nil), "cosmos.base.abci.v1beta1.SimulationResponse") + proto.RegisterType((*MsgData)(nil), "cosmos.base.abci.v1beta1.MsgData") + proto.RegisterType((*TxMsgData)(nil), "cosmos.base.abci.v1beta1.TxMsgData") + proto.RegisterType((*SearchTxsResult)(nil), "cosmos.base.abci.v1beta1.SearchTxsResult") +} + +func init() { + proto.RegisterFile("cosmos/base/abci/v1beta1/abci.proto", fileDescriptor_4e37629bc7eb0df8) +} + +var fileDescriptor_4e37629bc7eb0df8 = []byte{ + // 909 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xda, 0xdb, 0x75, 0x3c, 0x8e, 0x29, 0x1a, 0x45, 0xe9, 0xa4, 0x80, 0x6d, 0xdc, 0x22, + 0x59, 0x48, 0xac, 0xd5, 0xb4, 0x42, 0xb4, 0xa7, 0xd6, 0xe1, 0x2b, 0x52, 0xcb, 0x61, 0xe3, 0x0a, + 0x89, 0x8b, 0x35, 0xb6, 0xa7, 0xe3, 0x55, 0xbd, 0x3b, 0xd6, 0xce, 0x6c, 0xb2, 0xb9, 0x71, 0x83, + 0x23, 0x27, 0xce, 0x5c, 0xe1, 0x2f, 0xe9, 0x81, 0x43, 0x8e, 0x3d, 0x54, 0x01, 0x92, 0x1b, 0x7f, + 0x05, 0x7a, 0x6f, 0xc6, 0x1f, 0x25, 0x75, 0xd5, 0x93, 0xdf, 0xfc, 0xde, 0x87, 0xdf, 0xfb, 0xbd, + 0xdf, 0xce, 0x90, 0x5b, 0x63, 0xa5, 0x13, 0xa5, 0x7b, 0x23, 0xae, 0x45, 0x8f, 0x8f, 0xc6, 0x71, + 0xef, 0xf8, 0xce, 0x48, 0x18, 0x7e, 0x07, 0x0f, 0xe1, 0x3c, 0x53, 0x46, 0x51, 0x66, 0x83, 0x42, + 0x08, 0x0a, 0x11, 0x77, 0x41, 0x37, 0x77, 0xa4, 0x92, 0x0a, 0x83, 0x7a, 0x60, 0xd9, 0xf8, 0x9b, + 0x1f, 0x18, 0x91, 0x4e, 0x44, 0x96, 0xc4, 0xa9, 0xb1, 0x35, 0xcd, 0xe9, 0x5c, 0x68, 0xe7, 0xdc, + 0x93, 0x4a, 0xc9, 0x99, 0xe8, 0xe1, 0x69, 0x94, 0x3f, 0xeb, 0xf1, 0xf4, 0xd4, 0xba, 0x3a, 0x7f, + 0x56, 0x08, 0x19, 0x14, 0x91, 0xd0, 0x73, 0x95, 0x6a, 0x41, 0x77, 0x49, 0x30, 0x15, 0xb1, 0x9c, + 0x1a, 0xe6, 0xb5, 0xbd, 0x6e, 0x25, 0x72, 0x27, 0xda, 0x21, 0x81, 0x29, 0xa6, 0x5c, 0x4f, 0x59, + 0xb9, 0xed, 0x75, 0x6b, 0x7d, 0x72, 0x71, 0xde, 0x0a, 0x06, 0xc5, 0xb7, 0x5c, 0x4f, 0x23, 0xe7, + 0xa1, 0x1f, 0x92, 0xda, 0x58, 0x4d, 0x84, 0x9e, 0xf3, 0xb1, 0x60, 0x15, 0x08, 0x8b, 0x56, 0x00, + 0xa5, 0xc4, 0x87, 0x03, 0xf3, 0xdb, 0x5e, 0xb7, 0x11, 0xa1, 0x0d, 0xd8, 0x84, 0x1b, 0xce, 0xae, + 0x61, 0x30, 0xda, 0xf4, 0x06, 0xa9, 0x66, 0xfc, 0x64, 0x38, 0x53, 0x92, 0x05, 0x08, 0x07, 0x19, + 0x3f, 0x79, 0xac, 0x24, 0x7d, 0x4a, 0xfc, 0x99, 0x92, 0x9a, 0x55, 0xdb, 0x95, 0x6e, 0x7d, 0xbf, + 0x1b, 0x6e, 0x22, 0x28, 0x7c, 0xd4, 0x3f, 0x38, 0x7c, 0x22, 0xb4, 0xe6, 0x52, 0x3c, 0x56, 0xb2, + 0x7f, 0xe3, 0xc5, 0x79, 0xab, 0xf4, 0xc7, 0x5f, 0xad, 0xeb, 0xaf, 0xe3, 0x3a, 0xc2, 0x72, 0xd0, + 0x43, 0x9c, 0x3e, 0x53, 0x6c, 0xcb, 0xf6, 0x00, 0x36, 0xfd, 0x88, 0x10, 0xc9, 0xf5, 0xf0, 0x84, + 0xa7, 0x46, 0x4c, 0x58, 0x0d, 0x99, 0xa8, 0x49, 0xae, 0xbf, 0x47, 0x80, 0xee, 0x91, 0x2d, 0x70, + 0xe7, 0x5a, 0x4c, 0x18, 0x41, 0x67, 0x55, 0x72, 0xfd, 0x54, 0x8b, 0x09, 0xbd, 0x4d, 0xca, 0xa6, + 0x60, 0xf5, 0xb6, 0xd7, 0xad, 0xef, 0xef, 0x84, 0x96, 0xf6, 0x70, 0x41, 0x7b, 0xf8, 0x28, 0x3d, + 0x8d, 0xca, 0xa6, 0x00, 0xa6, 0x4c, 0x9c, 0x08, 0x6d, 0x78, 0x32, 0x67, 0xdb, 0x96, 0xa9, 0x25, + 0x40, 0xef, 0x91, 0x40, 0x1c, 0x8b, 0xd4, 0x68, 0xd6, 0xc0, 0x51, 0x77, 0xc3, 0xd5, 0x6e, 0xed, + 0xa4, 0x5f, 0x81, 0xbb, 0xef, 0xc3, 0x60, 0x91, 0x8b, 0x7d, 0xe0, 0xff, 0xfc, 0x5b, 0xab, 0xd4, + 0xf9, 0xdd, 0x23, 0xef, 0xbd, 0x3e, 0x27, 0xfd, 0x94, 0xd4, 0x12, 0x2d, 0x87, 0x71, 0x3a, 0x11, + 0x05, 0x6e, 0xb5, 0xd1, 0x6f, 0xfc, 0x7b, 0xde, 0x5a, 0x81, 0xd1, 0x56, 0xa2, 0xe5, 0x21, 0x58, + 0xf4, 0x7d, 0x52, 0x01, 0xe2, 0x71, 0xc7, 0x11, 0x98, 0xf4, 0x68, 0xd9, 0x4c, 0x05, 0x9b, 0xf9, + 0x64, 0x33, 0xef, 0x47, 0x26, 0x8b, 0x53, 0x69, 0x7b, 0xdb, 0x71, 0xa4, 0x6f, 0xaf, 0x81, 0x7a, + 0xd5, 0xeb, 0x8f, 0xaf, 0xda, 0x5e, 0x27, 0x23, 0xf5, 0x35, 0x2f, 0x2c, 0x02, 0x34, 0x8b, 0x2d, + 0xd6, 0x22, 0xb4, 0xe9, 0x21, 0x21, 0xdc, 0x98, 0x2c, 0x1e, 0xe5, 0x46, 0x68, 0x56, 0xc6, 0x0e, + 0x6e, 0xbd, 0x65, 0xf3, 0x8b, 0x58, 0xc7, 0xcd, 0x5a, 0xb2, 0xfb, 0xcf, 0xbb, 0xa4, 0xb6, 0x0c, + 0x82, 0x69, 0x9f, 0x8b, 0x53, 0xf7, 0x87, 0x60, 0xd2, 0x1d, 0x72, 0xed, 0x98, 0xcf, 0x72, 0xe1, + 0x18, 0xb0, 0x87, 0xce, 0x01, 0xa9, 0x7e, 0xc3, 0xf5, 0xe1, 0x55, 0x65, 0x40, 0xa6, 0xbf, 0x49, + 0x19, 0x65, 0x74, 0x2e, 0x94, 0x01, 0x9b, 0x09, 0x22, 0xa1, 0xf3, 0x99, 0xa1, 0xbb, 0x4e, 0xf6, + 0x90, 0xbe, 0xdd, 0x2f, 0x33, 0xcf, 0x49, 0xff, 0x2a, 0xfb, 0xf7, 0xfe, 0xc7, 0xfe, 0x3b, 0x49, + 0x81, 0xde, 0x27, 0x0d, 0x58, 0x6e, 0xe6, 0x3e, 0x6a, 0xcd, 0x7c, 0x4c, 0x7e, 0xb3, 0x1e, 0xb7, + 0x13, 0x2d, 0x17, 0x9f, 0xff, 0x42, 0x45, 0xbf, 0x7a, 0x84, 0x1e, 0xc5, 0x49, 0x3e, 0xe3, 0x26, + 0x56, 0xe9, 0xf2, 0x72, 0xf8, 0xda, 0x4e, 0x87, 0x9f, 0x8b, 0x87, 0x12, 0xff, 0x78, 0xf3, 0x2e, + 0x1c, 0x63, 0xfd, 0x2d, 0x68, 0xed, 0xec, 0xbc, 0xe5, 0x21, 0x15, 0x48, 0xe2, 0x17, 0x24, 0xc8, + 0x90, 0x09, 0x1c, 0xb5, 0xbe, 0xdf, 0xde, 0x5c, 0xc5, 0x32, 0x16, 0xb9, 0xf8, 0xce, 0x43, 0x52, + 0x7d, 0xa2, 0xe5, 0x97, 0x40, 0xd6, 0x1e, 0x01, 0xd9, 0x0e, 0xd7, 0x24, 0x53, 0x4d, 0xb4, 0x1c, + 0x80, 0x6a, 0x16, 0xd7, 0x0a, 0x54, 0xdf, 0xb6, 0xdc, 0x3e, 0x08, 0x60, 0xfd, 0xcc, 0xeb, 0xfc, + 0xe4, 0x91, 0xda, 0xa0, 0x58, 0x14, 0xb9, 0xbf, 0xdc, 0x44, 0xe5, 0xed, 0xd3, 0xb8, 0x84, 0xb5, + 0x65, 0x5d, 0x21, 0xb9, 0xfc, 0xee, 0x24, 0xa3, 0x14, 0x5f, 0x79, 0xe4, 0xfa, 0x91, 0xe0, 0xd9, + 0x78, 0x3a, 0x28, 0xb4, 0x53, 0x46, 0x8b, 0xd4, 0x8d, 0x32, 0x7c, 0x36, 0x1c, 0xab, 0x3c, 0x35, + 0x4e, 0x5f, 0x04, 0xa1, 0x03, 0x40, 0x40, 0xa0, 0xd6, 0x65, 0xd5, 0x65, 0x0f, 0x90, 0x36, 0xe7, + 0x52, 0x0c, 0xd3, 0x3c, 0x19, 0x89, 0x0c, 0xef, 0x5e, 0x3f, 0x22, 0x00, 0x7d, 0x87, 0x08, 0xc8, + 0x16, 0x03, 0xb0, 0x12, 0x5e, 0xc1, 0x7e, 0x54, 0x03, 0x64, 0x00, 0x00, 0x54, 0x9d, 0xc5, 0x49, + 0x6c, 0xf0, 0x22, 0xf6, 0x23, 0x7b, 0xa0, 0x9f, 0x93, 0x8a, 0x29, 0x34, 0x0b, 0x70, 0xae, 0xdb, + 0x9b, 0xb9, 0x59, 0x3d, 0x1f, 0x11, 0x24, 0xd8, 0xf1, 0xfa, 0x0f, 0x5f, 0xfe, 0xd3, 0x2c, 0xbd, + 0xb8, 0x68, 0x7a, 0x67, 0x17, 0x4d, 0xef, 0xef, 0x8b, 0xa6, 0xf7, 0xcb, 0x65, 0xb3, 0x74, 0x76, + 0xd9, 0x2c, 0xbd, 0xbc, 0x6c, 0x96, 0x7e, 0xe8, 0xc8, 0xd8, 0x4c, 0xf3, 0x51, 0x38, 0x56, 0x49, + 0xcf, 0x3d, 0x87, 0xf6, 0xe7, 0x33, 0x3d, 0x79, 0x6e, 0xdf, 0xae, 0x51, 0x80, 0x14, 0xde, 0xfd, + 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xf1, 0x8e, 0x98, 0x30, 0x07, 0x00, 0x00, +} + +func (m *TxResponse) 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 *TxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + } + if len(m.Timestamp) > 0 { + i -= len(m.Timestamp) + copy(dAtA[i:], m.Timestamp) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Timestamp))) + i-- + dAtA[i] = 0x62 + } + if m.Tx != nil { + { + size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.GasUsed != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x50 + } + if m.GasWanted != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.GasWanted)) + i-- + dAtA[i] = 0x48 + } + if len(m.Info) > 0 { + i -= len(m.Info) + copy(dAtA[i:], m.Info) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Info))) + i-- + dAtA[i] = 0x42 + } + if len(m.Logs) > 0 { + for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.RawLog) > 0 { + i -= len(m.RawLog) + copy(dAtA[i:], m.RawLog) + i = encodeVarintAbci(dAtA, i, uint64(len(m.RawLog))) + i-- + dAtA[i] = 0x32 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x2a + } + if m.Code != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Code)) + i-- + dAtA[i] = 0x20 + } + if len(m.Codespace) > 0 { + i -= len(m.Codespace) + copy(dAtA[i:], m.Codespace) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Codespace))) + i-- + dAtA[i] = 0x1a + } + if len(m.TxHash) > 0 { + i -= len(m.TxHash) + copy(dAtA[i:], m.TxHash) + i = encodeVarintAbci(dAtA, i, uint64(len(m.TxHash))) + i-- + dAtA[i] = 0x12 + } + if m.Height != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ABCIMessageLog) 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 *ABCIMessageLog) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ABCIMessageLog) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x12 + } + if m.MsgIndex != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.MsgIndex)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *StringEvent) 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 *StringEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Attribute) 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 *Attribute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GasInfo) 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 *GasInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GasInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasUsed != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.GasUsed)) + i-- + dAtA[i] = 0x10 + } + if m.GasWanted != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.GasWanted)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MsgResponses) > 0 { + for iNdEx := len(m.MsgResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MsgResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Log) > 0 { + i -= len(m.Log) + copy(dAtA[i:], m.Log) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Log))) + i-- + dAtA[i] = 0x12 + } + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SimulationResponse) 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 *SimulationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SimulationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Result != nil { + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.GasInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgData) 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 *MsgData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if len(m.MsgType) > 0 { + i -= len(m.MsgType) + copy(dAtA[i:], m.MsgType) + i = encodeVarintAbci(dAtA, i, uint64(len(m.MsgType))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TxMsgData) 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 *TxMsgData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxMsgData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MsgResponses) > 0 { + for iNdEx := len(m.MsgResponses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MsgResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Data) > 0 { + for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SearchTxsResult) 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 *SearchTxsResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SearchTxsResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Txs) > 0 { + for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Txs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Limit != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x28 + } + if m.PageTotal != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.PageTotal)) + i-- + dAtA[i] = 0x20 + } + if m.PageNumber != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.PageNumber)) + i-- + dAtA[i] = 0x18 + } + if m.Count != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x10 + } + if m.TotalCount != 0 { + i = encodeVarintAbci(dAtA, i, uint64(m.TotalCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAbci(dAtA []byte, offset int, v uint64) int { + offset -= sovAbci(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *TxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovAbci(uint64(m.Height)) + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Codespace) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if m.Code != 0 { + n += 1 + sovAbci(uint64(m.Code)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.RawLog) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if len(m.Logs) > 0 { + for _, e := range m.Logs { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + l = len(m.Info) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if m.GasWanted != 0 { + n += 1 + sovAbci(uint64(m.GasWanted)) + } + if m.GasUsed != 0 { + n += 1 + sovAbci(uint64(m.GasUsed)) + } + if m.Tx != nil { + l = m.Tx.Size() + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Timestamp) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func (m *ABCIMessageLog) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MsgIndex != 0 { + n += 1 + sovAbci(uint64(m.MsgIndex)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func (m *StringEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func (m *Attribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + return n +} + +func (m *GasInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GasWanted != 0 { + n += 1 + sovAbci(uint64(m.GasWanted)) + } + if m.GasUsed != 0 { + n += 1 + sovAbci(uint64(m.GasUsed)) + } + return n +} + +func (m *Result) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Log) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + if len(m.MsgResponses) > 0 { + for _, e := range m.MsgResponses { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func (m *SimulationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.GasInfo.Size() + n += 1 + l + sovAbci(uint64(l)) + if m.Result != nil { + l = m.Result.Size() + n += 1 + l + sovAbci(uint64(l)) + } + return n +} + +func (m *MsgData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MsgType) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Data) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + return n +} + +func (m *TxMsgData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Data) > 0 { + for _, e := range m.Data { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + if len(m.MsgResponses) > 0 { + for _, e := range m.MsgResponses { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func (m *SearchTxsResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TotalCount != 0 { + n += 1 + sovAbci(uint64(m.TotalCount)) + } + if m.Count != 0 { + n += 1 + sovAbci(uint64(m.Count)) + } + if m.PageNumber != 0 { + n += 1 + sovAbci(uint64(m.PageNumber)) + } + if m.PageTotal != 0 { + n += 1 + sovAbci(uint64(m.PageTotal)) + } + if m.Limit != 0 { + n += 1 + sovAbci(uint64(m.Limit)) + } + if len(m.Txs) > 0 { + for _, e := range m.Txs { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } + return n +} + +func sovAbci(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAbci(x uint64) (n int) { + return sovAbci(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *ABCIMessageLog) String() string { + if this == nil { + return "nil" + } + repeatedStringForEvents := "[]StringEvent{" + for _, f := range this.Events { + repeatedStringForEvents += strings.Replace(strings.Replace(f.String(), "StringEvent", "StringEvent", 1), `&`, ``, 1) + "," + } + repeatedStringForEvents += "}" + s := strings.Join([]string{`&ABCIMessageLog{`, + `MsgIndex:` + fmt.Sprintf("%v", this.MsgIndex) + `,`, + `Log:` + fmt.Sprintf("%v", this.Log) + `,`, + `Events:` + repeatedStringForEvents + `,`, + `}`, + }, "") + return s +} +func (this *StringEvent) String() string { + if this == nil { + return "nil" + } + repeatedStringForAttributes := "[]Attribute{" + for _, f := range this.Attributes { + repeatedStringForAttributes += fmt.Sprintf("%v", f) + "," + } + repeatedStringForAttributes += "}" + s := strings.Join([]string{`&StringEvent{`, + `Type:` + fmt.Sprintf("%v", this.Type) + `,`, + `Attributes:` + repeatedStringForAttributes + `,`, + `}`, + }, "") + return s +} +func (this *MsgData) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&MsgData{`, + `MsgType:` + fmt.Sprintf("%v", this.MsgType) + `,`, + `Data:` + fmt.Sprintf("%v", this.Data) + `,`, + `}`, + }, "") + return s +} +func (this *TxMsgData) String() string { + if this == nil { + return "nil" + } + repeatedStringForData := "[]*MsgData{" + for _, f := range this.Data { + repeatedStringForData += strings.Replace(f.String(), "MsgData", "MsgData", 1) + "," + } + repeatedStringForData += "}" + repeatedStringForMsgResponses := "[]*Any{" + for _, f := range this.MsgResponses { + repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," + } + repeatedStringForMsgResponses += "}" + s := strings.Join([]string{`&TxMsgData{`, + `Data:` + repeatedStringForData + `,`, + `MsgResponses:` + repeatedStringForMsgResponses + `,`, + `}`, + }, "") + return s +} +func (this *SearchTxsResult) String() string { + if this == nil { + return "nil" + } + repeatedStringForTxs := "[]*TxResponse{" + for _, f := range this.Txs { + repeatedStringForTxs += strings.Replace(fmt.Sprintf("%v", f), "TxResponse", "TxResponse", 1) + "," + } + repeatedStringForTxs += "}" + s := strings.Join([]string{`&SearchTxsResult{`, + `TotalCount:` + fmt.Sprintf("%v", this.TotalCount) + `,`, + `Count:` + fmt.Sprintf("%v", this.Count) + `,`, + `PageNumber:` + fmt.Sprintf("%v", this.PageNumber) + `,`, + `PageTotal:` + fmt.Sprintf("%v", this.PageTotal) + `,`, + `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, + `Txs:` + repeatedStringForTxs + `,`, + `}`, + }, "") + return s +} +func valueToStringAbci(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *TxResponse) 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 ErrIntOverflowAbci + } + 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: TxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Codespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + } + m.Code = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Code |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RawLog", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RawLog = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, ABCIMessageLog{}) + if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + 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 ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Info = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) + } + m.GasWanted = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasWanted |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tx == nil { + m.Tx = &types.Any{} + } + if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Timestamp = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, types1.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ABCIMessageLog) 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 ErrIntOverflowAbci + } + 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: ABCIMessageLog: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ABCIMessageLog: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgIndex", wireType) + } + m.MsgIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MsgIndex |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Log = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, StringEvent{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StringEvent) 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 ErrIntOverflowAbci + } + 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: StringEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StringEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, Attribute{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Attribute) 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 ErrIntOverflowAbci + } + 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: Attribute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Attribute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GasInfo) 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 ErrIntOverflowAbci + } + 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: GasInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GasInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) + } + m.GasWanted = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasWanted |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) + } + m.GasUsed = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasUsed |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Result) 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 ErrIntOverflowAbci + } + 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: Result: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Log = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, types1.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgResponses = append(m.MsgResponses, &types.Any{}) + if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SimulationResponse) 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 ErrIntOverflowAbci + } + 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: SimulationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SimulationResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GasInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Result == nil { + m.Result = &Result{} + } + if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgData) 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 ErrIntOverflowAbci + } + 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: MsgData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + 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 ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxMsgData) 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 ErrIntOverflowAbci + } + 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: TxMsgData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxMsgData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data, &MsgData{}) + if err := m.Data[len(m.Data)-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 MsgResponses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgResponses = append(m.MsgResponses, &types.Any{}) + if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SearchTxsResult) 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 ErrIntOverflowAbci + } + 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: SearchTxsResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SearchTxsResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType) + } + m.TotalCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) + } + m.Count = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Count |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageNumber", wireType) + } + m.PageNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PageNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PageTotal", wireType) + } + m.PageTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PageTotal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Txs = append(m.Txs, &TxResponse{}) + if err := m.Txs[len(m.Txs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAbci(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, ErrIntOverflowAbci + } + 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, ErrIntOverflowAbci + } + 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, ErrIntOverflowAbci + } + 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, ErrInvalidLengthAbci + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAbci + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAbci + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAbci = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAbci = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAbci = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/types/coin.pb.go b/github.com/cosmos/cosmos-sdk/types/coin.pb.go new file mode 100644 index 000000000000..28b017a81459 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/types/coin.pb.go @@ -0,0 +1,983 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/v1beta1/coin.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +type Coin struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Amount Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Int" json:"amount"` +} + +func (m *Coin) Reset() { *m = Coin{} } +func (*Coin) ProtoMessage() {} +func (*Coin) Descriptor() ([]byte, []int) { + return fileDescriptor_189a96714eafc2df, []int{0} +} +func (m *Coin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Coin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Coin.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 *Coin) XXX_Merge(src proto.Message) { + xxx_messageInfo_Coin.Merge(m, src) +} +func (m *Coin) XXX_Size() int { + return m.Size() +} +func (m *Coin) XXX_DiscardUnknown() { + xxx_messageInfo_Coin.DiscardUnknown(m) +} + +var xxx_messageInfo_Coin proto.InternalMessageInfo + +func (m *Coin) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +type DecCoin struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Amount Dec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Dec" json:"amount"` +} + +func (m *DecCoin) Reset() { *m = DecCoin{} } +func (*DecCoin) ProtoMessage() {} +func (*DecCoin) Descriptor() ([]byte, []int) { + return fileDescriptor_189a96714eafc2df, []int{1} +} +func (m *DecCoin) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DecCoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DecCoin.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 *DecCoin) XXX_Merge(src proto.Message) { + xxx_messageInfo_DecCoin.Merge(m, src) +} +func (m *DecCoin) XXX_Size() int { + return m.Size() +} +func (m *DecCoin) XXX_DiscardUnknown() { + xxx_messageInfo_DecCoin.DiscardUnknown(m) +} + +var xxx_messageInfo_DecCoin proto.InternalMessageInfo + +func (m *DecCoin) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// IntProto defines a Protobuf wrapper around an Int object. +type IntProto struct { + Int Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=Int" json:"int"` +} + +func (m *IntProto) Reset() { *m = IntProto{} } +func (*IntProto) ProtoMessage() {} +func (*IntProto) Descriptor() ([]byte, []int) { + return fileDescriptor_189a96714eafc2df, []int{2} +} +func (m *IntProto) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IntProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IntProto.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 *IntProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntProto.Merge(m, src) +} +func (m *IntProto) XXX_Size() int { + return m.Size() +} +func (m *IntProto) XXX_DiscardUnknown() { + xxx_messageInfo_IntProto.DiscardUnknown(m) +} + +var xxx_messageInfo_IntProto proto.InternalMessageInfo + +// DecProto defines a Protobuf wrapper around a Dec object. +type DecProto struct { + Dec Dec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=Dec" json:"dec"` +} + +func (m *DecProto) Reset() { *m = DecProto{} } +func (*DecProto) ProtoMessage() {} +func (*DecProto) Descriptor() ([]byte, []int) { + return fileDescriptor_189a96714eafc2df, []int{3} +} +func (m *DecProto) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DecProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DecProto.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 *DecProto) XXX_Merge(src proto.Message) { + xxx_messageInfo_DecProto.Merge(m, src) +} +func (m *DecProto) XXX_Size() int { + return m.Size() +} +func (m *DecProto) XXX_DiscardUnknown() { + xxx_messageInfo_DecProto.DiscardUnknown(m) +} + +var xxx_messageInfo_DecProto proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Coin)(nil), "cosmos.base.v1beta1.Coin") + proto.RegisterType((*DecCoin)(nil), "cosmos.base.v1beta1.DecCoin") + proto.RegisterType((*IntProto)(nil), "cosmos.base.v1beta1.IntProto") + proto.RegisterType((*DecProto)(nil), "cosmos.base.v1beta1.DecProto") +} + +func init() { proto.RegisterFile("cosmos/base/v1beta1/coin.proto", fileDescriptor_189a96714eafc2df) } + +var fileDescriptor_189a96714eafc2df = []byte{ + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x4f, 0xce, 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xeb, 0x81, + 0xe4, 0xf5, 0xa0, 0xf2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, + 0x54, 0x4a, 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, + 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x28, 0x2e, 0x16, 0xe7, 0xfc, 0xcc, 0x3c, 0x21, 0x11, + 0x2e, 0xd6, 0x94, 0xd4, 0xbc, 0xfc, 0x5c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x08, 0x47, + 0xc8, 0x8c, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0x24, 0xec, 0x24, 0x77, + 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0xcc, 0x9e, 0x79, 0x25, 0x97, 0xb6, 0xe8, 0x72, 0x41, + 0x4d, 0xf7, 0xcc, 0x2b, 0x59, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0xb5, 0x15, 0xcb, 0x8b, + 0x05, 0xf2, 0x8c, 0x4a, 0x11, 0x5c, 0xec, 0x2e, 0xa9, 0xc9, 0x78, 0x8c, 0x37, 0x44, 0x33, 0x5e, + 0x12, 0x66, 0xbc, 0x4b, 0x6a, 0x32, 0x92, 0xf1, 0x2e, 0xa9, 0xc9, 0x68, 0x26, 0x9b, 0x73, 0x71, + 0x78, 0xe6, 0x95, 0x04, 0x80, 0x83, 0x46, 0x9b, 0x8b, 0x39, 0x33, 0xaf, 0x04, 0x62, 0x30, 0xc2, + 0x04, 0x0c, 0x07, 0x06, 0x81, 0x54, 0x81, 0x34, 0xba, 0xa4, 0x26, 0xc3, 0x35, 0xa6, 0xa4, 0x26, + 0xa3, 0x6b, 0xc4, 0xb4, 0x1a, 0xa4, 0xca, 0xc9, 0xe5, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, + 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, + 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, + 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x0d, 0x75, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, + 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x74, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x33, 0xcc, 0xd5, 0x87, 0xef, 0x01, 0x00, 0x00, +} + +func (this *Coin) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Coin) + if !ok { + that2, ok := that.(Coin) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Denom != that1.Denom { + return false + } + if !this.Amount.Equal(that1.Amount) { + return false + } + return true +} +func (this *DecCoin) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DecCoin) + if !ok { + that2, ok := that.(DecCoin) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Denom != that1.Denom { + return false + } + if !this.Amount.Equal(that1.Amount) { + return false + } + return true +} +func (m *Coin) 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 *Coin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Coin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DecCoin) 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 *DecCoin) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DecCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IntProto) 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 *IntProto) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IntProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Int.Size() + i -= size + if _, err := m.Int.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DecProto) 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 *DecProto) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DecProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Dec.Size() + i -= size + if _, err := m.Dec.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintCoin(dAtA []byte, offset int, v uint64) int { + offset -= sovCoin(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Coin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCoin(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovCoin(uint64(l)) + return n +} + +func (m *DecCoin) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCoin(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovCoin(uint64(l)) + return n +} + +func (m *IntProto) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Int.Size() + n += 1 + l + sovCoin(uint64(l)) + return n +} + +func (m *DecProto) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Dec.Size() + n += 1 + l + sovCoin(uint64(l)) + return n +} + +func sovCoin(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCoin(x uint64) (n int) { + return sovCoin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Coin) 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 ErrIntOverflowCoin + } + 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: Coin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Coin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DecCoin) 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 ErrIntOverflowCoin + } + 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: DecCoin: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DecCoin: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IntProto) 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 ErrIntOverflowCoin + } + 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: IntProto: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntProto: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Int.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DecProto) 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 ErrIntOverflowCoin + } + 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: DecProto: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DecProto: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dec", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCoin + } + 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 ErrInvalidLengthCoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Dec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCoin(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, ErrIntOverflowCoin + } + 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, ErrIntOverflowCoin + } + 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, ErrIntOverflowCoin + } + 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, ErrInvalidLengthCoin + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCoin + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCoin + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCoin = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCoin = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCoin = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go b/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go new file mode 100644 index 000000000000..f03111ef6f9f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go @@ -0,0 +1,557 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/kv/v1beta1/kv.proto + +package kv + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Pairs defines a repeated slice of Pair objects. +type Pairs struct { + Pairs []Pair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"` +} + +func (m *Pairs) Reset() { *m = Pairs{} } +func (m *Pairs) String() string { return proto.CompactTextString(m) } +func (*Pairs) ProtoMessage() {} +func (*Pairs) Descriptor() ([]byte, []int) { + return fileDescriptor_a44e87fe7182bb73, []int{0} +} +func (m *Pairs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pairs.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 *Pairs) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pairs.Merge(m, src) +} +func (m *Pairs) XXX_Size() int { + return m.Size() +} +func (m *Pairs) XXX_DiscardUnknown() { + xxx_messageInfo_Pairs.DiscardUnknown(m) +} + +var xxx_messageInfo_Pairs proto.InternalMessageInfo + +func (m *Pairs) GetPairs() []Pair { + if m != nil { + return m.Pairs + } + return nil +} + +// Pair defines a key/value bytes tuple. +type Pair struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *Pair) Reset() { *m = Pair{} } +func (m *Pair) String() string { return proto.CompactTextString(m) } +func (*Pair) ProtoMessage() {} +func (*Pair) Descriptor() ([]byte, []int) { + return fileDescriptor_a44e87fe7182bb73, []int{1} +} +func (m *Pair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Pair.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 *Pair) XXX_Merge(src proto.Message) { + xxx_messageInfo_Pair.Merge(m, src) +} +func (m *Pair) XXX_Size() int { + return m.Size() +} +func (m *Pair) XXX_DiscardUnknown() { + xxx_messageInfo_Pair.DiscardUnknown(m) +} + +var xxx_messageInfo_Pair proto.InternalMessageInfo + +func (m *Pair) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *Pair) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func init() { + proto.RegisterType((*Pairs)(nil), "cosmos.base.kv.v1beta1.Pairs") + proto.RegisterType((*Pair)(nil), "cosmos.base.kv.v1beta1.Pair") +} + +func init() { proto.RegisterFile("cosmos/base/kv/v1beta1/kv.proto", fileDescriptor_a44e87fe7182bb73) } + +var fileDescriptor_a44e87fe7182bb73 = []byte{ + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0xcf, 0x2e, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0xd4, 0xcf, 0x2e, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0x28, 0xd0, + 0x03, 0x29, 0xd0, 0xcb, 0x2e, 0xd3, 0x83, 0x2a, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, + 0xd1, 0x07, 0xb1, 0x20, 0xaa, 0x95, 0x1c, 0xb9, 0x58, 0x03, 0x12, 0x33, 0x8b, 0x8a, 0x85, 0x2c, + 0xb8, 0x58, 0x0b, 0x40, 0x0c, 0x09, 0x46, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x19, 0x3d, 0xec, 0xc6, + 0xe8, 0x81, 0x54, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd1, 0xa0, 0xa4, 0xc7, 0xc5, + 0x02, 0x12, 0x14, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, + 0x02, 0x31, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, + 0x8e, 0x93, 0xfd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, + 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa6, 0x67, + 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x43, 0xbd, 0x09, 0xa1, 0x74, 0x8b, 0x53, + 0xb2, 0xf5, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xb3, 0xcb, 0x92, 0xd8, 0xc0, 0x4e, 0x37, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x15, 0x18, 0x16, 0xcf, 0x0b, 0x01, 0x00, 0x00, +} + +func (m *Pairs) 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 *Pairs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pairs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintKv(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Pair) 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 *Pair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintKv(dAtA []byte, offset int, v uint64) int { + offset -= sovKv(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Pairs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovKv(uint64(l)) + } + } + return n +} + +func (m *Pair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovKv(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovKv(uint64(l)) + } + return n +} + +func sovKv(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozKv(x uint64) (n int) { + return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Pairs) 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 ErrIntOverflowKv + } + 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: Pairs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pairs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthKv + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthKv + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, Pair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKv(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKv + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Pair) 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 ErrIntOverflowKv + } + 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: Pair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKv + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKv + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowKv + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthKv + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthKv + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) + if m.Value == nil { + m.Value = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipKv(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthKv + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipKv(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, ErrIntOverflowKv + } + 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, ErrIntOverflowKv + } + 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, ErrIntOverflowKv + } + 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, ErrInvalidLengthKv + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupKv + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthKv + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go b/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go new file mode 100644 index 000000000000..cc37a2517295 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go @@ -0,0 +1,719 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/query/v1beta1/pagination.proto + +package query + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// PageRequest is to be embedded in gRPC request messages for efficient +// pagination. Ex: +// +// 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 + // should be set. + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // offset is a numeric offset that can be used when key is unavailable. + // It is less efficient than using key. Only one of offset or key should + // be set. + Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + // limit is the total number of results to be returned in the result page. + // If left empty it will default to a value to be set by each app. + Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` + // count_total is set to true to indicate that the result set should include + // a count of the total number of items available for pagination in UIs. + // count_total is only respected when offset is used. It is ignored when key + // is set. + CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"` + // reverse is set to true if results are to be returned in the descending order. + // + // Since: cosmos-sdk 0.43 + Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` +} + +func (m *PageRequest) Reset() { *m = PageRequest{} } +func (m *PageRequest) String() string { return proto.CompactTextString(m) } +func (*PageRequest) ProtoMessage() {} +func (*PageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_53d6d609fe6828af, []int{0} +} +func (m *PageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PageRequest.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 *PageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PageRequest.Merge(m, src) +} +func (m *PageRequest) XXX_Size() int { + return m.Size() +} +func (m *PageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_PageRequest proto.InternalMessageInfo + +func (m *PageRequest) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +func (m *PageRequest) GetOffset() uint64 { + if m != nil { + return m.Offset + } + return 0 +} + +func (m *PageRequest) GetLimit() uint64 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *PageRequest) GetCountTotal() bool { + if m != nil { + return m.CountTotal + } + return false +} + +func (m *PageRequest) GetReverse() bool { + if m != nil { + return m.Reverse + } + return false +} + +// 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; +// } +type PageResponse struct { + // next_key is the key to be passed to PageRequest.key to + // query the next page most efficiently. It will be empty if + // there are no more results. + NextKey []byte `protobuf:"bytes,1,opt,name=next_key,json=nextKey,proto3" json:"next_key,omitempty"` + // total is total number of results available if PageRequest.count_total + // was set, its value is undefined otherwise + Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` +} + +func (m *PageResponse) Reset() { *m = PageResponse{} } +func (m *PageResponse) String() string { return proto.CompactTextString(m) } +func (*PageResponse) ProtoMessage() {} +func (*PageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_53d6d609fe6828af, []int{1} +} +func (m *PageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PageResponse.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 *PageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PageResponse.Merge(m, src) +} +func (m *PageResponse) XXX_Size() int { + return m.Size() +} +func (m *PageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_PageResponse proto.InternalMessageInfo + +func (m *PageResponse) GetNextKey() []byte { + if m != nil { + return m.NextKey + } + return nil +} + +func (m *PageResponse) GetTotal() uint64 { + if m != nil { + return m.Total + } + return 0 +} + +func init() { + proto.RegisterType((*PageRequest)(nil), "cosmos.base.query.v1beta1.PageRequest") + proto.RegisterType((*PageResponse)(nil), "cosmos.base.query.v1beta1.PageResponse") +} + +func init() { + proto.RegisterFile("cosmos/base/query/v1beta1/pagination.proto", fileDescriptor_53d6d609fe6828af) +} + +var fileDescriptor_53d6d609fe6828af = []byte{ + // 282 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x6b, 0xfa, 0x2b, 0xb7, 0x03, 0xb2, 0x10, 0x72, 0x17, 0x13, 0x75, 0x8a, 0x90, 0x88, + 0x55, 0xf1, 0x00, 0x48, 0x5d, 0x59, 0x50, 0xc4, 0xc4, 0x52, 0x39, 0xe1, 0x36, 0x44, 0x6d, 0xe2, + 0x34, 0xbe, 0xa9, 0xc8, 0x1b, 0x30, 0xf2, 0x58, 0x8c, 0x1d, 0x19, 0x51, 0xf2, 0x22, 0x28, 0x76, + 0x10, 0x93, 0xfd, 0x9d, 0x7b, 0x74, 0xef, 0xd1, 0xa1, 0xb7, 0xb1, 0x36, 0x99, 0x36, 0x32, 0x52, + 0x06, 0xe4, 0xb1, 0x82, 0xb2, 0x96, 0xa7, 0x75, 0x04, 0xa8, 0xd6, 0xb2, 0x50, 0x49, 0x9a, 0x2b, + 0x4c, 0x75, 0x1e, 0x14, 0xa5, 0x46, 0xcd, 0x96, 0xce, 0x1b, 0x74, 0xde, 0xc0, 0x7a, 0x83, 0xde, + 0xbb, 0xfa, 0x20, 0x74, 0xfe, 0xa4, 0x12, 0x08, 0xe1, 0x58, 0x81, 0x41, 0x76, 0x49, 0x87, 0x7b, + 0xa8, 0x39, 0xf1, 0x88, 0xbf, 0x08, 0xbb, 0x2f, 0xbb, 0xa6, 0x13, 0xbd, 0xdb, 0x19, 0x40, 0x7e, + 0xe1, 0x11, 0x7f, 0x14, 0xf6, 0xc4, 0xae, 0xe8, 0xf8, 0x90, 0x66, 0x29, 0xf2, 0xa1, 0x95, 0x1d, + 0xb0, 0x1b, 0x3a, 0x8f, 0x75, 0x95, 0xe3, 0x16, 0x35, 0xaa, 0x03, 0x1f, 0x79, 0xc4, 0x9f, 0x85, + 0xd4, 0x4a, 0xcf, 0x9d, 0xc2, 0x38, 0x9d, 0x96, 0x70, 0x82, 0xd2, 0x00, 0x1f, 0xdb, 0xe1, 0x1f, + 0xae, 0x1e, 0xe8, 0xc2, 0x25, 0x31, 0x85, 0xce, 0x0d, 0xb0, 0x25, 0x9d, 0xe5, 0xf0, 0x8e, 0xdb, + 0xff, 0x3c, 0xd3, 0x8e, 0x1f, 0xa1, 0xee, 0x6e, 0xbb, 0xfd, 0x2e, 0x92, 0x83, 0xcd, 0xe6, 0xab, + 0x11, 0xe4, 0xdc, 0x08, 0xf2, 0xd3, 0x08, 0xf2, 0xd9, 0x8a, 0xc1, 0xb9, 0x15, 0x83, 0xef, 0x56, + 0x0c, 0x5e, 0xfc, 0x24, 0xc5, 0xb7, 0x2a, 0x0a, 0x62, 0x9d, 0xc9, 0xbe, 0x37, 0xf7, 0xdc, 0x99, + 0xd7, 0xbd, 0xc4, 0xba, 0x00, 0xe3, 0x3a, 0x8c, 0x26, 0xb6, 0xb1, 0xfb, 0xdf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x3d, 0x43, 0x85, 0xf7, 0x5f, 0x01, 0x00, 0x00, +} + +func (m *PageRequest) 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 *PageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Reverse { + i-- + if m.Reverse { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.CountTotal { + i-- + if m.CountTotal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Limit != 0 { + i = encodeVarintPagination(dAtA, i, uint64(m.Limit)) + i-- + dAtA[i] = 0x18 + } + if m.Offset != 0 { + i = encodeVarintPagination(dAtA, i, uint64(m.Offset)) + i-- + dAtA[i] = 0x10 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintPagination(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PageResponse) 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 *PageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Total != 0 { + i = encodeVarintPagination(dAtA, i, uint64(m.Total)) + i-- + dAtA[i] = 0x10 + } + if len(m.NextKey) > 0 { + i -= len(m.NextKey) + copy(dAtA[i:], m.NextKey) + i = encodeVarintPagination(dAtA, i, uint64(len(m.NextKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintPagination(dAtA []byte, offset int, v uint64) int { + offset -= sovPagination(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *PageRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovPagination(uint64(l)) + } + if m.Offset != 0 { + n += 1 + sovPagination(uint64(m.Offset)) + } + if m.Limit != 0 { + n += 1 + sovPagination(uint64(m.Limit)) + } + if m.CountTotal { + n += 2 + } + if m.Reverse { + n += 2 + } + return n +} + +func (m *PageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NextKey) + if l > 0 { + n += 1 + l + sovPagination(uint64(l)) + } + if m.Total != 0 { + n += 1 + sovPagination(uint64(m.Total)) + } + return n +} + +func sovPagination(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozPagination(x uint64) (n int) { + return sovPagination(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PageRequest) 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 ErrIntOverflowPagination + } + 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: PageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPagination + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPagination + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) + } + m.Offset = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Offset |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) + } + m.Limit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Limit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CountTotal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.CountTotal = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Reverse", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Reverse = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipPagination(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPagination + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PageResponse) 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 ErrIntOverflowPagination + } + 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: PageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthPagination + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthPagination + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextKey = append(m.NextKey[:0], dAtA[iNdEx:postIndex]...) + if m.NextKey == nil { + m.NextKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + m.Total = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPagination + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Total |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipPagination(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthPagination + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipPagination(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, ErrIntOverflowPagination + } + 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, ErrIntOverflowPagination + } + 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, ErrIntOverflowPagination + } + 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, ErrInvalidLengthPagination + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupPagination + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthPagination + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthPagination = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowPagination = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupPagination = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go b/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go new file mode 100644 index 000000000000..1d784a86e5fb --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go @@ -0,0 +1,99 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: amino/amino.proto + +package amino + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" + math "math" +) + +// 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 + +var E_Name = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*string)(nil), + Field: 11110001, + Name: "amino.name", + Tag: "bytes,11110001,opt,name=name", + Filename: "amino/amino.proto", +} + +var E_MessageEncoding = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.MessageOptions)(nil), + ExtensionType: (*string)(nil), + Field: 11110002, + Name: "amino.message_encoding", + Tag: "bytes,11110002,opt,name=message_encoding", + Filename: "amino/amino.proto", +} + +var E_Encoding = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 11110003, + Name: "amino.encoding", + Tag: "bytes,11110003,opt,name=encoding", + Filename: "amino/amino.proto", +} + +var E_FieldName = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*string)(nil), + Field: 11110004, + Name: "amino.field_name", + Tag: "bytes,11110004,opt,name=field_name", + Filename: "amino/amino.proto", +} + +var E_DontOmitempty = &proto.ExtensionDesc{ + ExtendedType: (*descriptorpb.FieldOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 11110005, + Name: "amino.dont_omitempty", + Tag: "varint,11110005,opt,name=dont_omitempty", + Filename: "amino/amino.proto", +} + +func init() { + proto.RegisterExtension(E_Name) + proto.RegisterExtension(E_MessageEncoding) + proto.RegisterExtension(E_Encoding) + proto.RegisterExtension(E_FieldName) + proto.RegisterExtension(E_DontOmitempty) +} + +func init() { proto.RegisterFile("amino/amino.proto", fileDescriptor_115c1f70afec6bc5) } + +var fileDescriptor_115c1f70afec6bc5 = []byte{ + // 284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, + 0xcb, 0xd7, 0x07, 0x93, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xac, 0x60, 0x8e, 0x94, 0x42, + 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x58, 0x30, 0xa9, 0x34, 0x4d, 0x3f, 0x25, 0xb5, 0x38, + 0xb9, 0x28, 0xb3, 0xa0, 0x24, 0xbf, 0x08, 0xa2, 0xd0, 0xca, 0x8c, 0x8b, 0x25, 0x2f, 0x31, 0x37, + 0x55, 0x48, 0x5e, 0x0f, 0xa2, 0x54, 0x0f, 0xa6, 0x54, 0xcf, 0x37, 0xb5, 0xb8, 0x38, 0x31, 0x3d, + 0xd5, 0xbf, 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0xe2, 0x63, 0xcf, 0x32, 0x56, 0x05, 0x46, 0x0d, + 0xce, 0x20, 0xb0, 0x7a, 0x2b, 0x5f, 0x2e, 0x81, 0x5c, 0x88, 0x82, 0xf8, 0xd4, 0xbc, 0xe4, 0xfc, + 0x94, 0xcc, 0xbc, 0x74, 0xc2, 0x66, 0x7c, 0x82, 0x99, 0xc1, 0x0f, 0xd5, 0xeb, 0x0a, 0xd5, 0x6a, + 0x65, 0xc3, 0xc5, 0x01, 0x37, 0x46, 0x16, 0xc3, 0x18, 0xb7, 0xcc, 0xd4, 0x9c, 0x14, 0x98, 0x21, + 0x9f, 0x61, 0x86, 0xc0, 0x75, 0x58, 0xd9, 0x73, 0x71, 0xa5, 0x81, 0x94, 0xc4, 0x83, 0xbd, 0x42, + 0x40, 0xff, 0x17, 0x98, 0x7e, 0x4e, 0xb0, 0x1e, 0x3f, 0x90, 0x6f, 0xdc, 0xb9, 0xf8, 0x52, 0xf2, + 0xf3, 0x4a, 0xe2, 0xf3, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, 0x09, 0x19, 0xf2, 0x15, + 0x62, 0x08, 0x47, 0x10, 0x2f, 0x48, 0x9f, 0x3f, 0x4c, 0x9b, 0x93, 0xeb, 0x89, 0x47, 0x72, 0x8c, + 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, + 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, + 0xe7, 0xea, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0x43, 0x29, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, + 0xca, 0x82, 0xd4, 0x62, 0xfd, 0x92, 0x0a, 0x48, 0x24, 0x26, 0xb1, 0x81, 0x6d, 0x35, 0x06, 0x04, + 0x00, 0x00, 0xff, 0xff, 0xa9, 0xa0, 0x4d, 0x6f, 0xda, 0x01, 0x00, 0x00, +} diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go new file mode 100644 index 000000000000..7c4bbe2cf1d7 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go @@ -0,0 +1,1285 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/auth/v1beta1/auth.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +type BaseAccount struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"` + AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *BaseAccount) Reset() { *m = BaseAccount{} } +func (m *BaseAccount) String() string { return proto.CompactTextString(m) } +func (*BaseAccount) ProtoMessage() {} +func (*BaseAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_7e1f7e915d020d2d, []int{0} +} +func (m *BaseAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BaseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BaseAccount.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 *BaseAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_BaseAccount.Merge(m, src) +} +func (m *BaseAccount) XXX_Size() int { + return m.Size() +} +func (m *BaseAccount) XXX_DiscardUnknown() { + xxx_messageInfo_BaseAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_BaseAccount proto.InternalMessageInfo + +// ModuleAccount defines an account for modules that holds coins on a pool. +type ModuleAccount struct { + *BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Permissions []string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` +} + +func (m *ModuleAccount) Reset() { *m = ModuleAccount{} } +func (m *ModuleAccount) String() string { return proto.CompactTextString(m) } +func (*ModuleAccount) ProtoMessage() {} +func (*ModuleAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_7e1f7e915d020d2d, []int{1} +} +func (m *ModuleAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModuleAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModuleAccount.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 *ModuleAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModuleAccount.Merge(m, src) +} +func (m *ModuleAccount) XXX_Size() int { + return m.Size() +} +func (m *ModuleAccount) XXX_DiscardUnknown() { + xxx_messageInfo_ModuleAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_ModuleAccount proto.InternalMessageInfo + +// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +// +// Since: cosmos-sdk 0.47 +type ModuleCredential struct { + // module_name is the name of the module used for address derivation (passed into address.Module). + ModuleName string `protobuf:"bytes,1,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"` + // derivation_keys is for deriving a module account address (passed into address.Module) + // adding more keys creates sub-account addresses (passed into address.Derive) + DerivationKeys [][]byte `protobuf:"bytes,2,rep,name=derivation_keys,json=derivationKeys,proto3" json:"derivation_keys,omitempty"` +} + +func (m *ModuleCredential) Reset() { *m = ModuleCredential{} } +func (m *ModuleCredential) String() string { return proto.CompactTextString(m) } +func (*ModuleCredential) ProtoMessage() {} +func (*ModuleCredential) Descriptor() ([]byte, []int) { + return fileDescriptor_7e1f7e915d020d2d, []int{2} +} +func (m *ModuleCredential) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ModuleCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ModuleCredential.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 *ModuleCredential) XXX_Merge(src proto.Message) { + xxx_messageInfo_ModuleCredential.Merge(m, src) +} +func (m *ModuleCredential) XXX_Size() int { + return m.Size() +} +func (m *ModuleCredential) XXX_DiscardUnknown() { + xxx_messageInfo_ModuleCredential.DiscardUnknown(m) +} + +var xxx_messageInfo_ModuleCredential proto.InternalMessageInfo + +func (m *ModuleCredential) GetModuleName() string { + if m != nil { + return m.ModuleName + } + return "" +} + +func (m *ModuleCredential) GetDerivationKeys() [][]byte { + if m != nil { + return m.DerivationKeys + } + return nil +} + +// Params defines the parameters for the auth module. +type Params struct { + MaxMemoCharacters uint64 `protobuf:"varint,1,opt,name=max_memo_characters,json=maxMemoCharacters,proto3" json:"max_memo_characters,omitempty"` + TxSigLimit uint64 `protobuf:"varint,2,opt,name=tx_sig_limit,json=txSigLimit,proto3" json:"tx_sig_limit,omitempty"` + TxSizeCostPerByte uint64 `protobuf:"varint,3,opt,name=tx_size_cost_per_byte,json=txSizeCostPerByte,proto3" json:"tx_size_cost_per_byte,omitempty"` + SigVerifyCostED25519 uint64 `protobuf:"varint,4,opt,name=sig_verify_cost_ed25519,json=sigVerifyCostEd25519,proto3" json:"sig_verify_cost_ed25519,omitempty"` + SigVerifyCostSecp256k1 uint64 `protobuf:"varint,5,opt,name=sig_verify_cost_secp256k1,json=sigVerifyCostSecp256k1,proto3" json:"sig_verify_cost_secp256k1,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_7e1f7e915d020d2d, []int{3} +} +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) GetMaxMemoCharacters() uint64 { + if m != nil { + return m.MaxMemoCharacters + } + return 0 +} + +func (m *Params) GetTxSigLimit() uint64 { + if m != nil { + return m.TxSigLimit + } + return 0 +} + +func (m *Params) GetTxSizeCostPerByte() uint64 { + if m != nil { + return m.TxSizeCostPerByte + } + return 0 +} + +func (m *Params) GetSigVerifyCostED25519() uint64 { + if m != nil { + return m.SigVerifyCostED25519 + } + return 0 +} + +func (m *Params) GetSigVerifyCostSecp256k1() uint64 { + if m != nil { + return m.SigVerifyCostSecp256k1 + } + return 0 +} + +func init() { + proto.RegisterType((*BaseAccount)(nil), "cosmos.auth.v1beta1.BaseAccount") + proto.RegisterType((*ModuleAccount)(nil), "cosmos.auth.v1beta1.ModuleAccount") + proto.RegisterType((*ModuleCredential)(nil), "cosmos.auth.v1beta1.ModuleCredential") + proto.RegisterType((*Params)(nil), "cosmos.auth.v1beta1.Params") +} + +func init() { proto.RegisterFile("cosmos/auth/v1beta1/auth.proto", fileDescriptor_7e1f7e915d020d2d) } + +var fileDescriptor_7e1f7e915d020d2d = []byte{ + // 707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x4e, 0xe3, 0x46, + 0x1c, 0x8e, 0x93, 0x14, 0xca, 0x04, 0x68, 0x31, 0x29, 0x35, 0x51, 0x15, 0xbb, 0x91, 0x2a, 0x52, + 0x54, 0xec, 0x26, 0x15, 0x95, 0xca, 0x8d, 0xa4, 0x55, 0x85, 0x28, 0x14, 0x39, 0x5a, 0x0e, 0xab, + 0x95, 0xac, 0xb1, 0x33, 0x98, 0x11, 0x19, 0x8f, 0xd7, 0x33, 0x46, 0x31, 0x4f, 0x80, 0xf6, 0xb4, + 0x8f, 0xc0, 0xee, 0x13, 0x70, 0xe0, 0x21, 0x56, 0x7b, 0x42, 0x7b, 0xd9, 0xdd, 0x4b, 0xb4, 0x0a, + 0x07, 0xd0, 0x3e, 0xc5, 0xca, 0x33, 0x0e, 0x24, 0x6c, 0x2e, 0x91, 0x7f, 0xdf, 0xf7, 0xfd, 0xfe, + 0x7d, 0xfe, 0xc5, 0xa0, 0xea, 0x51, 0x46, 0x28, 0xb3, 0x60, 0xcc, 0x8f, 0xad, 0xd3, 0x86, 0x8b, + 0x38, 0x6c, 0x88, 0xc0, 0x0c, 0x23, 0xca, 0xa9, 0xba, 0x2c, 0x79, 0x53, 0x40, 0x19, 0x5f, 0x59, + 0x82, 0x04, 0x07, 0xd4, 0x12, 0xbf, 0x52, 0x57, 0x59, 0x95, 0x3a, 0x47, 0x44, 0x56, 0x96, 0x24, + 0xa9, 0xb2, 0x4f, 0x7d, 0x2a, 0xf1, 0xf4, 0x69, 0x94, 0xe0, 0x53, 0xea, 0xf7, 0x90, 0x25, 0x22, + 0x37, 0x3e, 0xb2, 0x60, 0x90, 0x48, 0xaa, 0xf6, 0x2a, 0x0f, 0x4a, 0x2d, 0xc8, 0xd0, 0xb6, 0xe7, + 0xd1, 0x38, 0xe0, 0x6a, 0x13, 0xcc, 0xc2, 0x6e, 0x37, 0x42, 0x8c, 0x69, 0x8a, 0xa1, 0xd4, 0xe7, + 0x5a, 0xda, 0xbb, 0xab, 0x8d, 0x72, 0xd6, 0x63, 0x5b, 0x32, 0x1d, 0x1e, 0xe1, 0xc0, 0xb7, 0x47, + 0x42, 0xf5, 0x10, 0xcc, 0x86, 0xb1, 0xeb, 0x9c, 0xa0, 0x44, 0xcb, 0x1b, 0x4a, 0xbd, 0xd4, 0x2c, + 0x9b, 0xb2, 0xa1, 0x39, 0x6a, 0x68, 0x6e, 0x07, 0x49, 0x6b, 0xed, 0xf3, 0x40, 0x2f, 0x87, 0xb1, + 0xdb, 0xc3, 0x5e, 0xaa, 0xfd, 0x8d, 0x12, 0xcc, 0x11, 0x09, 0x79, 0xf2, 0xfa, 0xf6, 0x72, 0x1d, + 0x3c, 0x10, 0xf6, 0x4c, 0x18, 0xbb, 0xbb, 0x28, 0x51, 0x7f, 0x01, 0x8b, 0x50, 0x8e, 0xe5, 0x04, + 0x31, 0x71, 0x51, 0xa4, 0x15, 0x0c, 0xa5, 0x5e, 0xb4, 0x17, 0x32, 0x74, 0x5f, 0x80, 0x6a, 0x05, + 0x7c, 0xcb, 0xd0, 0xf3, 0x18, 0x05, 0x1e, 0xd2, 0x8a, 0x42, 0x70, 0x1f, 0x6f, 0xb5, 0xcf, 0x2f, + 0xf4, 0xdc, 0xdd, 0x85, 0x9e, 0x7b, 0x7b, 0xb5, 0xf1, 0xd3, 0x14, 0x7b, 0xcd, 0x6c, 0xef, 0x9d, + 0x17, 0xb7, 0x97, 0xeb, 0x2b, 0x52, 0xb0, 0xc1, 0xba, 0x27, 0xd6, 0x98, 0x27, 0xb5, 0x8f, 0x0a, + 0x58, 0xd8, 0xa3, 0xdd, 0xb8, 0x77, 0xef, 0xd2, 0x0e, 0x98, 0x77, 0x21, 0x43, 0x4e, 0x36, 0x88, + 0xb0, 0xaa, 0xd4, 0x34, 0xcc, 0x69, 0x1d, 0xc6, 0x2a, 0xb5, 0x8a, 0xd7, 0x03, 0x5d, 0xb1, 0x4b, + 0xee, 0x98, 0xe1, 0x2a, 0x28, 0x06, 0x90, 0x20, 0xe1, 0xdc, 0x9c, 0x2d, 0x9e, 0x55, 0x03, 0x94, + 0x42, 0x14, 0x11, 0xcc, 0x18, 0xa6, 0x01, 0xd3, 0x0a, 0x46, 0xa1, 0x3e, 0x67, 0x8f, 0x43, 0x5b, + 0xff, 0x9e, 0xcb, 0x9d, 0x6a, 0xd3, 0x3a, 0x4e, 0xcc, 0x2a, 0x36, 0xd3, 0xc6, 0x36, 0x9b, 0x60, + 0x6b, 0xcf, 0xc0, 0xf7, 0x12, 0x68, 0x47, 0xa8, 0x8b, 0x02, 0x8e, 0x61, 0x4f, 0xd5, 0x41, 0x89, + 0x08, 0xcc, 0x11, 0x93, 0x89, 0x3b, 0xb0, 0x81, 0x84, 0xf6, 0xd3, 0xf9, 0xd6, 0xc0, 0x77, 0x5d, + 0x14, 0xe1, 0x53, 0xc8, 0x31, 0x0d, 0xd2, 0x57, 0xc6, 0xb4, 0xbc, 0x51, 0xa8, 0xcf, 0xdb, 0x8b, + 0x0f, 0xf0, 0x2e, 0x4a, 0x58, 0xed, 0x7d, 0x1e, 0xcc, 0x1c, 0xc0, 0x08, 0x12, 0xa6, 0x9a, 0x60, + 0x99, 0xc0, 0xbe, 0x43, 0x10, 0xa1, 0x8e, 0x77, 0x0c, 0x23, 0xe8, 0x71, 0x14, 0xc9, 0x23, 0x2b, + 0xda, 0x4b, 0x04, 0xf6, 0xf7, 0x10, 0xa1, 0xed, 0x7b, 0x42, 0x35, 0xc0, 0x3c, 0xef, 0x3b, 0x0c, + 0xfb, 0x4e, 0x0f, 0x13, 0xcc, 0x85, 0x3f, 0x45, 0x1b, 0xf0, 0x7e, 0x07, 0xfb, 0xff, 0xa5, 0x88, + 0xfa, 0x3b, 0xf8, 0x41, 0x28, 0xce, 0x90, 0xe3, 0x51, 0xc6, 0x9d, 0x10, 0x45, 0x8e, 0x9b, 0x70, + 0x94, 0x5d, 0xc9, 0x52, 0x2a, 0x3d, 0x43, 0x6d, 0xca, 0xf8, 0x01, 0x8a, 0x5a, 0x09, 0x47, 0xea, + 0xff, 0xe0, 0xc7, 0xb4, 0xe0, 0x29, 0x8a, 0xf0, 0x51, 0x22, 0x93, 0x50, 0xb7, 0xb9, 0xb9, 0xd9, + 0xf8, 0x4b, 0x1e, 0x4e, 0x4b, 0x1b, 0x0e, 0xf4, 0x72, 0x07, 0xfb, 0x87, 0x42, 0x91, 0xa6, 0xfe, + 0xf3, 0xb7, 0xe0, 0xed, 0x32, 0x9b, 0x40, 0x65, 0x96, 0xfa, 0x04, 0xac, 0x3e, 0x2e, 0xc8, 0x90, + 0x17, 0x36, 0x37, 0xff, 0x3c, 0x69, 0x68, 0xdf, 0x88, 0x92, 0x95, 0xe1, 0x40, 0x5f, 0x99, 0x28, + 0xd9, 0x19, 0x29, 0xec, 0x15, 0x36, 0x15, 0xdf, 0xfa, 0xf9, 0xee, 0x42, 0x57, 0x1e, 0xbf, 0xb7, + 0xbe, 0xfc, 0x6e, 0x48, 0x3b, 0x5b, 0xed, 0x37, 0xc3, 0xaa, 0x72, 0x3d, 0xac, 0x2a, 0x9f, 0x86, + 0x55, 0xe5, 0xe5, 0x4d, 0x35, 0x77, 0x7d, 0x53, 0xcd, 0x7d, 0xb8, 0xa9, 0xe6, 0x9e, 0xfe, 0xea, + 0x63, 0x7e, 0x1c, 0xbb, 0xa6, 0x47, 0x49, 0xf6, 0x6d, 0xb0, 0xbe, 0xae, 0xc2, 0x93, 0x10, 0x31, + 0x77, 0x46, 0xfc, 0x3f, 0xff, 0xf8, 0x12, 0x00, 0x00, 0xff, 0xff, 0x94, 0x45, 0xcd, 0x40, 0x99, + 0x04, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MaxMemoCharacters != that1.MaxMemoCharacters { + return false + } + if this.TxSigLimit != that1.TxSigLimit { + return false + } + if this.TxSizeCostPerByte != that1.TxSizeCostPerByte { + return false + } + if this.SigVerifyCostED25519 != that1.SigVerifyCostED25519 { + return false + } + if this.SigVerifyCostSecp256k1 != that1.SigVerifyCostSecp256k1 { + return false + } + return true +} +func (m *BaseAccount) 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 *BaseAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x20 + } + if m.AccountNumber != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.AccountNumber)) + i-- + dAtA[i] = 0x18 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuth(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModuleAccount) 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 *ModuleAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Permissions) > 0 { + for iNdEx := len(m.Permissions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Permissions[iNdEx]) + copy(dAtA[i:], m.Permissions[iNdEx]) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Permissions[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if m.BaseAccount != nil { + { + size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuth(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ModuleCredential) 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 *ModuleCredential) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModuleCredential) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DerivationKeys) > 0 { + for iNdEx := len(m.DerivationKeys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DerivationKeys[iNdEx]) + copy(dAtA[i:], m.DerivationKeys[iNdEx]) + i = encodeVarintAuth(dAtA, i, uint64(len(m.DerivationKeys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.ModuleName) > 0 { + i -= len(m.ModuleName) + copy(dAtA[i:], m.ModuleName) + i = encodeVarintAuth(dAtA, i, uint64(len(m.ModuleName))) + 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.SigVerifyCostSecp256k1 != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostSecp256k1)) + i-- + dAtA[i] = 0x28 + } + if m.SigVerifyCostED25519 != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostED25519)) + i-- + dAtA[i] = 0x20 + } + if m.TxSizeCostPerByte != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.TxSizeCostPerByte)) + i-- + dAtA[i] = 0x18 + } + if m.TxSigLimit != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.TxSigLimit)) + i-- + dAtA[i] = 0x10 + } + if m.MaxMemoCharacters != 0 { + i = encodeVarintAuth(dAtA, i, uint64(m.MaxMemoCharacters)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { + offset -= sovAuth(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BaseAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovAuth(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovAuth(uint64(l)) + } + if m.AccountNumber != 0 { + n += 1 + sovAuth(uint64(m.AccountNumber)) + } + if m.Sequence != 0 { + n += 1 + sovAuth(uint64(m.Sequence)) + } + return n +} + +func (m *ModuleAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseAccount != nil { + l = m.BaseAccount.Size() + n += 1 + l + sovAuth(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovAuth(uint64(l)) + } + if len(m.Permissions) > 0 { + for _, s := range m.Permissions { + l = len(s) + n += 1 + l + sovAuth(uint64(l)) + } + } + return n +} + +func (m *ModuleCredential) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ModuleName) + if l > 0 { + n += 1 + l + sovAuth(uint64(l)) + } + if len(m.DerivationKeys) > 0 { + for _, b := range m.DerivationKeys { + l = len(b) + n += 1 + l + sovAuth(uint64(l)) + } + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxMemoCharacters != 0 { + n += 1 + sovAuth(uint64(m.MaxMemoCharacters)) + } + if m.TxSigLimit != 0 { + n += 1 + sovAuth(uint64(m.TxSigLimit)) + } + if m.TxSizeCostPerByte != 0 { + n += 1 + sovAuth(uint64(m.TxSizeCostPerByte)) + } + if m.SigVerifyCostED25519 != 0 { + n += 1 + sovAuth(uint64(m.SigVerifyCostED25519)) + } + if m.SigVerifyCostSecp256k1 != 0 { + n += 1 + sovAuth(uint64(m.SigVerifyCostSecp256k1)) + } + return n +} + +func sovAuth(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuth(x uint64) (n int) { + return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BaseAccount) 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 ErrIntOverflowAuth + } + 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: BaseAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BaseAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + 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 ErrInvalidLengthAuth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuth + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) + } + m.AccountNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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 ErrIntOverflowAuth + } + 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 := skipAuth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleAccount) 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 ErrIntOverflowAuth + } + 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: ModuleAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuth + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseAccount == nil { + m.BaseAccount = &BaseAccount{} + } + if err := m.BaseAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowAuth + } + 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 ErrInvalidLengthAuth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + 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 ErrInvalidLengthAuth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permissions = append(m.Permissions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleCredential) 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 ErrIntOverflowAuth + } + 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: ModuleCredential: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleCredential: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + 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 ErrInvalidLengthAuth + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DerivationKeys", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAuth + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAuth + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DerivationKeys = append(m.DerivationKeys, make([]byte, postIndex-iNdEx)) + copy(m.DerivationKeys[len(m.DerivationKeys)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuth + } + 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 ErrIntOverflowAuth + } + 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 MaxMemoCharacters", wireType) + } + m.MaxMemoCharacters = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxMemoCharacters |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TxSigLimit", wireType) + } + m.TxSigLimit = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TxSigLimit |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TxSizeCostPerByte", wireType) + } + m.TxSizeCostPerByte = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TxSizeCostPerByte |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SigVerifyCostED25519", wireType) + } + m.SigVerifyCostED25519 = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SigVerifyCostED25519 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SigVerifyCostSecp256k1", wireType) + } + m.SigVerifyCostSecp256k1 = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuth + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SigVerifyCostSecp256k1 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAuth(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuth + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuth(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, ErrIntOverflowAuth + } + 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, ErrIntOverflowAuth + } + 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, ErrIntOverflowAuth + } + 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, ErrInvalidLengthAuth + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuth + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuth + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go new file mode 100644 index 000000000000..6ebdec98146f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/auth/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// GenesisState defines the auth module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // accounts are the accounts present at genesis. + Accounts []*types.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_d897ccbce9822332, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetAccounts() []*types.Any { + if m != nil { + return m.Accounts + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.auth.v1beta1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/auth/v1beta1/genesis.proto", fileDescriptor_d897ccbce9822332) } + +var fileDescriptor_d897ccbce9822332 = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, + 0x28, 0xd1, 0x03, 0x29, 0xd1, 0x83, 0x2a, 0x91, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, + 0x07, 0x2b, 0x49, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xa8, 0x97, 0x12, 0x49, 0xcf, 0x4f, + 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0xa8, 0xa8, 0x1c, 0x36, 0x8b, 0xc0, 0x46, 0x42, 0xe4, 0x05, + 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x48, 0xa9, 0x81, 0x91, 0x8b, 0xc7, 0x1d, + 0xe2, 0x94, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x3b, 0x2e, 0xb6, 0x82, 0xc4, 0xa2, 0xc4, 0xdc, + 0x62, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x69, 0x3d, 0x2c, 0x4e, 0xd3, 0x0b, 0x00, 0x2b, + 0x71, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x42, + 0x06, 0x5c, 0x1c, 0x89, 0xc9, 0xc9, 0xf9, 0xa5, 0x79, 0x25, 0xc5, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, + 0xdc, 0x46, 0x22, 0x7a, 0x10, 0x7f, 0xe8, 0xc1, 0xfc, 0xa1, 0xe7, 0x98, 0x57, 0x19, 0x04, 0x57, + 0xe5, 0xe4, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, + 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0xe9, 0x99, + 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, 0xaf, 0x41, 0x28, 0xdd, 0xe2, 0x94, + 0x6c, 0xfd, 0x0a, 0x88, 0x3f, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x86, 0x1b, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x70, 0x8d, 0xea, 0x6c, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Accounts = append(m.Accounts, &types.Any{}) + if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go new file mode 100644 index 000000000000..72910ef780ac --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go @@ -0,0 +1,4117 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/auth/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +type QueryAccountsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAccountsRequest) Reset() { *m = QueryAccountsRequest{} } +func (m *QueryAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountsRequest) ProtoMessage() {} +func (*QueryAccountsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{0} +} +func (m *QueryAccountsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountsRequest.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 *QueryAccountsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountsRequest.Merge(m, src) +} +func (m *QueryAccountsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountsRequest proto.InternalMessageInfo + +func (m *QueryAccountsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +// +// Since: cosmos-sdk 0.43 +type QueryAccountsResponse struct { + // accounts are the existing accounts + Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAccountsResponse) Reset() { *m = QueryAccountsResponse{} } +func (m *QueryAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountsResponse) ProtoMessage() {} +func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{1} +} +func (m *QueryAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountsResponse.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 *QueryAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountsResponse.Merge(m, src) +} +func (m *QueryAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo + +func (m *QueryAccountsResponse) GetAccounts() []*types.Any { + if m != nil { + return m.Accounts + } + return nil +} + +func (m *QueryAccountsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +type QueryAccountRequest struct { + // address defines the address to query for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryAccountRequest) Reset() { *m = QueryAccountRequest{} } +func (m *QueryAccountRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountRequest) ProtoMessage() {} +func (*QueryAccountRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{2} +} +func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountRequest.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 *QueryAccountRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountRequest.Merge(m, src) +} +func (m *QueryAccountRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo + +// QueryAccountResponse is the response type for the Query/Account RPC method. +type QueryAccountResponse struct { + // account defines the account of the corresponding address. + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} } +func (m *QueryAccountResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountResponse) ProtoMessage() {} +func (*QueryAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{3} +} +func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountResponse.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 *QueryAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountResponse.Merge(m, src) +} +func (m *QueryAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountResponse proto.InternalMessageInfo + +func (m *QueryAccountResponse) GetAccount() *types.Any { + if m != nil { + return m.Account + } + return nil +} + +// QueryParamsRequest is the 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_c451370b3929a27c, []int{4} +} +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 the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the 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_c451370b3929a27c, []int{5} +} +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{} +} + +// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +type QueryModuleAccountsRequest struct { +} + +func (m *QueryModuleAccountsRequest) Reset() { *m = QueryModuleAccountsRequest{} } +func (m *QueryModuleAccountsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryModuleAccountsRequest) ProtoMessage() {} +func (*QueryModuleAccountsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{6} +} +func (m *QueryModuleAccountsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryModuleAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryModuleAccountsRequest.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 *QueryModuleAccountsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryModuleAccountsRequest.Merge(m, src) +} +func (m *QueryModuleAccountsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryModuleAccountsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryModuleAccountsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryModuleAccountsRequest proto.InternalMessageInfo + +// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +// +// Since: cosmos-sdk 0.46 +type QueryModuleAccountsResponse struct { + Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` +} + +func (m *QueryModuleAccountsResponse) Reset() { *m = QueryModuleAccountsResponse{} } +func (m *QueryModuleAccountsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryModuleAccountsResponse) ProtoMessage() {} +func (*QueryModuleAccountsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{7} +} +func (m *QueryModuleAccountsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryModuleAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryModuleAccountsResponse.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 *QueryModuleAccountsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryModuleAccountsResponse.Merge(m, src) +} +func (m *QueryModuleAccountsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryModuleAccountsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryModuleAccountsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryModuleAccountsResponse proto.InternalMessageInfo + +func (m *QueryModuleAccountsResponse) GetAccounts() []*types.Any { + if m != nil { + return m.Accounts + } + return nil +} + +// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +type QueryModuleAccountByNameRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *QueryModuleAccountByNameRequest) Reset() { *m = QueryModuleAccountByNameRequest{} } +func (m *QueryModuleAccountByNameRequest) String() string { return proto.CompactTextString(m) } +func (*QueryModuleAccountByNameRequest) ProtoMessage() {} +func (*QueryModuleAccountByNameRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{8} +} +func (m *QueryModuleAccountByNameRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryModuleAccountByNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryModuleAccountByNameRequest.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 *QueryModuleAccountByNameRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryModuleAccountByNameRequest.Merge(m, src) +} +func (m *QueryModuleAccountByNameRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryModuleAccountByNameRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryModuleAccountByNameRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryModuleAccountByNameRequest proto.InternalMessageInfo + +func (m *QueryModuleAccountByNameRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +type QueryModuleAccountByNameResponse struct { + Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` +} + +func (m *QueryModuleAccountByNameResponse) Reset() { *m = QueryModuleAccountByNameResponse{} } +func (m *QueryModuleAccountByNameResponse) String() string { return proto.CompactTextString(m) } +func (*QueryModuleAccountByNameResponse) ProtoMessage() {} +func (*QueryModuleAccountByNameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{9} +} +func (m *QueryModuleAccountByNameResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryModuleAccountByNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryModuleAccountByNameResponse.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 *QueryModuleAccountByNameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryModuleAccountByNameResponse.Merge(m, src) +} +func (m *QueryModuleAccountByNameResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryModuleAccountByNameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryModuleAccountByNameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryModuleAccountByNameResponse proto.InternalMessageInfo + +func (m *QueryModuleAccountByNameResponse) GetAccount() *types.Any { + if m != nil { + return m.Account + } + return nil +} + +// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +type Bech32PrefixRequest struct { +} + +func (m *Bech32PrefixRequest) Reset() { *m = Bech32PrefixRequest{} } +func (m *Bech32PrefixRequest) String() string { return proto.CompactTextString(m) } +func (*Bech32PrefixRequest) ProtoMessage() {} +func (*Bech32PrefixRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{10} +} +func (m *Bech32PrefixRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bech32PrefixRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bech32PrefixRequest.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 *Bech32PrefixRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bech32PrefixRequest.Merge(m, src) +} +func (m *Bech32PrefixRequest) XXX_Size() int { + return m.Size() +} +func (m *Bech32PrefixRequest) XXX_DiscardUnknown() { + xxx_messageInfo_Bech32PrefixRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_Bech32PrefixRequest proto.InternalMessageInfo + +// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +// +// Since: cosmos-sdk 0.46 +type Bech32PrefixResponse struct { + Bech32Prefix string `protobuf:"bytes,1,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` +} + +func (m *Bech32PrefixResponse) Reset() { *m = Bech32PrefixResponse{} } +func (m *Bech32PrefixResponse) String() string { return proto.CompactTextString(m) } +func (*Bech32PrefixResponse) ProtoMessage() {} +func (*Bech32PrefixResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{11} +} +func (m *Bech32PrefixResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Bech32PrefixResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Bech32PrefixResponse.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 *Bech32PrefixResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bech32PrefixResponse.Merge(m, src) +} +func (m *Bech32PrefixResponse) XXX_Size() int { + return m.Size() +} +func (m *Bech32PrefixResponse) XXX_DiscardUnknown() { + xxx_messageInfo_Bech32PrefixResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_Bech32PrefixResponse proto.InternalMessageInfo + +func (m *Bech32PrefixResponse) GetBech32Prefix() string { + if m != nil { + return m.Bech32Prefix + } + return "" +} + +// AddressBytesToStringRequest is the request type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +type AddressBytesToStringRequest struct { + AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` +} + +func (m *AddressBytesToStringRequest) Reset() { *m = AddressBytesToStringRequest{} } +func (m *AddressBytesToStringRequest) String() string { return proto.CompactTextString(m) } +func (*AddressBytesToStringRequest) ProtoMessage() {} +func (*AddressBytesToStringRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{12} +} +func (m *AddressBytesToStringRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressBytesToStringRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressBytesToStringRequest.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 *AddressBytesToStringRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressBytesToStringRequest.Merge(m, src) +} +func (m *AddressBytesToStringRequest) XXX_Size() int { + return m.Size() +} +func (m *AddressBytesToStringRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressBytesToStringRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressBytesToStringRequest proto.InternalMessageInfo + +func (m *AddressBytesToStringRequest) GetAddressBytes() []byte { + if m != nil { + return m.AddressBytes + } + return nil +} + +// AddressBytesToStringResponse is the response type for AddressString rpc method. +// +// Since: cosmos-sdk 0.46 +type AddressBytesToStringResponse struct { + AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` +} + +func (m *AddressBytesToStringResponse) Reset() { *m = AddressBytesToStringResponse{} } +func (m *AddressBytesToStringResponse) String() string { return proto.CompactTextString(m) } +func (*AddressBytesToStringResponse) ProtoMessage() {} +func (*AddressBytesToStringResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{13} +} +func (m *AddressBytesToStringResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressBytesToStringResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressBytesToStringResponse.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 *AddressBytesToStringResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressBytesToStringResponse.Merge(m, src) +} +func (m *AddressBytesToStringResponse) XXX_Size() int { + return m.Size() +} +func (m *AddressBytesToStringResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressBytesToStringResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressBytesToStringResponse proto.InternalMessageInfo + +func (m *AddressBytesToStringResponse) GetAddressString() string { + if m != nil { + return m.AddressString + } + return "" +} + +// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +// +// Since: cosmos-sdk 0.46 +type AddressStringToBytesRequest struct { + AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` +} + +func (m *AddressStringToBytesRequest) Reset() { *m = AddressStringToBytesRequest{} } +func (m *AddressStringToBytesRequest) String() string { return proto.CompactTextString(m) } +func (*AddressStringToBytesRequest) ProtoMessage() {} +func (*AddressStringToBytesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{14} +} +func (m *AddressStringToBytesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressStringToBytesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressStringToBytesRequest.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 *AddressStringToBytesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressStringToBytesRequest.Merge(m, src) +} +func (m *AddressStringToBytesRequest) XXX_Size() int { + return m.Size() +} +func (m *AddressStringToBytesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressStringToBytesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressStringToBytesRequest proto.InternalMessageInfo + +func (m *AddressStringToBytesRequest) GetAddressString() string { + if m != nil { + return m.AddressString + } + return "" +} + +// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +// +// Since: cosmos-sdk 0.46 +type AddressStringToBytesResponse struct { + AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` +} + +func (m *AddressStringToBytesResponse) Reset() { *m = AddressStringToBytesResponse{} } +func (m *AddressStringToBytesResponse) String() string { return proto.CompactTextString(m) } +func (*AddressStringToBytesResponse) ProtoMessage() {} +func (*AddressStringToBytesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{15} +} +func (m *AddressStringToBytesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressStringToBytesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressStringToBytesResponse.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 *AddressStringToBytesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressStringToBytesResponse.Merge(m, src) +} +func (m *AddressStringToBytesResponse) XXX_Size() int { + return m.Size() +} +func (m *AddressStringToBytesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressStringToBytesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressStringToBytesResponse proto.InternalMessageInfo + +func (m *AddressStringToBytesResponse) GetAddressBytes() []byte { + if m != nil { + return m.AddressBytes + } + return nil +} + +// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +type QueryAccountAddressByIDRequest struct { + // Deprecated, use account_id instead + // + // id is the account number of the address to be queried. This field + // should have been an uint64 (like all account numbers), and will be + // updated to uint64 in a future version of the auth query. + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Deprecated: Do not use. + // account_id is the account number of the address to be queried. + // + // Since: cosmos-sdk 0.47 + AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` +} + +func (m *QueryAccountAddressByIDRequest) Reset() { *m = QueryAccountAddressByIDRequest{} } +func (m *QueryAccountAddressByIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIDRequest) ProtoMessage() {} +func (*QueryAccountAddressByIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{16} +} +func (m *QueryAccountAddressByIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountAddressByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountAddressByIDRequest.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 *QueryAccountAddressByIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIDRequest.Merge(m, src) +} +func (m *QueryAccountAddressByIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountAddressByIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountAddressByIDRequest proto.InternalMessageInfo + +// Deprecated: Do not use. +func (m *QueryAccountAddressByIDRequest) GetId() int64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *QueryAccountAddressByIDRequest) GetAccountId() uint64 { + if m != nil { + return m.AccountId + } + return 0 +} + +// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +// +// Since: cosmos-sdk 0.46.2 +type QueryAccountAddressByIDResponse struct { + AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` +} + +func (m *QueryAccountAddressByIDResponse) Reset() { *m = QueryAccountAddressByIDResponse{} } +func (m *QueryAccountAddressByIDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountAddressByIDResponse) ProtoMessage() {} +func (*QueryAccountAddressByIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{17} +} +func (m *QueryAccountAddressByIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountAddressByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountAddressByIDResponse.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 *QueryAccountAddressByIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountAddressByIDResponse.Merge(m, src) +} +func (m *QueryAccountAddressByIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountAddressByIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountAddressByIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountAddressByIDResponse proto.InternalMessageInfo + +func (m *QueryAccountAddressByIDResponse) GetAccountAddress() string { + if m != nil { + return m.AccountAddress + } + return "" +} + +// QueryAccountInfoRequest is the Query/AccountInfo request type. +// +// Since: cosmos-sdk 0.47 +type QueryAccountInfoRequest struct { + // address is the account address string. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *QueryAccountInfoRequest) Reset() { *m = QueryAccountInfoRequest{} } +func (m *QueryAccountInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAccountInfoRequest) ProtoMessage() {} +func (*QueryAccountInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{18} +} +func (m *QueryAccountInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountInfoRequest.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 *QueryAccountInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountInfoRequest.Merge(m, src) +} +func (m *QueryAccountInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountInfoRequest proto.InternalMessageInfo + +func (m *QueryAccountInfoRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// QueryAccountInfoResponse is the Query/AccountInfo response type. +// +// Since: cosmos-sdk 0.47 +type QueryAccountInfoResponse struct { + // info is the account info which is represented by BaseAccount. + Info *BaseAccount `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` +} + +func (m *QueryAccountInfoResponse) Reset() { *m = QueryAccountInfoResponse{} } +func (m *QueryAccountInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAccountInfoResponse) ProtoMessage() {} +func (*QueryAccountInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c451370b3929a27c, []int{19} +} +func (m *QueryAccountInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAccountInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAccountInfoResponse.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 *QueryAccountInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAccountInfoResponse.Merge(m, src) +} +func (m *QueryAccountInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAccountInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAccountInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAccountInfoResponse proto.InternalMessageInfo + +func (m *QueryAccountInfoResponse) GetInfo() *BaseAccount { + if m != nil { + return m.Info + } + return nil +} + +func init() { + proto.RegisterType((*QueryAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryAccountsRequest") + proto.RegisterType((*QueryAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryAccountsResponse") + proto.RegisterType((*QueryAccountRequest)(nil), "cosmos.auth.v1beta1.QueryAccountRequest") + proto.RegisterType((*QueryAccountResponse)(nil), "cosmos.auth.v1beta1.QueryAccountResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.auth.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.auth.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryModuleAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryModuleAccountsRequest") + proto.RegisterType((*QueryModuleAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryModuleAccountsResponse") + proto.RegisterType((*QueryModuleAccountByNameRequest)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameRequest") + proto.RegisterType((*QueryModuleAccountByNameResponse)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameResponse") + proto.RegisterType((*Bech32PrefixRequest)(nil), "cosmos.auth.v1beta1.Bech32PrefixRequest") + proto.RegisterType((*Bech32PrefixResponse)(nil), "cosmos.auth.v1beta1.Bech32PrefixResponse") + proto.RegisterType((*AddressBytesToStringRequest)(nil), "cosmos.auth.v1beta1.AddressBytesToStringRequest") + proto.RegisterType((*AddressBytesToStringResponse)(nil), "cosmos.auth.v1beta1.AddressBytesToStringResponse") + proto.RegisterType((*AddressStringToBytesRequest)(nil), "cosmos.auth.v1beta1.AddressStringToBytesRequest") + proto.RegisterType((*AddressStringToBytesResponse)(nil), "cosmos.auth.v1beta1.AddressStringToBytesResponse") + proto.RegisterType((*QueryAccountAddressByIDRequest)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") + proto.RegisterType((*QueryAccountAddressByIDResponse)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") + proto.RegisterType((*QueryAccountInfoRequest)(nil), "cosmos.auth.v1beta1.QueryAccountInfoRequest") + proto.RegisterType((*QueryAccountInfoResponse)(nil), "cosmos.auth.v1beta1.QueryAccountInfoResponse") +} + +func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } + +var fileDescriptor_c451370b3929a27c = []byte{ + // 1065 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x6e, 0x69, 0xbb, 0xaf, 0xd9, 0x22, 0x4d, 0xb3, 0x22, 0x38, 0x6d, 0x12, 0xb9, + 0xd0, 0xa6, 0x65, 0x63, 0xd3, 0x34, 0x2b, 0xf1, 0xe3, 0x54, 0xef, 0x02, 0xea, 0x61, 0x51, 0x70, + 0x57, 0x08, 0x71, 0x20, 0x72, 0x62, 0x27, 0xb5, 0xd8, 0x78, 0xb2, 0xb1, 0x03, 0x1b, 0xaa, 0x5c, + 0x90, 0x90, 0x7a, 0x41, 0x42, 0x82, 0x3f, 0x60, 0x0f, 0x88, 0xf3, 0x22, 0x95, 0x1b, 0x7f, 0xc0, + 0x6a, 0x4f, 0x2b, 0xb8, 0x70, 0x42, 0xa8, 0x45, 0x82, 0x1b, 0xff, 0x02, 0xca, 0xcc, 0xb3, 0x63, + 0xb7, 0x93, 0xc4, 0x85, 0x53, 0x9d, 0x99, 0xf7, 0xbe, 0xef, 0x33, 0x6f, 0x9e, 0xfd, 0x2d, 0x14, + 0x9a, 0xd4, 0xeb, 0x50, 0x4f, 0x33, 0xfb, 0xfe, 0x91, 0xf6, 0xd9, 0x6e, 0xc3, 0xf6, 0xcd, 0x5d, + 0xed, 0x61, 0xdf, 0xee, 0x0d, 0xd4, 0x6e, 0x8f, 0xfa, 0x94, 0xac, 0xf2, 0x00, 0x75, 0x14, 0xa0, + 0x62, 0x80, 0xbc, 0x83, 0x59, 0x0d, 0xd3, 0xb3, 0x79, 0x74, 0x98, 0xdb, 0x35, 0xdb, 0x8e, 0x6b, + 0xfa, 0x0e, 0x75, 0xb9, 0x80, 0x9c, 0x69, 0xd3, 0x36, 0x65, 0x8f, 0xda, 0xe8, 0x09, 0x57, 0x5f, + 0x6e, 0x53, 0xda, 0x7e, 0x60, 0x6b, 0xec, 0x57, 0xa3, 0xdf, 0xd2, 0x4c, 0x17, 0x2b, 0xca, 0x6b, + 0xb8, 0x65, 0x76, 0x1d, 0xcd, 0x74, 0x5d, 0xea, 0x33, 0x35, 0x0f, 0x77, 0xf3, 0x22, 0x60, 0x06, + 0x87, 0xc2, 0x7c, 0xbf, 0xce, 0x2b, 0x22, 0x3c, 0xdf, 0xca, 0x61, 0x6a, 0x00, 0x1c, 0x3d, 0xa7, + 0xf2, 0x09, 0x64, 0x3e, 0x18, 0xfd, 0xdc, 0x6f, 0x36, 0x69, 0xdf, 0xf5, 0x3d, 0xc3, 0x7e, 0xd8, + 0xb7, 0x3d, 0x9f, 0xbc, 0x0b, 0x30, 0x3e, 0x52, 0x56, 0x2a, 0x4a, 0xa5, 0xe5, 0xca, 0xa6, 0x8a, + 0xba, 0xa3, 0xf3, 0xab, 0x5c, 0x05, 0x51, 0xd4, 0x9a, 0xd9, 0xb6, 0x31, 0xd7, 0x88, 0x64, 0x2a, + 0xa7, 0x12, 0xdc, 0xbc, 0x50, 0xc0, 0xeb, 0x52, 0xd7, 0xb3, 0x89, 0x01, 0x4b, 0x26, 0xae, 0x65, + 0xa5, 0xe2, 0xb5, 0xd2, 0x72, 0x25, 0xa3, 0xf2, 0x16, 0xa8, 0x41, 0x77, 0xd4, 0x7d, 0x77, 0xa0, + 0x17, 0x9f, 0x9d, 0x96, 0xd7, 0x04, 0xb7, 0xa1, 0xa2, 0xe2, 0x81, 0x11, 0xea, 0x90, 0xf7, 0x62, + 0xd4, 0x73, 0x8c, 0x7a, 0x6b, 0x26, 0x35, 0x07, 0x8a, 0x61, 0x1f, 0xc2, 0x6a, 0x94, 0x3a, 0xe8, + 0x4a, 0x05, 0x16, 0x4d, 0xcb, 0xea, 0xd9, 0x9e, 0xc7, 0x5a, 0x72, 0x5d, 0xcf, 0xfe, 0x72, 0x5a, + 0xce, 0xa0, 0xfe, 0x3e, 0xdf, 0x39, 0xf4, 0x7b, 0x8e, 0xdb, 0x36, 0x82, 0xc0, 0xb7, 0x96, 0x4e, + 0x1e, 0x17, 0x52, 0x7f, 0x3f, 0x2e, 0xa4, 0x94, 0xa3, 0x78, 0xaf, 0xc3, 0x4e, 0xd4, 0x60, 0x11, + 0x4f, 0x80, 0x8d, 0xfe, 0xaf, 0x8d, 0x08, 0x64, 0x94, 0x0c, 0x10, 0x56, 0xa9, 0x66, 0xf6, 0xcc, + 0x4e, 0x70, 0xa7, 0x4a, 0x0d, 0x0f, 0x15, 0xac, 0x62, 0xf9, 0x37, 0x61, 0xa1, 0xcb, 0x56, 0xb0, + 0x7a, 0x4e, 0x15, 0x15, 0xe1, 0x49, 0xfa, 0xfc, 0xd3, 0xdf, 0x0b, 0x29, 0x03, 0x13, 0x94, 0x35, + 0x90, 0x99, 0xe2, 0x3d, 0x6a, 0xf5, 0x1f, 0xd8, 0x17, 0x66, 0x48, 0xf9, 0x1c, 0x72, 0xc2, 0x5d, + 0xac, 0xfb, 0x51, 0xc2, 0x01, 0xd8, 0x7c, 0x76, 0x5a, 0x56, 0x44, 0x48, 0x31, 0xdd, 0xc8, 0x18, + 0x28, 0xb7, 0xa1, 0x70, 0xb9, 0xb0, 0x3e, 0x78, 0xdf, 0xec, 0x04, 0x33, 0x4a, 0x08, 0xcc, 0xbb, + 0x66, 0xc7, 0xe6, 0xd7, 0x68, 0xb0, 0x67, 0xe5, 0x0b, 0x28, 0x4e, 0x4e, 0x43, 0xe8, 0x0f, 0x93, + 0xdd, 0x55, 0x52, 0xe6, 0xf0, 0xc6, 0x6e, 0xc2, 0xaa, 0x6e, 0x37, 0x8f, 0xf6, 0x2a, 0xb5, 0x9e, + 0xdd, 0x72, 0x1e, 0x05, 0x2d, 0x7c, 0x1b, 0x32, 0xf1, 0x65, 0xc4, 0xd8, 0x80, 0x1b, 0x0d, 0xb6, + 0x5e, 0xef, 0xb2, 0x0d, 0x3c, 0x47, 0xba, 0x11, 0x09, 0x56, 0x74, 0xc8, 0xe1, 0x4c, 0xea, 0x03, + 0xdf, 0xf6, 0xee, 0x53, 0x1c, 0x4d, 0x6c, 0xc1, 0x06, 0xdc, 0xc0, 0x19, 0xad, 0x37, 0x46, 0xfb, + 0x4c, 0x23, 0x6d, 0xa4, 0xcd, 0x48, 0x8e, 0xf2, 0x0e, 0xac, 0x89, 0x35, 0x10, 0xe4, 0x55, 0x58, + 0x09, 0x44, 0x3c, 0xb6, 0x83, 0x24, 0x81, 0x34, 0x0f, 0x57, 0xee, 0x86, 0x28, 0x7c, 0xe1, 0x3e, + 0x65, 0x72, 0x01, 0x4a, 0x42, 0x95, 0x3b, 0x21, 0xcc, 0x05, 0x95, 0x71, 0x57, 0x66, 0x9f, 0xe8, + 0x10, 0xf2, 0xd1, 0xb7, 0x30, 0x3c, 0xdd, 0xc1, 0xdd, 0xf1, 0x6c, 0xcc, 0x39, 0x16, 0xcb, 0xbd, + 0xa6, 0xcf, 0x65, 0x25, 0x63, 0xce, 0xb1, 0xc8, 0x3a, 0x00, 0x5e, 0x55, 0xdd, 0xb1, 0xd8, 0x97, + 0x65, 0xde, 0xb8, 0x8e, 0x2b, 0x07, 0x96, 0x62, 0xe1, 0xc4, 0x89, 0x44, 0x11, 0x6e, 0x1f, 0x5e, + 0x0c, 0x14, 0x92, 0x7e, 0x43, 0x56, 0xcc, 0x98, 0x9c, 0x72, 0x0f, 0x5e, 0x8a, 0x56, 0x39, 0x70, + 0x5b, 0xf4, 0x7f, 0x7c, 0x99, 0x94, 0x1a, 0x64, 0x2f, 0xcb, 0x21, 0x6d, 0x15, 0xe6, 0x1d, 0xb7, + 0x45, 0x71, 0xc8, 0x8b, 0xc2, 0x4f, 0x82, 0x6e, 0x7a, 0xc1, 0x24, 0x1b, 0x2c, 0xba, 0xf2, 0x4f, + 0x1a, 0x5e, 0x60, 0x92, 0xe4, 0x6b, 0x09, 0x96, 0x82, 0x37, 0x9e, 0x6c, 0x0b, 0xd3, 0x45, 0xbe, + 0x23, 0xef, 0x24, 0x09, 0xe5, 0x8c, 0xca, 0xce, 0xc9, 0x5f, 0x4f, 0x76, 0xa4, 0x2f, 0x7f, 0xfd, + 0xf3, 0xdb, 0xb9, 0x02, 0x59, 0xd7, 0x84, 0x0e, 0x19, 0x20, 0x7c, 0x27, 0xc1, 0x22, 0x0a, 0x90, + 0xd2, 0xcc, 0x1a, 0x01, 0xcd, 0x76, 0x82, 0x48, 0x84, 0xa9, 0x8e, 0x61, 0xb6, 0xc9, 0xd6, 0x54, + 0x18, 0xed, 0x18, 0x6f, 0x60, 0x48, 0x7e, 0x92, 0x80, 0x5c, 0x9e, 0x19, 0xb2, 0x37, 0xb3, 0xee, + 0xe5, 0xb1, 0x95, 0xab, 0x57, 0x4b, 0xba, 0x02, 0x77, 0xf8, 0x4e, 0xd5, 0x1d, 0x4b, 0x3b, 0x76, + 0xac, 0x21, 0xf9, 0x4a, 0x82, 0x05, 0xee, 0x08, 0x64, 0x6b, 0x72, 0xd9, 0x98, 0xfd, 0xc8, 0xa5, + 0xd9, 0x81, 0xc8, 0x54, 0x1a, 0x33, 0xad, 0x93, 0x9c, 0x90, 0x89, 0x1b, 0x10, 0xf9, 0x41, 0x82, + 0x95, 0xb8, 0xbd, 0x10, 0x6d, 0x72, 0x19, 0xa1, 0x4d, 0xc9, 0xaf, 0x27, 0x4f, 0x40, 0xbe, 0xdd, + 0x31, 0xdf, 0x26, 0x79, 0x45, 0xc8, 0xd7, 0x61, 0x99, 0xf5, 0x70, 0xfe, 0x7e, 0x96, 0x60, 0x55, + 0xe0, 0x2b, 0xa4, 0x9a, 0xb0, 0x78, 0xcc, 0xbd, 0xe4, 0xdb, 0x57, 0xcc, 0x42, 0xee, 0x37, 0xc6, + 0xdc, 0x65, 0xf2, 0x5a, 0x12, 0x6e, 0xed, 0x78, 0xe4, 0x8c, 0x43, 0x72, 0x22, 0x41, 0x3a, 0x6a, + 0x44, 0x13, 0xde, 0x21, 0x81, 0x85, 0x4d, 0x78, 0x87, 0x44, 0xae, 0xa6, 0x6c, 0x4c, 0xbd, 0x72, + 0xee, 0x6d, 0xe4, 0x89, 0x04, 0x19, 0x91, 0x25, 0x11, 0xf1, 0x3d, 0x4e, 0x71, 0x40, 0x79, 0xf7, + 0x0a, 0x19, 0x88, 0xb8, 0x37, 0xb5, 0x7b, 0x1c, 0x31, 0x7c, 0xbf, 0xb9, 0x0b, 0x0d, 0xc9, 0x8f, + 0x63, 0xe4, 0x98, 0x71, 0x4d, 0x47, 0x16, 0x39, 0xe5, 0x74, 0x64, 0xa1, 0x2b, 0x2a, 0x55, 0x86, + 0xac, 0x92, 0x5b, 0x89, 0x90, 0xb9, 0xff, 0x0e, 0xc9, 0xf7, 0x12, 0x2c, 0x47, 0x8c, 0x81, 0xdc, + 0x9a, 0xf9, 0x75, 0x89, 0xd8, 0x91, 0x5c, 0x4e, 0x18, 0x9d, 0x7c, 0x30, 0x43, 0xf7, 0x75, 0x5b, + 0x74, 0xfc, 0x01, 0xd5, 0xef, 0x3c, 0x3d, 0xcb, 0x4b, 0xcf, 0xcf, 0xf2, 0xd2, 0x1f, 0x67, 0x79, + 0xe9, 0x9b, 0xf3, 0x7c, 0xea, 0xf9, 0x79, 0x3e, 0xf5, 0xdb, 0x79, 0x3e, 0xf5, 0xf1, 0x76, 0xdb, + 0xf1, 0x8f, 0xfa, 0x0d, 0xb5, 0x49, 0x3b, 0x81, 0x20, 0xff, 0x53, 0xf6, 0xac, 0x4f, 0xb5, 0x47, + 0x5c, 0xdd, 0x1f, 0x74, 0x6d, 0xaf, 0xb1, 0xc0, 0xfe, 0x77, 0xdb, 0xfb, 0x37, 0x00, 0x00, 0xff, + 0xff, 0x1f, 0xa2, 0x5f, 0xef, 0x16, 0x0e, 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 { + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.43 + Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) + // Account returns account details based on address. + Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) + // Params queries all parameters. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 + ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) + // ModuleAccountByName returns the module account info by module name + ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 + Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) + // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 + AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) + // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 + AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + AccountInfo(ctx context.Context, in *QueryAccountInfoRequest, opts ...grpc.CallOption) (*QueryAccountInfoResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { + out := new(QueryAccountsResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Accounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) { + out := new(QueryAccountResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Account", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) { + out := new(QueryAccountAddressByIDResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressByID", 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, "/cosmos.auth.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) { + out := new(QueryModuleAccountsResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/ModuleAccounts", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) { + out := new(QueryModuleAccountByNameResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/ModuleAccountByName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) { + out := new(Bech32PrefixResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Bech32Prefix", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) { + out := new(AddressBytesToStringResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AddressBytesToString", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) { + out := new(AddressStringToBytesResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AddressStringToBytes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AccountInfo(ctx context.Context, in *QueryAccountInfoRequest, opts ...grpc.CallOption) (*QueryAccountInfoResponse, error) { + out := new(QueryAccountInfoResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Accounts returns all the existing accounts. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.43 + Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) + // Account returns account details based on address. + Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) + // AccountAddressByID returns account address based on account number. + // + // Since: cosmos-sdk 0.46.2 + AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) + // Params queries all parameters. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // ModuleAccounts returns all the existing module accounts. + // + // Since: cosmos-sdk 0.46 + ModuleAccounts(context.Context, *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) + // ModuleAccountByName returns the module account info by module name + ModuleAccountByName(context.Context, *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error) + // Bech32Prefix queries bech32Prefix + // + // Since: cosmos-sdk 0.46 + Bech32Prefix(context.Context, *Bech32PrefixRequest) (*Bech32PrefixResponse, error) + // AddressBytesToString converts Account Address bytes to string + // + // Since: cosmos-sdk 0.46 + AddressBytesToString(context.Context, *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) + // AddressStringToBytes converts Address string to bytes + // + // Since: cosmos-sdk 0.46 + AddressStringToBytes(context.Context, *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) + // AccountInfo queries account info which is common to all account types. + // + // Since: cosmos-sdk 0.47 + AccountInfo(context.Context, *QueryAccountInfoRequest) (*QueryAccountInfoResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccountsRequest) (*QueryAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") +} +func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") +} +func (*UnimplementedQueryServer) AccountAddressByID(ctx context.Context, req *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountAddressByID not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) ModuleAccounts(ctx context.Context, req *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModuleAccounts not implemented") +} +func (*UnimplementedQueryServer) ModuleAccountByName(ctx context.Context, req *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModuleAccountByName not implemented") +} +func (*UnimplementedQueryServer) Bech32Prefix(ctx context.Context, req *Bech32PrefixRequest) (*Bech32PrefixResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Bech32Prefix not implemented") +} +func (*UnimplementedQueryServer) AddressBytesToString(ctx context.Context, req *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddressBytesToString not implemented") +} +func (*UnimplementedQueryServer) AddressStringToBytes(ctx context.Context, req *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddressStringToBytes not implemented") +} +func (*UnimplementedQueryServer) AccountInfo(ctx context.Context, req *QueryAccountInfoRequest) (*QueryAccountInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AccountInfo not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Accounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/Accounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Account(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/Account", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AccountAddressByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountAddressByIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountAddressByID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressByID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountAddressByID(ctx, req.(*QueryAccountAddressByIDRequest)) + } + 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: "/cosmos.auth.v1beta1.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_ModuleAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryModuleAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ModuleAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/ModuleAccounts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ModuleAccounts(ctx, req.(*QueryModuleAccountsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ModuleAccountByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryModuleAccountByNameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ModuleAccountByName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/ModuleAccountByName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ModuleAccountByName(ctx, req.(*QueryModuleAccountByNameRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Bech32Prefix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Bech32PrefixRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Bech32Prefix(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/Bech32Prefix", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Bech32Prefix(ctx, req.(*Bech32PrefixRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AddressBytesToString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddressBytesToStringRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AddressBytesToString(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AddressBytesToString", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AddressBytesToString(ctx, req.(*AddressBytesToStringRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AddressStringToBytes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddressStringToBytesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AddressStringToBytes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AddressStringToBytes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AddressStringToBytes(ctx, req.(*AddressStringToBytesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAccountInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AccountInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.auth.v1beta1.Query/AccountInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AccountInfo(ctx, req.(*QueryAccountInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.auth.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Accounts", + Handler: _Query_Accounts_Handler, + }, + { + MethodName: "Account", + Handler: _Query_Account_Handler, + }, + { + MethodName: "AccountAddressByID", + Handler: _Query_AccountAddressByID_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "ModuleAccounts", + Handler: _Query_ModuleAccounts_Handler, + }, + { + MethodName: "ModuleAccountByName", + Handler: _Query_ModuleAccountByName_Handler, + }, + { + MethodName: "Bech32Prefix", + Handler: _Query_Bech32Prefix_Handler, + }, + { + MethodName: "AddressBytesToString", + Handler: _Query_AddressBytesToString_Handler, + }, + { + MethodName: "AddressStringToBytes", + Handler: _Query_AddressStringToBytes_Handler, + }, + { + MethodName: "AccountInfo", + Handler: _Query_AccountInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/auth/v1beta1/query.proto", +} + +func (m *QueryAccountsRequest) 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 *QueryAccountsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountsRequest) 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 *QueryAccountsResponse) 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 *QueryAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountsResponse) 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.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[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 *QueryAccountRequest) 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 *QueryAccountRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountResponse) 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 *QueryAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Account != nil { + { + size, err := m.Account.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 *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 *QueryModuleAccountsRequest) 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 *QueryModuleAccountsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryModuleAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryModuleAccountsResponse) 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 *QueryModuleAccountsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryModuleAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Accounts) > 0 { + for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Accounts[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 *QueryModuleAccountByNameRequest) 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 *QueryModuleAccountByNameRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryModuleAccountByNameRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryModuleAccountByNameResponse) 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 *QueryModuleAccountByNameResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryModuleAccountByNameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Account != nil { + { + size, err := m.Account.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 *Bech32PrefixRequest) 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 *Bech32PrefixRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bech32PrefixRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *Bech32PrefixResponse) 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 *Bech32PrefixResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Bech32PrefixResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bech32Prefix) > 0 { + i -= len(m.Bech32Prefix) + copy(dAtA[i:], m.Bech32Prefix) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Bech32Prefix))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressBytesToStringRequest) 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 *AddressBytesToStringRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressBytesToStringRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AddressBytes) > 0 { + i -= len(m.AddressBytes) + copy(dAtA[i:], m.AddressBytes) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressBytesToStringResponse) 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 *AddressBytesToStringResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressBytesToStringResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AddressString) > 0 { + i -= len(m.AddressString) + copy(dAtA[i:], m.AddressString) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressString))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressStringToBytesRequest) 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 *AddressStringToBytesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressStringToBytesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AddressString) > 0 { + i -= len(m.AddressString) + copy(dAtA[i:], m.AddressString) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressString))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AddressStringToBytesResponse) 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 *AddressStringToBytesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddressStringToBytesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AddressBytes) > 0 { + i -= len(m.AddressBytes) + copy(dAtA[i:], m.AddressBytes) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountAddressByIDRequest) 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 *QueryAccountAddressByIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountAddressByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AccountId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AccountId)) + i-- + dAtA[i] = 0x10 + } + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountAddressByIDResponse) 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 *QueryAccountAddressByIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountAddressByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AccountAddress) > 0 { + i -= len(m.AccountAddress) + copy(dAtA[i:], m.AccountAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountInfoRequest) 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 *QueryAccountInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAccountInfoResponse) 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 *QueryAccountInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAccountInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Info != nil { + { + size, err := m.Info.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 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 *QueryAccountsRequest) 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 *QueryAccountsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + 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 *QueryAccountRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAccountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + 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 *QueryModuleAccountsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryModuleAccountsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Accounts) > 0 { + for _, e := range m.Accounts { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryModuleAccountByNameRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryModuleAccountByNameResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Account != nil { + l = m.Account.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *Bech32PrefixRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *Bech32PrefixResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bech32Prefix) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AddressBytesToStringRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AddressBytes) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AddressBytesToStringResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AddressString) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AddressStringToBytesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AddressString) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *AddressStringToBytesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AddressBytes) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAccountAddressByIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + if m.AccountId != 0 { + n += 1 + sovQuery(uint64(m.AccountId)) + } + return n +} + +func (m *QueryAccountAddressByIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AccountAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAccountInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAccountInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } + 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 *QueryAccountsRequest) 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: QueryAccountsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountsRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountsResponse) 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: QueryAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", 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.Accounts = append(m.Accounts, &types.Any{}) + if err := m.Accounts[len(m.Accounts)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountRequest) 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: QueryAccountRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountResponse) 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: QueryAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.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) || (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) || (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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryModuleAccountsRequest) 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: QueryModuleAccountsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryModuleAccountsRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryModuleAccountsResponse) 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: QueryModuleAccountsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryModuleAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accounts", 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.Accounts = append(m.Accounts, &types.Any{}) + if err := m.Accounts[len(m.Accounts)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryModuleAccountByNameRequest) 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: QueryModuleAccountByNameRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryModuleAccountByNameRequest: 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 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryModuleAccountByNameResponse) 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: QueryModuleAccountByNameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryModuleAccountByNameResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account == nil { + m.Account = &types.Any{} + } + if err := m.Account.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bech32PrefixRequest) 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: Bech32PrefixRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bech32PrefixRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Bech32PrefixResponse) 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: Bech32PrefixResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Bech32PrefixResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", 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.Bech32Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressBytesToStringRequest) 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: AddressBytesToStringRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressBytesToStringRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressBytes = append(m.AddressBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AddressBytes == nil { + m.AddressBytes = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressBytesToStringResponse) 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: AddressBytesToStringResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressBytesToStringResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressString", 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.AddressString = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressStringToBytesRequest) 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: AddressStringToBytesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressStringToBytesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressString", 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.AddressString = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AddressStringToBytesResponse) 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: AddressStringToBytesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AddressStringToBytesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddressBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AddressBytes = append(m.AddressBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AddressBytes == nil { + m.AddressBytes = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountAddressByIDRequest) 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: QueryAccountAddressByIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountAddressByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountId", wireType) + } + m.AccountId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountAddressByIDResponse) 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: QueryAccountAddressByIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountAddressByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", 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.AccountAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountInfoRequest) 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: QueryAccountInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAccountInfoResponse) 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: QueryAccountInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAccountInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Info", 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.Info == nil { + m.Info = &BaseAccount{} + } + if err := m.Info.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) || (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/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go new file mode 100644 index 000000000000..36c34cb6602a --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go @@ -0,0 +1,990 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/auth/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Accounts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Accounts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Accounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Accounts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Accounts(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Account_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.Account(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.Account(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AccountAddressByID_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AccountAddressByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AccountAddressByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountAddressByIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AccountAddressByID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AccountAddressByID(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ModuleAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryModuleAccountsRequest + var metadata runtime.ServerMetadata + + msg, err := client.ModuleAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ModuleAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryModuleAccountsRequest + var metadata runtime.ServerMetadata + + msg, err := server.ModuleAccounts(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryModuleAccountByNameRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.ModuleAccountByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryModuleAccountByNameRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.ModuleAccountByName(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Bech32Prefix_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Bech32PrefixRequest + var metadata runtime.ServerMetadata + + msg, err := client.Bech32Prefix(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Bech32Prefix_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq Bech32PrefixRequest + var metadata runtime.ServerMetadata + + msg, err := server.Bech32Prefix(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_AddressBytesToString_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddressBytesToStringRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address_bytes"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_bytes") + } + + protoReq.AddressBytes, err = runtime.Bytes(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_bytes", err) + } + + msg, err := client.AddressBytesToString(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AddressBytesToString_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddressBytesToStringRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address_bytes"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_bytes") + } + + protoReq.AddressBytes, err = runtime.Bytes(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_bytes", err) + } + + msg, err := server.AddressBytesToString(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_AddressStringToBytes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddressStringToBytesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address_string"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_string") + } + + protoReq.AddressString, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_string", err) + } + + msg, err := client.AddressStringToBytes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AddressStringToBytes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddressStringToBytesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address_string"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_string") + } + + protoReq.AddressString, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_string", err) + } + + msg, err := server.AddressStringToBytes(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_AccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := client.AccountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAccountInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + msg, err := server.AccountInfo(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Accounts_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Account_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Account_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AccountAddressByID_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ModuleAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ModuleAccounts_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ModuleAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Bech32Prefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Bech32Prefix_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bech32Prefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AddressBytesToString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AddressBytesToString_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AddressBytesToString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AddressStringToBytes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AddressStringToBytes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AddressStringToBytes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AccountInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Accounts_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Account_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Account_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AccountAddressByID_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ModuleAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ModuleAccounts_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ModuleAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Bech32Prefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Bech32Prefix_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Bech32Prefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AddressBytesToString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AddressBytesToString_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AddressBytesToString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AddressStringToBytes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AddressStringToBytes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AddressStringToBytes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AccountInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "accounts"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AccountAddressByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "address_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ModuleAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "module_accounts"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ModuleAccountByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "module_accounts", "name"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Bech32Prefix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "bech32"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AddressBytesToString_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "bech32", "address_bytes"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AddressStringToBytes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "bech32", "address_string"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AccountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "account_info", "address"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Accounts_0 = runtime.ForwardResponseMessage + + forward_Query_Account_0 = runtime.ForwardResponseMessage + + forward_Query_AccountAddressByID_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_ModuleAccounts_0 = runtime.ForwardResponseMessage + + forward_Query_ModuleAccountByName_0 = runtime.ForwardResponseMessage + + forward_Query_Bech32Prefix_0 = runtime.ForwardResponseMessage + + forward_Query_AddressBytesToString_0 = runtime.ForwardResponseMessage + + forward_Query_AddressStringToBytes_0 = runtime.ForwardResponseMessage + + forward_Query_AccountInfo_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go new file mode 100644 index 000000000000..7214842181cc --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go @@ -0,0 +1,606 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/auth/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "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 + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +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 x/auth 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_c2d62bd9c4c212e5, []int{0} +} +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. +// +// Since: cosmos-sdk 0.47 +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_c2d62bd9c4c212e5, []int{1} +} +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((*MsgUpdateParams)(nil), "cosmos.auth.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.auth.v1beta1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/auth/v1beta1/tx.proto", fileDescriptor_c2d62bd9c4c212e5) } + +var fileDescriptor_c2d62bd9c4c212e5 = []byte{ + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, + 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, + 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x87, 0xda, 0x91, 0x5b, 0x9c, 0xae, + 0x5f, 0x66, 0x08, 0xa2, 0xa0, 0x12, 0x82, 0x89, 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x2a, + 0x24, 0x87, 0xcd, 0x3d, 0x60, 0xeb, 0xc1, 0xf2, 0x4a, 0xfb, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, + 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, + 0x41, 0x2a, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, + 0x6d, 0xd1, 0x15, 0x81, 0x3a, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, + 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x8e, 0x8b, 0xad, 0x00, 0x6c, 0x82, 0x04, 0x93, 0x02, + 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x16, 0xef, 0xea, 0x41, 0x2c, 0x71, 0xe2, 0x3c, 0x71, 0x4f, + 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x56, 0x26, 0x4d, 0xcf, 0x37, 0x68, + 0x21, 0xcc, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x11, 0x62, 0x82, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, + 0xc4, 0x13, 0x68, 0xae, 0x55, 0x92, 0xe4, 0x12, 0x47, 0x13, 0x0a, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, + 0x2b, 0x4e, 0x35, 0x2a, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x4a, 0xe2, 0xe2, 0x41, 0xf1, 0x9f, + 0x0a, 0x56, 0x77, 0xa1, 0x19, 0x22, 0xa5, 0x43, 0x8c, 0x2a, 0x98, 0x55, 0x52, 0xac, 0x0d, 0x20, + 0xaf, 0x38, 0x39, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, + 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x66, 0x7a, + 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0x36, 0xf5, 0x31, 0xfd, 0x56, 0x52, + 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x1a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, + 0x2c, 0xd6, 0xf9, 0x4c, 0x02, 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 { + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + 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) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.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 { + // UpdateParams defines a (governance) operation for updating the x/auth module + // parameters. The authority defaults to the x/gov module account. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +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_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: "/cosmos.auth.v1beta1.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: "cosmos.auth.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/auth/v1beta1/tx.proto", +} + +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 *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 *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) || (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) || (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/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go new file mode 100644 index 000000000000..2b5bf359cb9f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go @@ -0,0 +1,1046 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/authz/v1beta1/authz.proto + +package authz + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "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 + +// GenericAuthorization gives the grantee unrestricted permissions to execute +// the provided method on behalf of the granter's account. +type GenericAuthorization struct { + // Msg, identified by it's type URL, to grant unrestricted permissions to execute + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` +} + +func (m *GenericAuthorization) Reset() { *m = GenericAuthorization{} } +func (m *GenericAuthorization) String() string { return proto.CompactTextString(m) } +func (*GenericAuthorization) ProtoMessage() {} +func (*GenericAuthorization) Descriptor() ([]byte, []int) { + return fileDescriptor_544dc2e84b61c637, []int{0} +} +func (m *GenericAuthorization) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenericAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenericAuthorization.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 *GenericAuthorization) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenericAuthorization.Merge(m, src) +} +func (m *GenericAuthorization) XXX_Size() int { + return m.Size() +} +func (m *GenericAuthorization) XXX_DiscardUnknown() { + xxx_messageInfo_GenericAuthorization.DiscardUnknown(m) +} + +var xxx_messageInfo_GenericAuthorization proto.InternalMessageInfo + +// Grant gives permissions to execute +// the provide method with expiration time. +type Grant struct { + Authorization *types.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"` + // time when the grant will expire and will be pruned. If null, then the grant + // doesn't have a time expiration (other conditions in `authorization` + // may apply to invalidate the grant) + Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *Grant) Reset() { *m = Grant{} } +func (m *Grant) String() string { return proto.CompactTextString(m) } +func (*Grant) ProtoMessage() {} +func (*Grant) Descriptor() ([]byte, []int) { + return fileDescriptor_544dc2e84b61c637, []int{1} +} +func (m *Grant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Grant.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 *Grant) XXX_Merge(src proto.Message) { + xxx_messageInfo_Grant.Merge(m, src) +} +func (m *Grant) XXX_Size() int { + return m.Size() +} +func (m *Grant) XXX_DiscardUnknown() { + xxx_messageInfo_Grant.DiscardUnknown(m) +} + +var xxx_messageInfo_Grant proto.InternalMessageInfo + +// GrantAuthorization extends a grant with both the addresses of the grantee and granter. +// It is used in genesis.proto and query.proto +type GrantAuthorization struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + Authorization *types.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` + Expiration *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *GrantAuthorization) Reset() { *m = GrantAuthorization{} } +func (m *GrantAuthorization) String() string { return proto.CompactTextString(m) } +func (*GrantAuthorization) ProtoMessage() {} +func (*GrantAuthorization) Descriptor() ([]byte, []int) { + return fileDescriptor_544dc2e84b61c637, []int{2} +} +func (m *GrantAuthorization) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GrantAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GrantAuthorization.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 *GrantAuthorization) XXX_Merge(src proto.Message) { + xxx_messageInfo_GrantAuthorization.Merge(m, src) +} +func (m *GrantAuthorization) XXX_Size() int { + return m.Size() +} +func (m *GrantAuthorization) XXX_DiscardUnknown() { + xxx_messageInfo_GrantAuthorization.DiscardUnknown(m) +} + +var xxx_messageInfo_GrantAuthorization proto.InternalMessageInfo + +// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +type GrantQueueItem struct { + // msg_type_urls contains the list of TypeURL of a sdk.Msg. + MsgTypeUrls []string `protobuf:"bytes,1,rep,name=msg_type_urls,json=msgTypeUrls,proto3" json:"msg_type_urls,omitempty"` +} + +func (m *GrantQueueItem) Reset() { *m = GrantQueueItem{} } +func (m *GrantQueueItem) String() string { return proto.CompactTextString(m) } +func (*GrantQueueItem) ProtoMessage() {} +func (*GrantQueueItem) Descriptor() ([]byte, []int) { + return fileDescriptor_544dc2e84b61c637, []int{3} +} +func (m *GrantQueueItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GrantQueueItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GrantQueueItem.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 *GrantQueueItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_GrantQueueItem.Merge(m, src) +} +func (m *GrantQueueItem) XXX_Size() int { + return m.Size() +} +func (m *GrantQueueItem) XXX_DiscardUnknown() { + xxx_messageInfo_GrantQueueItem.DiscardUnknown(m) +} + +var xxx_messageInfo_GrantQueueItem proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenericAuthorization)(nil), "cosmos.authz.v1beta1.GenericAuthorization") + proto.RegisterType((*Grant)(nil), "cosmos.authz.v1beta1.Grant") + proto.RegisterType((*GrantAuthorization)(nil), "cosmos.authz.v1beta1.GrantAuthorization") + proto.RegisterType((*GrantQueueItem)(nil), "cosmos.authz.v1beta1.GrantQueueItem") +} + +func init() { proto.RegisterFile("cosmos/authz/v1beta1/authz.proto", fileDescriptor_544dc2e84b61c637) } + +var fileDescriptor_544dc2e84b61c637 = []byte{ + // 446 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3f, 0x8f, 0xd3, 0x30, + 0x18, 0xc6, 0xe3, 0xeb, 0xf1, 0xe7, 0x7c, 0x3a, 0x04, 0x51, 0x86, 0xd2, 0x21, 0xa9, 0x22, 0x84, + 0x4e, 0x48, 0x8d, 0x75, 0x07, 0x13, 0x13, 0x8d, 0x90, 0x4e, 0xb0, 0x11, 0x8e, 0x85, 0xa5, 0x72, + 0x5a, 0xe3, 0x5a, 0xd4, 0x71, 0x64, 0x3b, 0xe8, 0x72, 0x1f, 0x81, 0xe9, 0x3e, 0x03, 0x9f, 0x00, + 0xa4, 0x7e, 0x88, 0x8a, 0xa9, 0x62, 0x62, 0xe2, 0x4f, 0x3b, 0xf0, 0x35, 0x50, 0xed, 0x44, 0x34, + 0xb4, 0x12, 0x1d, 0x58, 0x22, 0xdb, 0xef, 0xf3, 0xbc, 0xef, 0x93, 0x5f, 0x62, 0xd8, 0x1d, 0x0a, + 0xc5, 0x85, 0x42, 0xb8, 0xd0, 0xe3, 0x4b, 0xf4, 0xee, 0x24, 0x25, 0x1a, 0x9f, 0xd8, 0x5d, 0x94, + 0x4b, 0xa1, 0x85, 0xeb, 0x59, 0x45, 0x64, 0xcf, 0x2a, 0x45, 0xe7, 0x0e, 0xe6, 0x2c, 0x13, 0xc8, + 0x3c, 0xad, 0xb0, 0x73, 0xd7, 0x0a, 0x07, 0x66, 0x87, 0x2a, 0x97, 0x2d, 0x05, 0x54, 0x08, 0x3a, + 0x21, 0xc8, 0xec, 0xd2, 0xe2, 0x0d, 0xd2, 0x8c, 0x13, 0xa5, 0x31, 0xcf, 0x2b, 0x81, 0x47, 0x05, + 0x15, 0xd6, 0xb8, 0x5a, 0xd5, 0x1d, 0xff, 0xb6, 0xe1, 0xac, 0xb4, 0xa5, 0x50, 0x43, 0xef, 0x8c, + 0x64, 0x44, 0xb2, 0x61, 0xbf, 0xd0, 0x63, 0x21, 0xd9, 0x25, 0xd6, 0x4c, 0x64, 0xee, 0x6d, 0xd8, + 0xe2, 0x8a, 0xb6, 0x41, 0x17, 0x1c, 0x1f, 0x24, 0xab, 0xe5, 0xe3, 0xe7, 0x9f, 0xa7, 0xbd, 0x70, + 0xdb, 0x3b, 0x44, 0x0d, 0xe7, 0xfb, 0x5f, 0x1f, 0x1f, 0x04, 0x56, 0xd6, 0x53, 0xa3, 0xb7, 0x68, + 0x5b, 0xf7, 0xf0, 0x13, 0x80, 0xd7, 0xce, 0x24, 0xce, 0xb4, 0x9b, 0xc2, 0x23, 0xbc, 0x5e, 0x32, + 0x13, 0x0f, 0x4f, 0xbd, 0xc8, 0x46, 0x8e, 0xea, 0xc8, 0x51, 0x3f, 0x2b, 0xe3, 0xfb, 0xbb, 0x45, + 0x48, 0x9a, 0x2d, 0xdd, 0xa7, 0x10, 0x92, 0x8b, 0x9c, 0x49, 0x3b, 0x60, 0xcf, 0x0c, 0xe8, 0x6c, + 0x0c, 0x38, 0xaf, 0x51, 0xc6, 0x37, 0x67, 0xdf, 0x02, 0x70, 0xf5, 0x3d, 0x00, 0xc9, 0x9a, 0x2f, + 0xfc, 0xb0, 0x07, 0x5d, 0x93, 0xb9, 0x09, 0xea, 0x14, 0xde, 0xa0, 0xab, 0x53, 0x22, 0x2d, 0xac, + 0xb8, 0xfd, 0x65, 0xda, 0xab, 0xbf, 0x75, 0x7f, 0x34, 0x92, 0x44, 0xa9, 0x97, 0x5a, 0xb2, 0x8c, + 0x26, 0xb5, 0xf0, 0x8f, 0x87, 0x98, 0x34, 0x3b, 0x78, 0xc8, 0x26, 0xa8, 0xd6, 0xff, 0x07, 0xf5, + 0xa4, 0x01, 0x6a, 0xff, 0x9f, 0xa0, 0xf6, 0x37, 0x20, 0x3d, 0x82, 0xb7, 0x0c, 0xa3, 0x17, 0x05, + 0x29, 0xc8, 0x33, 0x4d, 0xb8, 0x1b, 0xc2, 0x23, 0xae, 0xe8, 0x40, 0x97, 0x39, 0x19, 0x14, 0x72, + 0xa2, 0xda, 0xa0, 0xdb, 0x3a, 0x3e, 0x48, 0x0e, 0xb9, 0xa2, 0xe7, 0x65, 0x4e, 0x5e, 0xc9, 0x89, + 0x8a, 0xe3, 0xd9, 0x4f, 0xdf, 0x99, 0x2d, 0x7c, 0x30, 0x5f, 0xf8, 0xe0, 0xc7, 0xc2, 0x07, 0x57, + 0x4b, 0xdf, 0x99, 0x2f, 0x7d, 0xe7, 0xeb, 0xd2, 0x77, 0x5e, 0xdf, 0xa3, 0x4c, 0x8f, 0x8b, 0x34, + 0x1a, 0x0a, 0x5e, 0xdd, 0x06, 0xb4, 0xf6, 0x7f, 0x5d, 0xd8, 0x4b, 0x96, 0x5e, 0x37, 0xf9, 0x1e, + 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x50, 0x89, 0xaf, 0x02, 0x89, 0x03, 0x00, 0x00, +} + +func (m *GenericAuthorization) 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 *GenericAuthorization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenericAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Grant) 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 *Grant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintAuthz(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + } + if m.Authorization != nil { + { + size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuthz(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GrantAuthorization) 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 *GrantAuthorization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GrantAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintAuthz(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x22 + } + if m.Authorization != nil { + { + size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuthz(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GrantQueueItem) 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 *GrantQueueItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GrantQueueItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MsgTypeUrls) > 0 { + for iNdEx := len(m.MsgTypeUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.MsgTypeUrls[iNdEx]) + copy(dAtA[i:], m.MsgTypeUrls[iNdEx]) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.MsgTypeUrls[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { + offset -= sovAuthz(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenericAuthorization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovAuthz(uint64(l)) + } + return n +} + +func (m *Grant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Authorization != nil { + l = m.Authorization.Size() + n += 1 + l + sovAuthz(uint64(l)) + } + if m.Expiration != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovAuthz(uint64(l)) + } + return n +} + +func (m *GrantAuthorization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovAuthz(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovAuthz(uint64(l)) + } + if m.Authorization != nil { + l = m.Authorization.Size() + n += 1 + l + sovAuthz(uint64(l)) + } + if m.Expiration != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovAuthz(uint64(l)) + } + return n +} + +func (m *GrantQueueItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MsgTypeUrls) > 0 { + for _, s := range m.MsgTypeUrls { + l = len(s) + n += 1 + l + sovAuthz(uint64(l)) + } + } + return n +} + +func sovAuthz(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuthz(x uint64) (n int) { + return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenericAuthorization) 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 ErrIntOverflowAuthz + } + 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: GenericAuthorization: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenericAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + 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 ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuthz(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Grant) 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 ErrIntOverflowAuthz + } + 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: Grant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Authorization == nil { + m.Authorization = &types.Any{} + } + if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuthz(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GrantAuthorization) 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 ErrIntOverflowAuthz + } + 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: GrantAuthorization: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GrantAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + 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 ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + 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 ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Authorization == nil { + m.Authorization = &types.Any{} + } + if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuthz(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GrantQueueItem) 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 ErrIntOverflowAuthz + } + 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: GrantQueueItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GrantQueueItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + 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 ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgTypeUrls = append(m.MsgTypeUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuthz(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuthz(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, ErrIntOverflowAuthz + } + 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, ErrIntOverflowAuthz + } + 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, ErrIntOverflowAuthz + } + 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, ErrInvalidLengthAuthz + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuthz + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuthz + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go new file mode 100644 index 000000000000..454bd1611f15 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go @@ -0,0 +1,703 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/authz/v1beta1/event.proto + +package authz + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventGrant is emitted on Msg/Grant +type EventGrant struct { + // Msg type URL for which an autorization is granted + MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` + // Granter account address + Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"` + // Grantee account address + Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *EventGrant) Reset() { *m = EventGrant{} } +func (m *EventGrant) String() string { return proto.CompactTextString(m) } +func (*EventGrant) ProtoMessage() {} +func (*EventGrant) Descriptor() ([]byte, []int) { + return fileDescriptor_1f88cbc71a8baf1f, []int{0} +} +func (m *EventGrant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventGrant.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 *EventGrant) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventGrant.Merge(m, src) +} +func (m *EventGrant) XXX_Size() int { + return m.Size() +} +func (m *EventGrant) XXX_DiscardUnknown() { + xxx_messageInfo_EventGrant.DiscardUnknown(m) +} + +var xxx_messageInfo_EventGrant proto.InternalMessageInfo + +func (m *EventGrant) GetMsgTypeUrl() string { + if m != nil { + return m.MsgTypeUrl + } + return "" +} + +func (m *EventGrant) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *EventGrant) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +// EventRevoke is emitted on Msg/Revoke +type EventRevoke struct { + // Msg type URL for which an autorization is revoked + MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` + // Granter account address + Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"` + // Grantee account address + Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *EventRevoke) Reset() { *m = EventRevoke{} } +func (m *EventRevoke) String() string { return proto.CompactTextString(m) } +func (*EventRevoke) ProtoMessage() {} +func (*EventRevoke) Descriptor() ([]byte, []int) { + return fileDescriptor_1f88cbc71a8baf1f, []int{1} +} +func (m *EventRevoke) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRevoke.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 *EventRevoke) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRevoke.Merge(m, src) +} +func (m *EventRevoke) XXX_Size() int { + return m.Size() +} +func (m *EventRevoke) XXX_DiscardUnknown() { + xxx_messageInfo_EventRevoke.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRevoke proto.InternalMessageInfo + +func (m *EventRevoke) GetMsgTypeUrl() string { + if m != nil { + return m.MsgTypeUrl + } + return "" +} + +func (m *EventRevoke) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *EventRevoke) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func init() { + proto.RegisterType((*EventGrant)(nil), "cosmos.authz.v1beta1.EventGrant") + proto.RegisterType((*EventRevoke)(nil), "cosmos.authz.v1beta1.EventRevoke") +} + +func init() { proto.RegisterFile("cosmos/authz/v1beta1/event.proto", fileDescriptor_1f88cbc71a8baf1f) } + +var fileDescriptor_1f88cbc71a8baf1f = []byte{ + // 245 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa8, + 0xd0, 0x03, 0xab, 0xd0, 0x83, 0xaa, 0x90, 0x92, 0x84, 0x88, 0xc6, 0x83, 0xd5, 0xe8, 0x43, 0x95, + 0x80, 0x39, 0x4a, 0xd3, 0x18, 0xb9, 0xb8, 0x5c, 0x41, 0x06, 0xb8, 0x17, 0x25, 0xe6, 0x95, 0x08, + 0x29, 0x70, 0xf1, 0xe4, 0x16, 0xa7, 0xc7, 0x97, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, + 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0x71, 0xe5, 0x16, 0xa7, 0x87, 0x54, 0x16, 0xa4, 0x86, 0x16, + 0xe5, 0x08, 0x19, 0x71, 0xb1, 0xa7, 0x83, 0x94, 0xa6, 0x16, 0x49, 0x30, 0x83, 0x24, 0x9d, 0x24, + 0x2e, 0x6d, 0xd1, 0x85, 0x59, 0xeb, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, + 0x99, 0x97, 0x1e, 0x04, 0x53, 0x88, 0xd0, 0x93, 0x2a, 0xc1, 0x42, 0x9c, 0x9e, 0x54, 0xa5, 0xe9, + 0x8c, 0x5c, 0xdc, 0x60, 0x87, 0x05, 0xa5, 0x96, 0xe5, 0x67, 0xa7, 0x0e, 0x1e, 0x97, 0x39, 0xd9, + 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, + 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4a, 0x7a, 0x66, 0x49, 0x46, + 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0x94, 0xa1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, + 0x24, 0xde, 0x92, 0xd8, 0xc0, 0x21, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x74, 0xc2, + 0x29, 0xce, 0x01, 0x00, 0x00, +} + +func (m *EventGrant) 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 *EventGrant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x22 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0x1a + } + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintEvent(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *EventRevoke) 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 *EventRevoke) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x22 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0x1a + } + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintEvent(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventGrant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func (m *EventRevoke) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventGrant) 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 ErrIntOverflowEvent + } + 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: EventGrant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventGrant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRevoke) 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 ErrIntOverflowEvent + } + 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: EventRevoke: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRevoke: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + 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 ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvent(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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrIntOverflowEvent + } + 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, ErrInvalidLengthEvent + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvent + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvent + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go new file mode 100644 index 000000000000..caefd1c60be6 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go @@ -0,0 +1,334 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/authz/v1beta1/genesis.proto + +package authz + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the authz module's genesis state. +type GenesisState struct { + Authorization []GrantAuthorization `protobuf:"bytes,1,rep,name=authorization,proto3" json:"authorization"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_4c2fbb971da7c892, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetAuthorization() []GrantAuthorization { + if m != nil { + return m.Authorization + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.authz.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/authz/v1beta1/genesis.proto", fileDescriptor_4c2fbb971da7c892) +} + +var fileDescriptor_4c2fbb971da7c892 = []byte{ + // 222 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, + 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x81, 0xa8, 0xd1, 0x03, 0xab, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, + 0xd0, 0x07, 0xb1, 0x20, 0x6a, 0xa5, 0x14, 0xb0, 0x9a, 0x07, 0xd1, 0x09, 0x51, 0x21, 0x98, 0x98, + 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x99, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, + 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x22, 0xb9, 0x78, 0x41, 0x3a, 0xf2, 0x8b, 0x32, 0xab, 0x12, 0x4b, + 0x32, 0xf3, 0xf3, 0x24, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x34, 0xf4, 0xb0, 0x39, 0x44, 0xcf, + 0xbd, 0x28, 0x31, 0xaf, 0xc4, 0x11, 0x59, 0xbd, 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, + 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0x35, 0xc9, 0xc9, 0xee, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, + 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, + 0xe5, 0x18, 0xa2, 0x54, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xa1, + 0x9e, 0x80, 0x50, 0xba, 0xc5, 0x29, 0xd9, 0xfa, 0x15, 0x10, 0x3f, 0x24, 0xb1, 0x81, 0x5d, 0x6c, + 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xfa, 0xde, 0xe7, 0x38, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Authorization) > 0 { + for iNdEx := len(m.Authorization) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Authorization[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Authorization) > 0 { + for _, e := range m.Authorization { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authorization = append(m.Authorization, GrantAuthorization{}) + if err := m.Authorization[len(m.Authorization)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go new file mode 100644 index 000000000000..c022c6e1893a --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go @@ -0,0 +1,1873 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/authz/v1beta1/query.proto + +package authz + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryGrantsRequest is the request type for the Query/Grants RPC method. +type QueryGrantsRequest struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + // Optional, msg_type_url, when set, will query only grants matching given msg type. + MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGrantsRequest) Reset() { *m = QueryGrantsRequest{} } +func (m *QueryGrantsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGrantsRequest) ProtoMessage() {} +func (*QueryGrantsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{0} +} +func (m *QueryGrantsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGrantsRequest.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 *QueryGrantsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGrantsRequest.Merge(m, src) +} +func (m *QueryGrantsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGrantsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGrantsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGrantsRequest proto.InternalMessageInfo + +func (m *QueryGrantsRequest) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *QueryGrantsRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *QueryGrantsRequest) GetMsgTypeUrl() string { + if m != nil { + return m.MsgTypeUrl + } + return "" +} + +func (m *QueryGrantsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +type QueryGrantsResponse struct { + // authorizations is a list of grants granted for grantee by granter. + Grants []*Grant `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGrantsResponse) Reset() { *m = QueryGrantsResponse{} } +func (m *QueryGrantsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGrantsResponse) ProtoMessage() {} +func (*QueryGrantsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{1} +} +func (m *QueryGrantsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGrantsResponse.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 *QueryGrantsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGrantsResponse.Merge(m, src) +} +func (m *QueryGrantsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGrantsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGrantsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGrantsResponse proto.InternalMessageInfo + +func (m *QueryGrantsResponse) GetGrants() []*Grant { + if m != nil { + return m.Grants + } + return nil +} + +func (m *QueryGrantsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +type QueryGranterGrantsRequest struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGranterGrantsRequest) Reset() { *m = QueryGranterGrantsRequest{} } +func (m *QueryGranterGrantsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGranterGrantsRequest) ProtoMessage() {} +func (*QueryGranterGrantsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{2} +} +func (m *QueryGranterGrantsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGranterGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGranterGrantsRequest.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 *QueryGranterGrantsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGranterGrantsRequest.Merge(m, src) +} +func (m *QueryGranterGrantsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGranterGrantsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGranterGrantsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGranterGrantsRequest proto.InternalMessageInfo + +func (m *QueryGranterGrantsRequest) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *QueryGranterGrantsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +type QueryGranterGrantsResponse struct { + // grants is a list of grants granted by the granter. + Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGranterGrantsResponse) Reset() { *m = QueryGranterGrantsResponse{} } +func (m *QueryGranterGrantsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGranterGrantsResponse) ProtoMessage() {} +func (*QueryGranterGrantsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{3} +} +func (m *QueryGranterGrantsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGranterGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGranterGrantsResponse.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 *QueryGranterGrantsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGranterGrantsResponse.Merge(m, src) +} +func (m *QueryGranterGrantsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGranterGrantsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGranterGrantsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGranterGrantsResponse proto.InternalMessageInfo + +func (m *QueryGranterGrantsResponse) GetGrants() []*GrantAuthorization { + if m != nil { + return m.Grants + } + return nil +} + +func (m *QueryGranterGrantsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +type QueryGranteeGrantsRequest struct { + Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGranteeGrantsRequest) Reset() { *m = QueryGranteeGrantsRequest{} } +func (m *QueryGranteeGrantsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGranteeGrantsRequest) ProtoMessage() {} +func (*QueryGranteeGrantsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{4} +} +func (m *QueryGranteeGrantsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGranteeGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGranteeGrantsRequest.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 *QueryGranteeGrantsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGranteeGrantsRequest.Merge(m, src) +} +func (m *QueryGranteeGrantsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGranteeGrantsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGranteeGrantsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGranteeGrantsRequest proto.InternalMessageInfo + +func (m *QueryGranteeGrantsRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *QueryGranteeGrantsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +type QueryGranteeGrantsResponse struct { + // grants is a list of grants granted to the grantee. + Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGranteeGrantsResponse) Reset() { *m = QueryGranteeGrantsResponse{} } +func (m *QueryGranteeGrantsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGranteeGrantsResponse) ProtoMessage() {} +func (*QueryGranteeGrantsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_376d714ffdeb1545, []int{5} +} +func (m *QueryGranteeGrantsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGranteeGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGranteeGrantsResponse.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 *QueryGranteeGrantsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGranteeGrantsResponse.Merge(m, src) +} +func (m *QueryGranteeGrantsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGranteeGrantsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGranteeGrantsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGranteeGrantsResponse proto.InternalMessageInfo + +func (m *QueryGranteeGrantsResponse) GetGrants() []*GrantAuthorization { + if m != nil { + return m.Grants + } + return nil +} + +func (m *QueryGranteeGrantsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGrantsRequest") + proto.RegisterType((*QueryGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGrantsResponse") + proto.RegisterType((*QueryGranterGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGranterGrantsRequest") + proto.RegisterType((*QueryGranterGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGranterGrantsResponse") + proto.RegisterType((*QueryGranteeGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGranteeGrantsRequest") + proto.RegisterType((*QueryGranteeGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGranteeGrantsResponse") +} + +func init() { proto.RegisterFile("cosmos/authz/v1beta1/query.proto", fileDescriptor_376d714ffdeb1545) } + +var fileDescriptor_376d714ffdeb1545 = []byte{ + // 529 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x41, 0x6f, 0xd3, 0x3e, + 0x18, 0xc6, 0xeb, 0xf6, 0xff, 0x2f, 0xc2, 0x83, 0x8b, 0xe1, 0x90, 0x85, 0x29, 0x8a, 0xaa, 0x09, + 0x0a, 0xd2, 0xec, 0xad, 0x93, 0x38, 0x22, 0xb6, 0xc3, 0x76, 0x85, 0x00, 0x17, 0x2e, 0x55, 0xba, + 0xbe, 0x72, 0x23, 0xda, 0x38, 0xb3, 0x1d, 0x44, 0x87, 0x76, 0x81, 0x2f, 0x80, 0xb4, 0x03, 0x1f, + 0x01, 0x89, 0x33, 0x1f, 0x82, 0xe3, 0x04, 0x17, 0x8e, 0xa8, 0x45, 0xf0, 0x35, 0x50, 0x6d, 0x97, + 0xae, 0x23, 0xdb, 0x02, 0xd3, 0x24, 0x4e, 0xad, 0xa3, 0xe7, 0x7d, 0xde, 0xdf, 0xfb, 0x38, 0x76, + 0x70, 0xb8, 0x23, 0xd4, 0x40, 0x28, 0x16, 0xe7, 0xba, 0xb7, 0xc7, 0x9e, 0xaf, 0x75, 0x40, 0xc7, + 0x6b, 0x6c, 0x37, 0x07, 0x39, 0xa4, 0x99, 0x14, 0x5a, 0x90, 0xeb, 0x56, 0x41, 0x8d, 0x82, 0x3a, + 0x85, 0xbf, 0xc4, 0x85, 0xe0, 0x7d, 0x60, 0x71, 0x96, 0xb0, 0x38, 0x4d, 0x85, 0x8e, 0x75, 0x22, + 0x52, 0x65, 0x6b, 0xfc, 0x3b, 0xce, 0xb5, 0x13, 0x2b, 0xb0, 0x66, 0xbf, 0xac, 0xb3, 0x98, 0x27, + 0xa9, 0x11, 0x3b, 0x6d, 0x31, 0x81, 0xed, 0x66, 0x15, 0x8b, 0x56, 0xd1, 0x36, 0x2b, 0xe6, 0x70, + 0xcc, 0xa2, 0xf1, 0x1d, 0x61, 0xf2, 0x70, 0xe2, 0xbf, 0x2d, 0xe3, 0x54, 0xab, 0x08, 0x76, 0x73, + 0x50, 0x9a, 0xb4, 0xf0, 0x25, 0x3e, 0x79, 0x00, 0xd2, 0x43, 0x21, 0x6a, 0x5e, 0xde, 0xf4, 0x3e, + 0x7d, 0x58, 0x99, 0x0e, 0xb2, 0xd1, 0xed, 0x4a, 0x50, 0xea, 0x91, 0x96, 0x49, 0xca, 0xa3, 0xa9, + 0x70, 0x56, 0x03, 0x5e, 0xb5, 0x5c, 0x0d, 0x90, 0x10, 0x5f, 0x19, 0x28, 0xde, 0xd6, 0xc3, 0x0c, + 0xda, 0xb9, 0xec, 0x7b, 0xb5, 0x49, 0x61, 0x84, 0x07, 0x8a, 0x3f, 0x1e, 0x66, 0xf0, 0x44, 0xf6, + 0xc9, 0x16, 0xc6, 0xb3, 0x89, 0xbd, 0xff, 0x42, 0xd4, 0x5c, 0x68, 0xdd, 0xa4, 0xce, 0x75, 0x12, + 0x0f, 0xb5, 0x59, 0xbb, 0xb9, 0xe9, 0x83, 0x98, 0x83, 0x9b, 0x22, 0x3a, 0x52, 0xd9, 0x38, 0x40, + 0xf8, 0xda, 0xdc, 0xa0, 0x2a, 0x13, 0xa9, 0x02, 0xb2, 0x8e, 0xeb, 0x06, 0x46, 0x79, 0x28, 0xac, + 0x35, 0x17, 0x5a, 0x37, 0x68, 0xd1, 0x76, 0x51, 0x53, 0x15, 0x39, 0x29, 0xd9, 0x9e, 0x83, 0xaa, + 0x1a, 0xa8, 0x5b, 0x67, 0x42, 0xd9, 0x8e, 0x73, 0x54, 0x6f, 0x11, 0x5e, 0x9c, 0x51, 0x81, 0x3c, + 0xff, 0x2e, 0x6c, 0x15, 0xa0, 0xfd, 0x4d, 0x5e, 0xef, 0x10, 0xf6, 0x8b, 0xc8, 0x5c, 0x6c, 0xf7, + 0x8f, 0xc5, 0xd6, 0x3c, 0x25, 0xb6, 0x8d, 0x5c, 0xf7, 0x84, 0x4c, 0xf6, 0x8c, 0xf1, 0x85, 0x67, + 0x08, 0x27, 0x64, 0x08, 0x65, 0x33, 0x84, 0x8b, 0xca, 0x10, 0xfe, 0xd9, 0x0c, 0x5b, 0x3f, 0x6a, + 0xf8, 0x7f, 0x43, 0x4a, 0x5e, 0x23, 0x5c, 0xb7, 0x9c, 0xe4, 0x04, 0x9e, 0xdf, 0xaf, 0x0b, 0xff, + 0x76, 0x09, 0xa5, 0xed, 0xda, 0x58, 0x7e, 0xf5, 0xf9, 0xdb, 0x41, 0x35, 0x20, 0x4b, 0xac, 0xf0, + 0xda, 0x72, 0x83, 0xbd, 0x47, 0xf8, 0xea, 0xdc, 0x8b, 0x47, 0xd8, 0x59, 0x2d, 0x8e, 0x1d, 0x1e, + 0x7f, 0xb5, 0x7c, 0x81, 0x43, 0xbb, 0x6b, 0xd0, 0x56, 0x09, 0x3d, 0x0d, 0x8d, 0xb9, 0x83, 0xc6, + 0x5e, 0xba, 0x3f, 0xfb, 0x47, 0x60, 0xa1, 0x34, 0x2c, 0xfc, 0x29, 0x2c, 0x9c, 0x03, 0x16, 0xa6, + 0xb0, 0xb0, 0xbf, 0x79, 0xef, 0xe3, 0x28, 0x40, 0x87, 0xa3, 0x00, 0x7d, 0x1d, 0x05, 0xe8, 0xcd, + 0x38, 0xa8, 0x1c, 0x8e, 0x83, 0xca, 0x97, 0x71, 0x50, 0x79, 0xba, 0xcc, 0x13, 0xdd, 0xcb, 0x3b, + 0x74, 0x47, 0x0c, 0xa6, 0x9e, 0xf6, 0x67, 0x45, 0x75, 0x9f, 0xb1, 0x17, 0xb6, 0x41, 0xa7, 0x6e, + 0xbe, 0x1b, 0xeb, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x8b, 0x47, 0x69, 0xf8, 0x06, 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 { + // Returns list of `Authorization`, granted to the grantee by the granter. + Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) + // GranterGrants returns list of `GrantAuthorization`, granted by granter. + // + // Since: cosmos-sdk 0.46 + GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error) + // GranteeGrants returns a list of `GrantAuthorization` by grantee. + // + // Since: cosmos-sdk 0.46 + GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) { + out := new(QueryGrantsResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/Grants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error) { + out := new(QueryGranterGrantsResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/GranterGrants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error) { + out := new(QueryGranteeGrantsResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/GranteeGrants", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Returns list of `Authorization`, granted to the grantee by the granter. + Grants(context.Context, *QueryGrantsRequest) (*QueryGrantsResponse, error) + // GranterGrants returns list of `GrantAuthorization`, granted by granter. + // + // Since: cosmos-sdk 0.46 + GranterGrants(context.Context, *QueryGranterGrantsRequest) (*QueryGranterGrantsResponse, error) + // GranteeGrants returns a list of `GrantAuthorization` by grantee. + // + // Since: cosmos-sdk 0.46 + GranteeGrants(context.Context, *QueryGranteeGrantsRequest) (*QueryGranteeGrantsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Grants(ctx context.Context, req *QueryGrantsRequest) (*QueryGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Grants not implemented") +} +func (*UnimplementedQueryServer) GranterGrants(ctx context.Context, req *QueryGranterGrantsRequest) (*QueryGranterGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GranterGrants not implemented") +} +func (*UnimplementedQueryServer) GranteeGrants(ctx context.Context, req *QueryGranteeGrantsRequest) (*QueryGranteeGrantsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GranteeGrants not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Grants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGrantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Grants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Query/Grants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Grants(ctx, req.(*QueryGrantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GranterGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGranterGrantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GranterGrants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Query/GranterGrants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GranterGrants(ctx, req.(*QueryGranterGrantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GranteeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGranteeGrantsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GranteeGrants(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Query/GranteeGrants", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GranteeGrants(ctx, req.(*QueryGranteeGrantsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.authz.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Grants", + Handler: _Query_Grants_Handler, + }, + { + MethodName: "GranterGrants", + Handler: _Query_GranterGrants_Handler, + }, + { + MethodName: "GranteeGrants", + Handler: _Query_GranteeGrants_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/authz/v1beta1/query.proto", +} + +func (m *QueryGrantsRequest) 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 *QueryGrantsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGrantsRequest) 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] = 0x22 + } + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGrantsResponse) 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 *QueryGrantsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGrantsResponse) 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.Grants) > 0 { + for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Grants[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 *QueryGranterGrantsRequest) 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 *QueryGranterGrantsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGranterGrantsRequest) 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.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGranterGrantsResponse) 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 *QueryGranterGrantsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGranterGrantsResponse) 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.Grants) > 0 { + for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Grants[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 *QueryGranteeGrantsRequest) 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 *QueryGranteeGrantsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGranteeGrantsRequest) 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.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGranteeGrantsResponse) 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 *QueryGranteeGrantsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGranteeGrantsResponse) 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.Grants) > 0 { + for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Grants[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 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 *QueryGrantsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGrantsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Grants) > 0 { + for _, e := range m.Grants { + 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 *QueryGranterGrantsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGranterGrantsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Grants) > 0 { + for _, e := range m.Grants { + 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 *QueryGranteeGrantsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGranteeGrantsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Grants) > 0 { + for _, e := range m.Grants { + 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 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 *QueryGrantsRequest) 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: QueryGrantsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", 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.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGrantsResponse) 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: QueryGrantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &Grant{}) + if err := m.Grants[len(m.Grants)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGranterGrantsRequest) 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: QueryGranterGrantsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGranterGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGranterGrantsResponse) 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: QueryGranterGrantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGranterGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &GrantAuthorization{}) + if err := m.Grants[len(m.Grants)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGranteeGrantsRequest) 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: QueryGranteeGrantsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGranteeGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGranteeGrantsResponse) 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: QueryGranteeGrantsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGranteeGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &GrantAuthorization{}) + if err := m.Grants[len(m.Grants)-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) || (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/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go new file mode 100644 index 000000000000..7259ffcf2dd7 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go @@ -0,0 +1,409 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/authz/v1beta1/query.proto + +/* +Package authz is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package authz + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Grants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Grants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGrantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Grants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Grants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Grants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGrantsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Grants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Grants(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GranterGrants_0 = &utilities.DoubleArray{Encoding: map[string]int{"granter": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_GranterGrants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGranterGrantsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranterGrants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GranterGrants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GranterGrants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGranterGrantsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranterGrants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GranterGrants(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GranteeGrants_0 = &utilities.DoubleArray{Encoding: map[string]int{"grantee": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_GranteeGrants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGranteeGrantsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranteeGrants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GranteeGrants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GranteeGrants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGranteeGrantsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranteeGrants_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GranteeGrants(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Grants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Grants_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Grants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GranterGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GranterGrants_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GranterGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GranteeGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GranteeGrants_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GranteeGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Grants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Grants_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Grants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GranterGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GranterGrants_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GranterGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GranteeGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GranteeGrants_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GranteeGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Grants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "authz", "v1beta1", "grants"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GranterGrants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "authz", "v1beta1", "grants", "granter"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GranteeGrants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "authz", "v1beta1", "grants", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Grants_0 = runtime.ForwardResponseMessage + + forward_Query_GranterGrants_0 = runtime.ForwardResponseMessage + + forward_Query_GranteeGrants_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go new file mode 100644 index 000000000000..369d9283e46c --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go @@ -0,0 +1,1489 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/authz/v1beta1/tx.proto + +package authz + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// MsgGrant is a request type for Grant method. It declares authorization to the grantee +// on behalf of the granter with the provided expiration time. +type MsgGrant struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + Grant Grant `protobuf:"bytes,3,opt,name=grant,proto3" json:"grant"` +} + +func (m *MsgGrant) Reset() { *m = MsgGrant{} } +func (m *MsgGrant) String() string { return proto.CompactTextString(m) } +func (*MsgGrant) ProtoMessage() {} +func (*MsgGrant) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{0} +} +func (m *MsgGrant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrant.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 *MsgGrant) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrant.Merge(m, src) +} +func (m *MsgGrant) XXX_Size() int { + return m.Size() +} +func (m *MsgGrant) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrant.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrant proto.InternalMessageInfo + +// MsgExecResponse defines the Msg/MsgExecResponse response type. +type MsgExecResponse struct { + Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +} + +func (m *MsgExecResponse) Reset() { *m = MsgExecResponse{} } +func (m *MsgExecResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecResponse) ProtoMessage() {} +func (*MsgExecResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{1} +} +func (m *MsgExecResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecResponse.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 *MsgExecResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecResponse.Merge(m, src) +} +func (m *MsgExecResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecResponse proto.InternalMessageInfo + +// MsgExec attempts to execute the provided messages using +// authorizations granted to the grantee. Each message should have only +// one signer corresponding to the granter of the authorization. +type MsgExec struct { + Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` + // Execute Msg. + // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) + // triple and validate it. + Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` +} + +func (m *MsgExec) Reset() { *m = MsgExec{} } +func (m *MsgExec) String() string { return proto.CompactTextString(m) } +func (*MsgExec) ProtoMessage() {} +func (*MsgExec) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{2} +} +func (m *MsgExec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExec.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 *MsgExec) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExec.Merge(m, src) +} +func (m *MsgExec) XXX_Size() int { + return m.Size() +} +func (m *MsgExec) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExec.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExec proto.InternalMessageInfo + +// MsgGrantResponse defines the Msg/MsgGrant response type. +type MsgGrantResponse struct { +} + +func (m *MsgGrantResponse) Reset() { *m = MsgGrantResponse{} } +func (m *MsgGrantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGrantResponse) ProtoMessage() {} +func (*MsgGrantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{3} +} +func (m *MsgGrantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrantResponse.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 *MsgGrantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantResponse.Merge(m, src) +} +func (m *MsgGrantResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGrantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrantResponse proto.InternalMessageInfo + +// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +// granter's account with that has been granted to the grantee. +type MsgRevoke struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` +} + +func (m *MsgRevoke) Reset() { *m = MsgRevoke{} } +func (m *MsgRevoke) String() string { return proto.CompactTextString(m) } +func (*MsgRevoke) ProtoMessage() {} +func (*MsgRevoke) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{4} +} +func (m *MsgRevoke) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevoke.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 *MsgRevoke) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevoke.Merge(m, src) +} +func (m *MsgRevoke) XXX_Size() int { + return m.Size() +} +func (m *MsgRevoke) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevoke.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevoke proto.InternalMessageInfo + +// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +type MsgRevokeResponse struct { +} + +func (m *MsgRevokeResponse) Reset() { *m = MsgRevokeResponse{} } +func (m *MsgRevokeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRevokeResponse) ProtoMessage() {} +func (*MsgRevokeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3ceddab7d8589ad1, []int{5} +} +func (m *MsgRevokeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevokeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevokeResponse.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 *MsgRevokeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevokeResponse.Merge(m, src) +} +func (m *MsgRevokeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRevokeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevokeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevokeResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgGrant)(nil), "cosmos.authz.v1beta1.MsgGrant") + proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") + proto.RegisterType((*MsgExec)(nil), "cosmos.authz.v1beta1.MsgExec") + proto.RegisterType((*MsgGrantResponse)(nil), "cosmos.authz.v1beta1.MsgGrantResponse") + proto.RegisterType((*MsgRevoke)(nil), "cosmos.authz.v1beta1.MsgRevoke") + proto.RegisterType((*MsgRevokeResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeResponse") +} + +func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } + +var fileDescriptor_3ceddab7d8589ad1 = []byte{ + // 555 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0x12, 0x4f, + 0x18, 0x66, 0x4a, 0x29, 0x3f, 0xa6, 0x4d, 0x7e, 0x76, 0x4b, 0xe2, 0x76, 0x9b, 0x6e, 0x37, 0x6b, + 0xab, 0x04, 0xc3, 0x4c, 0xc0, 0x1b, 0xf1, 0x52, 0x92, 0xc6, 0x8b, 0xc4, 0x64, 0xd5, 0x8b, 0x17, + 0xb2, 0xc0, 0x38, 0x25, 0x65, 0x77, 0xc8, 0xce, 0x42, 0xc0, 0x93, 0xf1, 0xe8, 0xc9, 0x8f, 0xa1, + 0x37, 0x0e, 0x3d, 0xfa, 0x01, 0x88, 0xa7, 0xc6, 0x83, 0xf1, 0x64, 0x14, 0x0e, 0x7c, 0x0c, 0xcd, + 0xce, 0x1f, 0xa4, 0x86, 0xd6, 0x9e, 0xbc, 0xc0, 0xbc, 0xef, 0xf3, 0xbc, 0xb3, 0xef, 0xf3, 0x3e, + 0x6f, 0x06, 0xee, 0xb7, 0x18, 0x0f, 0x18, 0xc7, 0x7e, 0x3f, 0x3e, 0x7d, 0x85, 0x07, 0xe5, 0x26, + 0x89, 0xfd, 0x32, 0x8e, 0x87, 0xa8, 0x17, 0xb1, 0x98, 0x19, 0x79, 0x09, 0x23, 0x01, 0x23, 0x05, + 0x5b, 0xbb, 0x32, 0xdb, 0x10, 0x1c, 0xac, 0x28, 0x22, 0xb0, 0xf2, 0x94, 0x51, 0x26, 0xf3, 0xc9, + 0x49, 0x65, 0x77, 0x29, 0x63, 0xb4, 0x4b, 0xb0, 0x88, 0x9a, 0xfd, 0x97, 0xd8, 0x0f, 0x47, 0x0a, + 0x72, 0x56, 0x36, 0x20, 0xbf, 0x27, 0x19, 0xb7, 0x15, 0x23, 0xe0, 0x14, 0x0f, 0xca, 0xc9, 0x9f, + 0x02, 0xb6, 0xfd, 0xa0, 0x13, 0x32, 0x2c, 0x7e, 0x65, 0xca, 0xfd, 0x02, 0xe0, 0x7f, 0x75, 0x4e, + 0x1f, 0x45, 0x7e, 0x18, 0x1b, 0x15, 0x98, 0xa5, 0xc9, 0x81, 0x44, 0x26, 0x70, 0x40, 0x21, 0x57, + 0x33, 0x3f, 0x9f, 0x97, 0xb4, 0xa2, 0xe3, 0x76, 0x3b, 0x22, 0x9c, 0x3f, 0x8d, 0xa3, 0x4e, 0x48, + 0x3d, 0x4d, 0xfc, 0x5d, 0x43, 0xcc, 0xb5, 0x9b, 0xd5, 0x10, 0xe3, 0x21, 0xcc, 0x88, 0xa3, 0x99, + 0x76, 0x40, 0x61, 0xb3, 0xb2, 0x87, 0x56, 0x0d, 0x0d, 0x89, 0x9e, 0x6a, 0xb9, 0xc9, 0xb7, 0x83, + 0xd4, 0xfb, 0xf9, 0xb8, 0x08, 0x3c, 0x59, 0x54, 0x3d, 0x7c, 0x33, 0x1f, 0x17, 0xf5, 0xf7, 0xdf, + 0xce, 0xc7, 0xc5, 0x1d, 0x59, 0x5e, 0xe2, 0xed, 0x33, 0xac, 0xb5, 0xb8, 0xf7, 0xe1, 0xff, 0x75, + 0x4e, 0x4f, 0x86, 0xa4, 0xe5, 0x11, 0xde, 0x63, 0x21, 0x27, 0x86, 0x09, 0xb3, 0x11, 0xe1, 0xfd, + 0x6e, 0xcc, 0x4d, 0xe0, 0xa4, 0x0b, 0x5b, 0x9e, 0x0e, 0xdd, 0x0f, 0x00, 0x66, 0x15, 0x7b, 0x59, + 0x10, 0xb8, 0xa9, 0xa0, 0x13, 0xb8, 0x1e, 0x70, 0xca, 0xcd, 0x35, 0x27, 0x5d, 0xd8, 0xac, 0xe4, + 0x91, 0x74, 0x0f, 0x69, 0xf7, 0xd0, 0x71, 0x38, 0xaa, 0xed, 0x7d, 0x3a, 0x2f, 0x29, 0x67, 0x50, + 0xd3, 0xe7, 0x64, 0xa1, 0xb3, 0xce, 0xa9, 0x27, 0xca, 0xab, 0x77, 0x96, 0x94, 0x91, 0x44, 0x99, + 0x71, 0x59, 0x59, 0xd2, 0x9f, 0x6b, 0xc0, 0x5b, 0x5a, 0xa4, 0x56, 0xe6, 0x7e, 0x04, 0x30, 0x97, + 0x5c, 0x43, 0x06, 0xec, 0x8c, 0xfc, 0x33, 0x1b, 0x1d, 0xb8, 0x15, 0x70, 0xda, 0x88, 0x47, 0x3d, + 0xd2, 0xe8, 0x47, 0x5d, 0xe1, 0x66, 0xce, 0x83, 0x01, 0xa7, 0xcf, 0x46, 0x3d, 0xf2, 0x3c, 0xea, + 0x56, 0x8f, 0xfe, 0xb4, 0x2a, 0x7f, 0x59, 0x90, 0x6c, 0xd8, 0xdd, 0x81, 0xdb, 0x8b, 0x40, 0x6b, + 0xaa, 0xfc, 0x04, 0x30, 0x5d, 0xe7, 0xd4, 0x78, 0x02, 0x33, 0x72, 0x3b, 0xed, 0xd5, 0x6b, 0xa2, + 0x87, 0x61, 0xdd, 0xbd, 0x1e, 0x5f, 0xac, 0xc1, 0x63, 0xb8, 0x2e, 0x8c, 0xde, 0xbf, 0x92, 0x9f, + 0xc0, 0xd6, 0xd1, 0xb5, 0xf0, 0xe2, 0x36, 0x0f, 0x6e, 0xa8, 0xb1, 0x1f, 0x5c, 0x59, 0x20, 0x09, + 0xd6, 0xbd, 0xbf, 0x10, 0xf4, 0x9d, 0x56, 0xe6, 0x75, 0xb2, 0xef, 0xb5, 0xda, 0xe4, 0x87, 0x9d, + 0x9a, 0x4c, 0x6d, 0x70, 0x31, 0xb5, 0xc1, 0xf7, 0xa9, 0x0d, 0xde, 0xcd, 0xec, 0xd4, 0xc5, 0xcc, + 0x4e, 0x7d, 0x9d, 0xd9, 0xa9, 0x17, 0x87, 0xb4, 0x13, 0x9f, 0xf6, 0x9b, 0xa8, 0xc5, 0x02, 0xf5, + 0xa2, 0xe0, 0xa5, 0xe1, 0x0e, 0xe5, 0x8b, 0xd0, 0xdc, 0x10, 0x3b, 0xf8, 0xe0, 0x57, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xbb, 0x9d, 0x9d, 0x9e, 0xb7, 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 { + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error) + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error) { + out := new(MsgGrantResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Grant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) { + out := new(MsgExecResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Exec", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) { + out := new(MsgRevokeResponse) + err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Revoke", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Grant grants the provided authorization to the grantee on the granter's + // account with the provided expiration time. If there is already a grant + // for the given (granter, grantee, Authorization) triple, then the grant + // will be overwritten. + Grant(context.Context, *MsgGrant) (*MsgGrantResponse, error) + // Exec attempts to execute the provided messages using + // authorizations granted to the grantee. Each message should have only + // one signer corresponding to the granter of the authorization. + Exec(context.Context, *MsgExec) (*MsgExecResponse, error) + // Revoke revokes any authorization corresponding to the provided method name on the + // granter's account that has been granted to the grantee. + Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Grant(ctx context.Context, req *MsgGrant) (*MsgGrantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Grant not implemented") +} +func (*UnimplementedMsgServer) Exec(ctx context.Context, req *MsgExec) (*MsgExecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") +} +func (*UnimplementedMsgServer) Revoke(ctx context.Context, req *MsgRevoke) (*MsgRevokeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Grant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGrant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Grant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Msg/Grant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Grant(ctx, req.(*MsgGrant)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExec) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Exec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Msg/Exec", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Exec(ctx, req.(*MsgExec)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRevoke) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Revoke(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.authz.v1beta1.Msg/Revoke", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Revoke(ctx, req.(*MsgRevoke)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.authz.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Grant", + Handler: _Msg_Grant_Handler, + }, + { + MethodName: "Exec", + Handler: _Msg_Exec_Handler, + }, + { + MethodName: "Revoke", + Handler: _Msg_Revoke_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/authz/v1beta1/tx.proto", +} + +func (m *MsgGrant) 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 *MsgGrant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Grant.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecResponse) 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 *MsgExecResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Results[iNdEx]) + copy(dAtA[i:], m.Results[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgExec) 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 *MsgExec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGrantResponse) 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 *MsgGrantResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRevoke) 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 *MsgRevoke) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MsgTypeUrl) > 0 { + i -= len(m.MsgTypeUrl) + copy(dAtA[i:], m.MsgTypeUrl) + i = encodeVarintTx(dAtA, i, uint64(len(m.MsgTypeUrl))) + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRevokeResponse) 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 *MsgRevokeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevokeResponse) 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 *MsgGrant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Grant.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgExecResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Results) > 0 { + for _, b := range m.Results { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgExec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgGrantResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRevoke) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.MsgTypeUrl) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRevokeResponse) 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 *MsgGrant) 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: MsgGrant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grant", 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.Grant.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 *MsgExecResponse) 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: MsgExecResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Results = append(m.Results, make([]byte, postIndex-iNdEx)) + copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) + 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 *MsgExec) 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: MsgExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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.Msgs = append(m.Msgs, &types.Any{}) + if err := m.Msgs[len(m.Msgs)-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 *MsgGrantResponse) 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: MsgGrantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrantResponse: 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 *MsgRevoke) 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: MsgRevoke: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevoke: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", 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.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) + 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 *MsgRevokeResponse) 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: MsgRevokeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevokeResponse: 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") +) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go new file mode 100644 index 000000000000..17131972c91b --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go @@ -0,0 +1,405 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/bank/v1beta1/authz.proto + +package types + +import ( + 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/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// SendAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account. +// +// Since: cosmos-sdk 0.43 +type SendAuthorization struct { + SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` + // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + // granter. If omitted, any recipient is allowed. + // + // Since: cosmos-sdk 0.47 + AllowList []string `protobuf:"bytes,2,rep,name=allow_list,json=allowList,proto3" json:"allow_list,omitempty"` +} + +func (m *SendAuthorization) Reset() { *m = SendAuthorization{} } +func (m *SendAuthorization) String() string { return proto.CompactTextString(m) } +func (*SendAuthorization) ProtoMessage() {} +func (*SendAuthorization) Descriptor() ([]byte, []int) { + return fileDescriptor_a4d2a37888ea779f, []int{0} +} +func (m *SendAuthorization) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SendAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SendAuthorization.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 *SendAuthorization) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendAuthorization.Merge(m, src) +} +func (m *SendAuthorization) XXX_Size() int { + return m.Size() +} +func (m *SendAuthorization) XXX_DiscardUnknown() { + xxx_messageInfo_SendAuthorization.DiscardUnknown(m) +} + +var xxx_messageInfo_SendAuthorization proto.InternalMessageInfo + +func (m *SendAuthorization) GetSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.SpendLimit + } + return nil +} + +func (m *SendAuthorization) GetAllowList() []string { + if m != nil { + return m.AllowList + } + return nil +} + +func init() { + proto.RegisterType((*SendAuthorization)(nil), "cosmos.bank.v1beta1.SendAuthorization") +} + +func init() { proto.RegisterFile("cosmos/bank/v1beta1/authz.proto", fileDescriptor_a4d2a37888ea779f) } + +var fileDescriptor_a4d2a37888ea779f = []byte{ + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcc, 0xcb, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, + 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, + 0x03, 0x29, 0xd0, 0x83, 0x2a, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, + 0x75, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0x84, 0xe8, + 0x8e, 0x87, 0x48, 0x40, 0x8d, 0x82, 0x48, 0xc9, 0xc1, 0x6d, 0x2e, 0x4e, 0x85, 0xdb, 0x9c, 0x9c, + 0x9f, 0x99, 0x07, 0x91, 0x57, 0xea, 0x60, 0xe2, 0x12, 0x0c, 0x4e, 0xcd, 0x4b, 0x71, 0x2c, 0x2d, + 0xc9, 0xc8, 0x2f, 0xca, 0xac, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x13, 0x2a, 0xe4, 0xe2, 0x2e, 0x2e, + 0x48, 0xcd, 0x4b, 0x89, 0xcf, 0xc9, 0xcc, 0xcd, 0x2c, 0x91, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, + 0x92, 0xd4, 0x83, 0x3b, 0xb2, 0x38, 0x15, 0xe6, 0x48, 0x3d, 0xe7, 0xfc, 0xcc, 0x3c, 0x27, 0xd3, + 0x13, 0xf7, 0xe4, 0x19, 0x56, 0xdd, 0x97, 0xd7, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, + 0xce, 0xcf, 0x85, 0x3a, 0x03, 0x4a, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x16, + 0x83, 0x35, 0x14, 0xaf, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x88, 0x0b, 0x6c, 0x89, 0x0f, 0xc8, 0x0e, + 0x21, 0x73, 0x2e, 0xae, 0xc4, 0x9c, 0x9c, 0xfc, 0xf2, 0xf8, 0x9c, 0xcc, 0xe2, 0x12, 0x09, 0x26, + 0x05, 0x66, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x96, 0x3a, 0xa6, 0xa4, 0x14, + 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x71, 0x82, 0xd5, 0xfa, 0x64, 0x16, + 0x97, 0x58, 0xb9, 0x9f, 0xda, 0xa2, 0xab, 0x04, 0x55, 0x04, 0x09, 0x52, 0x98, 0xd3, 0x50, 0xfc, + 0xd4, 0xf5, 0x7c, 0x83, 0x96, 0x0c, 0x92, 0x63, 0x30, 0x3c, 0xed, 0xe4, 0x7c, 0xe2, 0x91, 0x1c, + 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, + 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0x78, 0xbd, 0x55, 0x01, 0x89, 0x56, 0xb0, 0xef, + 0x92, 0xd8, 0xc0, 0xc1, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x78, 0xc2, 0x7d, 0xd9, 0xf2, + 0x01, 0x00, 0x00, +} + +func (m *SendAuthorization) 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 *SendAuthorization) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SendAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllowList) > 0 { + for iNdEx := len(m.AllowList) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowList[iNdEx]) + copy(dAtA[i:], m.AllowList[iNdEx]) + i = encodeVarintAuthz(dAtA, i, uint64(len(m.AllowList[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.SpendLimit) > 0 { + for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAuthz(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { + offset -= sovAuthz(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SendAuthorization) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SpendLimit) > 0 { + for _, e := range m.SpendLimit { + l = e.Size() + n += 1 + l + sovAuthz(uint64(l)) + } + } + if len(m.AllowList) > 0 { + for _, s := range m.AllowList { + l = len(s) + n += 1 + l + sovAuthz(uint64(l)) + } + } + return n +} + +func sovAuthz(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAuthz(x uint64) (n int) { + return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SendAuthorization) 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 ErrIntOverflowAuthz + } + 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: SendAuthorization: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SendAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAuthz + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendLimit = append(m.SpendLimit, types.Coin{}) + if err := m.SpendLimit[len(m.SpendLimit)-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 AllowList", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAuthz + } + 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 ErrInvalidLengthAuthz + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAuthz + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowList = append(m.AllowList, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAuthz(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAuthz + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAuthz(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, ErrIntOverflowAuthz + } + 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, ErrIntOverflowAuthz + } + 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, ErrIntOverflowAuthz + } + 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, ErrInvalidLengthAuthz + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAuthz + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAuthz + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go new file mode 100644 index 000000000000..fe19f342ee5c --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go @@ -0,0 +1,2122 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/bank/v1beta1/bank.proto + +package types + +import ( + 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" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the bank module. +type Params struct { + // Deprecated: Use of SendEnabled in params is deprecated. + // For genesis, use the newly added send_enabled field in the genesis object. + // Storage, lookup, and manipulation of this information is now in the keeper. + // + // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. + DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{0} +} +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 + +// Deprecated: Do not use. +func (m *Params) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +func (m *Params) GetDefaultSendEnabled() bool { + if m != nil { + return m.DefaultSendEnabled + } + return false +} + +// SendEnabled maps coin denom to a send_enabled status (whether a denom is +// sendable). +type SendEnabled struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (m *SendEnabled) Reset() { *m = SendEnabled{} } +func (*SendEnabled) ProtoMessage() {} +func (*SendEnabled) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{1} +} +func (m *SendEnabled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SendEnabled.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 *SendEnabled) XXX_Merge(src proto.Message) { + xxx_messageInfo_SendEnabled.Merge(m, src) +} +func (m *SendEnabled) XXX_Size() int { + return m.Size() +} +func (m *SendEnabled) XXX_DiscardUnknown() { + xxx_messageInfo_SendEnabled.DiscardUnknown(m) +} + +var xxx_messageInfo_SendEnabled proto.InternalMessageInfo + +func (m *SendEnabled) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *SendEnabled) GetEnabled() bool { + if m != nil { + return m.Enabled + } + return false +} + +// Input models transaction input. +type Input struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *Input) Reset() { *m = Input{} } +func (m *Input) String() string { return proto.CompactTextString(m) } +func (*Input) ProtoMessage() {} +func (*Input) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{2} +} +func (m *Input) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Input.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 *Input) XXX_Merge(src proto.Message) { + xxx_messageInfo_Input.Merge(m, src) +} +func (m *Input) XXX_Size() int { + return m.Size() +} +func (m *Input) XXX_DiscardUnknown() { + xxx_messageInfo_Input.DiscardUnknown(m) +} + +var xxx_messageInfo_Input proto.InternalMessageInfo + +// Output models transaction outputs. +type Output struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *Output) Reset() { *m = Output{} } +func (m *Output) String() string { return proto.CompactTextString(m) } +func (*Output) ProtoMessage() {} +func (*Output) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{3} +} +func (m *Output) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Output.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 *Output) XXX_Merge(src proto.Message) { + xxx_messageInfo_Output.Merge(m, src) +} +func (m *Output) XXX_Size() int { + return m.Size() +} +func (m *Output) XXX_DiscardUnknown() { + xxx_messageInfo_Output.DiscardUnknown(m) +} + +var xxx_messageInfo_Output proto.InternalMessageInfo + +// Supply represents a struct that passively keeps track of the total supply +// amounts in the network. +// This message is deprecated now that supply is indexed by denom. +// +// Deprecated: Do not use. +type Supply struct { + Total github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total"` +} + +func (m *Supply) Reset() { *m = Supply{} } +func (m *Supply) String() string { return proto.CompactTextString(m) } +func (*Supply) ProtoMessage() {} +func (*Supply) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{4} +} +func (m *Supply) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Supply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Supply.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 *Supply) XXX_Merge(src proto.Message) { + xxx_messageInfo_Supply.Merge(m, src) +} +func (m *Supply) XXX_Size() int { + return m.Size() +} +func (m *Supply) XXX_DiscardUnknown() { + xxx_messageInfo_Supply.DiscardUnknown(m) +} + +var xxx_messageInfo_Supply proto.InternalMessageInfo + +// DenomUnit represents a struct that describes a given +// denomination unit of the basic token. +type DenomUnit struct { + // denom represents the string name of the given denom unit (e.g uatom). + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // exponent represents power of 10 exponent that one must + // raise the base_denom to in order to equal the given DenomUnit's denom + // 1 denom = 10^exponent base_denom + // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + // exponent = 6, thus: 1 atom = 10^6 uatom). + Exponent uint32 `protobuf:"varint,2,opt,name=exponent,proto3" json:"exponent,omitempty"` + // aliases is a list of string aliases for the given denom + Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` +} + +func (m *DenomUnit) Reset() { *m = DenomUnit{} } +func (m *DenomUnit) String() string { return proto.CompactTextString(m) } +func (*DenomUnit) ProtoMessage() {} +func (*DenomUnit) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{5} +} +func (m *DenomUnit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomUnit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomUnit.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 *DenomUnit) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomUnit.Merge(m, src) +} +func (m *DenomUnit) XXX_Size() int { + return m.Size() +} +func (m *DenomUnit) XXX_DiscardUnknown() { + xxx_messageInfo_DenomUnit.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomUnit proto.InternalMessageInfo + +func (m *DenomUnit) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *DenomUnit) GetExponent() uint32 { + if m != nil { + return m.Exponent + } + return 0 +} + +func (m *DenomUnit) GetAliases() []string { + if m != nil { + return m.Aliases + } + return nil +} + +// Metadata represents a struct that describes +// a basic token. +type Metadata struct { + Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` + // denom_units represents the list of DenomUnit's for a given coin + DenomUnits []*DenomUnit `protobuf:"bytes,2,rep,name=denom_units,json=denomUnits,proto3" json:"denom_units,omitempty"` + // base represents the base denom (should be the DenomUnit with exponent = 0). + Base string `protobuf:"bytes,3,opt,name=base,proto3" json:"base,omitempty"` + // display indicates the suggested denom that should be + // displayed in clients. + Display string `protobuf:"bytes,4,opt,name=display,proto3" json:"display,omitempty"` + // name defines the name of the token (eg: Cosmos Atom) + // + // Since: cosmos-sdk 0.43 + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + // be the same as the display. + // + // Since: cosmos-sdk 0.43 + Symbol string `protobuf:"bytes,6,opt,name=symbol,proto3" json:"symbol,omitempty"` + // URI to a document (on or off-chain) that contains additional information. Optional. + // + // Since: cosmos-sdk 0.46 + URI string `protobuf:"bytes,7,opt,name=uri,proto3" json:"uri,omitempty"` + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + // + // Since: cosmos-sdk 0.46 + URIHash string `protobuf:"bytes,8,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_dd052eee12edf988, []int{6} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.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 *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Metadata) GetDenomUnits() []*DenomUnit { + if m != nil { + return m.DenomUnits + } + return nil +} + +func (m *Metadata) GetBase() string { + if m != nil { + return m.Base + } + return "" +} + +func (m *Metadata) GetDisplay() string { + if m != nil { + return m.Display + } + return "" +} + +func (m *Metadata) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Metadata) GetSymbol() string { + if m != nil { + return m.Symbol + } + return "" +} + +func (m *Metadata) GetURI() string { + if m != nil { + return m.URI + } + return "" +} + +func (m *Metadata) GetURIHash() string { + if m != nil { + return m.URIHash + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "cosmos.bank.v1beta1.Params") + proto.RegisterType((*SendEnabled)(nil), "cosmos.bank.v1beta1.SendEnabled") + proto.RegisterType((*Input)(nil), "cosmos.bank.v1beta1.Input") + proto.RegisterType((*Output)(nil), "cosmos.bank.v1beta1.Output") + proto.RegisterType((*Supply)(nil), "cosmos.bank.v1beta1.Supply") + proto.RegisterType((*DenomUnit)(nil), "cosmos.bank.v1beta1.DenomUnit") + proto.RegisterType((*Metadata)(nil), "cosmos.bank.v1beta1.Metadata") +} + +func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } + +var fileDescriptor_dd052eee12edf988 = []byte{ + // 670 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xbf, 0x6f, 0x13, 0x3f, + 0x14, 0x8f, 0x93, 0xe6, 0x47, 0x9d, 0xef, 0x77, 0xc0, 0x44, 0xe0, 0x16, 0xe9, 0x12, 0x32, 0xa0, + 0xb4, 0x52, 0x13, 0x5a, 0xc4, 0x92, 0x05, 0x91, 0x82, 0x4a, 0x06, 0x04, 0xba, 0xaa, 0x42, 0x62, + 0x89, 0x9c, 0x9c, 0x9b, 0x58, 0xbd, 0xb3, 0x4f, 0x67, 0x5f, 0xd5, 0xac, 0x4c, 0xa8, 0x13, 0x23, + 0x12, 0x4b, 0x27, 0x84, 0x18, 0x50, 0x87, 0x2e, 0xfc, 0x07, 0x15, 0x53, 0xc5, 0xc4, 0x54, 0x50, + 0x3a, 0x94, 0x3f, 0x03, 0xd9, 0xbe, 0x4b, 0x53, 0xa9, 0xb0, 0x21, 0xb1, 0x24, 0xef, 0xbd, 0xcf, + 0xf3, 0xfb, 0x7c, 0xfc, 0xde, 0xf3, 0x41, 0x67, 0x20, 0x64, 0x20, 0x64, 0xab, 0x4f, 0xf8, 0x4e, + 0x6b, 0x77, 0xb5, 0x4f, 0x15, 0x59, 0x35, 0x4e, 0x33, 0x8c, 0x84, 0x12, 0xe8, 0xba, 0xc5, 0x9b, + 0x26, 0x94, 0xe0, 0x8b, 0x95, 0xa1, 0x18, 0x0a, 0x83, 0xb7, 0xb4, 0x65, 0x53, 0x17, 0x17, 0x6c, + 0x6a, 0xcf, 0x02, 0xc9, 0x39, 0x0b, 0x5d, 0xb0, 0x48, 0x3a, 0x65, 0x19, 0x08, 0xc6, 0x13, 0xfc, + 0x66, 0x82, 0x07, 0x72, 0xd8, 0xda, 0x5d, 0xd5, 0x7f, 0x09, 0x70, 0x8d, 0x04, 0x8c, 0x8b, 0x96, + 0xf9, 0xb5, 0xa1, 0xfa, 0x7b, 0x00, 0x0b, 0xcf, 0x49, 0x44, 0x02, 0x89, 0x36, 0xe0, 0x7f, 0x92, + 0x72, 0xaf, 0x47, 0x39, 0xe9, 0xfb, 0xd4, 0xc3, 0xa0, 0x96, 0x6b, 0x94, 0xd7, 0x6a, 0xcd, 0x2b, + 0x34, 0x37, 0x37, 0x29, 0xf7, 0x1e, 0xdb, 0xbc, 0x4e, 0x16, 0x03, 0xb7, 0x2c, 0x2f, 0x02, 0xe8, + 0x2e, 0xac, 0x78, 0x74, 0x9b, 0xc4, 0xbe, 0xea, 0x5d, 0x2a, 0x98, 0xad, 0x81, 0x46, 0xc9, 0x45, + 0x09, 0x36, 0x53, 0xa2, 0x7d, 0xfb, 0xed, 0x41, 0x35, 0xb3, 0x7f, 0x7e, 0xb8, 0x8c, 0x2d, 0xd9, + 0x8a, 0xf4, 0x76, 0x5a, 0x7b, 0xb6, 0x8d, 0x56, 0x5d, 0x7d, 0x03, 0x96, 0x67, 0x4e, 0xa0, 0x0a, + 0xcc, 0x7b, 0x94, 0x8b, 0x00, 0x83, 0x1a, 0x68, 0xcc, 0xbb, 0xd6, 0x41, 0x18, 0x16, 0x2f, 0x93, + 0xa5, 0x6e, 0xbb, 0xa4, 0x19, 0x7e, 0x1e, 0x54, 0x41, 0xfd, 0x33, 0x80, 0xf9, 0x2e, 0x0f, 0x63, + 0x85, 0xd6, 0x60, 0x91, 0x78, 0x5e, 0x44, 0xa5, 0xb4, 0x55, 0x3a, 0xf8, 0xeb, 0xd1, 0x4a, 0x25, + 0xb9, 0xee, 0x43, 0x8b, 0x6c, 0xaa, 0x88, 0xf1, 0xa1, 0x9b, 0x26, 0xa2, 0x6d, 0x98, 0xd7, 0x9d, + 0x96, 0x38, 0x6b, 0xba, 0xb3, 0x70, 0xd1, 0x1d, 0x49, 0xa7, 0xdd, 0x59, 0x17, 0x8c, 0x77, 0xee, + 0x1f, 0x9f, 0x56, 0x33, 0x1f, 0xbf, 0x57, 0x1b, 0x43, 0xa6, 0x46, 0x71, 0xbf, 0x39, 0x10, 0x41, + 0x32, 0xc6, 0xd6, 0xcc, 0x25, 0xd5, 0x38, 0xa4, 0xd2, 0x1c, 0x90, 0x1f, 0xce, 0x0f, 0x97, 0x81, + 0x6b, 0xcb, 0xb7, 0x2b, 0xaf, 0xad, 0xde, 0xcc, 0xab, 0xf3, 0xc3, 0xe5, 0x94, 0xbd, 0xfe, 0x09, + 0xc0, 0xc2, 0xb3, 0x58, 0xfd, 0xeb, 0xe2, 0x4b, 0xa9, 0xf8, 0xfa, 0x3b, 0x00, 0x0b, 0x9b, 0x71, + 0x18, 0xfa, 0x63, 0x4d, 0xae, 0x84, 0x22, 0x7e, 0xb2, 0x57, 0x7f, 0x81, 0xdc, 0x94, 0x6f, 0x2f, + 0x25, 0xe4, 0xe0, 0xcb, 0xd1, 0xca, 0xad, 0x2b, 0x77, 0xd7, 0xe8, 0xe9, 0x62, 0x50, 0x7f, 0x01, + 0xe7, 0x1f, 0xe9, 0xbd, 0xd9, 0xe2, 0x4c, 0xfd, 0x66, 0xa3, 0x16, 0x61, 0x89, 0xee, 0x85, 0x82, + 0x53, 0xae, 0xcc, 0x4a, 0xfd, 0xef, 0x4e, 0x7d, 0xbd, 0x6d, 0xc4, 0x67, 0x44, 0x52, 0x89, 0x73, + 0xb5, 0x5c, 0x63, 0xde, 0x4d, 0xdd, 0xfa, 0x7e, 0x16, 0x96, 0x9e, 0x52, 0x45, 0x3c, 0xa2, 0x08, + 0xaa, 0xc1, 0xb2, 0x47, 0xe5, 0x20, 0x62, 0xa1, 0x62, 0x82, 0x27, 0xe5, 0x67, 0x43, 0xe8, 0x81, + 0xce, 0xe0, 0x22, 0xe8, 0xc5, 0x9c, 0xa9, 0x74, 0x3a, 0xce, 0x95, 0x0f, 0x6f, 0xaa, 0xd7, 0x85, + 0x5e, 0x6a, 0x4a, 0x84, 0xe0, 0x9c, 0x6e, 0x23, 0xce, 0x99, 0xda, 0xc6, 0xd6, 0xea, 0x3c, 0x26, + 0x43, 0x9f, 0x8c, 0xf1, 0x9c, 0x09, 0xa7, 0xae, 0xce, 0xe6, 0x24, 0xa0, 0x38, 0x6f, 0xb3, 0xb5, + 0x8d, 0x6e, 0xc0, 0x82, 0x1c, 0x07, 0x7d, 0xe1, 0xe3, 0x82, 0x89, 0x26, 0x1e, 0x5a, 0x80, 0xb9, + 0x38, 0x62, 0xb8, 0x68, 0x56, 0xac, 0x38, 0x39, 0xad, 0xe6, 0xb6, 0xdc, 0xae, 0xab, 0x63, 0xe8, + 0x0e, 0x2c, 0xc5, 0x11, 0xeb, 0x8d, 0x88, 0x1c, 0xe1, 0x92, 0xc1, 0xcb, 0x93, 0xd3, 0x6a, 0x71, + 0xcb, 0xed, 0x3e, 0x21, 0x72, 0xe4, 0x16, 0xe3, 0x88, 0x69, 0xa3, 0xb3, 0x7e, 0x3c, 0x71, 0xc0, + 0xc9, 0xc4, 0x01, 0x3f, 0x26, 0x0e, 0x78, 0x73, 0xe6, 0x64, 0x4e, 0xce, 0x9c, 0xcc, 0xb7, 0x33, + 0x27, 0xf3, 0x72, 0xe9, 0x8f, 0x03, 0x4e, 0xde, 0xbf, 0x99, 0x73, 0xbf, 0x60, 0x3e, 0x57, 0xf7, + 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf6, 0x7e, 0x4e, 0x62, 0x05, 0x00, 0x00, +} + +func (this *SendEnabled) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SendEnabled) + if !ok { + that2, ok := that.(SendEnabled) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Denom != that1.Denom { + return false + } + if this.Enabled != that1.Enabled { + return false + } + return true +} +func (this *Supply) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Supply) + if !ok { + that2, ok := that.(Supply) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Total) != len(that1.Total) { + return false + } + for i := range this.Total { + if !this.Total[i].Equal(&that1.Total[i]) { + return false + } + } + return true +} +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.DefaultSendEnabled { + i-- + if m.DefaultSendEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *SendEnabled) 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 *SendEnabled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SendEnabled) 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.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintBank(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Input) 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 *Input) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Input) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintBank(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Output) 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 *Output) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintBank(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Supply) 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 *Supply) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DenomUnit) 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 *DenomUnit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomUnit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Aliases) > 0 { + for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Aliases[iNdEx]) + copy(dAtA[i:], m.Aliases[iNdEx]) + i = encodeVarintBank(dAtA, i, uint64(len(m.Aliases[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if m.Exponent != 0 { + i = encodeVarintBank(dAtA, i, uint64(m.Exponent)) + i-- + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintBank(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Metadata) 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 *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.URIHash) > 0 { + i -= len(m.URIHash) + copy(dAtA[i:], m.URIHash) + i = encodeVarintBank(dAtA, i, uint64(len(m.URIHash))) + i-- + dAtA[i] = 0x42 + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintBank(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0x3a + } + if len(m.Symbol) > 0 { + i -= len(m.Symbol) + copy(dAtA[i:], m.Symbol) + i = encodeVarintBank(dAtA, i, uint64(len(m.Symbol))) + i-- + dAtA[i] = 0x32 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintBank(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x2a + } + if len(m.Display) > 0 { + i -= len(m.Display) + copy(dAtA[i:], m.Display) + i = encodeVarintBank(dAtA, i, uint64(len(m.Display))) + i-- + dAtA[i] = 0x22 + } + if len(m.Base) > 0 { + i -= len(m.Base) + copy(dAtA[i:], m.Base) + i = encodeVarintBank(dAtA, i, uint64(len(m.Base))) + i-- + dAtA[i] = 0x1a + } + if len(m.DenomUnits) > 0 { + for iNdEx := len(m.DenomUnits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBank(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintBank(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintBank(dAtA []byte, offset int, v uint64) int { + offset -= sovBank(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } + if m.DefaultSendEnabled { + n += 2 + } + return n +} + +func (m *SendEnabled) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + if m.Enabled { + n += 2 + } + return n +} + +func (m *Input) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } + return n +} + +func (m *Output) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } + return n +} + +func (m *Supply) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } + return n +} + +func (m *DenomUnit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + if m.Exponent != 0 { + n += 1 + sovBank(uint64(m.Exponent)) + } + if len(m.Aliases) > 0 { + for _, s := range m.Aliases { + l = len(s) + n += 1 + l + sovBank(uint64(l)) + } + } + return n +} + +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Description) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + if len(m.DenomUnits) > 0 { + for _, e := range m.DenomUnits { + l = e.Size() + n += 1 + l + sovBank(uint64(l)) + } + } + l = len(m.Base) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.Display) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.Symbol) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.URI) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.URIHash) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + return n +} + +func sovBank(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBank(x uint64) (n int) { + return sovBank(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowBank + } + 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 SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DefaultSendEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SendEnabled) 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 ErrIntOverflowBank + } + 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: SendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = 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 ErrIntOverflowBank + } + 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 := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Input) 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 ErrIntOverflowBank + } + 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: Input: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Input: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Output) 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 ErrIntOverflowBank + } + 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: Output: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Output: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Supply) 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 ErrIntOverflowBank + } + 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: Supply: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Supply: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Total = append(m.Total, types.Coin{}) + if err := m.Total[len(m.Total)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomUnit) 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 ErrIntOverflowBank + } + 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: DenomUnit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomUnit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) + } + m.Exponent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Exponent |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Metadata) 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 ErrIntOverflowBank + } + 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: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomUnits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomUnits = append(m.DenomUnits, &DenomUnit{}) + if err := m.DenomUnits[len(m.DenomUnits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Base = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Display", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Display = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Symbol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URIHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + 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 ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URIHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBank(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBank + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBank(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, ErrIntOverflowBank + } + 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, ErrIntOverflowBank + } + 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, ErrIntOverflowBank + } + 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, ErrInvalidLengthBank + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBank + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBank + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBank = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBank = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBank = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go new file mode 100644 index 000000000000..af5383cc7606 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go @@ -0,0 +1,818 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/bank/v1beta1/genesis.proto + +package types + +import ( + 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/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the bank module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // balances is an array containing the balances of all the accounts. + Balances []Balance `protobuf:"bytes,2,rep,name=balances,proto3" json:"balances"` + // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` + // denom_metadata defines the metadata of the different coins. + DenomMetadata []Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata"` + // send_enabled defines the denoms where send is enabled or disabled. + // + // Since: cosmos-sdk 0.47 + SendEnabled []SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_8f007de11b420c6e, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetBalances() []Balance { + if m != nil { + return m.Balances + } + return nil +} + +func (m *GenesisState) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Supply + } + return nil +} + +func (m *GenesisState) GetDenomMetadata() []Metadata { + if m != nil { + return m.DenomMetadata + } + return nil +} + +func (m *GenesisState) GetSendEnabled() []SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +// Balance defines an account address and balance pair used in the bank module's +// genesis state. +type Balance struct { + // address is the address of the balance holder. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // coins defines the different coins this balance holds. + Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` +} + +func (m *Balance) Reset() { *m = Balance{} } +func (m *Balance) String() string { return proto.CompactTextString(m) } +func (*Balance) ProtoMessage() {} +func (*Balance) Descriptor() ([]byte, []int) { + return fileDescriptor_8f007de11b420c6e, []int{1} +} +func (m *Balance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Balance.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 *Balance) XXX_Merge(src proto.Message) { + xxx_messageInfo_Balance.Merge(m, src) +} +func (m *Balance) XXX_Size() int { + return m.Size() +} +func (m *Balance) XXX_DiscardUnknown() { + xxx_messageInfo_Balance.DiscardUnknown(m) +} + +var xxx_messageInfo_Balance proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.bank.v1beta1.GenesisState") + proto.RegisterType((*Balance)(nil), "cosmos.bank.v1beta1.Balance") +} + +func init() { proto.RegisterFile("cosmos/bank/v1beta1/genesis.proto", fileDescriptor_8f007de11b420c6e) } + +var fileDescriptor_8f007de11b420c6e = []byte{ + // 445 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbd, 0xae, 0xd3, 0x30, + 0x1c, 0xc5, 0x13, 0xca, 0xed, 0xbd, 0xd7, 0xbd, 0x20, 0x61, 0x3a, 0xa4, 0x05, 0x92, 0xd2, 0xa9, + 0x20, 0x35, 0x51, 0x8b, 0x58, 0x18, 0x90, 0x48, 0x85, 0x98, 0xf8, 0x50, 0xbb, 0xb1, 0x54, 0x4e, + 0x6c, 0xd2, 0xa8, 0x8d, 0x1d, 0xc5, 0x2e, 0xa2, 0x6f, 0xc0, 0xc8, 0x13, 0xa0, 0x8e, 0x88, 0x05, + 0x06, 0x1e, 0xa2, 0x63, 0xc5, 0xc4, 0x04, 0xa8, 0x1d, 0xe0, 0x31, 0x50, 0x6c, 0x37, 0x8d, 0x44, + 0xc4, 0xc4, 0x92, 0x44, 0x3e, 0xe7, 0xfc, 0xfe, 0x27, 0xb6, 0xc1, 0xed, 0x90, 0xf1, 0x84, 0x71, + 0x2f, 0x40, 0x74, 0xee, 0xbd, 0x1e, 0x04, 0x44, 0xa0, 0x81, 0x17, 0x11, 0x4a, 0x78, 0xcc, 0xdd, + 0x34, 0x63, 0x82, 0xc1, 0xeb, 0xca, 0xe2, 0xe6, 0x16, 0x57, 0x5b, 0xda, 0xcd, 0x88, 0x45, 0x4c, + 0xea, 0x5e, 0xfe, 0xa5, 0xac, 0x6d, 0xbb, 0xa0, 0x71, 0x52, 0xd0, 0x42, 0x16, 0xd3, 0xbf, 0xf4, + 0xd2, 0x34, 0xc9, 0x55, 0x7a, 0x4b, 0xe9, 0x53, 0x05, 0xd6, 0x73, 0x95, 0x74, 0x0d, 0x25, 0x31, + 0x65, 0x9e, 0x7c, 0xaa, 0xa5, 0xee, 0xfb, 0x1a, 0xb8, 0x78, 0xa2, 0xaa, 0x4e, 0x04, 0x12, 0x04, + 0x3e, 0x04, 0xf5, 0x14, 0x65, 0x28, 0xe1, 0x96, 0xd9, 0x31, 0x7b, 0x8d, 0xe1, 0x0d, 0xb7, 0xa2, + 0xba, 0xfb, 0x42, 0x5a, 0xfc, 0xf3, 0xcd, 0x77, 0xc7, 0xf8, 0xf0, 0xeb, 0xf3, 0x5d, 0x73, 0xac, + 0x53, 0x70, 0x04, 0xce, 0x02, 0xb4, 0x40, 0x34, 0x24, 0xdc, 0xba, 0xd4, 0xa9, 0xf5, 0x1a, 0xc3, + 0x9b, 0x95, 0x04, 0x5f, 0x99, 0xca, 0x88, 0x22, 0x08, 0x67, 0xa0, 0xce, 0x97, 0x69, 0xba, 0x58, + 0x59, 0x35, 0x89, 0x68, 0x1d, 0x11, 0x9c, 0x14, 0x88, 0x11, 0x8b, 0xa9, 0x7f, 0x3f, 0xcf, 0x7f, + 0xfc, 0xe1, 0xf4, 0xa2, 0x58, 0xcc, 0x96, 0x81, 0x1b, 0xb2, 0x44, 0xff, 0xb4, 0x7e, 0xf5, 0x39, + 0x9e, 0x7b, 0x62, 0x95, 0x12, 0x2e, 0x03, 0x5c, 0xd7, 0x55, 0x7c, 0xf8, 0x1c, 0x5c, 0xc5, 0x84, + 0xb2, 0x64, 0x9a, 0x10, 0x81, 0x30, 0x12, 0xc8, 0xba, 0x2c, 0x27, 0xde, 0xaa, 0x2c, 0xfd, 0x54, + 0x9b, 0xca, 0xad, 0xaf, 0xc8, 0xfc, 0x41, 0x81, 0xcf, 0xc0, 0x05, 0x27, 0x14, 0x4f, 0x09, 0x45, + 0xc1, 0x82, 0x60, 0xeb, 0x44, 0xe2, 0x3a, 0x95, 0xb8, 0x09, 0xa1, 0xf8, 0xb1, 0xf2, 0x95, 0x89, + 0x0d, 0x7e, 0x5c, 0xef, 0x7e, 0x32, 0xc1, 0xa9, 0xde, 0x2b, 0x38, 0x04, 0xa7, 0x08, 0xe3, 0x8c, + 0x70, 0x75, 0x38, 0xe7, 0xbe, 0xf5, 0xf5, 0x4b, 0xbf, 0xa9, 0xc9, 0x8f, 0x94, 0x32, 0x11, 0x59, + 0x4c, 0xa3, 0xf1, 0xc1, 0x08, 0x5f, 0x81, 0x93, 0xfc, 0xf2, 0x1c, 0x0e, 0xe3, 0xff, 0xef, 0xa4, + 0xc2, 0x3f, 0x38, 0x7b, 0xbb, 0x76, 0x8c, 0xdf, 0x6b, 0xc7, 0xf0, 0x47, 0x9b, 0x9d, 0x6d, 0x6e, + 0x77, 0xb6, 0xf9, 0x73, 0x67, 0x9b, 0xef, 0xf6, 0xb6, 0xb1, 0xdd, 0xdb, 0xc6, 0xb7, 0xbd, 0x6d, + 0xbc, 0xbc, 0xf3, 0x4f, 0xf2, 0x1b, 0x75, 0xa5, 0xe5, 0x80, 0xa0, 0x2e, 0xaf, 0xe7, 0xbd, 0x3f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x88, 0xa3, 0x71, 0x5c, 0x03, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.DenomMetadata) > 0 { + for iNdEx := len(m.DenomMetadata) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Supply) > 0 { + for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Supply[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Balance) 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 *Balance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Coins) > 0 { + for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.Balances) > 0 { + for _, e := range m.Balances { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Supply) > 0 { + for _, e := range m.Supply { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.DenomMetadata) > 0 { + for _, e := range m.DenomMetadata { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *Balance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.Coins) > 0 { + for _, e := range m.Coins { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Balances = append(m.Balances, Balance{}) + if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Supply = append(m.Supply, types.Coin{}) + if err := m.Supply[len(m.Supply)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomMetadata = append(m.DenomMetadata, Metadata{}) + if err := m.DenomMetadata[len(m.DenomMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SendEnabled = append(m.SendEnabled, SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Balance) 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 ErrIntOverflowGenesis + } + 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: Balance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Coins = append(m.Coins, types.Coin{}) + if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go new file mode 100644 index 000000000000..7f8c6931b6c9 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go @@ -0,0 +1,5508 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/bank/v1beta1/query.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" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryBalanceRequest is the request type for the Query/Balance RPC method. +type QueryBalanceRequest struct { + // address is the address to query balances for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // denom is the coin denom to query balances for. + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryBalanceRequest) Reset() { *m = QueryBalanceRequest{} } +func (m *QueryBalanceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBalanceRequest) ProtoMessage() {} +func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{0} +} +func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceRequest.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 *QueryBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceRequest.Merge(m, src) +} +func (m *QueryBalanceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceRequest proto.InternalMessageInfo + +// QueryBalanceResponse is the response type for the Query/Balance RPC method. +type QueryBalanceResponse struct { + // balance is the balance of the coin. + Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (m *QueryBalanceResponse) Reset() { *m = QueryBalanceResponse{} } +func (m *QueryBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBalanceResponse) ProtoMessage() {} +func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{1} +} +func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBalanceResponse.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 *QueryBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBalanceResponse.Merge(m, src) +} +func (m *QueryBalanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBalanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBalanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBalanceResponse proto.InternalMessageInfo + +func (m *QueryBalanceResponse) GetBalance() *types.Coin { + if m != nil { + return m.Balance + } + return nil +} + +// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +type QueryAllBalancesRequest struct { + // address is the address to query balances for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBalancesRequest) Reset() { *m = QueryAllBalancesRequest{} } +func (m *QueryAllBalancesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllBalancesRequest) ProtoMessage() {} +func (*QueryAllBalancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{2} +} +func (m *QueryAllBalancesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBalancesRequest.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 *QueryAllBalancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBalancesRequest.Merge(m, src) +} +func (m *QueryAllBalancesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBalancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBalancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBalancesRequest proto.InternalMessageInfo + +// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +// method. +type QueryAllBalancesResponse struct { + // balances is the balances of all the coins. + Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllBalancesResponse) Reset() { *m = QueryAllBalancesResponse{} } +func (m *QueryAllBalancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllBalancesResponse) ProtoMessage() {} +func (*QueryAllBalancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{3} +} +func (m *QueryAllBalancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllBalancesResponse.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 *QueryAllBalancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllBalancesResponse.Merge(m, src) +} +func (m *QueryAllBalancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllBalancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllBalancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllBalancesResponse proto.InternalMessageInfo + +func (m *QueryAllBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balances + } + return nil +} + +func (m *QueryAllBalancesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySpendableBalancesRequest defines the gRPC request structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +type QuerySpendableBalancesRequest struct { + // address is the address to query spendable balances for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySpendableBalancesRequest) Reset() { *m = QuerySpendableBalancesRequest{} } +func (m *QuerySpendableBalancesRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableBalancesRequest) ProtoMessage() {} +func (*QuerySpendableBalancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{4} +} +func (m *QuerySpendableBalancesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableBalancesRequest.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 *QuerySpendableBalancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableBalancesRequest.Merge(m, src) +} +func (m *QuerySpendableBalancesRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableBalancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableBalancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableBalancesRequest proto.InternalMessageInfo + +// QuerySpendableBalancesResponse defines the gRPC response structure for querying +// an account's spendable balances. +// +// Since: cosmos-sdk 0.46 +type QuerySpendableBalancesResponse struct { + // balances is the spendable balances of all the coins. + Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySpendableBalancesResponse) Reset() { *m = QuerySpendableBalancesResponse{} } +func (m *QuerySpendableBalancesResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableBalancesResponse) ProtoMessage() {} +func (*QuerySpendableBalancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{5} +} +func (m *QuerySpendableBalancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableBalancesResponse.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 *QuerySpendableBalancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableBalancesResponse.Merge(m, src) +} +func (m *QuerySpendableBalancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableBalancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableBalancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableBalancesResponse proto.InternalMessageInfo + +func (m *QuerySpendableBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balances + } + return nil +} + +func (m *QuerySpendableBalancesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +type QuerySpendableBalanceByDenomRequest struct { + // address is the address to query balances for. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // denom is the coin denom to query balances for. + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QuerySpendableBalanceByDenomRequest) Reset() { *m = QuerySpendableBalanceByDenomRequest{} } +func (m *QuerySpendableBalanceByDenomRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableBalanceByDenomRequest) ProtoMessage() {} +func (*QuerySpendableBalanceByDenomRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{6} +} +func (m *QuerySpendableBalanceByDenomRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableBalanceByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableBalanceByDenomRequest.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 *QuerySpendableBalanceByDenomRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableBalanceByDenomRequest.Merge(m, src) +} +func (m *QuerySpendableBalanceByDenomRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableBalanceByDenomRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableBalanceByDenomRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableBalanceByDenomRequest proto.InternalMessageInfo + +// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +// querying an account's spendable balance for a specific denom. +// +// Since: cosmos-sdk 0.47 +type QuerySpendableBalanceByDenomResponse struct { + // balance is the balance of the coin. + Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (m *QuerySpendableBalanceByDenomResponse) Reset() { *m = QuerySpendableBalanceByDenomResponse{} } +func (m *QuerySpendableBalanceByDenomResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpendableBalanceByDenomResponse) ProtoMessage() {} +func (*QuerySpendableBalanceByDenomResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{7} +} +func (m *QuerySpendableBalanceByDenomResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpendableBalanceByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpendableBalanceByDenomResponse.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 *QuerySpendableBalanceByDenomResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpendableBalanceByDenomResponse.Merge(m, src) +} +func (m *QuerySpendableBalanceByDenomResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySpendableBalanceByDenomResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpendableBalanceByDenomResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpendableBalanceByDenomResponse proto.InternalMessageInfo + +func (m *QuerySpendableBalanceByDenomResponse) GetBalance() *types.Coin { + if m != nil { + return m.Balance + } + return nil +} + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +// method. +type QueryTotalSupplyRequest struct { + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest{} } +func (m *QueryTotalSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyRequest) ProtoMessage() {} +func (*QueryTotalSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{8} +} +func (m *QueryTotalSupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyRequest.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 *QueryTotalSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyRequest.Merge(m, src) +} +func (m *QueryTotalSupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyRequest proto.InternalMessageInfo + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +// method +type QueryTotalSupplyResponse struct { + // supply is the supply of the coins + Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` + // pagination defines the pagination in the response. + // + // Since: cosmos-sdk 0.43 + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyResponse{} } +func (m *QueryTotalSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyResponse) ProtoMessage() {} +func (*QueryTotalSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{9} +} +func (m *QueryTotalSupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyResponse.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 *QueryTotalSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyResponse.Merge(m, src) +} +func (m *QueryTotalSupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyResponse proto.InternalMessageInfo + +func (m *QueryTotalSupplyResponse) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Supply + } + return nil +} + +func (m *QueryTotalSupplyResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +type QuerySupplyOfRequest struct { + // denom is the coin denom to query balances for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QuerySupplyOfRequest) Reset() { *m = QuerySupplyOfRequest{} } +func (m *QuerySupplyOfRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyOfRequest) ProtoMessage() {} +func (*QuerySupplyOfRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{10} +} +func (m *QuerySupplyOfRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyOfRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyOfRequest.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 *QuerySupplyOfRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyOfRequest.Merge(m, src) +} +func (m *QuerySupplyOfRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyOfRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyOfRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyOfRequest proto.InternalMessageInfo + +func (m *QuerySupplyOfRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +type QuerySupplyOfResponse struct { + // amount is the supply of the coin. + Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` +} + +func (m *QuerySupplyOfResponse) Reset() { *m = QuerySupplyOfResponse{} } +func (m *QuerySupplyOfResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyOfResponse) ProtoMessage() {} +func (*QuerySupplyOfResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{11} +} +func (m *QuerySupplyOfResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyOfResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyOfResponse.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 *QuerySupplyOfResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyOfResponse.Merge(m, src) +} +func (m *QuerySupplyOfResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyOfResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyOfResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyOfResponse proto.InternalMessageInfo + +func (m *QuerySupplyOfResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + +// QueryParamsRequest defines the request type for querying x/bank parameters. +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_9c6fc1939682df13, []int{12} +} +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 defines the response type for querying x/bank parameters. +type QueryParamsResponse struct { + 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_9c6fc1939682df13, []int{13} +} +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{} +} + +// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +type QueryDenomsMetadataRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomsMetadataRequest) Reset() { *m = QueryDenomsMetadataRequest{} } +func (m *QueryDenomsMetadataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsMetadataRequest) ProtoMessage() {} +func (*QueryDenomsMetadataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{14} +} +func (m *QueryDenomsMetadataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsMetadataRequest.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 *QueryDenomsMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsMetadataRequest.Merge(m, src) +} +func (m *QueryDenomsMetadataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsMetadataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsMetadataRequest proto.InternalMessageInfo + +func (m *QueryDenomsMetadataRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +// method. +type QueryDenomsMetadataResponse struct { + // metadata provides the client information for all the registered tokens. + Metadatas []Metadata `protobuf:"bytes,1,rep,name=metadatas,proto3" json:"metadatas"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomsMetadataResponse) Reset() { *m = QueryDenomsMetadataResponse{} } +func (m *QueryDenomsMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomsMetadataResponse) ProtoMessage() {} +func (*QueryDenomsMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{15} +} +func (m *QueryDenomsMetadataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomsMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomsMetadataResponse.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 *QueryDenomsMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomsMetadataResponse.Merge(m, src) +} +func (m *QueryDenomsMetadataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomsMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomsMetadataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomsMetadataResponse proto.InternalMessageInfo + +func (m *QueryDenomsMetadataResponse) GetMetadatas() []Metadata { + if m != nil { + return m.Metadatas + } + return nil +} + +func (m *QueryDenomsMetadataResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +type QueryDenomMetadataRequest struct { + // denom is the coin denom to query the metadata for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryDenomMetadataRequest) Reset() { *m = QueryDenomMetadataRequest{} } +func (m *QueryDenomMetadataRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomMetadataRequest) ProtoMessage() {} +func (*QueryDenomMetadataRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{16} +} +func (m *QueryDenomMetadataRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomMetadataRequest.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 *QueryDenomMetadataRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomMetadataRequest.Merge(m, src) +} +func (m *QueryDenomMetadataRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomMetadataRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomMetadataRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomMetadataRequest proto.InternalMessageInfo + +func (m *QueryDenomMetadataRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +// method. +type QueryDenomMetadataResponse struct { + // metadata describes and provides all the client information for the requested token. + Metadata Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *QueryDenomMetadataResponse) Reset() { *m = QueryDenomMetadataResponse{} } +func (m *QueryDenomMetadataResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomMetadataResponse) ProtoMessage() {} +func (*QueryDenomMetadataResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{17} +} +func (m *QueryDenomMetadataResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomMetadataResponse.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 *QueryDenomMetadataResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomMetadataResponse.Merge(m, src) +} +func (m *QueryDenomMetadataResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomMetadataResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomMetadataResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomMetadataResponse proto.InternalMessageInfo + +func (m *QueryDenomMetadataResponse) GetMetadata() Metadata { + if m != nil { + return m.Metadata + } + return Metadata{} +} + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +type QueryDenomOwnersRequest struct { + // denom defines the coin denomination to query all account holders for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersRequest) Reset() { *m = QueryDenomOwnersRequest{} } +func (m *QueryDenomOwnersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersRequest) ProtoMessage() {} +func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{18} +} +func (m *QueryDenomOwnersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersRequest.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 *QueryDenomOwnersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersRequest.Merge(m, src) +} +func (m *QueryDenomOwnersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersRequest proto.InternalMessageInfo + +func (m *QueryDenomOwnersRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryDenomOwnersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +// +// Since: cosmos-sdk 0.46 +type DenomOwner struct { + // address defines the address that owns a particular denomination. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // balance is the balance of the denominated coin for an account. + Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` +} + +func (m *DenomOwner) Reset() { *m = DenomOwner{} } +func (m *DenomOwner) String() string { return proto.CompactTextString(m) } +func (*DenomOwner) ProtoMessage() {} +func (*DenomOwner) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{19} +} +func (m *DenomOwner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomOwner.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 *DenomOwner) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomOwner.Merge(m, src) +} +func (m *DenomOwner) XXX_Size() int { + return m.Size() +} +func (m *DenomOwner) XXX_DiscardUnknown() { + xxx_messageInfo_DenomOwner.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomOwner proto.InternalMessageInfo + +func (m *DenomOwner) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *DenomOwner) GetBalance() types.Coin { + if m != nil { + return m.Balance + } + return types.Coin{} +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +// +// Since: cosmos-sdk 0.46 +type QueryDenomOwnersResponse struct { + DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersResponse) Reset() { *m = QueryDenomOwnersResponse{} } +func (m *QueryDenomOwnersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersResponse) ProtoMessage() {} +func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{20} +} +func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersResponse.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 *QueryDenomOwnersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersResponse.Merge(m, src) +} +func (m *QueryDenomOwnersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersResponse proto.InternalMessageInfo + +func (m *QueryDenomOwnersResponse) GetDenomOwners() []*DenomOwner { + if m != nil { + return m.DenomOwners + } + return nil +} + +func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +// +// Since: cosmos-sdk 0.47 +type QuerySendEnabledRequest struct { + // denoms is the specific denoms you want look up. Leave empty to get all entries. + Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` + // pagination defines an optional pagination for the request. This field is + // only read if the denoms field is empty. + Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest{} } +func (m *QuerySendEnabledRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySendEnabledRequest) ProtoMessage() {} +func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{21} +} +func (m *QuerySendEnabledRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySendEnabledRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySendEnabledRequest.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 *QuerySendEnabledRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySendEnabledRequest.Merge(m, src) +} +func (m *QuerySendEnabledRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySendEnabledRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySendEnabledRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySendEnabledRequest proto.InternalMessageInfo + +func (m *QuerySendEnabledRequest) GetDenoms() []string { + if m != nil { + return m.Denoms + } + return nil +} + +func (m *QuerySendEnabledRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +// +// Since: cosmos-sdk 0.47 +type QuerySendEnabledResponse struct { + SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // pagination defines the pagination in the response. This field is only + // populated if the denoms field in the request is empty. + Pagination *query.PageResponse `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QuerySendEnabledResponse) Reset() { *m = QuerySendEnabledResponse{} } +func (m *QuerySendEnabledResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySendEnabledResponse) ProtoMessage() {} +func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{22} +} +func (m *QuerySendEnabledResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySendEnabledResponse.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 *QuerySendEnabledResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySendEnabledResponse.Merge(m, src) +} +func (m *QuerySendEnabledResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySendEnabledResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySendEnabledResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySendEnabledResponse proto.InternalMessageInfo + +func (m *QuerySendEnabledResponse) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +func (m *QuerySendEnabledResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest") + proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse") + proto.RegisterType((*QueryAllBalancesRequest)(nil), "cosmos.bank.v1beta1.QueryAllBalancesRequest") + proto.RegisterType((*QueryAllBalancesResponse)(nil), "cosmos.bank.v1beta1.QueryAllBalancesResponse") + proto.RegisterType((*QuerySpendableBalancesRequest)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesRequest") + proto.RegisterType((*QuerySpendableBalancesResponse)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesResponse") + proto.RegisterType((*QuerySpendableBalanceByDenomRequest)(nil), "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest") + proto.RegisterType((*QuerySpendableBalanceByDenomResponse)(nil), "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse") + proto.RegisterType((*QueryTotalSupplyRequest)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyRequest") + proto.RegisterType((*QueryTotalSupplyResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyResponse") + proto.RegisterType((*QuerySupplyOfRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfRequest") + proto.RegisterType((*QuerySupplyOfResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.bank.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.bank.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryDenomsMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataRequest") + proto.RegisterType((*QueryDenomsMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataResponse") + proto.RegisterType((*QueryDenomMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataRequest") + proto.RegisterType((*QueryDenomMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataResponse") + proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") + proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") + proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") + proto.RegisterType((*QuerySendEnabledRequest)(nil), "cosmos.bank.v1beta1.QuerySendEnabledRequest") + proto.RegisterType((*QuerySendEnabledResponse)(nil), "cosmos.bank.v1beta1.QuerySendEnabledResponse") +} + +func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } + +var fileDescriptor_9c6fc1939682df13 = []byte{ + // 1188 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0x04, 0xd5, 0x49, 0x9e, 0x4b, 0xa5, 0x4e, 0x03, 0x4d, 0x36, 0xc4, 0x2e, 0xdb, 0xaa, + 0xf9, 0x41, 0xb2, 0xdb, 0x38, 0x80, 0x68, 0x55, 0x22, 0xd5, 0x29, 0xed, 0x01, 0xa1, 0x16, 0x87, + 0x5e, 0xe0, 0x60, 0xad, 0xbd, 0x83, 0x6b, 0xc5, 0xde, 0x71, 0x3d, 0x6b, 0x8a, 0x55, 0x55, 0x42, + 0x48, 0x48, 0x3d, 0x22, 0xd1, 0x13, 0x12, 0x22, 0x42, 0x02, 0x2a, 0x90, 0x10, 0x42, 0x1c, 0xf9, + 0x03, 0x7a, 0x41, 0x2a, 0x70, 0x28, 0x27, 0x40, 0x09, 0x12, 0xfc, 0x19, 0xc8, 0xf3, 0xc3, 0xbb, + 0x6b, 0x8f, 0x37, 0x9b, 0xd4, 0x95, 0xe8, 0xa5, 0xb5, 0x67, 0xde, 0x9b, 0xf7, 0x7d, 0xef, 0xbd, + 0x99, 0xf7, 0x39, 0x90, 0xab, 0x50, 0xd6, 0xa0, 0xcc, 0x2e, 0x3b, 0xde, 0x96, 0xfd, 0xde, 0x6a, + 0x99, 0xf8, 0xce, 0xaa, 0x7d, 0xa3, 0x4d, 0x5a, 0x1d, 0xab, 0xd9, 0xa2, 0x3e, 0xc5, 0xc7, 0x84, + 0x81, 0xd5, 0x35, 0xb0, 0xa4, 0x81, 0xb1, 0xd4, 0xf3, 0x62, 0x44, 0x58, 0xf7, 0x7c, 0x9b, 0x4e, + 0xb5, 0xe6, 0x39, 0x7e, 0x8d, 0x7a, 0xe2, 0x00, 0x63, 0xaa, 0x4a, 0xab, 0x94, 0x7f, 0xb4, 0xbb, + 0x9f, 0xe4, 0xea, 0x73, 0x55, 0x4a, 0xab, 0x75, 0x62, 0x3b, 0xcd, 0x9a, 0xed, 0x78, 0x1e, 0xf5, + 0xb9, 0x0b, 0x93, 0xbb, 0xd9, 0xf0, 0xf9, 0xea, 0xe4, 0x0a, 0xad, 0x79, 0x03, 0xfb, 0x21, 0xd4, + 0x1c, 0xa1, 0xd8, 0x9f, 0x11, 0xfb, 0x25, 0x11, 0x56, 0x32, 0x10, 0x5b, 0xb3, 0xd2, 0x55, 0xa1, + 0x0e, 0x93, 0x35, 0x8e, 0x3a, 0x8d, 0x9a, 0x47, 0x6d, 0xfe, 0xaf, 0x58, 0x32, 0x6b, 0x70, 0xec, + 0xcd, 0xae, 0x45, 0xc1, 0xa9, 0x3b, 0x5e, 0x85, 0x14, 0xc9, 0x8d, 0x36, 0x61, 0x3e, 0xce, 0xc3, + 0xb8, 0xe3, 0xba, 0x2d, 0xc2, 0xd8, 0x34, 0x3a, 0x81, 0x16, 0x26, 0x0b, 0xd3, 0xbf, 0xfe, 0xb8, + 0x32, 0x25, 0x23, 0x5d, 0x10, 0x3b, 0x9b, 0x7e, 0xab, 0xe6, 0x55, 0x8b, 0xca, 0x10, 0x4f, 0xc1, + 0x21, 0x97, 0x78, 0xb4, 0x31, 0x3d, 0xd6, 0xf5, 0x28, 0x8a, 0x2f, 0xe7, 0x26, 0xee, 0x6c, 0xe7, + 0x52, 0xff, 0x6e, 0xe7, 0x52, 0xe6, 0xeb, 0x30, 0x15, 0x0d, 0xc5, 0x9a, 0xd4, 0x63, 0x04, 0xaf, + 0xc1, 0x78, 0x59, 0x2c, 0xf1, 0x58, 0x99, 0xfc, 0x8c, 0xd5, 0x2b, 0x0a, 0x23, 0xaa, 0x28, 0xd6, + 0x06, 0xad, 0x79, 0x45, 0x65, 0x69, 0x7e, 0x8e, 0xe0, 0x38, 0x3f, 0xed, 0x42, 0xbd, 0x2e, 0x0f, + 0x64, 0x8f, 0x02, 0xfe, 0x12, 0x40, 0x50, 0x5a, 0xce, 0x20, 0x93, 0x3f, 0x1d, 0xc1, 0x21, 0x12, + 0xa9, 0xd0, 0x5c, 0x75, 0xaa, 0x2a, 0x59, 0xc5, 0x90, 0x67, 0x88, 0xee, 0x2f, 0x08, 0xa6, 0x07, + 0x11, 0x4a, 0xce, 0x75, 0x98, 0x90, 0x4c, 0xba, 0x18, 0x9f, 0x8a, 0x25, 0x5d, 0x78, 0xe9, 0xfe, + 0x1f, 0xb9, 0xd4, 0x37, 0x7f, 0xe6, 0x16, 0xaa, 0x35, 0xff, 0x7a, 0xbb, 0x6c, 0x55, 0x68, 0x43, + 0x16, 0x5d, 0xfe, 0xb7, 0xc2, 0xdc, 0x2d, 0xdb, 0xef, 0x34, 0x09, 0xe3, 0x0e, 0xec, 0xde, 0x3f, + 0xdf, 0x2f, 0xa1, 0x62, 0x2f, 0x02, 0xbe, 0xac, 0x21, 0x37, 0xbf, 0x27, 0x39, 0x01, 0x35, 0xcc, + 0xce, 0xfc, 0x12, 0xc1, 0x1c, 0xe7, 0xb4, 0xd9, 0x24, 0x9e, 0xeb, 0x94, 0xeb, 0xe4, 0xff, 0x99, + 0xfb, 0x87, 0x08, 0xb2, 0xc3, 0x70, 0x3e, 0xd9, 0x15, 0xe8, 0xc0, 0x49, 0x2d, 0xb1, 0x42, 0xe7, + 0x62, 0xf7, 0xba, 0x3d, 0xce, 0xfb, 0xfb, 0x0e, 0x9c, 0x8a, 0x0f, 0xfd, 0x28, 0xf7, 0x79, 0x4b, + 0x5e, 0xe7, 0xb7, 0xa8, 0xef, 0xd4, 0x37, 0xdb, 0xcd, 0x66, 0xbd, 0xa3, 0xb8, 0x44, 0xdb, 0x03, + 0x8d, 0xa0, 0x3d, 0x7e, 0x56, 0x57, 0x33, 0x12, 0x4d, 0xc2, 0xbf, 0x0e, 0x69, 0xc6, 0x57, 0x1e, + 0x5b, 0x5b, 0xc8, 0xf3, 0x47, 0xd7, 0x14, 0xcb, 0xf2, 0x65, 0x15, 0x4c, 0xae, 0xbc, 0xab, 0x32, + 0xd7, 0xab, 0x28, 0x0a, 0x55, 0xd4, 0xbc, 0x06, 0xcf, 0xf4, 0x59, 0x4b, 0xe6, 0xe7, 0x21, 0xed, + 0x34, 0x68, 0xdb, 0xf3, 0xf7, 0xac, 0x5b, 0x61, 0xb2, 0xcb, 0x5c, 0xb2, 0x11, 0x3e, 0xe6, 0x14, + 0x60, 0x7e, 0xec, 0x55, 0xa7, 0xe5, 0x34, 0xd4, 0x7b, 0x60, 0x5e, 0x93, 0xf3, 0x45, 0xad, 0xca, + 0x50, 0xeb, 0x90, 0x6e, 0xf2, 0x15, 0x19, 0x6a, 0xd6, 0xd2, 0xcc, 0x61, 0x4b, 0x38, 0x45, 0x82, + 0x09, 0x2f, 0xd3, 0x05, 0x83, 0x1f, 0xcb, 0x3b, 0x8f, 0xbd, 0x41, 0x7c, 0xc7, 0x75, 0x7c, 0x67, + 0xc4, 0x1d, 0x63, 0x7e, 0x87, 0x60, 0x56, 0x1b, 0x46, 0xb2, 0xb8, 0x04, 0x93, 0x0d, 0xb9, 0xa6, + 0x1e, 0x91, 0x39, 0x2d, 0x11, 0xe5, 0x19, 0xa6, 0x12, 0xb8, 0x8e, 0xae, 0x11, 0x56, 0x61, 0x26, + 0xc0, 0xdb, 0x9f, 0x15, 0x7d, 0x37, 0x94, 0xc3, 0x99, 0x1c, 0x60, 0x78, 0x11, 0x26, 0x14, 0x4c, + 0x99, 0xc7, 0xe4, 0x04, 0x7b, 0x9e, 0xe6, 0x4d, 0x79, 0xb9, 0x79, 0x8c, 0x2b, 0x37, 0x3d, 0xd2, + 0x62, 0xb1, 0xa0, 0x46, 0x35, 0x11, 0xcc, 0x0f, 0x10, 0x40, 0x10, 0xf4, 0x40, 0xaf, 0xe2, 0x7a, + 0xf0, 0x9a, 0x8d, 0xed, 0xe3, 0x56, 0xf4, 0x1e, 0xb6, 0xaf, 0xd5, 0x5b, 0x13, 0x21, 0x2f, 0xd3, + 0x5b, 0x80, 0xc3, 0x9c, 0x70, 0x89, 0xf2, 0x75, 0xd9, 0x43, 0x39, 0x6d, 0x8a, 0x03, 0xff, 0x62, + 0xc6, 0x0d, 0xce, 0x1a, 0xe5, 0x68, 0x11, 0x55, 0xda, 0x24, 0x9e, 0xfb, 0x9a, 0xd7, 0x7d, 0xe0, + 0x5d, 0x55, 0xa5, 0x67, 0x21, 0xcd, 0x43, 0x0a, 0x84, 0x93, 0x45, 0xf9, 0xad, 0xaf, 0x4e, 0x95, + 0x03, 0xd7, 0xe9, 0x9e, 0x4a, 0x52, 0x24, 0xb6, 0x4c, 0xd2, 0x06, 0x1c, 0x66, 0xc4, 0x73, 0x4b, + 0x44, 0xac, 0xcb, 0x24, 0x9d, 0xd0, 0x26, 0x29, 0xec, 0x9f, 0x61, 0xc1, 0x97, 0xbe, 0x2c, 0x55, + 0x0e, 0x9c, 0xa5, 0xfc, 0x0f, 0x47, 0xe0, 0x10, 0x87, 0x8a, 0x3f, 0x43, 0x30, 0x2e, 0x47, 0x20, + 0x5e, 0xd0, 0xa2, 0xd1, 0x28, 0x6b, 0x63, 0x31, 0x81, 0xa5, 0x08, 0x6b, 0xbe, 0x7a, 0xa7, 0xdb, + 0x4a, 0x1f, 0xfe, 0xf6, 0xf7, 0x27, 0x63, 0x79, 0x7c, 0xc6, 0xd6, 0xff, 0x28, 0x10, 0x02, 0xc3, + 0xbe, 0x25, 0xfb, 0xf5, 0xb6, 0x5d, 0xee, 0x94, 0xc4, 0x25, 0xda, 0x46, 0x90, 0x09, 0x69, 0x4f, + 0xbc, 0x3c, 0x3c, 0xf2, 0xa0, 0x88, 0x36, 0x56, 0x12, 0x5a, 0x4b, 0xac, 0x2f, 0x06, 0x58, 0x17, + 0xf1, 0x7c, 0x42, 0xac, 0xf8, 0x27, 0x04, 0x47, 0x07, 0x24, 0x1a, 0xce, 0x0f, 0x0f, 0x3d, 0x4c, + 0x77, 0x1a, 0x6b, 0xfb, 0xf2, 0x91, 0xa0, 0xd7, 0x03, 0xd0, 0x6b, 0x78, 0x55, 0x0b, 0x9a, 0x29, + 0xe7, 0x92, 0x06, 0xfe, 0x43, 0x04, 0xc7, 0x87, 0xa8, 0x21, 0xfc, 0x4a, 0x72, 0x40, 0x51, 0xed, + 0x66, 0x9c, 0x3d, 0x80, 0xa7, 0x24, 0x74, 0x39, 0x20, 0x74, 0x1e, 0x9f, 0xdb, 0x37, 0xa1, 0xa0, + 0x77, 0xee, 0x22, 0xc8, 0x84, 0xc4, 0x51, 0x5c, 0xef, 0x0c, 0x2a, 0xb6, 0xb8, 0xde, 0xd1, 0x28, + 0x2e, 0x73, 0x21, 0x40, 0x3d, 0x87, 0x67, 0xf5, 0xa8, 0x05, 0x8c, 0xbb, 0x08, 0x26, 0x94, 0x6c, + 0xc1, 0x31, 0x37, 0xa9, 0x4f, 0x08, 0x19, 0x4b, 0x49, 0x4c, 0x25, 0x9a, 0xd5, 0x00, 0xcd, 0x69, + 0x7c, 0x2a, 0x06, 0x4d, 0x90, 0xad, 0x8f, 0x10, 0xa4, 0x85, 0x56, 0xc1, 0xf3, 0xc3, 0x23, 0x45, + 0x84, 0x91, 0xb1, 0xb0, 0xb7, 0x61, 0xf2, 0xf4, 0x08, 0x55, 0x84, 0xbf, 0x45, 0xf0, 0x74, 0x64, + 0x8e, 0x63, 0x6b, 0x78, 0x14, 0x9d, 0x46, 0x30, 0xec, 0xc4, 0xf6, 0x12, 0xdc, 0xd9, 0x00, 0x9c, + 0x85, 0x97, 0xb5, 0xe0, 0xc4, 0xac, 0x28, 0x29, 0x35, 0x60, 0xdf, 0xe2, 0x0b, 0xb7, 0xf1, 0x57, + 0x08, 0x8e, 0x44, 0x85, 0x15, 0xde, 0x2b, 0x7c, 0xbf, 0xd2, 0x33, 0xce, 0x24, 0x77, 0x48, 0x5e, + 0xde, 0x3e, 0xc0, 0xf8, 0x0b, 0x04, 0x99, 0xd0, 0xf4, 0x8e, 0xbb, 0x0c, 0x83, 0x0a, 0x27, 0xee, + 0x32, 0x68, 0x24, 0x81, 0xf9, 0x72, 0x80, 0xef, 0x05, 0xbc, 0x38, 0x1c, 0x9f, 0x94, 0x0c, 0xbd, + 0x6c, 0x7e, 0x8a, 0x20, 0x13, 0x9a, 0x7e, 0x71, 0x20, 0x07, 0x07, 0x7c, 0x1c, 0x48, 0xcd, 0x48, + 0x36, 0xad, 0x00, 0xe4, 0x49, 0xfc, 0xbc, 0xfe, 0x8e, 0x84, 0x46, 0x76, 0x61, 0xe3, 0xfe, 0x4e, + 0x16, 0x3d, 0xd8, 0xc9, 0xa2, 0xbf, 0x76, 0xb2, 0xe8, 0xe3, 0xdd, 0x6c, 0xea, 0xc1, 0x6e, 0x36, + 0xf5, 0xfb, 0x6e, 0x36, 0xf5, 0xf6, 0x62, 0xec, 0x4f, 0xa7, 0xf7, 0xc5, 0x99, 0xfc, 0x17, 0x54, + 0x39, 0xcd, 0xff, 0x62, 0xb5, 0xf6, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x2c, 0x27, 0x2a, + 0xd4, 0x13, 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 { + // Balance queries the balance of a single coin for a single account. + Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) + // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) + // SpendableBalances queries the spendable balance of all coins for a single + // account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + SpendableBalanceByDenom(ctx context.Context, in *QuerySpendableBalanceByDenomRequest, opts ...grpc.CallOption) (*QuerySpendableBalanceByDenomResponse, error) + // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) + // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) + // Params queries the parameters of x/bank module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // DenomsMetadata queries the client metadata of a given coin denomination. + DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) + // DenomsMetadata queries the client metadata for all registered coin + // denominations. + DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { + out := new(QueryBalanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/Balance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) { + out := new(QueryAllBalancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/AllBalances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) { + out := new(QuerySpendableBalancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SpendableBalances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SpendableBalanceByDenom(ctx context.Context, in *QuerySpendableBalanceByDenomRequest, opts ...grpc.CallOption) (*QuerySpendableBalanceByDenomResponse, error) { + out := new(QuerySpendableBalanceByDenomResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { + out := new(QueryTotalSupplyResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/TotalSupply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) { + out := new(QuerySupplyOfResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SupplyOf", 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, "/cosmos.bank.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) { + out := new(QueryDenomMetadataResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { + out := new(QueryDenomsMetadataResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomsMetadata", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) { + out := new(QueryDenomOwnersResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomOwners", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { + out := new(QuerySendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Balance queries the balance of a single coin for a single account. + Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) + // AllBalances queries the balance of all coins for a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + AllBalances(context.Context, *QueryAllBalancesRequest) (*QueryAllBalancesResponse, error) + // SpendableBalances queries the spendable balance of all coins for a single + // account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + SpendableBalances(context.Context, *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) + // SpendableBalanceByDenom queries the spendable balance of a single denom for + // a single account. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.47 + SpendableBalanceByDenom(context.Context, *QuerySpendableBalanceByDenomRequest) (*QuerySpendableBalanceByDenomResponse, error) + // TotalSupply queries the total supply of all coins. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) + // SupplyOf queries the supply of a single coin. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) + // Params queries the parameters of x/bank module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // DenomsMetadata queries the client metadata of a given coin denomination. + DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) + // DenomsMetadata queries the client metadata for all registered coin + // denominations. + DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + // + // When called from another module, this query might consume a high amount of + // gas if the pagination field is incorrectly set. + // + // Since: cosmos-sdk 0.46 + DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) + // SendEnabled queries for SendEnabled entries. + // + // This query only returns denominations that have specific SendEnabled settings. + // Any denomination that does not have a specific setting will use the default + // params.default_send_enabled, and will not be returned by this query. + // + // Since: cosmos-sdk 0.47 + SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Balance(ctx context.Context, req *QueryBalanceRequest) (*QueryBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") +} +func (*UnimplementedQueryServer) AllBalances(ctx context.Context, req *QueryAllBalancesRequest) (*QueryAllBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllBalances not implemented") +} +func (*UnimplementedQueryServer) SpendableBalances(ctx context.Context, req *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpendableBalances not implemented") +} +func (*UnimplementedQueryServer) SpendableBalanceByDenom(ctx context.Context, req *QuerySpendableBalanceByDenomRequest) (*QuerySpendableBalanceByDenomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpendableBalanceByDenom not implemented") +} +func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupply not implemented") +} +func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) DenomMetadata(ctx context.Context, req *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomMetadata not implemented") +} +func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") +} +func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") +} +func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Balance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/Balance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllBalancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllBalances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/AllBalances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllBalances(ctx, req.(*QueryAllBalancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SpendableBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpendableBalancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SpendableBalances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SpendableBalances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpendableBalances(ctx, req.(*QuerySpendableBalancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SpendableBalanceByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpendableBalanceByDenomRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SpendableBalanceByDenom(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpendableBalanceByDenom(ctx, req.(*QuerySpendableBalanceByDenomRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/TotalSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SupplyOf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySupplyOfRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SupplyOf(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SupplyOf", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SupplyOf(ctx, req.(*QuerySupplyOfRequest)) + } + 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: "/cosmos.bank.v1beta1.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_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomMetadata(ctx, req.(*QueryDenomMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomsMetadataRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomsMetadata(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomsMetadata", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomOwnersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomOwners(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomOwners", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomOwners(ctx, req.(*QueryDenomOwnersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySendEnabledRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabledRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.bank.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Balance", + Handler: _Query_Balance_Handler, + }, + { + MethodName: "AllBalances", + Handler: _Query_AllBalances_Handler, + }, + { + MethodName: "SpendableBalances", + Handler: _Query_SpendableBalances_Handler, + }, + { + MethodName: "SpendableBalanceByDenom", + Handler: _Query_SpendableBalanceByDenom_Handler, + }, + { + MethodName: "TotalSupply", + Handler: _Query_TotalSupply_Handler, + }, + { + MethodName: "SupplyOf", + Handler: _Query_SupplyOf_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "DenomMetadata", + Handler: _Query_DenomMetadata_Handler, + }, + { + MethodName: "DenomsMetadata", + Handler: _Query_DenomsMetadata_Handler, + }, + { + MethodName: "DenomOwners", + Handler: _Query_DenomOwners_Handler, + }, + { + MethodName: "SendEnabled", + Handler: _Query_SendEnabled_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/bank/v1beta1/query.proto", +} + +func (m *QueryBalanceRequest) 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 *QueryBalanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBalanceResponse) 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 *QueryBalanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Balance != nil { + { + size, err := m.Balance.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 *QueryAllBalancesRequest) 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 *QueryAllBalancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBalancesRequest) 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.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllBalancesResponse) 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 *QueryAllBalancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllBalancesResponse) 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.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[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 *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalancesRequest) 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.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySpendableBalancesResponse) 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 *QuerySpendableBalancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalancesResponse) 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.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[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 *QuerySpendableBalanceByDenomRequest) 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 *QuerySpendableBalanceByDenomRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalanceByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySpendableBalanceByDenomResponse) 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 *QuerySpendableBalanceByDenomResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalanceByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Balance != nil { + { + size, err := m.Balance.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 *QueryTotalSupplyRequest) 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 *QueryTotalSupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyRequest) 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 *QueryTotalSupplyResponse) 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 *QueryTotalSupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyResponse) 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.Supply) > 0 { + for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Supply[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 *QuerySupplyOfRequest) 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 *QuerySupplyOfRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyOfRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySupplyOfResponse) 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 *QuerySupplyOfResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyOfResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.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 *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 *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataResponse) 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 *QueryDenomsMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsMetadataResponse) 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.Metadatas) > 0 { + for iNdEx := len(m.Metadatas) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Metadatas[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 *QueryDenomMetadataRequest) 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 *QueryDenomMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomMetadataResponse) 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 *QueryDenomMetadataResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.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 *QueryDenomOwnersRequest) 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 *QueryDenomOwnersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersRequest) 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.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomOwner) 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 *DenomOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomOwnersResponse) 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 *QueryDenomOwnersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersResponse) 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.DenomOwners) > 0 { + for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomOwners[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 *QuerySendEnabledRequest) 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 *QuerySendEnabledRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySendEnabledRequest) 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] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySendEnabledResponse) 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 *QuerySendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySendEnabledResponse) 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] = 0x6 + i-- + dAtA[i] = 0x9a + } + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[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 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 *QueryBalanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBalanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Balance != nil { + l = m.Balance.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllBalancesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllBalancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Balances) > 0 { + for _, e := range m.Balances { + 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 *QuerySpendableBalancesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySpendableBalancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Balances) > 0 { + for _, e := range m.Balances { + 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 *QuerySpendableBalanceByDenomRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySpendableBalanceByDenomResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Balance != nil { + l = m.Balance.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTotalSupplyRequest) 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 *QueryTotalSupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Supply) > 0 { + for _, e := range m.Supply { + 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 *QuerySupplyOfRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySupplyOfResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + 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 *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Metadatas) > 0 { + for _, e := range m.Metadatas { + 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 *QueryDenomMetadataRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDenomMetadataResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDenomOwnersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *DenomOwner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.Balance.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDenomOwnersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomOwners) > 0 { + for _, e := range m.DenomOwners { + 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 *QuerySendEnabledRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Denoms) > 0 { + for _, s := range m.Denoms { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 2 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySendEnabledResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 2 + l + sovQuery(uint64(l)) + } + 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 *QueryBalanceRequest) 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: QueryBalanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBalanceResponse) 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: QueryBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance == nil { + m.Balance = &types.Coin{} + } + if err := m.Balance.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllBalancesRequest) 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: QueryAllBalancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllBalancesResponse) 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: QueryAllBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, types.Coin{}) + if err := m.Balances[len(m.Balances)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpendableBalancesRequest) 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: QuerySpendableBalancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpendableBalancesResponse) 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: QuerySpendableBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, types.Coin{}) + if err := m.Balances[len(m.Balances)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpendableBalanceByDenomRequest) 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: QuerySpendableBalanceByDenomRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalanceByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySpendableBalanceByDenomResponse) 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: QuerySpendableBalanceByDenomResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalanceByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance == nil { + m.Balance = &types.Coin{} + } + if err := m.Balance.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyRequest) 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: QueryTotalSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyResponse) 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: QueryTotalSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", 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.Supply = append(m.Supply, types.Coin{}) + if err := m.Supply[len(m.Supply)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySupplyOfRequest) 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: QuerySupplyOfRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyOfRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySupplyOfResponse) 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: QuerySupplyOfResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyOfResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.Amount.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) || (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) || (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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomsMetadataRequest) 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: QueryDenomsMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsMetadataRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomsMetadataResponse) 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: QueryDenomsMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomsMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadatas", 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.Metadatas = append(m.Metadatas, Metadata{}) + if err := m.Metadatas[len(m.Metadatas)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomMetadataRequest) 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: QueryDenomMetadataRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomMetadataResponse) 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: QueryDenomMetadataResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomOwnersRequest) 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: QueryDenomOwnersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomOwner) 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: DenomOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomOwner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomOwnersResponse) 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: QueryDenomOwnersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", 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.DenomOwners = append(m.DenomOwners, &DenomOwner{}) + if err := m.DenomOwners[len(m.DenomOwners)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySendEnabledRequest) 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: QuerySendEnabledRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySendEnabledRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 99: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySendEnabledResponse) 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: QuerySendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", 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.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 99: + 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) || (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/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go new file mode 100644 index 000000000000..982f53168300 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go @@ -0,0 +1,1181 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/bank/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Balance_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBalanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Balance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBalanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Balance(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_AllBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllBalances(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SpendableBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpendableBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SpendableBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpendableBalancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SpendableBalances(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SpendableBalanceByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpendableBalanceByDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SpendableBalanceByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpendableBalanceByDenomRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + } + + protoReq.Address, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SpendableBalanceByDenom(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_TotalSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TotalSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TotalSupply(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SupplyOf_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyOfRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SupplyOf_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SupplyOf(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyOfRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SupplyOf_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SupplyOf(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomMetadataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := client.DenomMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomMetadataRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + msg, err := server.DenomMetadata(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_DenomsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsMetadataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomsMetadataRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomsMetadata(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomOwners(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_SendEnabled_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySendEnabledRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SendEnabled(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySendEnabledRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SendEnabled(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Balance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Balance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllBalances_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SpendableBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SpendableBalances_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SpendableBalanceByDenom_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalSupply_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SupplyOf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SupplyOf_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SupplyOf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomMetadata_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomsMetadata_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SendEnabled_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Balance_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Balance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AllBalances_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SpendableBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SpendableBalances_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SpendableBalanceByDenom_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalSupply_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SupplyOf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SupplyOf_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SupplyOf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomMetadata_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomsMetadata_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_SendEnabled_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "bank", "v1beta1", "balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SpendableBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "spendable_balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SpendableBalanceByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "bank", "v1beta1", "spendable_balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "send_enabled"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Balance_0 = runtime.ForwardResponseMessage + + forward_Query_AllBalances_0 = runtime.ForwardResponseMessage + + forward_Query_SpendableBalances_0 = runtime.ForwardResponseMessage + + forward_Query_SpendableBalanceByDenom_0 = runtime.ForwardResponseMessage + + forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage + + forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage + + forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage + + forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage + + forward_Query_SendEnabled_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go new file mode 100644 index 000000000000..b3fd1ea3d863 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go @@ -0,0 +1,1924 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/bank/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 + +// MsgSend represents a message to send coins from one account to another. +type MsgSend 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"` +} + +func (m *MsgSend) Reset() { *m = MsgSend{} } +func (m *MsgSend) String() string { return proto.CompactTextString(m) } +func (*MsgSend) ProtoMessage() {} +func (*MsgSend) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{0} +} +func (m *MsgSend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSend.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 *MsgSend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSend.Merge(m, src) +} +func (m *MsgSend) XXX_Size() int { + return m.Size() +} +func (m *MsgSend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSend proto.InternalMessageInfo + +// MsgSendResponse defines the Msg/Send response type. +type MsgSendResponse struct { +} + +func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } +func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSendResponse) ProtoMessage() {} +func (*MsgSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{1} +} +func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSendResponse.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 *MsgSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSendResponse.Merge(m, src) +} +func (m *MsgSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo + +// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +type MsgMultiSend struct { + // Inputs, despite being `repeated`, only allows one sender input. This is + // checked in MsgMultiSend's ValidateBasic. + Inputs []Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs"` + Outputs []Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs"` +} + +func (m *MsgMultiSend) Reset() { *m = MsgMultiSend{} } +func (m *MsgMultiSend) String() string { return proto.CompactTextString(m) } +func (*MsgMultiSend) ProtoMessage() {} +func (*MsgMultiSend) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{2} +} +func (m *MsgMultiSend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMultiSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMultiSend.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 *MsgMultiSend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMultiSend.Merge(m, src) +} +func (m *MsgMultiSend) XXX_Size() int { + return m.Size() +} +func (m *MsgMultiSend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMultiSend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMultiSend proto.InternalMessageInfo + +func (m *MsgMultiSend) GetInputs() []Input { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *MsgMultiSend) GetOutputs() []Output { + if m != nil { + return m.Outputs + } + return nil +} + +// MsgMultiSendResponse defines the Msg/MultiSend response type. +type MsgMultiSendResponse struct { +} + +func (m *MsgMultiSendResponse) Reset() { *m = MsgMultiSendResponse{} } +func (m *MsgMultiSendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMultiSendResponse) ProtoMessage() {} +func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{3} +} +func (m *MsgMultiSendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMultiSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMultiSendResponse.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 *MsgMultiSendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMultiSendResponse.Merge(m, src) +} +func (m *MsgMultiSendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMultiSendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +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 x/bank 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_1d8cb1613481f5b7, []int{4} +} +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. +// +// Since: cosmos-sdk 0.47 +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_1d8cb1613481f5b7, []int{5} +} +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 + +// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +// +// Only entries to add/update/delete need to be included. +// Existing SendEnabled entries that are not included in this +// message are left unchanged. +// +// Since: cosmos-sdk 0.47 +type MsgSetSendEnabled struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // send_enabled is the list of entries to add or update. + SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` + // use_default_for is a list of denoms that should use the params.default_send_enabled value. + // Denoms listed here will have their SendEnabled entries deleted. + // If a denom is included that doesn't have a SendEnabled entry, + // it will be ignored. + UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` +} + +func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } +func (m *MsgSetSendEnabled) String() string { return proto.CompactTextString(m) } +func (*MsgSetSendEnabled) ProtoMessage() {} +func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{6} +} +func (m *MsgSetSendEnabled) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetSendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetSendEnabled.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 *MsgSetSendEnabled) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetSendEnabled.Merge(m, src) +} +func (m *MsgSetSendEnabled) XXX_Size() int { + return m.Size() +} +func (m *MsgSetSendEnabled) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetSendEnabled.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetSendEnabled proto.InternalMessageInfo + +func (m *MsgSetSendEnabled) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { + if m != nil { + return m.SendEnabled + } + return nil +} + +func (m *MsgSetSendEnabled) GetUseDefaultFor() []string { + if m != nil { + return m.UseDefaultFor + } + return nil +} + +// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +// +// Since: cosmos-sdk 0.47 +type MsgSetSendEnabledResponse struct { +} + +func (m *MsgSetSendEnabledResponse) Reset() { *m = MsgSetSendEnabledResponse{} } +func (m *MsgSetSendEnabledResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetSendEnabledResponse) ProtoMessage() {} +func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1d8cb1613481f5b7, []int{7} +} +func (m *MsgSetSendEnabledResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetSendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetSendEnabledResponse.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 *MsgSetSendEnabledResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetSendEnabledResponse.Merge(m, src) +} +func (m *MsgSetSendEnabledResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetSendEnabledResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") + proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") + proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") + proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.bank.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.bank.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") + proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") +} + +func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } + +var fileDescriptor_1d8cb1613481f5b7 = []byte{ + // 690 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x4f, 0xd4, 0x5e, + 0x14, 0x6d, 0x99, 0xdf, 0x6f, 0x48, 0x1f, 0xa3, 0x84, 0x4a, 0x84, 0x29, 0xa4, 0x03, 0x8d, 0x21, + 0x80, 0xd2, 0x0a, 0x7e, 0x25, 0x63, 0x34, 0x3a, 0xa8, 0x89, 0x26, 0x13, 0xcd, 0x10, 0x17, 0xba, + 0x99, 0xb4, 0xf4, 0xd1, 0x69, 0xa0, 0x7d, 0x4d, 0xdf, 0x2b, 0x81, 0x9d, 0xba, 0x32, 0xae, 0xdc, + 0xbb, 0x61, 0x69, 0x5c, 0xb1, 0x70, 0x69, 0xe2, 0x96, 0x25, 0x71, 0xe5, 0x4a, 0x0d, 0x2c, 0xd0, + 0xff, 0xc2, 0xbc, 0x8f, 0x96, 0xce, 0x30, 0xc3, 0x10, 0x37, 0xd3, 0xce, 0xbb, 0xe7, 0x9c, 0x7b, + 0xcf, 0xed, 0x69, 0xc1, 0xe4, 0x2a, 0xc2, 0x01, 0xc2, 0x96, 0x63, 0x87, 0xeb, 0xd6, 0xe6, 0xa2, + 0x03, 0x89, 0xbd, 0x68, 0x91, 0x2d, 0x33, 0x8a, 0x11, 0x41, 0xea, 0x05, 0x5e, 0x35, 0x69, 0xd5, + 0x14, 0x55, 0x6d, 0xd4, 0x43, 0x1e, 0x62, 0x75, 0x8b, 0xde, 0x71, 0xa8, 0xa6, 0x67, 0x42, 0x18, + 0x66, 0x42, 0xab, 0xc8, 0x0f, 0x4f, 0xd4, 0x73, 0x8d, 0x98, 0x2e, 0xaf, 0x97, 0x79, 0xbd, 0xc9, + 0x85, 0x45, 0x5f, 0x5e, 0x1a, 0x13, 0xd4, 0x00, 0x7b, 0xd6, 0xe6, 0x22, 0xbd, 0x88, 0xc2, 0x88, + 0x1d, 0xf8, 0x21, 0xb2, 0xd8, 0x2f, 0x3f, 0x32, 0x3e, 0x0c, 0x80, 0xc1, 0x3a, 0xf6, 0x56, 0x60, + 0xe8, 0xaa, 0xb7, 0x41, 0x69, 0x2d, 0x46, 0x41, 0xd3, 0x76, 0xdd, 0x18, 0x62, 0x3c, 0x2e, 0x4f, + 0xc9, 0xb3, 0x4a, 0x6d, 0xfc, 0xdb, 0xe7, 0x85, 0x51, 0xa1, 0x7f, 0x9f, 0x57, 0x56, 0x48, 0xec, + 0x87, 0x5e, 0x63, 0x88, 0xa2, 0xc5, 0x91, 0x7a, 0x0b, 0x00, 0x82, 0x32, 0xea, 0x40, 0x1f, 0xaa, + 0x42, 0x50, 0x4a, 0x6c, 0x81, 0xa2, 0x1d, 0xa0, 0x24, 0x24, 0xe3, 0x85, 0xa9, 0xc2, 0xec, 0xd0, + 0x52, 0xd9, 0xcc, 0x96, 0x88, 0x61, 0xba, 0x44, 0x73, 0x19, 0xf9, 0x61, 0xed, 0xc6, 0xde, 0x8f, + 0x8a, 0xf4, 0xe9, 0x67, 0x65, 0xd6, 0xf3, 0x49, 0x2b, 0x71, 0xcc, 0x55, 0x14, 0x08, 0xe7, 0xe2, + 0xb2, 0x80, 0xdd, 0x75, 0x8b, 0x6c, 0x47, 0x10, 0x33, 0x02, 0xfe, 0x78, 0xb4, 0x3b, 0x2f, 0x37, + 0x84, 0x7e, 0xf5, 0xea, 0xdb, 0x9d, 0x8a, 0xf4, 0x7b, 0xa7, 0x22, 0xbd, 0x39, 0xda, 0x9d, 0x6f, + 0xb3, 0xfa, 0xee, 0x68, 0x77, 0x5e, 0xcd, 0x49, 0x88, 0x8d, 0x18, 0x23, 0x60, 0x58, 0xdc, 0x36, + 0x20, 0x8e, 0x50, 0x88, 0xa1, 0xf1, 0x45, 0x06, 0xa5, 0x3a, 0xf6, 0xea, 0xc9, 0x06, 0xf1, 0xd9, + 0xd6, 0xee, 0x80, 0xa2, 0x1f, 0x46, 0x09, 0xa1, 0xfb, 0xa2, 0xf3, 0x6b, 0x66, 0x97, 0x10, 0x98, + 0x8f, 0x29, 0xa4, 0xa6, 0x50, 0x03, 0x62, 0x28, 0x4e, 0x52, 0xef, 0x81, 0x41, 0x94, 0x10, 0xc6, + 0x1f, 0x60, 0xfc, 0x89, 0xae, 0xfc, 0xa7, 0x0c, 0x93, 0x17, 0x48, 0x69, 0xd5, 0xcb, 0xa9, 0x25, + 0x21, 0x49, 0xcd, 0x8c, 0xb5, 0x9b, 0xc9, 0xa6, 0x35, 0x2e, 0x82, 0xd1, 0xfc, 0xff, 0xcc, 0xd6, + 0x57, 0x99, 0x59, 0x7d, 0x1e, 0xb9, 0x36, 0x81, 0xcf, 0xec, 0xd8, 0x0e, 0xb0, 0x7a, 0x13, 0x28, + 0x76, 0x42, 0x5a, 0x28, 0xf6, 0xc9, 0x76, 0xdf, 0x30, 0x1c, 0x43, 0xd5, 0xbb, 0xa0, 0x18, 0x31, + 0x05, 0x16, 0x83, 0x5e, 0x8e, 0x78, 0x93, 0xb6, 0x95, 0x70, 0x56, 0xf5, 0x3a, 0x35, 0x73, 0xac, + 0x47, 0xfd, 0x4c, 0xe7, 0xfc, 0x6c, 0xf1, 0x77, 0xa2, 0x63, 0x5a, 0xa3, 0x0c, 0xc6, 0x3a, 0x8e, + 0x32, 0x73, 0x7f, 0x64, 0x30, 0xc2, 0x9e, 0x23, 0xa1, 0x9e, 0x1f, 0x86, 0xb6, 0xb3, 0x01, 0xdd, + 0x7f, 0xb6, 0xb7, 0x0c, 0x4a, 0x18, 0x86, 0x6e, 0x13, 0x72, 0x1d, 0xf1, 0xd8, 0xa6, 0xba, 0x9a, + 0xcc, 0xf5, 0x6b, 0x0c, 0xe1, 0x5c, 0xf3, 0x19, 0x30, 0x9c, 0x60, 0xd8, 0x74, 0xe1, 0x9a, 0x9d, + 0x6c, 0x90, 0xe6, 0x1a, 0x8a, 0x59, 0xfc, 0x95, 0xc6, 0xb9, 0x04, 0xc3, 0x07, 0xfc, 0xf4, 0x11, + 0x8a, 0xab, 0xd6, 0xc9, 0x5d, 0x4c, 0x76, 0x06, 0x35, 0xef, 0xca, 0x98, 0x00, 0xe5, 0x13, 0x87, + 0xe9, 0x22, 0x96, 0x5e, 0x17, 0x40, 0xa1, 0x8e, 0x3d, 0xf5, 0x09, 0xf8, 0x8f, 0x65, 0x77, 0xb2, + 0xeb, 0xd0, 0x22, 0xf2, 0xda, 0xa5, 0xd3, 0xaa, 0xa9, 0xa6, 0xfa, 0x02, 0x28, 0xc7, 0x2f, 0xc3, + 0x74, 0x2f, 0x4a, 0x06, 0xd1, 0xe6, 0xfa, 0x42, 0x32, 0x69, 0x07, 0x94, 0xda, 0x02, 0xd9, 0x73, + 0xa0, 0x3c, 0x4a, 0xbb, 0x72, 0x16, 0x54, 0xd6, 0xa3, 0x05, 0xce, 0x77, 0xe4, 0x62, 0xa6, 0xb7, + 0xed, 0x3c, 0x4e, 0x33, 0xcf, 0x86, 0x4b, 0x3b, 0x69, 0xff, 0xbf, 0xa2, 0x29, 0xaf, 0x2d, 0xef, + 0x1d, 0xe8, 0xf2, 0xfe, 0x81, 0x2e, 0xff, 0x3a, 0xd0, 0xe5, 0xf7, 0x87, 0xba, 0xb4, 0x7f, 0xa8, + 0x4b, 0xdf, 0x0f, 0x75, 0xe9, 0xe5, 0xdc, 0xa9, 0x9f, 0x35, 0x11, 0x7b, 0xf6, 0x75, 0x73, 0x8a, + 0xec, 0xeb, 0x7d, 0xed, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0xe8, 0x90, 0x24, 0x8f, 0x06, + 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 { + // Send defines a method for sending coins from one account to another account. + Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. + MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { + out := new(MsgSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/Send", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) { + out := new(MsgMultiSendResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/MultiSend", 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, "/cosmos.bank.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { + out := new(MsgSetSendEnabledResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Send defines a method for sending coins from one account to another account. + Send(context.Context, *MsgSend) (*MsgSendResponse, error) + // MultiSend defines a method for sending coins from some accounts to other accounts. + MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) + // UpdateParams defines a governance operation for updating the x/bank module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // SetSendEnabled is a governance operation for setting the SendEnabled flag + // on any number of Denoms. Only the entries to add or update should be + // included. Entries that already exist in the store, but that aren't + // included in this message, will be left unchanged. + // + // Since: cosmos-sdk 0.47 + SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") +} +func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) SetSendEnabled(ctx context.Context, req *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Send(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/Send", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Send(ctx, req.(*MsgSend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMultiSend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).MultiSend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/MultiSend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).MultiSend(ctx, req.(*MsgMultiSend)) + } + 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: "/cosmos.bank.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetSendEnabled) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetSendEnabled(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.bank.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Send", + Handler: _Msg_Send_Handler, + }, + { + MethodName: "MultiSend", + Handler: _Msg_MultiSend_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "SetSendEnabled", + Handler: _Msg_SetSendEnabled_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/bank/v1beta1/tx.proto", +} + +func (m *MsgSend) 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 *MsgSend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSend) 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 *MsgSendResponse) 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 *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgMultiSend) 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 *MsgMultiSend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMultiSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Outputs) > 0 { + for iNdEx := len(m.Outputs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Outputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Inputs) > 0 { + for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgMultiSendResponse) 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 *MsgMultiSendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 (m *MsgSetSendEnabled) 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 *MsgSetSendEnabled) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.UseDefaultFor) > 0 { + for iNdEx := len(m.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.UseDefaultFor[iNdEx]) + copy(dAtA[i:], m.UseDefaultFor[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.UseDefaultFor[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.SendEnabled) > 0 { + for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SendEnabled[iNdEx].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 *MsgSetSendEnabledResponse) 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 *MsgSetSendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetSendEnabledResponse) 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 *MsgSend) 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 *MsgSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgMultiSend) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Inputs) > 0 { + for _, e := range m.Inputs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.Outputs) > 0 { + for _, e := range m.Outputs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgMultiSendResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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 (m *MsgSetSendEnabled) 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)) + } + if len(m.SendEnabled) > 0 { + for _, e := range m.SendEnabled { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.UseDefaultFor) > 0 { + for _, s := range m.UseDefaultFor { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSetSendEnabledResponse) 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 *MsgSend) 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: MsgSend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSend: 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 *MsgSendResponse) 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: MsgSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSendResponse: 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 *MsgMultiSend) 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: MsgMultiSend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMultiSend: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Inputs", 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.Inputs = append(m.Inputs, Input{}) + if err := m.Inputs[len(m.Inputs)-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 Outputs", 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.Outputs = append(m.Outputs, Output{}) + if err := m.Outputs[len(m.Outputs)-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 *MsgMultiSendResponse) 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: MsgMultiSendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMultiSendResponse: 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 *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) || (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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetSendEnabled) 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: MsgSetSendEnabled: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetSendEnabled: 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 SendEnabled", 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.SendEnabled = append(m.SendEnabled, &SendEnabled{}) + if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UseDefaultFor", 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.UseDefaultFor = append(m.UseDefaultFor, string(dAtA[iNdEx:postIndex])) + 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 *MsgSetSendEnabledResponse) 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: MsgSetSendEnabledResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetSendEnabledResponse: 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") +) diff --git a/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go b/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go new file mode 100644 index 000000000000..7f91e468ae1e --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go @@ -0,0 +1,702 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/capability/v1beta1/capability.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Capability defines an implementation of an object capability. The index +// provided to a Capability must be globally unique. +type Capability struct { + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *Capability) Reset() { *m = Capability{} } +func (*Capability) ProtoMessage() {} +func (*Capability) Descriptor() ([]byte, []int) { + return fileDescriptor_6308261edd8470a9, []int{0} +} +func (m *Capability) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Capability.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 *Capability) XXX_Merge(src proto.Message) { + xxx_messageInfo_Capability.Merge(m, src) +} +func (m *Capability) XXX_Size() int { + return m.Size() +} +func (m *Capability) XXX_DiscardUnknown() { + xxx_messageInfo_Capability.DiscardUnknown(m) +} + +var xxx_messageInfo_Capability proto.InternalMessageInfo + +func (m *Capability) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +// Owner defines a single capability owner. An owner is defined by the name of +// capability and the module name. +type Owner struct { + Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *Owner) Reset() { *m = Owner{} } +func (*Owner) ProtoMessage() {} +func (*Owner) Descriptor() ([]byte, []int) { + return fileDescriptor_6308261edd8470a9, []int{1} +} +func (m *Owner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Owner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Owner.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 *Owner) XXX_Merge(src proto.Message) { + xxx_messageInfo_Owner.Merge(m, src) +} +func (m *Owner) XXX_Size() int { + return m.Size() +} +func (m *Owner) XXX_DiscardUnknown() { + xxx_messageInfo_Owner.DiscardUnknown(m) +} + +var xxx_messageInfo_Owner proto.InternalMessageInfo + +// CapabilityOwners defines a set of owners of a single Capability. The set of +// owners must be unique. +type CapabilityOwners struct { + Owners []Owner `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners"` +} + +func (m *CapabilityOwners) Reset() { *m = CapabilityOwners{} } +func (m *CapabilityOwners) String() string { return proto.CompactTextString(m) } +func (*CapabilityOwners) ProtoMessage() {} +func (*CapabilityOwners) Descriptor() ([]byte, []int) { + return fileDescriptor_6308261edd8470a9, []int{2} +} +func (m *CapabilityOwners) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CapabilityOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CapabilityOwners.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 *CapabilityOwners) XXX_Merge(src proto.Message) { + xxx_messageInfo_CapabilityOwners.Merge(m, src) +} +func (m *CapabilityOwners) XXX_Size() int { + return m.Size() +} +func (m *CapabilityOwners) XXX_DiscardUnknown() { + xxx_messageInfo_CapabilityOwners.DiscardUnknown(m) +} + +var xxx_messageInfo_CapabilityOwners proto.InternalMessageInfo + +func (m *CapabilityOwners) GetOwners() []Owner { + if m != nil { + return m.Owners + } + return nil +} + +func init() { + proto.RegisterType((*Capability)(nil), "cosmos.capability.v1beta1.Capability") + proto.RegisterType((*Owner)(nil), "cosmos.capability.v1beta1.Owner") + proto.RegisterType((*CapabilityOwners)(nil), "cosmos.capability.v1beta1.CapabilityOwners") +} + +func init() { + proto.RegisterFile("cosmos/capability/v1beta1/capability.proto", fileDescriptor_6308261edd8470a9) +} + +var fileDescriptor_6308261edd8470a9 = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xca, 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x12, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, + 0xa8, 0xd5, 0x43, 0x92, 0x80, 0xaa, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, + 0xb1, 0x20, 0x1a, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x48, 0x49, + 0x83, 0x8b, 0xcb, 0x19, 0xae, 0x5d, 0x48, 0x84, 0x8b, 0x35, 0x33, 0x2f, 0x25, 0xb5, 0x42, 0x82, + 0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0xb1, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0x41, 0xc9, 0x96, + 0x8b, 0xd5, 0xbf, 0x3c, 0x2f, 0xb5, 0x48, 0x48, 0x8c, 0x8b, 0x2d, 0x37, 0x3f, 0xa5, 0x34, 0x27, + 0x15, 0xac, 0x8a, 0x33, 0x08, 0xca, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, + 0x02, 0x8b, 0x82, 0xd9, 0x56, 0x1c, 0x1d, 0x0b, 0xe4, 0x19, 0xc0, 0xda, 0xc3, 0xb9, 0x04, 0x10, + 0x16, 0x81, 0x0d, 0x2a, 0x16, 0x72, 0xe6, 0x62, 0xcb, 0x07, 0xb3, 0x24, 0x18, 0x15, 0x98, 0x35, + 0xb8, 0x8d, 0x14, 0xf4, 0x70, 0xfa, 0x48, 0x0f, 0xac, 0xc5, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, + 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0xb5, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, + 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, + 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, + 0x3e, 0x2c, 0x58, 0xc1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x72, 0x18, 0x97, 0x54, 0x16, + 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xc4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x27, 0x8c, 0xba, + 0x4e, 0x85, 0x01, 0x00, 0x00, +} + +func (m *Capability) 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 *Capability) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Index != 0 { + i = encodeVarintCapability(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Owner) 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 *Owner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Owner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintCapability(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintCapability(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CapabilityOwners) 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 *CapabilityOwners) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilityOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owners) > 0 { + for iNdEx := len(m.Owners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Owners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCapability(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintCapability(dAtA []byte, offset int, v uint64) int { + offset -= sovCapability(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Capability) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovCapability(uint64(m.Index)) + } + return n +} + +func (m *Owner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovCapability(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovCapability(uint64(l)) + } + return n +} + +func (m *CapabilityOwners) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Owners) > 0 { + for _, e := range m.Owners { + l = e.Size() + n += 1 + l + sovCapability(uint64(l)) + } + } + return n +} + +func sovCapability(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCapability(x uint64) (n int) { + return sovCapability(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Capability) 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 ErrIntOverflowCapability + } + 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: Capability: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Capability: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCapability + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCapability(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCapability + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Owner) 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 ErrIntOverflowCapability + } + 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: Owner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Owner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCapability + } + 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 ErrInvalidLengthCapability + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCapability + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowCapability + } + 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 ErrInvalidLengthCapability + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCapability + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCapability(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCapability + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CapabilityOwners) 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 ErrIntOverflowCapability + } + 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: CapabilityOwners: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CapabilityOwners: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCapability + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCapability + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCapability + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owners = append(m.Owners, Owner{}) + if err := m.Owners[len(m.Owners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCapability(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCapability + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCapability(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, ErrIntOverflowCapability + } + 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, ErrIntOverflowCapability + } + 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, ErrIntOverflowCapability + } + 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, ErrInvalidLengthCapability + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupCapability + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthCapability + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthCapability = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCapability = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupCapability = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go new file mode 100644 index 000000000000..785d99b51b94 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/capability/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisOwners defines the capability owners with their corresponding index. +type GenesisOwners struct { + // index is the index of the capability owner. + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + // index_owners are the owners at the given index. + IndexOwners CapabilityOwners `protobuf:"bytes,2,opt,name=index_owners,json=indexOwners,proto3" json:"index_owners"` +} + +func (m *GenesisOwners) Reset() { *m = GenesisOwners{} } +func (m *GenesisOwners) String() string { return proto.CompactTextString(m) } +func (*GenesisOwners) ProtoMessage() {} +func (*GenesisOwners) Descriptor() ([]byte, []int) { + return fileDescriptor_94922dd16a11c23e, []int{0} +} +func (m *GenesisOwners) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisOwners.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 *GenesisOwners) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisOwners.Merge(m, src) +} +func (m *GenesisOwners) XXX_Size() int { + return m.Size() +} +func (m *GenesisOwners) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisOwners.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisOwners proto.InternalMessageInfo + +func (m *GenesisOwners) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *GenesisOwners) GetIndexOwners() CapabilityOwners { + if m != nil { + return m.IndexOwners + } + return CapabilityOwners{} +} + +// GenesisState defines the capability module's genesis state. +type GenesisState struct { + // index is the capability global index. + Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + // owners represents a map from index to owners of the capability index + // index key is string to allow amino marshalling. + Owners []GenesisOwners `protobuf:"bytes,2,rep,name=owners,proto3" json:"owners"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_94922dd16a11c23e, []int{1} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *GenesisState) GetOwners() []GenesisOwners { + if m != nil { + return m.Owners + } + return nil +} + +func init() { + proto.RegisterType((*GenesisOwners)(nil), "cosmos.capability.v1beta1.GenesisOwners") + proto.RegisterType((*GenesisState)(nil), "cosmos.capability.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/capability/v1beta1/genesis.proto", fileDescriptor_94922dd16a11c23e) +} + +var fileDescriptor_94922dd16a11c23e = []byte{ + // 280 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xca, 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2f, 0x33, + 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, + 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xb4, 0x70, 0x9b, 0x8c, 0x64, + 0x06, 0x44, 0xad, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x08, 0x29, 0x35, 0x30, + 0x72, 0xf1, 0xba, 0x43, 0x5c, 0xe0, 0x5f, 0x9e, 0x97, 0x5a, 0x54, 0x2c, 0x24, 0xc2, 0xc5, 0x9a, + 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x12, 0x04, 0xe1, 0x08, 0x45, 0x72, + 0xf1, 0x80, 0x19, 0xf1, 0xf9, 0x60, 0x55, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xda, 0x7a, + 0x38, 0x9d, 0xab, 0xe7, 0x0c, 0x17, 0x82, 0x18, 0xec, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, + 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xb8, 0xc1, 0x66, 0x41, 0xc4, 0x95, 0x0a, 0xb9, 0x78, 0xa0, 0x2e, + 0x08, 0x2e, 0x49, 0x2c, 0x49, 0xc5, 0xe1, 0x00, 0x6f, 0x2e, 0x36, 0xb8, 0xd5, 0xcc, 0x1a, 0xdc, + 0x46, 0x1a, 0x78, 0xac, 0x46, 0xf1, 0x10, 0xb2, 0xbd, 0x50, 0x23, 0x9c, 0x3c, 0x4f, 0x3c, 0x92, + 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, + 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, + 0x39, 0x3f, 0x57, 0x1f, 0x16, 0xb2, 0x60, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x39, 0x98, + 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe1, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0xa2, 0x39, 0xc7, 0xe6, 0xe2, 0x01, 0x00, 0x00, +} + +func (m *GenesisOwners) 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 *GenesisOwners) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IndexOwners.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Index != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owners) > 0 { + for iNdEx := len(m.Owners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Owners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Index != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisOwners) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovGenesis(uint64(m.Index)) + } + l = m.IndexOwners.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovGenesis(uint64(m.Index)) + } + if len(m.Owners) > 0 { + for _, e := range m.Owners { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisOwners) 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 ErrIntOverflowGenesis + } + 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: GenesisOwners: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisOwners: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IndexOwners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IndexOwners.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owners = append(m.Owners, GenesisOwners{}) + if err := m.Owners[len(m.Owners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go new file mode 100644 index 000000000000..b6f6df03ec71 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go @@ -0,0 +1,544 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cometbft/cometbft/proto/tendermint/types" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryParamsRequest defines the request type for querying x/consensus parameters. +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_bf54d1e5df04cee9, []int{0} +} +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 defines the response type for querying x/consensus parameters. +type QueryParamsResponse struct { + // params are the tendermint consensus params stored in the consensus module. + // Please note that `params.version` is not populated in this response, it is + // tracked separately in the x/upgrade module. + Params *types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +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_bf54d1e5df04cee9, []int{1} +} +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() *types.ConsensusParams { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus.v1.QueryParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/consensus/v1/query.proto", fileDescriptor_bf54d1e5df04cee9) } + +var fileDescriptor_bf54d1e5df04cee9 = []byte{ + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, + 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, + 0x83, 0x2b, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, + 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x68, 0x91, + 0x92, 0x2d, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0x4a, 0x2b, 0x89, 0x70, 0x09, 0x05, 0x82, 0x2c, + 0x08, 0x00, 0x0b, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0x05, 0x70, 0x09, 0xa3, 0x88, + 0x16, 0x17, 0x80, 0x2c, 0x14, 0xb2, 0xe4, 0x62, 0x83, 0x68, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, + 0x36, 0x52, 0xd4, 0x43, 0x18, 0xae, 0x07, 0x36, 0x5c, 0xcf, 0x19, 0xe6, 0x32, 0xa8, 0x56, 0xa8, + 0x06, 0xa3, 0x2e, 0x46, 0x2e, 0x56, 0xb0, 0x91, 0x42, 0x0d, 0x8c, 0x5c, 0x6c, 0x10, 0x49, 0x21, + 0x75, 0x3d, 0x2c, 0xfe, 0xd1, 0xc3, 0x74, 0x8f, 0x94, 0x06, 0x61, 0x85, 0x10, 0x27, 0x2a, 0x29, + 0x37, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x56, 0x48, 0x5a, 0x1f, 0x5b, 0x58, 0x42, 0x1c, 0xe3, 0xe4, + 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, + 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x7a, 0xe9, 0x99, 0x25, 0x19, + 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0x08, 0x03, 0x40, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, + 0x92, 0x69, 0x60, 0xef, 0x26, 0xb1, 0x81, 0x43, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1b, + 0xa2, 0x35, 0xa1, 0xba, 0x01, 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 { + // Params queries the parameters of x/consensus_param module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the parameters of x/consensus_param module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/cosmos.consensus.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) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.consensus.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus/v1/query.proto", +} + +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 + if m.Params != nil { + { + 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 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 *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 + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + 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 *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) || (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 m.Params == nil { + m.Params = &types.ConsensusParams{} + } + 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) || (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/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go new file mode 100644 index 000000000000..c2bd4deb378f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/consensus/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "consensus", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go new file mode 100644 index 000000000000..abb69d2dc8db --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go @@ -0,0 +1,732 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/consensus/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cometbft/cometbft/proto/tendermint/types" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + 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 + +// 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 x/consensus parameters to update. + // VersionsParams is not included in this Msg because it is tracked + // separarately in x/upgrade. + // + // NOTE: All parameters must be supplied. + Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` + Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` + Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` +} + +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_2135c60575ab504d, []int{0} +} +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) GetBlock() *types.BlockParams { + if m != nil { + return m.Block + } + return nil +} + +func (m *MsgUpdateParams) GetEvidence() *types.EvidenceParams { + if m != nil { + return m.Evidence + } + return nil +} + +func (m *MsgUpdateParams) GetValidator() *types.ValidatorParams { + if m != nil { + return m.Validator + } + return nil +} + +// 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_2135c60575ab504d, []int{1} +} +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((*MsgUpdateParams)(nil), "cosmos.consensus.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } + +var fileDescriptor_2135c60575ab504d = []byte{ + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, + 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, + 0xca, 0x0c, 0xa5, 0x24, 0x21, 0x82, 0xf1, 0x60, 0x25, 0xfa, 0x50, 0x15, 0x60, 0x8e, 0x94, 0x38, + 0xd4, 0xb4, 0xdc, 0xe2, 0x74, 0x90, 0x39, 0xb9, 0xc5, 0xe9, 0x50, 0x09, 0xd9, 0x92, 0xd4, 0xbc, + 0x94, 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0xfd, 0x82, 0xc4, + 0xa2, 0xc4, 0x5c, 0xa8, 0x3e, 0xa5, 0x5e, 0x26, 0x2e, 0x7e, 0xdf, 0xe2, 0xf4, 0xd0, 0x82, 0x94, + 0xc4, 0x92, 0xd4, 0x00, 0xb0, 0x8c, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, + 0x66, 0x49, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, 0x22, 0x50, + 0x0b, 0x1d, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, 0x10, + 0x4a, 0x85, 0x8c, 0xb9, 0x58, 0x93, 0x72, 0xf2, 0x93, 0xb3, 0x25, 0x98, 0x14, 0x18, 0x35, 0xb8, + 0x8d, 0x64, 0xf5, 0x10, 0x56, 0xeb, 0x81, 0xad, 0xd6, 0x73, 0x02, 0x49, 0x43, 0x6c, 0x09, 0x82, + 0xa8, 0x15, 0xb2, 0xe1, 0xe2, 0x48, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0x95, 0x60, 0x06, + 0xeb, 0x53, 0xc0, 0xd4, 0xe7, 0x0a, 0x55, 0x01, 0xd5, 0x0a, 0xd7, 0x21, 0x64, 0xcf, 0xc5, 0x59, + 0x96, 0x98, 0x93, 0x99, 0x92, 0x58, 0x92, 0x5f, 0x24, 0xc1, 0x02, 0xd6, 0xae, 0x88, 0xa9, 0x3d, + 0x0c, 0xa6, 0x04, 0xaa, 0x1f, 0xa1, 0xc7, 0x8a, 0xaf, 0xe9, 0xf9, 0x06, 0x2d, 0x84, 0x1f, 0x94, + 0x24, 0xb9, 0xc4, 0xd1, 0x82, 0x23, 0x28, 0xb5, 0xb8, 0x00, 0x14, 0x09, 0x46, 0x99, 0x5c, 0xcc, + 0xbe, 0xc5, 0xe9, 0x42, 0x49, 0x5c, 0x3c, 0x28, 0xa1, 0xa5, 0xa2, 0x87, 0x25, 0xaa, 0xf4, 0xd0, + 0x0c, 0x91, 0xd2, 0x21, 0x46, 0x15, 0xcc, 0x2a, 0x27, 0x8f, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, + 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, + 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, + 0x87, 0x27, 0x20, 0x10, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x81, 0x94, 0x9a, 0xc0, 0x5e, 0x4f, + 0x62, 0x03, 0x47, 0xb3, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x89, 0xc5, 0x6c, 0x6e, 0x02, + 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 { + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + 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) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.consensus.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 { + // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. + // The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +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_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: "/cosmos.consensus.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: "cosmos.consensus.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/consensus/v1/tx.proto", +} + +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 + if m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Evidence != nil { + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Block != nil { + { + size, err := m.Block.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 *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)) + } + if m.Block != nil { + l = m.Block.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Validator != nil { + l = m.Validator.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 *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 Block", 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 m.Block == nil { + m.Block = &types.BlockParams{} + } + if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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 m.Evidence == nil { + m.Evidence = &types.EvidenceParams{} + } + if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", 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 m.Validator == nil { + m.Validator = &types.ValidatorParams{} + } + if err := m.Validator.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 *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) || (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/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go new file mode 100644 index 000000000000..fbd2981eab58 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go @@ -0,0 +1,330 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crisis/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// GenesisState defines the crisis module's genesis state. +type GenesisState struct { + // constant_fee is the fee used to verify the invariant in the crisis + // module. + ConstantFee types.Coin `protobuf:"bytes,3,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_7a9c2781aa8a27ae, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetConstantFee() types.Coin { + if m != nil { + return m.ConstantFee + } + return types.Coin{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.crisis.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/crisis/v1beta1/genesis.proto", fileDescriptor_7a9c2781aa8a27ae) +} + +var fileDescriptor_7a9c2781aa8a27ae = []byte{ + // 241 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2c, 0xce, 0x2c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, + 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, + 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0xe4, 0xa0, 0x26, 0x26, 0x25, 0x16, 0xa7, 0xc2, 0xcd, + 0x4b, 0xce, 0xcf, 0xcc, 0x83, 0xca, 0x0b, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, + 0x90, 0x52, 0x38, 0x17, 0x8f, 0x3b, 0xc4, 0xc2, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x77, 0x2e, + 0x9e, 0xe4, 0xfc, 0xbc, 0xe2, 0x92, 0xc4, 0xbc, 0x92, 0xf8, 0xb4, 0xd4, 0x54, 0x09, 0x66, 0x05, + 0x46, 0x0d, 0x6e, 0x23, 0x49, 0x3d, 0xa8, 0x33, 0x40, 0x26, 0xc3, 0x1c, 0xa1, 0xe7, 0x9c, 0x9f, + 0x99, 0xe7, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xb8, 0x61, + 0x3a, 0xdd, 0x52, 0x53, 0x9d, 0x5c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, + 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, + 0x4a, 0x3b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x16, 0x04, 0x60, + 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x16, 0x1e, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, + 0x60, 0x67, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x98, 0x45, 0xfd, 0x02, 0x2d, 0x01, 0x00, + 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ConstantFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ConstantFee.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConstantFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ConstantFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go new file mode 100644 index 000000000000..96458da2529e --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go @@ -0,0 +1,1028 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/crisis/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + 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 + +// MsgVerifyInvariant represents a message to verify a particular invariance. +type MsgVerifyInvariant struct { + // sender is the account address of private key to send coins to fee collector account. + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // name of the invariant module. + InvariantModuleName string `protobuf:"bytes,2,opt,name=invariant_module_name,json=invariantModuleName,proto3" json:"invariant_module_name,omitempty"` + // invariant_route is the msg's invariant route. + InvariantRoute string `protobuf:"bytes,3,opt,name=invariant_route,json=invariantRoute,proto3" json:"invariant_route,omitempty"` +} + +func (m *MsgVerifyInvariant) Reset() { *m = MsgVerifyInvariant{} } +func (m *MsgVerifyInvariant) String() string { return proto.CompactTextString(m) } +func (*MsgVerifyInvariant) ProtoMessage() {} +func (*MsgVerifyInvariant) Descriptor() ([]byte, []int) { + return fileDescriptor_61276163172fe867, []int{0} +} +func (m *MsgVerifyInvariant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVerifyInvariant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVerifyInvariant.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 *MsgVerifyInvariant) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVerifyInvariant.Merge(m, src) +} +func (m *MsgVerifyInvariant) XXX_Size() int { + return m.Size() +} +func (m *MsgVerifyInvariant) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVerifyInvariant.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVerifyInvariant proto.InternalMessageInfo + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +type MsgVerifyInvariantResponse struct { +} + +func (m *MsgVerifyInvariantResponse) Reset() { *m = MsgVerifyInvariantResponse{} } +func (m *MsgVerifyInvariantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVerifyInvariantResponse) ProtoMessage() {} +func (*MsgVerifyInvariantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_61276163172fe867, []int{1} +} +func (m *MsgVerifyInvariantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVerifyInvariantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVerifyInvariantResponse.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 *MsgVerifyInvariantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVerifyInvariantResponse.Merge(m, src) +} +func (m *MsgVerifyInvariantResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVerifyInvariantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVerifyInvariantResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVerifyInvariantResponse proto.InternalMessageInfo + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +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"` + // constant_fee defines the x/crisis parameter. + ConstantFee types.Coin `protobuf:"bytes,2,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"` +} + +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_61276163172fe867, []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) GetConstantFee() types.Coin { + if m != nil { + return m.ConstantFee + } + return types.Coin{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +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_61276163172fe867, []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((*MsgVerifyInvariant)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariant") + proto.RegisterType((*MsgVerifyInvariantResponse)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.crisis.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.crisis.v1beta1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/crisis/v1beta1/tx.proto", fileDescriptor_61276163172fe867) } + +var fileDescriptor_61276163172fe867 = []byte{ + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xde, 0xb5, 0x58, 0xc8, 0xb4, 0x18, 0x5c, 0x5b, 0x9a, 0x2c, 0xba, 0x91, 0x08, 0xfe, 0x88, + 0x74, 0xd7, 0x44, 0xec, 0xa1, 0x37, 0x23, 0x2a, 0x1e, 0x22, 0xb2, 0xa2, 0x07, 0x2f, 0x61, 0xb2, + 0x3b, 0xd9, 0x0e, 0xba, 0x33, 0x61, 0xde, 0x24, 0x34, 0x37, 0xf1, 0x24, 0x9e, 0xfc, 0x13, 0x7a, + 0xf4, 0x98, 0x83, 0x7f, 0x44, 0xf1, 0x54, 0x3c, 0x89, 0x07, 0x91, 0x04, 0x89, 0x7f, 0x86, 0xec, + 0xce, 0x4c, 0x52, 0x93, 0x8a, 0xb9, 0x24, 0xcb, 0xfb, 0xbe, 0xf7, 0xde, 0xf7, 0x7d, 0x33, 0x83, + 0xbc, 0x88, 0x43, 0xca, 0x21, 0x88, 0x04, 0x05, 0x0a, 0xc1, 0xa0, 0xde, 0x21, 0x12, 0xd7, 0x03, + 0x79, 0xe8, 0xf7, 0x04, 0x97, 0xdc, 0xd9, 0x56, 0xb8, 0xaf, 0x70, 0x5f, 0xe3, 0xee, 0x56, 0xc2, + 0x13, 0x9e, 0x33, 0x82, 0xec, 0x4b, 0x91, 0xdd, 0xb2, 0x22, 0xb7, 0x15, 0xa0, 0x3b, 0x15, 0xb4, + 0xa3, 0xf7, 0xa4, 0x90, 0x04, 0x83, 0x7a, 0xf6, 0xa7, 0x81, 0x8b, 0x38, 0xa5, 0x8c, 0x07, 0xf9, + 0xaf, 0x2e, 0x19, 0x4d, 0x1d, 0x0c, 0x64, 0xa6, 0x28, 0xe2, 0x94, 0x29, 0xbc, 0xfa, 0xdd, 0x46, + 0x4e, 0x0b, 0x92, 0x97, 0x44, 0xd0, 0xee, 0xf0, 0x09, 0x1b, 0x60, 0x41, 0x31, 0x93, 0xce, 0x1d, + 0xb4, 0x0e, 0x84, 0xc5, 0x44, 0x94, 0xec, 0xab, 0xf6, 0xcd, 0x42, 0xb3, 0xf4, 0xf5, 0xf3, 0xee, + 0x96, 0x16, 0x71, 0x3f, 0x8e, 0x05, 0x01, 0x78, 0x2e, 0x05, 0x65, 0x49, 0xa8, 0x79, 0x4e, 0x03, + 0x6d, 0x53, 0xd3, 0xde, 0x4e, 0x79, 0xdc, 0x7f, 0x43, 0xda, 0x0c, 0xa7, 0xa4, 0x74, 0x2e, 0x1b, + 0x10, 0x5e, 0x9a, 0x81, 0xad, 0x1c, 0x7b, 0x8a, 0x53, 0xe2, 0xdc, 0x40, 0xc5, 0x79, 0x8f, 0xe0, + 0x7d, 0x49, 0x4a, 0x6b, 0x39, 0xfb, 0xc2, 0xac, 0x1c, 0x66, 0xd5, 0xfd, 0x7b, 0xef, 0x8f, 0x2a, + 0xd6, 0xef, 0xa3, 0x8a, 0xf5, 0x6e, 0x3a, 0xaa, 0xe9, 0x8d, 0x1f, 0xa6, 0xa3, 0xda, 0x15, 0x25, + 0x69, 0x17, 0xe2, 0xd7, 0xc1, 0xb2, 0x8b, 0xea, 0x65, 0xe4, 0x2e, 0x57, 0x43, 0x02, 0x3d, 0xce, + 0x80, 0x54, 0xbf, 0xd8, 0xa8, 0xd8, 0x82, 0xe4, 0x45, 0x2f, 0xc6, 0x92, 0x3c, 0xc3, 0x02, 0xa7, + 0xe0, 0xec, 0xa1, 0x02, 0xee, 0xcb, 0x03, 0x2e, 0xa8, 0x1c, 0xfe, 0xd7, 0xfa, 0x9c, 0xea, 0x3c, + 0x46, 0x9b, 0x11, 0x67, 0x20, 0x33, 0x23, 0x5d, 0xa2, 0x4c, 0x6f, 0x34, 0xca, 0xbe, 0xee, 0xcb, + 0xd2, 0x37, 0xe7, 0xed, 0x3f, 0xe0, 0x94, 0x35, 0x0b, 0xc7, 0x3f, 0x2a, 0xd6, 0xa7, 0xe9, 0xa8, + 0x66, 0x87, 0x1b, 0xa6, 0xf3, 0x11, 0x21, 0xfb, 0x7b, 0x99, 0xc3, 0xf9, 0xe0, 0xcc, 0xe4, 0xb5, + 0x53, 0x26, 0x0f, 0xcd, 0xe5, 0x5a, 0x10, 0x5e, 0x2d, 0xa3, 0x9d, 0x85, 0x92, 0xf1, 0xd9, 0xf8, + 0x65, 0xa3, 0xb5, 0x16, 0x24, 0x0e, 0x47, 0xc5, 0xc5, 0x63, 0xbe, 0xe5, 0x9f, 0x79, 0x25, 0xfd, + 0xe5, 0xd4, 0xdc, 0xfa, 0xca, 0x54, 0xb3, 0xd8, 0xe9, 0xa2, 0xcd, 0xbf, 0xc2, 0xbd, 0xfe, 0xef, + 0x11, 0xa7, 0x79, 0xae, 0xbf, 0x1a, 0xcf, 0xec, 0x71, 0xcf, 0xbf, 0xcd, 0x72, 0x6c, 0x3e, 0x3c, + 0x1e, 0x7b, 0xf6, 0xc9, 0xd8, 0xb3, 0x7f, 0x8e, 0x3d, 0xfb, 0xe3, 0xc4, 0xb3, 0x4e, 0x26, 0x9e, + 0xf5, 0x6d, 0xe2, 0x59, 0xaf, 0x6e, 0x27, 0x54, 0x1e, 0xf4, 0x3b, 0x7e, 0xc4, 0xd3, 0xc0, 0xbc, + 0xd1, 0x33, 0x32, 0x95, 0xc3, 0x1e, 0x81, 0xce, 0x7a, 0xfe, 0x30, 0xee, 0xfe, 0x09, 0x00, 0x00, + 0xff, 0xff, 0x2a, 0xe4, 0x45, 0xe4, 0xce, 0x03, 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 { + // VerifyInvariant defines a method to verify a particular invariant. + VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + 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) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) { + out := new(MsgVerifyInvariantResponse) + err := c.cc.Invoke(ctx, "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", 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, "/cosmos.crisis.v1beta1.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 { + // VerifyInvariant defines a method to verify a particular invariant. + VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) + // UpdateParams defines a governance operation for updating the x/crisis module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) VerifyInvariant(ctx context.Context, req *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyInvariant 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_VerifyInvariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVerifyInvariant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VerifyInvariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VerifyInvariant(ctx, req.(*MsgVerifyInvariant)) + } + 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: "/cosmos.crisis.v1beta1.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: "cosmos.crisis.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "VerifyInvariant", + Handler: _Msg_VerifyInvariant_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/crisis/v1beta1/tx.proto", +} + +func (m *MsgVerifyInvariant) 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 *MsgVerifyInvariant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InvariantRoute) > 0 { + i -= len(m.InvariantRoute) + copy(dAtA[i:], m.InvariantRoute) + i = encodeVarintTx(dAtA, i, uint64(len(m.InvariantRoute))) + i-- + dAtA[i] = 0x1a + } + if len(m.InvariantModuleName) > 0 { + i -= len(m.InvariantModuleName) + copy(dAtA[i:], m.InvariantModuleName) + i = encodeVarintTx(dAtA, i, uint64(len(m.InvariantModuleName))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgVerifyInvariantResponse) 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 *MsgVerifyInvariantResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVerifyInvariantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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.ConstantFee.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 *MsgVerifyInvariant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InvariantModuleName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InvariantRoute) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgVerifyInvariantResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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.ConstantFee.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 *MsgVerifyInvariant) 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: MsgVerifyInvariant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVerifyInvariant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvariantModuleName", 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.InvariantModuleName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InvariantRoute", 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.InvariantRoute = string(dAtA[iNdEx:postIndex]) + 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 *MsgVerifyInvariantResponse) 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: MsgVerifyInvariantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVerifyInvariantResponse: 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 *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 ConstantFee", 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.ConstantFee.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 *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) || (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/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go new file mode 100644 index 000000000000..b1d71354fc9f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go @@ -0,0 +1,3585 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/distribution/v1beta1/distribution.proto + +package types + +import ( + 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/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the set of params for the distribution module. +type Params struct { + CommunityTax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_tax"` + // Deprecated: The base_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + BaseProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_proposer_reward"` // Deprecated: Do not use. + // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + // in the x/distribution module's reward mechanism. + BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_proposer_reward"` // Deprecated: Do not use. + WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{0} +} +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) GetWithdrawAddrEnabled() bool { + if m != nil { + return m.WithdrawAddrEnabled + } + return false +} + +// ValidatorHistoricalRewards represents historical rewards for a validator. +// Height is implicit within the store key. +// Cumulative reward ratio is the sum from the zeroeth period +// until this period of rewards / tokens, per the spec. +// The reference count indicates the number of objects +// which might need to reference this historical entry at any point. +// ReferenceCount = +// +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization +type ValidatorHistoricalRewards struct { + CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio"` + ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty"` +} + +func (m *ValidatorHistoricalRewards) Reset() { *m = ValidatorHistoricalRewards{} } +func (m *ValidatorHistoricalRewards) String() string { return proto.CompactTextString(m) } +func (*ValidatorHistoricalRewards) ProtoMessage() {} +func (*ValidatorHistoricalRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{1} +} +func (m *ValidatorHistoricalRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorHistoricalRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorHistoricalRewards.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 *ValidatorHistoricalRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorHistoricalRewards.Merge(m, src) +} +func (m *ValidatorHistoricalRewards) XXX_Size() int { + return m.Size() +} +func (m *ValidatorHistoricalRewards) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorHistoricalRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorHistoricalRewards proto.InternalMessageInfo + +func (m *ValidatorHistoricalRewards) GetCumulativeRewardRatio() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.CumulativeRewardRatio + } + return nil +} + +func (m *ValidatorHistoricalRewards) GetReferenceCount() uint32 { + if m != nil { + return m.ReferenceCount + } + return 0 +} + +// ValidatorCurrentRewards represents current rewards and current +// period for a validator kept as a running counter and incremented +// each block as long as the validator's tokens remain constant. +type ValidatorCurrentRewards struct { + Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` + Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` +} + +func (m *ValidatorCurrentRewards) Reset() { *m = ValidatorCurrentRewards{} } +func (m *ValidatorCurrentRewards) String() string { return proto.CompactTextString(m) } +func (*ValidatorCurrentRewards) ProtoMessage() {} +func (*ValidatorCurrentRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{2} +} +func (m *ValidatorCurrentRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorCurrentRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorCurrentRewards.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 *ValidatorCurrentRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorCurrentRewards.Merge(m, src) +} +func (m *ValidatorCurrentRewards) XXX_Size() int { + return m.Size() +} +func (m *ValidatorCurrentRewards) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorCurrentRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorCurrentRewards proto.InternalMessageInfo + +func (m *ValidatorCurrentRewards) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *ValidatorCurrentRewards) GetPeriod() uint64 { + if m != nil { + return m.Period + } + return 0 +} + +// ValidatorAccumulatedCommission represents accumulated commission +// for a validator kept as a running counter, can be withdrawn at any time. +type ValidatorAccumulatedCommission struct { + Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=commission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"commission"` +} + +func (m *ValidatorAccumulatedCommission) Reset() { *m = ValidatorAccumulatedCommission{} } +func (m *ValidatorAccumulatedCommission) String() string { return proto.CompactTextString(m) } +func (*ValidatorAccumulatedCommission) ProtoMessage() {} +func (*ValidatorAccumulatedCommission) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{3} +} +func (m *ValidatorAccumulatedCommission) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorAccumulatedCommission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorAccumulatedCommission.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 *ValidatorAccumulatedCommission) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorAccumulatedCommission.Merge(m, src) +} +func (m *ValidatorAccumulatedCommission) XXX_Size() int { + return m.Size() +} +func (m *ValidatorAccumulatedCommission) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorAccumulatedCommission.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorAccumulatedCommission proto.InternalMessageInfo + +func (m *ValidatorAccumulatedCommission) GetCommission() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Commission + } + return nil +} + +// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +// for a validator inexpensive to track, allows simple sanity checks. +type ValidatorOutstandingRewards struct { + Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` +} + +func (m *ValidatorOutstandingRewards) Reset() { *m = ValidatorOutstandingRewards{} } +func (m *ValidatorOutstandingRewards) String() string { return proto.CompactTextString(m) } +func (*ValidatorOutstandingRewards) ProtoMessage() {} +func (*ValidatorOutstandingRewards) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{4} +} +func (m *ValidatorOutstandingRewards) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorOutstandingRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorOutstandingRewards.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 *ValidatorOutstandingRewards) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorOutstandingRewards.Merge(m, src) +} +func (m *ValidatorOutstandingRewards) XXX_Size() int { + return m.Size() +} +func (m *ValidatorOutstandingRewards) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorOutstandingRewards.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorOutstandingRewards proto.InternalMessageInfo + +func (m *ValidatorOutstandingRewards) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Rewards + } + return nil +} + +// ValidatorSlashEvent represents a validator slash event. +// Height is implicit within the store key. +// This is needed to calculate appropriate amount of staking tokens +// for delegations which are withdrawn after a slash has occurred. +type ValidatorSlashEvent struct { + ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty"` + Fraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fraction"` +} + +func (m *ValidatorSlashEvent) Reset() { *m = ValidatorSlashEvent{} } +func (m *ValidatorSlashEvent) String() string { return proto.CompactTextString(m) } +func (*ValidatorSlashEvent) ProtoMessage() {} +func (*ValidatorSlashEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{5} +} +func (m *ValidatorSlashEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSlashEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSlashEvent.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 *ValidatorSlashEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSlashEvent.Merge(m, src) +} +func (m *ValidatorSlashEvent) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSlashEvent) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSlashEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSlashEvent proto.InternalMessageInfo + +func (m *ValidatorSlashEvent) GetValidatorPeriod() uint64 { + if m != nil { + return m.ValidatorPeriod + } + return 0 +} + +// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +type ValidatorSlashEvents struct { + ValidatorSlashEvents []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` +} + +func (m *ValidatorSlashEvents) Reset() { *m = ValidatorSlashEvents{} } +func (*ValidatorSlashEvents) ProtoMessage() {} +func (*ValidatorSlashEvents) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{6} +} +func (m *ValidatorSlashEvents) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSlashEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSlashEvents.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 *ValidatorSlashEvents) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSlashEvents.Merge(m, src) +} +func (m *ValidatorSlashEvents) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSlashEvents) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSlashEvents.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSlashEvents proto.InternalMessageInfo + +func (m *ValidatorSlashEvents) GetValidatorSlashEvents() []ValidatorSlashEvent { + if m != nil { + return m.ValidatorSlashEvents + } + return nil +} + +// FeePool is the global fee pool for distribution. +type FeePool struct { + CommunityPool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=community_pool,json=communityPool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"community_pool"` +} + +func (m *FeePool) Reset() { *m = FeePool{} } +func (m *FeePool) String() string { return proto.CompactTextString(m) } +func (*FeePool) ProtoMessage() {} +func (*FeePool) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{7} +} +func (m *FeePool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeePool.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 *FeePool) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeePool.Merge(m, src) +} +func (m *FeePool) XXX_Size() int { + return m.Size() +} +func (m *FeePool) XXX_DiscardUnknown() { + xxx_messageInfo_FeePool.DiscardUnknown(m) +} + +var xxx_messageInfo_FeePool proto.InternalMessageInfo + +func (m *FeePool) GetCommunityPool() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.CommunityPool + } + return nil +} + +// TokenizeShareRecordReward represents the properties of tokenize share +type TokenizeShareRecordReward struct { + RecordId uint64 `protobuf:"varint,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` + Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` +} + +func (m *TokenizeShareRecordReward) Reset() { *m = TokenizeShareRecordReward{} } +func (m *TokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*TokenizeShareRecordReward) ProtoMessage() {} +func (*TokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{8} +} +func (m *TokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TokenizeShareRecordReward.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 *TokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenizeShareRecordReward.Merge(m, src) +} +func (m *TokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *TokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_TokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_TokenizeShareRecordReward proto.InternalMessageInfo + +// CommunityPoolSpendProposal details a proposal for use of community funds, +// together with how many coins are proposed to be spent, and to which +// recipient account. +// +// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +// longer a need for an explicit CommunityPoolSpendProposal. To spend community +// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +// module via a v1 governance proposal. +// +// Deprecated: Do not use. +type CommunityPoolSpendProposal 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"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *CommunityPoolSpendProposal) Reset() { *m = CommunityPoolSpendProposal{} } +func (*CommunityPoolSpendProposal) ProtoMessage() {} +func (*CommunityPoolSpendProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{9} +} +func (m *CommunityPoolSpendProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommunityPoolSpendProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommunityPoolSpendProposal.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 *CommunityPoolSpendProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommunityPoolSpendProposal.Merge(m, src) +} +func (m *CommunityPoolSpendProposal) XXX_Size() int { + return m.Size() +} +func (m *CommunityPoolSpendProposal) XXX_DiscardUnknown() { + xxx_messageInfo_CommunityPoolSpendProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_CommunityPoolSpendProposal proto.InternalMessageInfo + +// DelegatorStartingInfo represents the starting info for a delegator reward +// period. It tracks the previous validator period, the delegation's amount of +// staking token, and the creation height (to check later on if any slashes have +// occurred). NOTE: Even though validators are slashed to whole staking tokens, +// the delegators within the validator may be left with less than a full token, +// thus sdk.Dec is used. +type DelegatorStartingInfo struct { + PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty"` + Stake github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height"` +} + +func (m *DelegatorStartingInfo) Reset() { *m = DelegatorStartingInfo{} } +func (m *DelegatorStartingInfo) String() string { return proto.CompactTextString(m) } +func (*DelegatorStartingInfo) ProtoMessage() {} +func (*DelegatorStartingInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{10} +} +func (m *DelegatorStartingInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorStartingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorStartingInfo.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 *DelegatorStartingInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorStartingInfo.Merge(m, src) +} +func (m *DelegatorStartingInfo) XXX_Size() int { + return m.Size() +} +func (m *DelegatorStartingInfo) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorStartingInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorStartingInfo proto.InternalMessageInfo + +func (m *DelegatorStartingInfo) GetPreviousPeriod() uint64 { + if m != nil { + return m.PreviousPeriod + } + return 0 +} + +func (m *DelegatorStartingInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +// DelegationDelegatorReward represents the properties +// of a delegator's delegation reward. +type DelegationDelegatorReward struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` +} + +func (m *DelegationDelegatorReward) Reset() { *m = DelegationDelegatorReward{} } +func (m *DelegationDelegatorReward) String() string { return proto.CompactTextString(m) } +func (*DelegationDelegatorReward) ProtoMessage() {} +func (*DelegationDelegatorReward) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{11} +} +func (m *DelegationDelegatorReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegationDelegatorReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegationDelegatorReward.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 *DelegationDelegatorReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegationDelegatorReward.Merge(m, src) +} +func (m *DelegationDelegatorReward) XXX_Size() int { + return m.Size() +} +func (m *DelegationDelegatorReward) XXX_DiscardUnknown() { + xxx_messageInfo_DelegationDelegatorReward.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegationDelegatorReward proto.InternalMessageInfo + +// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +// with a deposit +type CommunityPoolSpendProposalWithDeposit 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"` + Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` + Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` + Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *CommunityPoolSpendProposalWithDeposit) Reset() { *m = CommunityPoolSpendProposalWithDeposit{} } +func (m *CommunityPoolSpendProposalWithDeposit) String() string { return proto.CompactTextString(m) } +func (*CommunityPoolSpendProposalWithDeposit) ProtoMessage() {} +func (*CommunityPoolSpendProposalWithDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_cd78a31ea281a992, []int{12} +} +func (m *CommunityPoolSpendProposalWithDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CommunityPoolSpendProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.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 *CommunityPoolSpendProposalWithDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.Merge(m, src) +} +func (m *CommunityPoolSpendProposalWithDeposit) XXX_Size() int { + return m.Size() +} +func (m *CommunityPoolSpendProposalWithDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_CommunityPoolSpendProposalWithDeposit proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "cosmos.distribution.v1beta1.Params") + proto.RegisterType((*ValidatorHistoricalRewards)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewards") + proto.RegisterType((*ValidatorCurrentRewards)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewards") + proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission") + proto.RegisterType((*ValidatorOutstandingRewards)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewards") + proto.RegisterType((*ValidatorSlashEvent)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvent") + proto.RegisterType((*ValidatorSlashEvents)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvents") + proto.RegisterType((*FeePool)(nil), "cosmos.distribution.v1beta1.FeePool") + proto.RegisterType((*TokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.TokenizeShareRecordReward") + proto.RegisterType((*CommunityPoolSpendProposal)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposal") + proto.RegisterType((*DelegatorStartingInfo)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfo") + proto.RegisterType((*DelegationDelegatorReward)(nil), "cosmos.distribution.v1beta1.DelegationDelegatorReward") + proto.RegisterType((*CommunityPoolSpendProposalWithDeposit)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit") +} + +func init() { + proto.RegisterFile("cosmos/distribution/v1beta1/distribution.proto", fileDescriptor_cd78a31ea281a992) +} + +var fileDescriptor_cd78a31ea281a992 = []byte{ + // 1044 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x4f, 0x1b, 0x47, + 0x14, 0xf6, 0x04, 0x30, 0x30, 0x69, 0xa0, 0x19, 0x0c, 0x31, 0x26, 0xb2, 0xd1, 0x4a, 0x4d, 0x09, + 0x0d, 0xa6, 0x24, 0xaa, 0x54, 0x59, 0x55, 0x25, 0x6c, 0x53, 0x35, 0xa7, 0xa0, 0x25, 0x6a, 0xab, + 0x5e, 0x56, 0xe3, 0xdd, 0xc1, 0x1e, 0xb1, 0x3b, 0xb3, 0x9d, 0x19, 0x1b, 0x52, 0xa9, 0xf7, 0x28, + 0x87, 0xb6, 0x47, 0xd4, 0x13, 0x6a, 0x2f, 0x51, 0xa5, 0x4a, 0x1c, 0xf8, 0x11, 0x51, 0x4f, 0x51, + 0x0e, 0x6d, 0x15, 0x55, 0xb4, 0x82, 0x03, 0x55, 0x7f, 0x45, 0x35, 0x3b, 0xe3, 0xb5, 0x21, 0x94, + 0xa6, 0x49, 0x50, 0x2e, 0xe0, 0xf7, 0xde, 0xee, 0xfb, 0xbe, 0xef, 0xcd, 0x7b, 0x6f, 0x16, 0x96, + 0x7d, 0x2e, 0x23, 0x2e, 0x17, 0x03, 0x2a, 0x95, 0xa0, 0x8d, 0xb6, 0xa2, 0x9c, 0x2d, 0x76, 0x96, + 0x1a, 0x44, 0xe1, 0xa5, 0x63, 0xce, 0x72, 0x2c, 0xb8, 0xe2, 0x68, 0xc6, 0x3c, 0x5f, 0x3e, 0x16, + 0xb2, 0xcf, 0x17, 0x72, 0x4d, 0xde, 0xe4, 0xc9, 0x73, 0x8b, 0xfa, 0x97, 0x79, 0xa5, 0x50, 0xb4, + 0x10, 0x0d, 0x2c, 0x49, 0x9a, 0xda, 0xe7, 0xd4, 0xa6, 0x2c, 0x4c, 0x9b, 0xb8, 0x67, 0x5e, 0xb4, + 0xf9, 0x4d, 0xe8, 0x32, 0x8e, 0x28, 0xe3, 0x8b, 0xc9, 0x5f, 0xe3, 0x72, 0x76, 0x07, 0x60, 0x76, + 0x15, 0x0b, 0x1c, 0x49, 0x84, 0xe1, 0x25, 0x9f, 0x47, 0x51, 0x9b, 0x51, 0x75, 0xcf, 0x53, 0x78, + 0x2b, 0x0f, 0x66, 0xc1, 0xdc, 0x68, 0xf5, 0x83, 0x47, 0xfb, 0xa5, 0xcc, 0xd3, 0xfd, 0xd2, 0xb5, + 0x26, 0x55, 0xad, 0x76, 0xa3, 0xec, 0xf3, 0xc8, 0x66, 0xb5, 0xff, 0x16, 0x64, 0xb0, 0xb1, 0xa8, + 0xee, 0xc5, 0x44, 0x96, 0xeb, 0xc4, 0x7f, 0xb2, 0xb7, 0x00, 0x2d, 0x68, 0x9d, 0xf8, 0xee, 0x1b, + 0x69, 0xca, 0xbb, 0x78, 0x0b, 0xc5, 0x30, 0xa7, 0x69, 0x6b, 0x6e, 0x31, 0x97, 0x44, 0x78, 0x82, + 0x6c, 0x62, 0x11, 0xe4, 0x2f, 0x24, 0x48, 0x1f, 0xbe, 0x0c, 0x52, 0x1e, 0xb8, 0x48, 0xe7, 0x5e, + 0xb5, 0xa9, 0xdd, 0x24, 0x33, 0x12, 0x70, 0xb2, 0xc1, 0x59, 0x5b, 0x3e, 0x03, 0x39, 0xf0, 0x4a, + 0x20, 0x27, 0x92, 0xe4, 0x27, 0x30, 0x6f, 0xc2, 0xc9, 0x4d, 0xaa, 0x5a, 0x81, 0xc0, 0x9b, 0x1e, + 0x0e, 0x02, 0xe1, 0x11, 0x86, 0x1b, 0x21, 0x09, 0xf2, 0x83, 0xb3, 0x60, 0x6e, 0xc4, 0x9d, 0xe8, + 0x06, 0x97, 0x83, 0x40, 0xac, 0x98, 0x50, 0xe5, 0xfa, 0xf6, 0x4e, 0x29, 0xf3, 0xe0, 0x68, 0x77, + 0x7e, 0xb6, 0x0f, 0x77, 0xeb, 0x78, 0x1f, 0x99, 0x73, 0x72, 0x7e, 0x01, 0xb0, 0xf0, 0x09, 0x0e, + 0x69, 0x80, 0x15, 0x17, 0x1f, 0x53, 0xa9, 0xb8, 0xa0, 0x3e, 0x0e, 0x0d, 0xb8, 0x44, 0x5f, 0x03, + 0x78, 0xc5, 0x6f, 0x47, 0xed, 0x10, 0x2b, 0xda, 0x21, 0x56, 0xae, 0x27, 0xb0, 0xa2, 0x3c, 0x0f, + 0x66, 0x07, 0xe6, 0x2e, 0xde, 0xbc, 0x6a, 0xbb, 0xb4, 0xac, 0xeb, 0xd5, 0xed, 0x36, 0x2d, 0xa8, + 0xc6, 0x29, 0xab, 0xbe, 0xaf, 0x4b, 0xf2, 0xe3, 0x1f, 0xa5, 0x77, 0x9e, 0xaf, 0x24, 0xfa, 0x1d, + 0xf9, 0xf0, 0x68, 0x77, 0x1e, 0xb8, 0x93, 0x3d, 0x58, 0x43, 0xc6, 0xd5, 0xa0, 0xe8, 0x6d, 0x38, + 0x2e, 0xc8, 0x3a, 0x11, 0x84, 0xf9, 0xc4, 0xf3, 0x79, 0x9b, 0xa9, 0xe4, 0xbc, 0x2f, 0xb9, 0x63, + 0xa9, 0xbb, 0xa6, 0xbd, 0xce, 0x0f, 0x00, 0x5e, 0x49, 0x85, 0xd5, 0xda, 0x42, 0x10, 0xa6, 0xba, + 0xaa, 0x62, 0x38, 0x6c, 0x94, 0xc8, 0x73, 0x16, 0xd1, 0x85, 0x41, 0x53, 0x30, 0x1b, 0x13, 0x41, + 0xb9, 0xe9, 0xce, 0x41, 0xd7, 0x5a, 0xce, 0x36, 0x80, 0xc5, 0x94, 0xe5, 0xb2, 0x6f, 0x35, 0x93, + 0xa0, 0xc6, 0xa3, 0x88, 0x4a, 0x49, 0x39, 0x43, 0x1d, 0x08, 0xfd, 0xd4, 0x3a, 0x67, 0xbe, 0x7d, + 0x48, 0xce, 0x37, 0x00, 0xce, 0xa4, 0xd4, 0xee, 0xb4, 0x95, 0x54, 0x98, 0x05, 0x94, 0x35, 0x5f, + 0x5b, 0x11, 0x9d, 0xef, 0x00, 0x9c, 0x48, 0x19, 0xad, 0x85, 0x58, 0xb6, 0x56, 0x3a, 0x84, 0x29, + 0x74, 0x1d, 0xbe, 0xd9, 0xe9, 0xba, 0x3d, 0x5b, 0x66, 0x90, 0x94, 0x79, 0x3c, 0xf5, 0xaf, 0x26, + 0x6e, 0xf4, 0x19, 0x1c, 0x59, 0x17, 0xd8, 0xd7, 0x13, 0x60, 0xf7, 0xc4, 0xcb, 0x6d, 0xa4, 0x34, + 0x9b, 0x2e, 0x57, 0xee, 0x14, 0x72, 0x12, 0x7d, 0x01, 0xa7, 0x7a, 0xec, 0xa4, 0x0e, 0x78, 0x24, + 0x89, 0xd8, 0xb2, 0xbd, 0x5b, 0x3e, 0x63, 0x6d, 0x97, 0x4f, 0x49, 0x59, 0x1d, 0xd5, 0x94, 0x4d, + 0x6d, 0x72, 0x9d, 0x53, 0x20, 0x2b, 0x83, 0x7a, 0xfe, 0x9d, 0xfb, 0x00, 0x0e, 0x7f, 0x44, 0xc8, + 0x2a, 0xe7, 0x21, 0xfa, 0x0a, 0x8e, 0xf5, 0xd6, 0x71, 0xcc, 0x79, 0x78, 0xce, 0x67, 0xd6, 0x5b, + 0xfe, 0x1a, 0xde, 0xf9, 0x09, 0xc0, 0xe9, 0xbb, 0x7c, 0x83, 0x30, 0xfa, 0x25, 0x59, 0x6b, 0x61, + 0x41, 0x5c, 0xe2, 0x73, 0x11, 0xd8, 0x15, 0x37, 0x03, 0x47, 0x45, 0x62, 0x7b, 0xb4, 0x7b, 0x70, + 0x23, 0xc6, 0x71, 0x3b, 0x40, 0x14, 0x66, 0xd3, 0xbd, 0xfe, 0xdf, 0x8c, 0x6f, 0xbd, 0x00, 0x63, + 0xd7, 0x02, 0x54, 0x46, 0xee, 0xef, 0x94, 0x32, 0xdb, 0x3b, 0x25, 0xe0, 0x3c, 0xb8, 0x00, 0x0b, + 0xb5, 0x7e, 0x05, 0x6b, 0x31, 0x61, 0x81, 0xd9, 0xcc, 0x38, 0x44, 0x39, 0x38, 0xa4, 0xa8, 0x0a, + 0x89, 0xb9, 0xd4, 0x5c, 0x63, 0xa0, 0x59, 0x78, 0x31, 0x20, 0xd2, 0x17, 0x34, 0xee, 0xb5, 0x97, + 0xdb, 0xef, 0x42, 0x57, 0x13, 0xa1, 0x34, 0xa6, 0x84, 0x29, 0x73, 0x67, 0xb8, 0x3d, 0x07, 0x6a, + 0xc1, 0x2c, 0x8e, 0x92, 0x8d, 0x36, 0x98, 0x28, 0x9d, 0x3e, 0x55, 0x69, 0x22, 0xf3, 0x3d, 0x2b, + 0x73, 0xee, 0x39, 0x64, 0xf6, 0x9d, 0x8a, 0xcd, 0x5f, 0xb9, 0x61, 0x85, 0x66, 0xfe, 0xda, 0x29, + 0x65, 0x7e, 0xde, 0x5b, 0x28, 0x58, 0xa0, 0x26, 0xef, 0xf4, 0xe1, 0x30, 0xa5, 0x69, 0x02, 0xe7, + 0x29, 0x80, 0x93, 0x75, 0x12, 0x92, 0x66, 0xd2, 0x66, 0x0a, 0x0b, 0x45, 0x59, 0xf3, 0x36, 0x5b, + 0x4f, 0x96, 0x71, 0x2c, 0x48, 0x87, 0x72, 0x7d, 0x25, 0xf6, 0xcf, 0xdd, 0x58, 0xd7, 0x6d, 0xc7, + 0xce, 0x85, 0x43, 0x52, 0xe1, 0x0d, 0xf2, 0x4a, 0x66, 0xce, 0xa4, 0x42, 0x75, 0x98, 0x6d, 0x11, + 0xda, 0x6c, 0x99, 0x4a, 0x0e, 0x56, 0x6f, 0xfc, 0xbd, 0x5f, 0x1a, 0xf7, 0x05, 0xd1, 0xd7, 0x04, + 0xf3, 0x4c, 0xe8, 0xfb, 0xa3, 0xdd, 0xf9, 0x93, 0x3e, 0x5b, 0x0a, 0x63, 0x38, 0xbf, 0x03, 0x38, + 0x6d, 0xc5, 0x51, 0xce, 0x52, 0x99, 0xb6, 0x33, 0x57, 0xe0, 0xe5, 0xde, 0xec, 0xea, 0xdb, 0x97, + 0x48, 0x69, 0xbf, 0x64, 0xf2, 0x4f, 0xf6, 0x16, 0x72, 0x96, 0xd5, 0xb2, 0x89, 0xac, 0x29, 0xa1, + 0xf7, 0x63, 0x6f, 0x19, 0x59, 0x3f, 0x62, 0xff, 0xab, 0x87, 0x5f, 0x7c, 0xea, 0x9e, 0x6d, 0xe4, + 0x5f, 0x01, 0x7c, 0xeb, 0xdf, 0x1b, 0xf9, 0x53, 0xaa, 0x5a, 0x75, 0x12, 0x73, 0x49, 0xd5, 0x39, + 0xf5, 0xf4, 0x54, 0x5f, 0x4f, 0xeb, 0x90, 0xb5, 0x50, 0x1e, 0x0e, 0x07, 0x06, 0x38, 0x3f, 0x94, + 0x04, 0xba, 0x66, 0xe5, 0x5a, 0x97, 0xfb, 0xd9, 0x7d, 0x59, 0xbd, 0xf3, 0xf0, 0xa0, 0x08, 0x1e, + 0x1d, 0x14, 0xc1, 0xe3, 0x83, 0x22, 0xf8, 0xf3, 0xa0, 0x08, 0xbe, 0x3d, 0x2c, 0x66, 0x1e, 0x1f, + 0x16, 0x33, 0xbf, 0x1d, 0x16, 0x33, 0x9f, 0x2f, 0x9d, 0x59, 0xbb, 0x13, 0x9f, 0x42, 0x49, 0x29, + 0x1b, 0xd9, 0xe4, 0x1b, 0xf6, 0xd6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x1c, 0x82, 0xe5, + 0x76, 0x0b, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.CommunityTax.Equal(that1.CommunityTax) { + return false + } + if !this.BaseProposerReward.Equal(that1.BaseProposerReward) { + return false + } + if !this.BonusProposerReward.Equal(that1.BonusProposerReward) { + return false + } + if this.WithdrawAddrEnabled != that1.WithdrawAddrEnabled { + return false + } + return true +} +func (this *ValidatorHistoricalRewards) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorHistoricalRewards) + if !ok { + that2, ok := that.(ValidatorHistoricalRewards) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.CumulativeRewardRatio) != len(that1.CumulativeRewardRatio) { + return false + } + for i := range this.CumulativeRewardRatio { + if !this.CumulativeRewardRatio[i].Equal(&that1.CumulativeRewardRatio[i]) { + return false + } + } + if this.ReferenceCount != that1.ReferenceCount { + return false + } + return true +} +func (this *ValidatorCurrentRewards) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorCurrentRewards) + if !ok { + that2, ok := that.(ValidatorCurrentRewards) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Rewards) != len(that1.Rewards) { + return false + } + for i := range this.Rewards { + if !this.Rewards[i].Equal(&that1.Rewards[i]) { + return false + } + } + if this.Period != that1.Period { + return false + } + return true +} +func (this *ValidatorAccumulatedCommission) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorAccumulatedCommission) + if !ok { + that2, ok := that.(ValidatorAccumulatedCommission) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Commission) != len(that1.Commission) { + return false + } + for i := range this.Commission { + if !this.Commission[i].Equal(&that1.Commission[i]) { + return false + } + } + return true +} +func (this *ValidatorOutstandingRewards) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorOutstandingRewards) + if !ok { + that2, ok := that.(ValidatorOutstandingRewards) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Rewards) != len(that1.Rewards) { + return false + } + for i := range this.Rewards { + if !this.Rewards[i].Equal(&that1.Rewards[i]) { + return false + } + } + return true +} +func (this *ValidatorSlashEvent) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorSlashEvent) + if !ok { + that2, ok := that.(ValidatorSlashEvent) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ValidatorPeriod != that1.ValidatorPeriod { + return false + } + if !this.Fraction.Equal(that1.Fraction) { + return false + } + return true +} +func (this *ValidatorSlashEvents) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*ValidatorSlashEvents) + if !ok { + that2, ok := that.(ValidatorSlashEvents) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.ValidatorSlashEvents) != len(that1.ValidatorSlashEvents) { + return false + } + for i := range this.ValidatorSlashEvents { + if !this.ValidatorSlashEvents[i].Equal(&that1.ValidatorSlashEvents[i]) { + return false + } + } + return true +} +func (this *FeePool) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*FeePool) + if !ok { + that2, ok := that.(FeePool) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.CommunityPool) != len(that1.CommunityPool) { + return false + } + for i := range this.CommunityPool { + if !this.CommunityPool[i].Equal(&that1.CommunityPool[i]) { + return false + } + } + return true +} +func (this *TokenizeShareRecordReward) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TokenizeShareRecordReward) + if !ok { + that2, ok := that.(TokenizeShareRecordReward) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.RecordId != that1.RecordId { + return false + } + if len(this.Reward) != len(that1.Reward) { + return false + } + for i := range this.Reward { + if !this.Reward[i].Equal(&that1.Reward[i]) { + return false + } + } + return true +} +func (this *DelegatorStartingInfo) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DelegatorStartingInfo) + if !ok { + that2, ok := that.(DelegatorStartingInfo) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.PreviousPeriod != that1.PreviousPeriod { + return false + } + if !this.Stake.Equal(that1.Stake) { + return false + } + if this.Height != that1.Height { + return false + } + return true +} +func (this *DelegationDelegatorReward) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*DelegationDelegatorReward) + if !ok { + that2, ok := that.(DelegationDelegatorReward) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ValidatorAddress != that1.ValidatorAddress { + return false + } + if len(this.Reward) != len(that1.Reward) { + return false + } + for i := range this.Reward { + if !this.Reward[i].Equal(&that1.Reward[i]) { + return false + } + } + return true +} +func (this *CommunityPoolSpendProposalWithDeposit) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*CommunityPoolSpendProposalWithDeposit) + if !ok { + that2, ok := that.(CommunityPoolSpendProposalWithDeposit) + 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.Recipient != that1.Recipient { + return false + } + if this.Amount != that1.Amount { + return false + } + if this.Deposit != that1.Deposit { + return false + } + return true +} +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.WithdrawAddrEnabled { + i-- + if m.WithdrawAddrEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + { + size := m.BonusProposerReward.Size() + i -= size + if _, err := m.BonusProposerReward.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.BaseProposerReward.Size() + i -= size + if _, err := m.BaseProposerReward.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.CommunityTax.Size() + i -= size + if _, err := m.CommunityTax.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ValidatorHistoricalRewards) 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 *ValidatorHistoricalRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorHistoricalRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ReferenceCount != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.ReferenceCount)) + i-- + dAtA[i] = 0x10 + } + if len(m.CumulativeRewardRatio) > 0 { + for iNdEx := len(m.CumulativeRewardRatio) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CumulativeRewardRatio[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ValidatorCurrentRewards) 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 *ValidatorCurrentRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorCurrentRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Period != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.Period)) + i-- + dAtA[i] = 0x10 + } + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ValidatorAccumulatedCommission) 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 *ValidatorAccumulatedCommission) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorAccumulatedCommission) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Commission) > 0 { + for iNdEx := len(m.Commission) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ValidatorOutstandingRewards) 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 *ValidatorOutstandingRewards) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorOutstandingRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSlashEvent) 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 *ValidatorSlashEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSlashEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Fraction.Size() + i -= size + if _, err := m.Fraction.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.ValidatorPeriod != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.ValidatorPeriod)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSlashEvents) 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 *ValidatorSlashEvents) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSlashEvents) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorSlashEvents) > 0 { + for iNdEx := len(m.ValidatorSlashEvents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorSlashEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FeePool) 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 *FeePool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CommunityPool) > 0 { + for iNdEx := len(m.CommunityPool) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CommunityPool[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TokenizeShareRecordReward) 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 *TokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reward) > 0 { + for iNdEx := len(m.Reward) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Reward[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.RecordId != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.RecordId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CommunityPoolSpendProposal) 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 *CommunityPoolSpendProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommunityPoolSpendProposal) 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 = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintDistribution(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintDistribution(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 = encodeVarintDistribution(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegatorStartingInfo) 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 *DelegatorStartingInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorStartingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + { + size := m.Stake.Size() + i -= size + if _, err := m.Stake.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.PreviousPeriod != 0 { + i = encodeVarintDistribution(dAtA, i, uint64(m.PreviousPeriod)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DelegationDelegatorReward) 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 *DelegationDelegatorReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegationDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Reward) > 0 { + for iNdEx := len(m.Reward) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Reward[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDistribution(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintDistribution(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CommunityPoolSpendProposalWithDeposit) 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 *CommunityPoolSpendProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CommunityPoolSpendProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Deposit) > 0 { + i -= len(m.Deposit) + copy(dAtA[i:], m.Deposit) + i = encodeVarintDistribution(dAtA, i, uint64(len(m.Deposit))) + i-- + dAtA[i] = 0x2a + } + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintDistribution(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x22 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintDistribution(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintDistribution(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 = encodeVarintDistribution(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDistribution(dAtA []byte, offset int, v uint64) int { + offset -= sovDistribution(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CommunityTax.Size() + n += 1 + l + sovDistribution(uint64(l)) + l = m.BaseProposerReward.Size() + n += 1 + l + sovDistribution(uint64(l)) + l = m.BonusProposerReward.Size() + n += 1 + l + sovDistribution(uint64(l)) + if m.WithdrawAddrEnabled { + n += 2 + } + return n +} + +func (m *ValidatorHistoricalRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CumulativeRewardRatio) > 0 { + for _, e := range m.CumulativeRewardRatio { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + if m.ReferenceCount != 0 { + n += 1 + sovDistribution(uint64(m.ReferenceCount)) + } + return n +} + +func (m *ValidatorCurrentRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + if m.Period != 0 { + n += 1 + sovDistribution(uint64(m.Period)) + } + return n +} + +func (m *ValidatorAccumulatedCommission) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Commission) > 0 { + for _, e := range m.Commission { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *ValidatorOutstandingRewards) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *ValidatorSlashEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ValidatorPeriod != 0 { + n += 1 + sovDistribution(uint64(m.ValidatorPeriod)) + } + l = m.Fraction.Size() + n += 1 + l + sovDistribution(uint64(l)) + return n +} + +func (m *ValidatorSlashEvents) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ValidatorSlashEvents) > 0 { + for _, e := range m.ValidatorSlashEvents { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *FeePool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CommunityPool) > 0 { + for _, e := range m.CommunityPool { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *TokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RecordId != 0 { + n += 1 + sovDistribution(uint64(m.RecordId)) + } + if len(m.Reward) > 0 { + for _, e := range m.Reward { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *CommunityPoolSpendProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *DelegatorStartingInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PreviousPeriod != 0 { + n += 1 + sovDistribution(uint64(m.PreviousPeriod)) + } + l = m.Stake.Size() + n += 1 + l + sovDistribution(uint64(l)) + if m.Height != 0 { + n += 1 + sovDistribution(uint64(m.Height)) + } + return n +} + +func (m *DelegationDelegatorReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + if len(m.Reward) > 0 { + for _, e := range m.Reward { + l = e.Size() + n += 1 + l + sovDistribution(uint64(l)) + } + } + return n +} + +func (m *CommunityPoolSpendProposalWithDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + l = len(m.Deposit) + if l > 0 { + n += 1 + l + sovDistribution(uint64(l)) + } + return n +} + +func sovDistribution(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDistribution(x uint64) (n int) { + return sovDistribution(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +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 ErrIntOverflowDistribution + } + 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 CommunityTax", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CommunityTax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseProposerReward", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BaseProposerReward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BonusProposerReward", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BonusProposerReward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddrEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WithdrawAddrEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorHistoricalRewards) 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 ErrIntOverflowDistribution + } + 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: ValidatorHistoricalRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorHistoricalRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CumulativeRewardRatio", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CumulativeRewardRatio = append(m.CumulativeRewardRatio, types.DecCoin{}) + if err := m.CumulativeRewardRatio[len(m.CumulativeRewardRatio)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReferenceCount", wireType) + } + m.ReferenceCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReferenceCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorCurrentRewards) 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 ErrIntOverflowDistribution + } + 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: ValidatorCurrentRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorCurrentRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rewards = append(m.Rewards, types.DecCoin{}) + if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + m.Period = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Period |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorAccumulatedCommission) 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 ErrIntOverflowDistribution + } + 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: ValidatorAccumulatedCommission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorAccumulatedCommission: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commission = append(m.Commission, types.DecCoin{}) + if err := m.Commission[len(m.Commission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorOutstandingRewards) 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 ErrIntOverflowDistribution + } + 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: ValidatorOutstandingRewards: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorOutstandingRewards: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rewards = append(m.Rewards, types.DecCoin{}) + if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSlashEvent) 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 ErrIntOverflowDistribution + } + 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: ValidatorSlashEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSlashEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorPeriod", wireType) + } + m.ValidatorPeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorPeriod |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fraction", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Fraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSlashEvents) 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 ErrIntOverflowDistribution + } + 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: ValidatorSlashEvents: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSlashEvents: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorSlashEvents = append(m.ValidatorSlashEvents, ValidatorSlashEvent{}) + if err := m.ValidatorSlashEvents[len(m.ValidatorSlashEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeePool) 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 ErrIntOverflowDistribution + } + 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: FeePool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeePool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommunityPool = append(m.CommunityPool, types.DecCoin{}) + if err := m.CommunityPool[len(m.CommunityPool)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TokenizeShareRecordReward) 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 ErrIntOverflowDistribution + } + 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: TokenizeShareRecordReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) + } + m.RecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RecordId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reward = append(m.Reward, types.DecCoin{}) + if err := m.Reward[len(m.Reward)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommunityPoolSpendProposal) 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 ErrIntOverflowDistribution + } + 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: CommunityPoolSpendProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommunityPoolSpendProposal: 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 ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + 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 ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + 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 Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + 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 := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorStartingInfo) 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 ErrIntOverflowDistribution + } + 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: DelegatorStartingInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorStartingInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousPeriod", wireType) + } + m.PreviousPeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PreviousPeriod |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Stake.Unmarshal(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 ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegationDelegatorReward) 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 ErrIntOverflowDistribution + } + 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: DelegationDelegatorReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegationDelegatorReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDistribution + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Reward = append(m.Reward, types.DecCoin{}) + if err := m.Reward[len(m.Reward)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommunityPoolSpendProposalWithDeposit) 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 ErrIntOverflowDistribution + } + 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: CommunityPoolSpendProposalWithDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommunityPoolSpendProposalWithDeposit: 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 ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + 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 ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + 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 Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDistribution + } + 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 ErrInvalidLengthDistribution + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDistribution + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDistribution(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDistribution + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDistribution(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, ErrIntOverflowDistribution + } + 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, ErrIntOverflowDistribution + } + 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, ErrIntOverflowDistribution + } + 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, ErrInvalidLengthDistribution + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDistribution + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDistribution + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDistribution = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDistribution = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDistribution = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go new file mode 100644 index 000000000000..a5a4933261ba --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go @@ -0,0 +1,2477 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/distribution/v1beta1/genesis.proto + +package types + +import ( + 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/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// DelegatorWithdrawInfo is the address for where distributions rewards are +// withdrawn to by default this struct is only used at genesis to feed in +// default withdraw addresses. +type DelegatorWithdrawInfo struct { + // delegator_address is the address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + // withdraw_address is the address to withdraw the delegation rewards to. + WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` +} + +func (m *DelegatorWithdrawInfo) Reset() { *m = DelegatorWithdrawInfo{} } +func (m *DelegatorWithdrawInfo) String() string { return proto.CompactTextString(m) } +func (*DelegatorWithdrawInfo) ProtoMessage() {} +func (*DelegatorWithdrawInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{0} +} +func (m *DelegatorWithdrawInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorWithdrawInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorWithdrawInfo.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 *DelegatorWithdrawInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorWithdrawInfo.Merge(m, src) +} +func (m *DelegatorWithdrawInfo) XXX_Size() int { + return m.Size() +} +func (m *DelegatorWithdrawInfo) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorWithdrawInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorWithdrawInfo proto.InternalMessageInfo + +// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +type ValidatorOutstandingRewardsRecord struct { + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // outstanding_rewards represents the outstanding rewards of a validator. + OutstandingRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"outstanding_rewards"` +} + +func (m *ValidatorOutstandingRewardsRecord) Reset() { *m = ValidatorOutstandingRewardsRecord{} } +func (m *ValidatorOutstandingRewardsRecord) String() string { return proto.CompactTextString(m) } +func (*ValidatorOutstandingRewardsRecord) ProtoMessage() {} +func (*ValidatorOutstandingRewardsRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{1} +} +func (m *ValidatorOutstandingRewardsRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorOutstandingRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorOutstandingRewardsRecord.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 *ValidatorOutstandingRewardsRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorOutstandingRewardsRecord.Merge(m, src) +} +func (m *ValidatorOutstandingRewardsRecord) XXX_Size() int { + return m.Size() +} +func (m *ValidatorOutstandingRewardsRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorOutstandingRewardsRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorOutstandingRewardsRecord proto.InternalMessageInfo + +// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +// json. +type ValidatorAccumulatedCommissionRecord struct { + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // accumulated is the accumulated commission of a validator. + Accumulated ValidatorAccumulatedCommission `protobuf:"bytes,2,opt,name=accumulated,proto3" json:"accumulated"` +} + +func (m *ValidatorAccumulatedCommissionRecord) Reset() { *m = ValidatorAccumulatedCommissionRecord{} } +func (m *ValidatorAccumulatedCommissionRecord) String() string { return proto.CompactTextString(m) } +func (*ValidatorAccumulatedCommissionRecord) ProtoMessage() {} +func (*ValidatorAccumulatedCommissionRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{2} +} +func (m *ValidatorAccumulatedCommissionRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorAccumulatedCommissionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorAccumulatedCommissionRecord.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 *ValidatorAccumulatedCommissionRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorAccumulatedCommissionRecord.Merge(m, src) +} +func (m *ValidatorAccumulatedCommissionRecord) XXX_Size() int { + return m.Size() +} +func (m *ValidatorAccumulatedCommissionRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorAccumulatedCommissionRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorAccumulatedCommissionRecord proto.InternalMessageInfo + +// ValidatorHistoricalRewardsRecord is used for import / export via genesis +// json. +type ValidatorHistoricalRewardsRecord struct { + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // period defines the period the historical rewards apply to. + Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` + // rewards defines the historical rewards of a validator. + Rewards ValidatorHistoricalRewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards"` +} + +func (m *ValidatorHistoricalRewardsRecord) Reset() { *m = ValidatorHistoricalRewardsRecord{} } +func (m *ValidatorHistoricalRewardsRecord) String() string { return proto.CompactTextString(m) } +func (*ValidatorHistoricalRewardsRecord) ProtoMessage() {} +func (*ValidatorHistoricalRewardsRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{3} +} +func (m *ValidatorHistoricalRewardsRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorHistoricalRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorHistoricalRewardsRecord.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 *ValidatorHistoricalRewardsRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorHistoricalRewardsRecord.Merge(m, src) +} +func (m *ValidatorHistoricalRewardsRecord) XXX_Size() int { + return m.Size() +} +func (m *ValidatorHistoricalRewardsRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorHistoricalRewardsRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorHistoricalRewardsRecord proto.InternalMessageInfo + +// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +type ValidatorCurrentRewardsRecord struct { + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // rewards defines the current rewards of a validator. + Rewards ValidatorCurrentRewards `protobuf:"bytes,2,opt,name=rewards,proto3" json:"rewards"` +} + +func (m *ValidatorCurrentRewardsRecord) Reset() { *m = ValidatorCurrentRewardsRecord{} } +func (m *ValidatorCurrentRewardsRecord) String() string { return proto.CompactTextString(m) } +func (*ValidatorCurrentRewardsRecord) ProtoMessage() {} +func (*ValidatorCurrentRewardsRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{4} +} +func (m *ValidatorCurrentRewardsRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorCurrentRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorCurrentRewardsRecord.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 *ValidatorCurrentRewardsRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorCurrentRewardsRecord.Merge(m, src) +} +func (m *ValidatorCurrentRewardsRecord) XXX_Size() int { + return m.Size() +} +func (m *ValidatorCurrentRewardsRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorCurrentRewardsRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorCurrentRewardsRecord proto.InternalMessageInfo + +// DelegatorStartingInfoRecord used for import / export via genesis json. +type DelegatorStartingInfoRecord struct { + // delegator_address is the address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // starting_info defines the starting info of a delegator. + StartingInfo DelegatorStartingInfo `protobuf:"bytes,3,opt,name=starting_info,json=startingInfo,proto3" json:"starting_info"` +} + +func (m *DelegatorStartingInfoRecord) Reset() { *m = DelegatorStartingInfoRecord{} } +func (m *DelegatorStartingInfoRecord) String() string { return proto.CompactTextString(m) } +func (*DelegatorStartingInfoRecord) ProtoMessage() {} +func (*DelegatorStartingInfoRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{5} +} +func (m *DelegatorStartingInfoRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DelegatorStartingInfoRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DelegatorStartingInfoRecord.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 *DelegatorStartingInfoRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_DelegatorStartingInfoRecord.Merge(m, src) +} +func (m *DelegatorStartingInfoRecord) XXX_Size() int { + return m.Size() +} +func (m *DelegatorStartingInfoRecord) XXX_DiscardUnknown() { + xxx_messageInfo_DelegatorStartingInfoRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_DelegatorStartingInfoRecord proto.InternalMessageInfo + +// ValidatorSlashEventRecord is used for import / export via genesis json. +type ValidatorSlashEventRecord struct { + // validator_address is the address of the validator. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // height defines the block height at which the slash event occurred. + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // period is the period of the slash event. + Period uint64 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` + // validator_slash_event describes the slash event. + ValidatorSlashEvent ValidatorSlashEvent `protobuf:"bytes,4,opt,name=validator_slash_event,json=validatorSlashEvent,proto3" json:"validator_slash_event"` +} + +func (m *ValidatorSlashEventRecord) Reset() { *m = ValidatorSlashEventRecord{} } +func (m *ValidatorSlashEventRecord) String() string { return proto.CompactTextString(m) } +func (*ValidatorSlashEventRecord) ProtoMessage() {} +func (*ValidatorSlashEventRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{6} +} +func (m *ValidatorSlashEventRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorSlashEventRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorSlashEventRecord.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 *ValidatorSlashEventRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorSlashEventRecord.Merge(m, src) +} +func (m *ValidatorSlashEventRecord) XXX_Size() int { + return m.Size() +} +func (m *ValidatorSlashEventRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorSlashEventRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorSlashEventRecord proto.InternalMessageInfo + +// GenesisState defines the distribution module's genesis state. +type GenesisState struct { + // params defines all the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // fee_pool defines the fee pool at genesis. + FeePool FeePool `protobuf:"bytes,2,opt,name=fee_pool,json=feePool,proto3" json:"fee_pool"` + // fee_pool defines the delegator withdraw infos at genesis. + DelegatorWithdrawInfos []DelegatorWithdrawInfo `protobuf:"bytes,3,rep,name=delegator_withdraw_infos,json=delegatorWithdrawInfos,proto3" json:"delegator_withdraw_infos"` + // fee_pool defines the previous proposer at genesis. + PreviousProposer string `protobuf:"bytes,4,opt,name=previous_proposer,json=previousProposer,proto3" json:"previous_proposer,omitempty"` + // fee_pool defines the outstanding rewards of all validators at genesis. + OutstandingRewards []ValidatorOutstandingRewardsRecord `protobuf:"bytes,5,rep,name=outstanding_rewards,json=outstandingRewards,proto3" json:"outstanding_rewards"` + // fee_pool defines the accumulated commissions of all validators at genesis. + ValidatorAccumulatedCommissions []ValidatorAccumulatedCommissionRecord `protobuf:"bytes,6,rep,name=validator_accumulated_commissions,json=validatorAccumulatedCommissions,proto3" json:"validator_accumulated_commissions"` + // fee_pool defines the historical rewards of all validators at genesis. + ValidatorHistoricalRewards []ValidatorHistoricalRewardsRecord `protobuf:"bytes,7,rep,name=validator_historical_rewards,json=validatorHistoricalRewards,proto3" json:"validator_historical_rewards"` + // fee_pool defines the current rewards of all validators at genesis. + ValidatorCurrentRewards []ValidatorCurrentRewardsRecord `protobuf:"bytes,8,rep,name=validator_current_rewards,json=validatorCurrentRewards,proto3" json:"validator_current_rewards"` + // fee_pool defines the delegator starting infos at genesis. + DelegatorStartingInfos []DelegatorStartingInfoRecord `protobuf:"bytes,9,rep,name=delegator_starting_infos,json=delegatorStartingInfos,proto3" json:"delegator_starting_infos"` + // fee_pool defines the validator slash events at genesis. + ValidatorSlashEvents []ValidatorSlashEventRecord `protobuf:"bytes,10,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_76eed0f9489db580, []int{7} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DelegatorWithdrawInfo)(nil), "cosmos.distribution.v1beta1.DelegatorWithdrawInfo") + proto.RegisterType((*ValidatorOutstandingRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord") + proto.RegisterType((*ValidatorAccumulatedCommissionRecord)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord") + proto.RegisterType((*ValidatorHistoricalRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord") + proto.RegisterType((*ValidatorCurrentRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord") + proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord") + proto.RegisterType((*ValidatorSlashEventRecord)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEventRecord") + proto.RegisterType((*GenesisState)(nil), "cosmos.distribution.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/distribution/v1beta1/genesis.proto", fileDescriptor_76eed0f9489db580) +} + +var fileDescriptor_76eed0f9489db580 = []byte{ + // 921 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x38, 0x25, 0x4d, 0xc6, 0x45, 0xb4, 0xdb, 0x34, 0x6c, 0xd2, 0xb2, 0x4e, 0x4b, 0x0f, + 0x05, 0xd4, 0x35, 0x31, 0x08, 0xaa, 0x22, 0x90, 0x62, 0xb7, 0xe5, 0xe3, 0xd2, 0xc8, 0x96, 0x40, + 0x20, 0x24, 0x6b, 0xbc, 0x3b, 0x5e, 0x8f, 0xb0, 0x77, 0xac, 0x99, 0xf1, 0x1a, 0x90, 0x38, 0x70, + 0x02, 0x21, 0x90, 0x38, 0xc2, 0xad, 0xc7, 0x0a, 0x09, 0x89, 0x03, 0x7f, 0x44, 0x25, 0x2e, 0x15, + 0x27, 0x4e, 0x7c, 0x38, 0x07, 0xe0, 0x9f, 0x40, 0x68, 0x67, 0x66, 0x77, 0xc7, 0xda, 0xed, 0xd6, + 0x69, 0x93, 0x4b, 0xe2, 0x9d, 0x79, 0x1f, 0xbf, 0xdf, 0x7b, 0x3f, 0xbd, 0x37, 0xf0, 0x39, 0x8f, + 0xf2, 0x31, 0xe5, 0x0d, 0x9f, 0x70, 0xc1, 0x48, 0x7f, 0x2a, 0x08, 0x0d, 0x1b, 0xd1, 0x6e, 0x1f, + 0x0b, 0xb4, 0xdb, 0x08, 0x70, 0x88, 0x39, 0xe1, 0xee, 0x84, 0x51, 0x41, 0xad, 0xf3, 0xca, 0xd4, + 0x35, 0x4d, 0x5d, 0x6d, 0xba, 0xbd, 0x11, 0xd0, 0x80, 0x4a, 0xbb, 0x46, 0xfc, 0x4b, 0xb9, 0x6c, + 0x3b, 0x3a, 0x7a, 0x1f, 0x71, 0x9c, 0x46, 0xf5, 0x28, 0x09, 0xf5, 0xbd, 0x5b, 0x96, 0x7d, 0x21, + 0x8f, 0xb2, 0xdf, 0x52, 0xf6, 0x3d, 0x95, 0x48, 0xe3, 0x51, 0x57, 0x67, 0xd0, 0x98, 0x84, 0xb4, + 0x21, 0xff, 0xaa, 0xa3, 0x4b, 0x3f, 0x02, 0x78, 0xee, 0x06, 0x1e, 0xe1, 0x00, 0x09, 0xca, 0xde, + 0x23, 0x62, 0xe8, 0x33, 0x34, 0x7b, 0x3b, 0x1c, 0x50, 0xeb, 0x26, 0x3c, 0xe3, 0x27, 0x17, 0x3d, + 0xe4, 0xfb, 0x0c, 0x73, 0x6e, 0x83, 0x1d, 0x70, 0x65, 0xbd, 0x65, 0xff, 0xfa, 0xf3, 0xd5, 0x0d, + 0x1d, 0x79, 0x4f, 0xdd, 0x74, 0x05, 0x23, 0x61, 0xd0, 0x39, 0x9d, 0xba, 0xe8, 0x73, 0xab, 0x0d, + 0x4f, 0xcf, 0x74, 0xd8, 0x34, 0x4a, 0xf5, 0x21, 0x51, 0x9e, 0x4a, 0x3c, 0xf4, 0xf1, 0xf5, 0xb5, + 0x2f, 0xef, 0xd4, 0x2b, 0xff, 0xdc, 0xa9, 0x57, 0x2e, 0xfd, 0x07, 0xe0, 0xc5, 0x77, 0xd1, 0x88, + 0xf8, 0x71, 0x8e, 0xdb, 0x53, 0xc1, 0x05, 0x0a, 0xfd, 0xd8, 0x07, 0xcf, 0x10, 0xf3, 0x79, 0x07, + 0x7b, 0x94, 0xf9, 0x31, 0xf6, 0x28, 0x31, 0x5a, 0x1e, 0x7b, 0xea, 0x92, 0x60, 0xff, 0x02, 0xc0, + 0xb3, 0x34, 0xcb, 0xd1, 0x63, 0x2a, 0x89, 0x5d, 0xdd, 0x59, 0xb9, 0x52, 0x6b, 0x5e, 0xd0, 0x9d, + 0x71, 0xe3, 0xce, 0x25, 0x4d, 0x76, 0x6f, 0x60, 0xaf, 0x4d, 0x49, 0xd8, 0xba, 0x76, 0xef, 0xf7, + 0x7a, 0xe5, 0x87, 0x3f, 0xea, 0x2f, 0x04, 0x44, 0x0c, 0xa7, 0x7d, 0xd7, 0xa3, 0x63, 0xdd, 0x0c, + 0xfd, 0xef, 0x2a, 0xf7, 0x3f, 0x6a, 0x88, 0x4f, 0x26, 0x98, 0x27, 0x3e, 0xfc, 0xee, 0xdf, 0x3f, + 0x3d, 0x0f, 0x3a, 0x16, 0xcd, 0xd1, 0x32, 0x0a, 0xf0, 0x17, 0x80, 0x97, 0xd3, 0x02, 0xec, 0x79, + 0xde, 0x74, 0x3c, 0x1d, 0x21, 0x81, 0xfd, 0x36, 0x1d, 0x8f, 0x09, 0xe7, 0x84, 0x86, 0x47, 0x5b, + 0x83, 0x21, 0xac, 0xa1, 0x2c, 0x8b, 0x6c, 0x5d, 0xad, 0xf9, 0x9a, 0x5b, 0xa2, 0x73, 0xb7, 0x1c, + 0x5e, 0x6b, 0x3d, 0xae, 0x8c, 0xa2, 0x6a, 0x86, 0x36, 0x38, 0xfe, 0x0b, 0xe0, 0x4e, 0x1a, 0xe4, + 0x2d, 0xc2, 0x05, 0x65, 0xc4, 0x43, 0xa3, 0x63, 0xe9, 0xf1, 0x26, 0x5c, 0x9d, 0x60, 0x46, 0xa8, + 0xa2, 0x76, 0xa2, 0xa3, 0xbf, 0xac, 0x0f, 0xe1, 0xc9, 0xa4, 0xdd, 0x2b, 0x92, 0xf3, 0xab, 0xcb, + 0x71, 0xce, 0xc1, 0x35, 0xf9, 0x26, 0x21, 0x0d, 0xae, 0xbf, 0x00, 0xf8, 0x4c, 0xea, 0xdc, 0x9e, + 0x32, 0x86, 0x43, 0x71, 0x2c, 0x44, 0xdf, 0xcf, 0x08, 0xa9, 0x26, 0xbe, 0xbc, 0x1c, 0xa1, 0x45, + 0x4c, 0x0f, 0x61, 0xf3, 0x7d, 0x15, 0x9e, 0x4f, 0xc7, 0x49, 0x57, 0x20, 0x26, 0x48, 0x18, 0xc4, + 0xe3, 0x24, 0xe3, 0x72, 0x14, 0x43, 0xa5, 0xb0, 0x24, 0xd5, 0x43, 0x97, 0xa4, 0x0f, 0x9f, 0xe4, + 0x1a, 0x63, 0x8f, 0x84, 0x03, 0xaa, 0x3b, 0xdd, 0x2c, 0x2d, 0x4c, 0x21, 0x3d, 0xb3, 0x2c, 0xa7, + 0xb8, 0x71, 0x61, 0xd4, 0xe6, 0x9b, 0x2a, 0xdc, 0x4a, 0xab, 0xda, 0x1d, 0x21, 0x3e, 0xbc, 0x19, + 0xc9, 0xc2, 0x1e, 0xb1, 0x9c, 0x87, 0x98, 0x04, 0x43, 0x91, 0xc8, 0x59, 0x7d, 0x19, 0x32, 0x5f, + 0x59, 0x90, 0x39, 0x85, 0xe7, 0xb2, 0xb4, 0x3c, 0x06, 0xd5, 0xc3, 0x31, 0x2a, 0xfb, 0x84, 0x2c, + 0xc5, 0x8b, 0xcb, 0x69, 0x24, 0x63, 0x63, 0x16, 0xe2, 0x6c, 0x94, 0xbf, 0x37, 0xea, 0xf1, 0xf5, + 0x3a, 0x3c, 0xf5, 0xa6, 0xda, 0x9e, 0x5d, 0x81, 0x04, 0xb6, 0x6e, 0xc1, 0xd5, 0x09, 0x62, 0x68, + 0xac, 0x78, 0xd7, 0x9a, 0xcf, 0x96, 0x26, 0xdf, 0x97, 0xa6, 0x66, 0x3e, 0xed, 0x6d, 0xbd, 0x03, + 0xd7, 0x06, 0x18, 0xf7, 0x26, 0x94, 0x8e, 0xb4, 0xd4, 0x2f, 0x97, 0x46, 0xba, 0x85, 0xf1, 0x3e, + 0xa5, 0xa3, 0x05, 0x69, 0x0f, 0xd4, 0x99, 0x35, 0x83, 0x76, 0x26, 0xd8, 0x74, 0x91, 0xc5, 0x62, + 0x89, 0xe7, 0xc2, 0xca, 0xf2, 0x6a, 0x31, 0x77, 0xab, 0x99, 0x69, 0xd3, 0x2f, 0xb2, 0x90, 0x12, + 0x9f, 0x30, 0x1c, 0x11, 0x3a, 0x95, 0xab, 0x7c, 0x42, 0x39, 0x66, 0xb2, 0x29, 0xa5, 0x7a, 0x48, + 0x5c, 0xf6, 0xb5, 0x87, 0xf5, 0x69, 0xf1, 0x06, 0x7b, 0x42, 0x42, 0x7f, 0x63, 0xb9, 0xee, 0x3e, + 0x68, 0xcd, 0x9a, 0x34, 0x0a, 0x96, 0x96, 0xf5, 0x1d, 0x80, 0x17, 0x0d, 0x4d, 0x67, 0xa3, 0xbe, + 0xe7, 0xa5, 0xdb, 0x80, 0xdb, 0xab, 0x12, 0xca, 0xde, 0x63, 0x6c, 0x94, 0x3c, 0x9a, 0x7a, 0x54, + 0xea, 0xc0, 0xad, 0xaf, 0x00, 0xbc, 0x90, 0x41, 0x1b, 0xa6, 0x33, 0x3b, 0x2d, 0xd0, 0x49, 0x89, + 0xea, 0xf5, 0x47, 0x9c, 0xf9, 0x79, 0x44, 0xdb, 0xd1, 0x03, 0x8d, 0xad, 0xcf, 0x01, 0xdc, 0xca, + 0xc0, 0x78, 0x6a, 0xde, 0xa6, 0x48, 0xd6, 0x24, 0x92, 0xeb, 0x8f, 0x32, 0xac, 0xf3, 0x30, 0x9e, + 0x8e, 0x8a, 0x2d, 0xad, 0xcf, 0x4c, 0x9d, 0x2f, 0x0c, 0x45, 0x6e, 0xaf, 0x4b, 0x04, 0xd7, 0x0e, + 0x3f, 0x15, 0xf3, 0xf9, 0x33, 0xb5, 0x9b, 0x76, 0xdc, 0x9a, 0xc1, 0xcd, 0xc2, 0x31, 0xc4, 0x6d, + 0x28, 0x93, 0xbf, 0x72, 0xd8, 0x39, 0x94, 0x4f, 0xbd, 0x51, 0x30, 0x8d, 0x8c, 0xd5, 0xd5, 0xba, + 0x7d, 0x77, 0xee, 0x80, 0x7b, 0x73, 0x07, 0xdc, 0x9f, 0x3b, 0xe0, 0xcf, 0xb9, 0x03, 0xbe, 0x3d, + 0x70, 0x2a, 0xf7, 0x0f, 0x9c, 0xca, 0x6f, 0x07, 0x4e, 0xe5, 0x83, 0xdd, 0xd2, 0x67, 0xdc, 0xc7, + 0x8b, 0xaf, 0x73, 0xf9, 0xaa, 0xeb, 0xaf, 0xca, 0x17, 0xf6, 0x4b, 0xff, 0x07, 0x00, 0x00, 0xff, + 0xff, 0x71, 0x88, 0x91, 0xf2, 0x3f, 0x0c, 0x00, 0x00, +} + +func (m *DelegatorWithdrawInfo) 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 *DelegatorWithdrawInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorWithdrawInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WithdrawAddress) > 0 { + i -= len(m.WithdrawAddress) + copy(dAtA[i:], m.WithdrawAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.WithdrawAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorOutstandingRewardsRecord) 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 *ValidatorOutstandingRewardsRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorOutstandingRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OutstandingRewards) > 0 { + for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorAccumulatedCommissionRecord) 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 *ValidatorAccumulatedCommissionRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorAccumulatedCommissionRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Accumulated.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorHistoricalRewardsRecord) 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 *ValidatorHistoricalRewardsRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorHistoricalRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Rewards.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if m.Period != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Period)) + i-- + dAtA[i] = 0x10 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorCurrentRewardsRecord) 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 *ValidatorCurrentRewardsRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorCurrentRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Rewards.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DelegatorStartingInfoRecord) 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 *DelegatorStartingInfoRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DelegatorStartingInfoRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.StartingInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ValidatorSlashEventRecord) 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 *ValidatorSlashEventRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorSlashEventRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ValidatorSlashEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.Period != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Period)) + i-- + dAtA[i] = 0x18 + } + if m.Height != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorSlashEvents) > 0 { + for iNdEx := len(m.ValidatorSlashEvents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorSlashEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } + if len(m.DelegatorStartingInfos) > 0 { + for iNdEx := len(m.DelegatorStartingInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DelegatorStartingInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + } + if len(m.ValidatorCurrentRewards) > 0 { + for iNdEx := len(m.ValidatorCurrentRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorCurrentRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.ValidatorHistoricalRewards) > 0 { + for iNdEx := len(m.ValidatorHistoricalRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorHistoricalRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.ValidatorAccumulatedCommissions) > 0 { + for iNdEx := len(m.ValidatorAccumulatedCommissions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorAccumulatedCommissions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.OutstandingRewards) > 0 { + for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.PreviousProposer) > 0 { + i -= len(m.PreviousProposer) + copy(dAtA[i:], m.PreviousProposer) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PreviousProposer))) + i-- + dAtA[i] = 0x22 + } + if len(m.DelegatorWithdrawInfos) > 0 { + for iNdEx := len(m.DelegatorWithdrawInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DelegatorWithdrawInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.FeePool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DelegatorWithdrawInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.WithdrawAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *ValidatorOutstandingRewardsRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.OutstandingRewards) > 0 { + for _, e := range m.OutstandingRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *ValidatorAccumulatedCommissionRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.Accumulated.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *ValidatorHistoricalRewardsRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Period != 0 { + n += 1 + sovGenesis(uint64(m.Period)) + } + l = m.Rewards.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *ValidatorCurrentRewardsRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.Rewards.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *DelegatorStartingInfoRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.StartingInfo.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *ValidatorSlashEventRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovGenesis(uint64(m.Height)) + } + if m.Period != 0 { + n += 1 + sovGenesis(uint64(m.Period)) + } + l = m.ValidatorSlashEvent.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.FeePool.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.DelegatorWithdrawInfos) > 0 { + for _, e := range m.DelegatorWithdrawInfos { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = len(m.PreviousProposer) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if len(m.OutstandingRewards) > 0 { + for _, e := range m.OutstandingRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ValidatorAccumulatedCommissions) > 0 { + for _, e := range m.ValidatorAccumulatedCommissions { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ValidatorHistoricalRewards) > 0 { + for _, e := range m.ValidatorHistoricalRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ValidatorCurrentRewards) > 0 { + for _, e := range m.ValidatorCurrentRewards { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.DelegatorStartingInfos) > 0 { + for _, e := range m.DelegatorStartingInfos { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ValidatorSlashEvents) > 0 { + for _, e := range m.ValidatorSlashEvents { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DelegatorWithdrawInfo) 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 ErrIntOverflowGenesis + } + 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: DelegatorWithdrawInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorWithdrawInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WithdrawAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorOutstandingRewardsRecord) 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 ErrIntOverflowGenesis + } + 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: ValidatorOutstandingRewardsRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorOutstandingRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutstandingRewards = append(m.OutstandingRewards, types.DecCoin{}) + if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorAccumulatedCommissionRecord) 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 ErrIntOverflowGenesis + } + 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: ValidatorAccumulatedCommissionRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorAccumulatedCommissionRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Accumulated", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Accumulated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorHistoricalRewardsRecord) 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 ErrIntOverflowGenesis + } + 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: ValidatorHistoricalRewardsRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorHistoricalRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + m.Period = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Period |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorCurrentRewardsRecord) 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 ErrIntOverflowGenesis + } + 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: ValidatorCurrentRewardsRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorCurrentRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DelegatorStartingInfoRecord) 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 ErrIntOverflowGenesis + } + 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: DelegatorStartingInfoRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DelegatorStartingInfoRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StartingInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorSlashEventRecord) 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 ErrIntOverflowGenesis + } + 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: ValidatorSlashEventRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorSlashEventRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + m.Period = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Period |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ValidatorSlashEvent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FeePool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorWithdrawInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorWithdrawInfos = append(m.DelegatorWithdrawInfos, DelegatorWithdrawInfo{}) + if err := m.DelegatorWithdrawInfos[len(m.DelegatorWithdrawInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PreviousProposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PreviousProposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutstandingRewards = append(m.OutstandingRewards, ValidatorOutstandingRewardsRecord{}) + if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAccumulatedCommissions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAccumulatedCommissions = append(m.ValidatorAccumulatedCommissions, ValidatorAccumulatedCommissionRecord{}) + if err := m.ValidatorAccumulatedCommissions[len(m.ValidatorAccumulatedCommissions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHistoricalRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorHistoricalRewards = append(m.ValidatorHistoricalRewards, ValidatorHistoricalRewardsRecord{}) + if err := m.ValidatorHistoricalRewards[len(m.ValidatorHistoricalRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCurrentRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorCurrentRewards = append(m.ValidatorCurrentRewards, ValidatorCurrentRewardsRecord{}) + if err := m.ValidatorCurrentRewards[len(m.ValidatorCurrentRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorStartingInfos", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DelegatorStartingInfos = append(m.DelegatorStartingInfos, DelegatorStartingInfoRecord{}) + if err := m.DelegatorStartingInfos[len(m.DelegatorStartingInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorSlashEvents = append(m.ValidatorSlashEvents, ValidatorSlashEventRecord{}) + if err := m.ValidatorSlashEvents[len(m.ValidatorSlashEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go new file mode 100644 index 000000000000..0b8c1a1ace93 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go @@ -0,0 +1,4882 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/distribution/v1beta1/query.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" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryParamsRequest is the 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_5efd02cbc06efdc9, []int{0} +} +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 the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params defines the parameters of the 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_5efd02cbc06efdc9, []int{1} +} +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{} +} + +// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +type QueryValidatorDistributionInfoRequest struct { + // validator_address defines the validator address to query for. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *QueryValidatorDistributionInfoRequest) Reset() { *m = QueryValidatorDistributionInfoRequest{} } +func (m *QueryValidatorDistributionInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorDistributionInfoRequest) ProtoMessage() {} +func (*QueryValidatorDistributionInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{2} +} +func (m *QueryValidatorDistributionInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorDistributionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorDistributionInfoRequest.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 *QueryValidatorDistributionInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorDistributionInfoRequest.Merge(m, src) +} +func (m *QueryValidatorDistributionInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorDistributionInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorDistributionInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorDistributionInfoRequest proto.InternalMessageInfo + +func (m *QueryValidatorDistributionInfoRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +type QueryValidatorDistributionInfoResponse struct { + // operator_address defines the validator operator address. + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + // self_bond_rewards defines the self delegations rewards. + SelfBondRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=self_bond_rewards,json=selfBondRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"self_bond_rewards"` + // commission defines the commission the validator received. + Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,3,rep,name=commission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"commission"` +} + +func (m *QueryValidatorDistributionInfoResponse) Reset() { + *m = QueryValidatorDistributionInfoResponse{} +} +func (m *QueryValidatorDistributionInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorDistributionInfoResponse) ProtoMessage() {} +func (*QueryValidatorDistributionInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{3} +} +func (m *QueryValidatorDistributionInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorDistributionInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorDistributionInfoResponse.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 *QueryValidatorDistributionInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorDistributionInfoResponse.Merge(m, src) +} +func (m *QueryValidatorDistributionInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorDistributionInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorDistributionInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorDistributionInfoResponse proto.InternalMessageInfo + +func (m *QueryValidatorDistributionInfoResponse) GetOperatorAddress() string { + if m != nil { + return m.OperatorAddress + } + return "" +} + +func (m *QueryValidatorDistributionInfoResponse) GetSelfBondRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.SelfBondRewards + } + return nil +} + +func (m *QueryValidatorDistributionInfoResponse) GetCommission() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Commission + } + return nil +} + +// QueryValidatorOutstandingRewardsRequest is the request type for the +// Query/ValidatorOutstandingRewards RPC method. +type QueryValidatorOutstandingRewardsRequest struct { + // validator_address defines the validator address to query for. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *QueryValidatorOutstandingRewardsRequest) Reset() { + *m = QueryValidatorOutstandingRewardsRequest{} +} +func (m *QueryValidatorOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorOutstandingRewardsRequest) ProtoMessage() {} +func (*QueryValidatorOutstandingRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{4} +} +func (m *QueryValidatorOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorOutstandingRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.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 *QueryValidatorOutstandingRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.Merge(m, src) +} +func (m *QueryValidatorOutstandingRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorOutstandingRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorOutstandingRewardsRequest proto.InternalMessageInfo + +func (m *QueryValidatorOutstandingRewardsRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +// QueryValidatorOutstandingRewardsResponse is the response type for the +// Query/ValidatorOutstandingRewards RPC method. +type QueryValidatorOutstandingRewardsResponse struct { + Rewards ValidatorOutstandingRewards `protobuf:"bytes,1,opt,name=rewards,proto3" json:"rewards"` +} + +func (m *QueryValidatorOutstandingRewardsResponse) Reset() { + *m = QueryValidatorOutstandingRewardsResponse{} +} +func (m *QueryValidatorOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorOutstandingRewardsResponse) ProtoMessage() {} +func (*QueryValidatorOutstandingRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{5} +} +func (m *QueryValidatorOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorOutstandingRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.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 *QueryValidatorOutstandingRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.Merge(m, src) +} +func (m *QueryValidatorOutstandingRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorOutstandingRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorOutstandingRewardsResponse proto.InternalMessageInfo + +func (m *QueryValidatorOutstandingRewardsResponse) GetRewards() ValidatorOutstandingRewards { + if m != nil { + return m.Rewards + } + return ValidatorOutstandingRewards{} +} + +// QueryValidatorCommissionRequest is the request type for the +// Query/ValidatorCommission RPC method +type QueryValidatorCommissionRequest struct { + // validator_address defines the validator address to query for. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *QueryValidatorCommissionRequest) Reset() { *m = QueryValidatorCommissionRequest{} } +func (m *QueryValidatorCommissionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorCommissionRequest) ProtoMessage() {} +func (*QueryValidatorCommissionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{6} +} +func (m *QueryValidatorCommissionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorCommissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorCommissionRequest.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 *QueryValidatorCommissionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorCommissionRequest.Merge(m, src) +} +func (m *QueryValidatorCommissionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorCommissionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorCommissionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorCommissionRequest proto.InternalMessageInfo + +func (m *QueryValidatorCommissionRequest) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +// QueryValidatorCommissionResponse is the response type for the +// Query/ValidatorCommission RPC method +type QueryValidatorCommissionResponse struct { + // commission defines the commission the validator received. + Commission ValidatorAccumulatedCommission `protobuf:"bytes,1,opt,name=commission,proto3" json:"commission"` +} + +func (m *QueryValidatorCommissionResponse) Reset() { *m = QueryValidatorCommissionResponse{} } +func (m *QueryValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorCommissionResponse) ProtoMessage() {} +func (*QueryValidatorCommissionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{7} +} +func (m *QueryValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorCommissionResponse.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 *QueryValidatorCommissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorCommissionResponse.Merge(m, src) +} +func (m *QueryValidatorCommissionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorCommissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorCommissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorCommissionResponse proto.InternalMessageInfo + +func (m *QueryValidatorCommissionResponse) GetCommission() ValidatorAccumulatedCommission { + if m != nil { + return m.Commission + } + return ValidatorAccumulatedCommission{} +} + +// QueryValidatorSlashesRequest is the request type for the +// Query/ValidatorSlashes RPC method +type QueryValidatorSlashesRequest struct { + // validator_address defines the validator address to query for. + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // starting_height defines the optional starting height to query the slashes. + StartingHeight uint64 `protobuf:"varint,2,opt,name=starting_height,json=startingHeight,proto3" json:"starting_height,omitempty"` + // starting_height defines the optional ending height to query the slashes. + EndingHeight uint64 `protobuf:"varint,3,opt,name=ending_height,json=endingHeight,proto3" json:"ending_height,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorSlashesRequest) Reset() { *m = QueryValidatorSlashesRequest{} } +func (m *QueryValidatorSlashesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorSlashesRequest) ProtoMessage() {} +func (*QueryValidatorSlashesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{8} +} +func (m *QueryValidatorSlashesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorSlashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorSlashesRequest.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 *QueryValidatorSlashesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorSlashesRequest.Merge(m, src) +} +func (m *QueryValidatorSlashesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorSlashesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorSlashesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorSlashesRequest proto.InternalMessageInfo + +// QueryValidatorSlashesResponse is the response type for the +// Query/ValidatorSlashes RPC method. +type QueryValidatorSlashesResponse struct { + // slashes defines the slashes the validator received. + Slashes []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=slashes,proto3" json:"slashes"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorSlashesResponse) Reset() { *m = QueryValidatorSlashesResponse{} } +func (m *QueryValidatorSlashesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorSlashesResponse) ProtoMessage() {} +func (*QueryValidatorSlashesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{9} +} +func (m *QueryValidatorSlashesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorSlashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorSlashesResponse.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 *QueryValidatorSlashesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorSlashesResponse.Merge(m, src) +} +func (m *QueryValidatorSlashesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorSlashesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorSlashesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorSlashesResponse proto.InternalMessageInfo + +func (m *QueryValidatorSlashesResponse) GetSlashes() []ValidatorSlashEvent { + if m != nil { + return m.Slashes + } + return nil +} + +func (m *QueryValidatorSlashesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDelegationRewardsRequest is the request type for the +// Query/DelegationRewards RPC method. +type QueryDelegationRewardsRequest struct { + // delegator_address defines the delegator address to query for. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + // validator_address defines the validator address to query for. + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *QueryDelegationRewardsRequest) Reset() { *m = QueryDelegationRewardsRequest{} } +func (m *QueryDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegationRewardsRequest) ProtoMessage() {} +func (*QueryDelegationRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{10} +} +func (m *QueryDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegationRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegationRewardsRequest.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 *QueryDelegationRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegationRewardsRequest.Merge(m, src) +} +func (m *QueryDelegationRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegationRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegationRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegationRewardsRequest proto.InternalMessageInfo + +// QueryDelegationRewardsResponse is the response type for the +// Query/DelegationRewards RPC method. +type QueryDelegationRewardsResponse struct { + // rewards defines the rewards accrued by a delegation. + Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` +} + +func (m *QueryDelegationRewardsResponse) Reset() { *m = QueryDelegationRewardsResponse{} } +func (m *QueryDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegationRewardsResponse) ProtoMessage() {} +func (*QueryDelegationRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{11} +} +func (m *QueryDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegationRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegationRewardsResponse.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 *QueryDelegationRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegationRewardsResponse.Merge(m, src) +} +func (m *QueryDelegationRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegationRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegationRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegationRewardsResponse proto.InternalMessageInfo + +func (m *QueryDelegationRewardsResponse) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Rewards + } + return nil +} + +// QueryDelegationTotalRewardsRequest is the request type for the +// Query/DelegationTotalRewards RPC method. +type QueryDelegationTotalRewardsRequest struct { + // delegator_address defines the delegator address to query for. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *QueryDelegationTotalRewardsRequest) Reset() { *m = QueryDelegationTotalRewardsRequest{} } +func (m *QueryDelegationTotalRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegationTotalRewardsRequest) ProtoMessage() {} +func (*QueryDelegationTotalRewardsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{12} +} +func (m *QueryDelegationTotalRewardsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegationTotalRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegationTotalRewardsRequest.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 *QueryDelegationTotalRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegationTotalRewardsRequest.Merge(m, src) +} +func (m *QueryDelegationTotalRewardsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegationTotalRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegationTotalRewardsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegationTotalRewardsRequest proto.InternalMessageInfo + +// QueryDelegationTotalRewardsResponse is the response type for the +// Query/DelegationTotalRewards RPC method. +type QueryDelegationTotalRewardsResponse struct { + // rewards defines all the rewards accrued by a delegator. + Rewards []DelegationDelegatorReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` + // total defines the sum of all the rewards. + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` +} + +func (m *QueryDelegationTotalRewardsResponse) Reset() { *m = QueryDelegationTotalRewardsResponse{} } +func (m *QueryDelegationTotalRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegationTotalRewardsResponse) ProtoMessage() {} +func (*QueryDelegationTotalRewardsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{13} +} +func (m *QueryDelegationTotalRewardsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegationTotalRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegationTotalRewardsResponse.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 *QueryDelegationTotalRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegationTotalRewardsResponse.Merge(m, src) +} +func (m *QueryDelegationTotalRewardsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegationTotalRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegationTotalRewardsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegationTotalRewardsResponse proto.InternalMessageInfo + +func (m *QueryDelegationTotalRewardsResponse) GetRewards() []DelegationDelegatorReward { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *QueryDelegationTotalRewardsResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Total + } + return nil +} + +// QueryDelegatorValidatorsRequest is the request type for the +// Query/DelegatorValidators RPC method. +type QueryDelegatorValidatorsRequest struct { + // delegator_address defines the delegator address to query for. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *QueryDelegatorValidatorsRequest) Reset() { *m = QueryDelegatorValidatorsRequest{} } +func (m *QueryDelegatorValidatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorValidatorsRequest) ProtoMessage() {} +func (*QueryDelegatorValidatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{14} +} +func (m *QueryDelegatorValidatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorValidatorsRequest.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 *QueryDelegatorValidatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorValidatorsRequest.Merge(m, src) +} +func (m *QueryDelegatorValidatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorValidatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorValidatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorValidatorsRequest proto.InternalMessageInfo + +// QueryDelegatorValidatorsResponse is the response type for the +// Query/DelegatorValidators RPC method. +type QueryDelegatorValidatorsResponse struct { + // validators defines the validators a delegator is delegating for. + Validators []string `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` +} + +func (m *QueryDelegatorValidatorsResponse) Reset() { *m = QueryDelegatorValidatorsResponse{} } +func (m *QueryDelegatorValidatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorValidatorsResponse) ProtoMessage() {} +func (*QueryDelegatorValidatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{15} +} +func (m *QueryDelegatorValidatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorValidatorsResponse.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 *QueryDelegatorValidatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorValidatorsResponse.Merge(m, src) +} +func (m *QueryDelegatorValidatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorValidatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorValidatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorValidatorsResponse proto.InternalMessageInfo + +// QueryDelegatorWithdrawAddressRequest is the request type for the +// Query/DelegatorWithdrawAddress RPC method. +type QueryDelegatorWithdrawAddressRequest struct { + // delegator_address defines the delegator address to query for. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *QueryDelegatorWithdrawAddressRequest) Reset() { *m = QueryDelegatorWithdrawAddressRequest{} } +func (m *QueryDelegatorWithdrawAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorWithdrawAddressRequest) ProtoMessage() {} +func (*QueryDelegatorWithdrawAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{16} +} +func (m *QueryDelegatorWithdrawAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorWithdrawAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.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 *QueryDelegatorWithdrawAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.Merge(m, src) +} +func (m *QueryDelegatorWithdrawAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorWithdrawAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorWithdrawAddressRequest proto.InternalMessageInfo + +// QueryDelegatorWithdrawAddressResponse is the response type for the +// Query/DelegatorWithdrawAddress RPC method. +type QueryDelegatorWithdrawAddressResponse struct { + // withdraw_address defines the delegator address to query for. + WithdrawAddress string `protobuf:"bytes,1,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` +} + +func (m *QueryDelegatorWithdrawAddressResponse) Reset() { *m = QueryDelegatorWithdrawAddressResponse{} } +func (m *QueryDelegatorWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDelegatorWithdrawAddressResponse) ProtoMessage() {} +func (*QueryDelegatorWithdrawAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{17} +} +func (m *QueryDelegatorWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDelegatorWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.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 *QueryDelegatorWithdrawAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.Merge(m, src) +} +func (m *QueryDelegatorWithdrawAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDelegatorWithdrawAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDelegatorWithdrawAddressResponse proto.InternalMessageInfo + +// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +// method. +type QueryCommunityPoolRequest struct { +} + +func (m *QueryCommunityPoolRequest) Reset() { *m = QueryCommunityPoolRequest{} } +func (m *QueryCommunityPoolRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCommunityPoolRequest) ProtoMessage() {} +func (*QueryCommunityPoolRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{18} +} +func (m *QueryCommunityPoolRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCommunityPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCommunityPoolRequest.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 *QueryCommunityPoolRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCommunityPoolRequest.Merge(m, src) +} +func (m *QueryCommunityPoolRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCommunityPoolRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCommunityPoolRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCommunityPoolRequest proto.InternalMessageInfo + +// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +// RPC method. +type QueryCommunityPoolResponse struct { + // pool defines community pool's coins. + Pool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=pool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"pool"` +} + +func (m *QueryCommunityPoolResponse) Reset() { *m = QueryCommunityPoolResponse{} } +func (m *QueryCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCommunityPoolResponse) ProtoMessage() {} +func (*QueryCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{19} +} +func (m *QueryCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCommunityPoolResponse.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 *QueryCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCommunityPoolResponse.Merge(m, src) +} +func (m *QueryCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCommunityPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCommunityPoolResponse proto.InternalMessageInfo + +func (m *QueryCommunityPoolResponse) GetPool() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Pool + } + return nil +} + +// QueryTokenizeShareRecordRewardRequest is the request type for the Query/TokenizeShareRecordReward RPC +// method. +type QueryTokenizeShareRecordRewardRequest struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` +} + +func (m *QueryTokenizeShareRecordRewardRequest) Reset() { *m = QueryTokenizeShareRecordRewardRequest{} } +func (m *QueryTokenizeShareRecordRewardRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordRewardRequest) ProtoMessage() {} +func (*QueryTokenizeShareRecordRewardRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{20} +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.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 *QueryTokenizeShareRecordRewardRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.Merge(m, src) +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordRewardRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenizeShareRecordRewardRequest proto.InternalMessageInfo + +// QueryTokenizeShareRecordRewardResponse is the response type for the Query/TokenizeShareRecordReward +// RPC method. +type QueryTokenizeShareRecordRewardResponse struct { + // rewards defines all the rewards accrued by a delegator. + Rewards []TokenizeShareRecordReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` + // total defines the sum of all the rewards. + Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` +} + +func (m *QueryTokenizeShareRecordRewardResponse) Reset() { + *m = QueryTokenizeShareRecordRewardResponse{} +} +func (m *QueryTokenizeShareRecordRewardResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*QueryTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5efd02cbc06efdc9, []int{21} +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.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 *QueryTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenizeShareRecordRewardResponse proto.InternalMessageInfo + +func (m *QueryTokenizeShareRecordRewardResponse) GetRewards() []TokenizeShareRecordReward { + if m != nil { + return m.Rewards + } + return nil +} + +func (m *QueryTokenizeShareRecordRewardResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.Total + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.distribution.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.distribution.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryValidatorDistributionInfoRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest") + proto.RegisterType((*QueryValidatorDistributionInfoResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse") + proto.RegisterType((*QueryValidatorOutstandingRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest") + proto.RegisterType((*QueryValidatorOutstandingRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse") + proto.RegisterType((*QueryValidatorCommissionRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionRequest") + proto.RegisterType((*QueryValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionResponse") + proto.RegisterType((*QueryValidatorSlashesRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesRequest") + proto.RegisterType((*QueryValidatorSlashesResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse") + proto.RegisterType((*QueryDelegationRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsRequest") + proto.RegisterType((*QueryDelegationRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse") + proto.RegisterType((*QueryDelegationTotalRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest") + proto.RegisterType((*QueryDelegationTotalRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse") + proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest") + proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse") + proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest") + proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse") + proto.RegisterType((*QueryCommunityPoolRequest)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolRequest") + proto.RegisterType((*QueryCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolResponse") + proto.RegisterType((*QueryTokenizeShareRecordRewardRequest)(nil), "cosmos.distribution.v1beta1.QueryTokenizeShareRecordRewardRequest") + proto.RegisterType((*QueryTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.QueryTokenizeShareRecordRewardResponse") +} + +func init() { + proto.RegisterFile("cosmos/distribution/v1beta1/query.proto", fileDescriptor_5efd02cbc06efdc9) +} + +var fileDescriptor_5efd02cbc06efdc9 = []byte{ + // 1381 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x6c, 0x1b, 0x45, + 0x14, 0xf6, 0xb8, 0x69, 0x4b, 0xa7, 0x2d, 0x49, 0x26, 0x11, 0x72, 0x36, 0xc1, 0x8e, 0x36, 0xb4, + 0x89, 0x1a, 0xc5, 0xdb, 0x24, 0x52, 0x29, 0x09, 0x11, 0xc4, 0x4e, 0x42, 0xa1, 0x51, 0x7f, 0x9c, + 0xd0, 0x08, 0x50, 0x65, 0xad, 0xbd, 0x93, 0xf5, 0x52, 0x7b, 0xc7, 0xd9, 0x5d, 0xc7, 0x84, 0x28, + 0x97, 0x22, 0xa4, 0xc2, 0x09, 0xc1, 0xa5, 0xc7, 0x1c, 0x11, 0x27, 0x0e, 0x20, 0x8e, 0xbd, 0xf6, + 0x58, 0x81, 0x84, 0x38, 0x15, 0x94, 0x80, 0x68, 0x0f, 0x48, 0x88, 0x0b, 0x1c, 0x91, 0x67, 0x66, + 0xed, 0xdd, 0xd8, 0x5e, 0xef, 0xda, 0xf1, 0x25, 0xd9, 0xcc, 0xcc, 0xfb, 0xde, 0xfb, 0xde, 0x9b, + 0x37, 0xf3, 0x4d, 0xe0, 0x78, 0x96, 0x98, 0x05, 0x62, 0x4a, 0x8a, 0x66, 0x5a, 0x86, 0x96, 0x29, + 0x59, 0x1a, 0xd1, 0xa5, 0xed, 0xe9, 0x0c, 0xb6, 0xe4, 0x69, 0x69, 0xab, 0x84, 0x8d, 0x9d, 0x78, + 0xd1, 0x20, 0x16, 0x41, 0xc3, 0x6c, 0x61, 0xdc, 0xb9, 0x30, 0xce, 0x17, 0x0a, 0x97, 0x38, 0x4a, + 0x46, 0x36, 0x31, 0xb3, 0xaa, 0x62, 0x14, 0x65, 0x55, 0xd3, 0x65, 0xba, 0x9a, 0x02, 0x09, 0x83, + 0x2a, 0x51, 0x09, 0xfd, 0x94, 0x2a, 0x5f, 0x7c, 0x74, 0x44, 0x25, 0x44, 0xcd, 0x63, 0x49, 0x2e, + 0x6a, 0x92, 0xac, 0xeb, 0xc4, 0xa2, 0x26, 0x26, 0x9f, 0x8d, 0x3a, 0xf1, 0x6d, 0xe4, 0x2c, 0xd1, + 0x6c, 0xcc, 0xb8, 0x17, 0x0b, 0x57, 0xc4, 0x6c, 0xfd, 0x10, 0x5b, 0x9f, 0x66, 0x61, 0x70, 0x66, + 0x6c, 0xaa, 0x5f, 0x2e, 0x68, 0x3a, 0x91, 0xe8, 0x4f, 0x36, 0x24, 0x0e, 0x42, 0x74, 0xbb, 0xc2, + 0xe9, 0x96, 0x6c, 0xc8, 0x05, 0x33, 0x85, 0xb7, 0x4a, 0xd8, 0xb4, 0xc4, 0xbb, 0x70, 0xc0, 0x35, + 0x6a, 0x16, 0x89, 0x6e, 0x62, 0xb4, 0x02, 0x4f, 0x15, 0xe9, 0x48, 0x04, 0x8c, 0x82, 0x89, 0xb3, + 0x33, 0x63, 0x71, 0x8f, 0xc4, 0xc5, 0x99, 0x71, 0xe2, 0xcc, 0xe3, 0xa7, 0xb1, 0xd0, 0xd7, 0x7f, + 0x7e, 0x7b, 0x09, 0xa4, 0xb8, 0xb5, 0xa8, 0xc3, 0x0b, 0x14, 0xfe, 0x8e, 0x9c, 0xd7, 0x14, 0xd9, + 0x22, 0xc6, 0x92, 0xc3, 0xfe, 0x6d, 0x7d, 0x93, 0xf0, 0x38, 0xd0, 0x32, 0xec, 0xdf, 0xb6, 0xd7, + 0xa4, 0x65, 0x45, 0x31, 0xb0, 0xc9, 0x7c, 0x9f, 0x49, 0x44, 0x7e, 0xfc, 0x6e, 0x6a, 0x90, 0xbb, + 0x5f, 0x64, 0x33, 0x6b, 0x96, 0xa1, 0xe9, 0x6a, 0xaa, 0xaf, 0x6a, 0xc2, 0xc7, 0xc5, 0x3f, 0xc2, + 0xf0, 0x62, 0x2b, 0x87, 0x9c, 0x62, 0x12, 0xf6, 0x91, 0x22, 0x36, 0x02, 0x39, 0xec, 0xb5, 0x2d, + 0xf8, 0x30, 0xba, 0x0f, 0x60, 0xbf, 0x89, 0xf3, 0x9b, 0xe9, 0x0c, 0xd1, 0x95, 0xb4, 0x81, 0xcb, + 0xb2, 0xa1, 0x98, 0x91, 0xf0, 0xe8, 0x89, 0x89, 0xb3, 0x33, 0x23, 0x76, 0xce, 0x2a, 0xf5, 0xae, + 0xe6, 0x6a, 0x09, 0x67, 0x93, 0x44, 0xd3, 0x13, 0x57, 0x2b, 0xc9, 0xfa, 0xe6, 0xd7, 0xd8, 0xa4, + 0xaa, 0x59, 0xb9, 0x52, 0x26, 0x9e, 0x25, 0x05, 0x5e, 0x42, 0xfe, 0x6b, 0xca, 0x54, 0xee, 0x49, + 0xd6, 0x4e, 0x11, 0x9b, 0xb6, 0x8d, 0xc9, 0x72, 0xdb, 0x5b, 0x71, 0x98, 0x20, 0xba, 0x92, 0x62, + 0xee, 0xd0, 0x16, 0x84, 0x59, 0x52, 0x28, 0x68, 0xa6, 0xa9, 0x11, 0x3d, 0x72, 0xc2, 0x87, 0xf3, + 0xd9, 0x36, 0x9c, 0xa7, 0x1c, 0x4e, 0xc4, 0x22, 0x1c, 0x77, 0xa7, 0xf9, 0x66, 0xc9, 0x32, 0x2d, + 0x59, 0x57, 0x2a, 0x59, 0x62, 0x61, 0x1d, 0x73, 0x65, 0x3f, 0x03, 0x70, 0xa2, 0xb5, 0x4b, 0x5e, + 0xdb, 0xbb, 0xf0, 0xb4, 0x5d, 0x0b, 0xb6, 0x7f, 0xaf, 0x7a, 0xee, 0x5f, 0x0f, 0x48, 0xe7, 0xa6, + 0xb6, 0x31, 0xc5, 0x1c, 0x8c, 0xb9, 0x43, 0x49, 0x56, 0x33, 0x73, 0xcc, 0xac, 0x3f, 0x07, 0x70, + 0xb4, 0xb9, 0x2b, 0xce, 0x76, 0xd3, 0x55, 0x7f, 0x46, 0x78, 0xde, 0x1f, 0xe1, 0xc5, 0x6c, 0xb6, + 0x54, 0x28, 0xe5, 0x65, 0x0b, 0x2b, 0x35, 0x60, 0x27, 0x67, 0x67, 0xd1, 0x3f, 0x0d, 0xc3, 0x11, + 0x77, 0x30, 0x6b, 0x79, 0xd9, 0xcc, 0xe1, 0x63, 0x2e, 0x35, 0x1a, 0x87, 0xbd, 0xa6, 0x25, 0x1b, + 0x96, 0xa6, 0xab, 0xe9, 0x1c, 0xd6, 0xd4, 0x9c, 0x15, 0x09, 0x8f, 0x82, 0x89, 0x9e, 0xd4, 0x8b, + 0xf6, 0xf0, 0x35, 0x3a, 0x8a, 0xc6, 0xe0, 0x79, 0x4c, 0x8b, 0x65, 0x2f, 0x3b, 0x41, 0x97, 0x9d, + 0x63, 0x83, 0x7c, 0xd1, 0x0a, 0x84, 0xb5, 0xd3, 0x3b, 0xd2, 0x43, 0xb3, 0x73, 0xd1, 0xd5, 0x1d, + 0xec, 0x82, 0xa8, 0x1d, 0x66, 0x2a, 0xe6, 0x84, 0x52, 0x0e, 0xcb, 0xb9, 0x17, 0x1e, 0xec, 0xc7, + 0x42, 0x0f, 0xf7, 0x63, 0x40, 0x7c, 0x04, 0xe0, 0xcb, 0x4d, 0xf2, 0xc0, 0x2b, 0xf2, 0x2e, 0x3c, + 0x6d, 0xb2, 0xa1, 0x08, 0xa0, 0xed, 0x78, 0xd9, 0x5f, 0x39, 0x28, 0xce, 0xf2, 0x36, 0xd6, 0x2d, + 0xd7, 0xbe, 0xe3, 0x58, 0xe8, 0x2d, 0x17, 0x95, 0x30, 0xa5, 0x32, 0xde, 0x92, 0x0a, 0x8b, 0xc9, + 0xc9, 0x45, 0xfc, 0xc1, 0x66, 0xb0, 0x84, 0xf3, 0x58, 0xa5, 0x63, 0xf5, 0x5d, 0xab, 0xb0, 0xb9, + 0x20, 0xa5, 0xac, 0x9a, 0xd8, 0xa5, 0x6c, 0xb8, 0x23, 0xc2, 0x41, 0x77, 0x04, 0xcb, 0xfd, 0xb3, + 0xfd, 0x58, 0x48, 0xfc, 0x12, 0xc0, 0x68, 0xb3, 0xc8, 0x79, 0xf2, 0x8b, 0xce, 0xe6, 0xef, 0xe6, + 0x41, 0x5c, 0x3d, 0x0f, 0x4a, 0x50, 0x3c, 0x12, 0xd3, 0x3a, 0xb1, 0xe4, 0x7c, 0x57, 0x52, 0xea, + 0xc8, 0xc5, 0xdf, 0x00, 0x8e, 0x79, 0xfa, 0xe5, 0x09, 0xf9, 0xe0, 0x68, 0x42, 0xae, 0x78, 0xee, + 0xc6, 0x1a, 0xda, 0x92, 0xed, 0x9b, 0x21, 0x36, 0x3a, 0x0b, 0x51, 0x1e, 0x9e, 0xb4, 0x2a, 0x4e, + 0xbb, 0x7c, 0xe9, 0x31, 0x27, 0xa2, 0xc1, 0x4f, 0xde, 0x6a, 0x64, 0xd5, 0xd6, 0xe9, 0x5e, 0x9a, + 0x57, 0xf9, 0x11, 0xdc, 0xd0, 0x27, 0x4f, 0x71, 0x14, 0xc2, 0xea, 0xa6, 0x65, 0x59, 0x3e, 0x93, + 0x72, 0x8c, 0x38, 0xd0, 0xca, 0xf0, 0x15, 0x37, 0xda, 0x86, 0x66, 0xe5, 0x14, 0x43, 0x2e, 0x73, + 0xc7, 0x5d, 0xa3, 0xb1, 0xcd, 0xa5, 0x58, 0x73, 0xc7, 0x35, 0x61, 0x54, 0xe6, 0x53, 0xfe, 0x85, + 0x51, 0xd9, 0x0d, 0xe6, 0xf0, 0x3b, 0x0c, 0x87, 0xa8, 0xdf, 0xca, 0xfd, 0x52, 0xd2, 0x35, 0x6b, + 0xe7, 0x16, 0x21, 0x79, 0x5b, 0x7e, 0x3e, 0x00, 0x50, 0x68, 0x34, 0xcb, 0x43, 0xf9, 0x10, 0xf6, + 0x14, 0x09, 0xc9, 0x77, 0xb9, 0x8f, 0xa9, 0x0f, 0xb1, 0xc8, 0xf3, 0xb3, 0x4e, 0xee, 0x61, 0x5d, + 0xfb, 0x18, 0xaf, 0xe5, 0x64, 0x03, 0xa7, 0x70, 0x96, 0x18, 0x5c, 0x68, 0xd9, 0x95, 0x59, 0x80, + 0xe7, 0x49, 0x59, 0xc7, 0x75, 0x55, 0xf9, 0xe7, 0x69, 0x6c, 0x70, 0x47, 0x2e, 0xe4, 0xe7, 0x44, + 0xd7, 0xb4, 0x98, 0x3a, 0x47, 0xff, 0xae, 0xcf, 0xcc, 0x73, 0xc0, 0xc5, 0xaa, 0x87, 0x4b, 0x9e, + 0x88, 0x3b, 0xc1, 0x5a, 0xb8, 0x29, 0x60, 0xa2, 0xa7, 0x92, 0xa5, 0x5a, 0xf7, 0xaa, 0x41, 0xba, + 0xb7, 0x2d, 0xd5, 0xc8, 0xf0, 0x67, 0x1e, 0x0d, 0xc0, 0x93, 0x94, 0x2b, 0x7a, 0x08, 0xe0, 0x29, + 0xf6, 0x60, 0x40, 0x92, 0x27, 0x89, 0xfa, 0xd7, 0x8a, 0x70, 0xd9, 0xbf, 0x01, 0x4b, 0x9c, 0x38, + 0x79, 0xff, 0xa7, 0xdf, 0xbf, 0x0a, 0x5f, 0x40, 0x63, 0x92, 0xd7, 0xe3, 0x8a, 0xbd, 0x56, 0xd0, + 0x73, 0x00, 0x87, 0x9a, 0x3e, 0x1c, 0x50, 0xa2, 0xb5, 0xf3, 0x56, 0xcf, 0x1c, 0x21, 0xd9, 0x11, + 0x06, 0xe7, 0x94, 0xa4, 0x9c, 0x16, 0xd0, 0xbc, 0x27, 0xa7, 0xda, 0xe9, 0x23, 0xed, 0xd6, 0xdd, + 0xc1, 0x7b, 0xe8, 0x93, 0x30, 0x1c, 0xf6, 0xd0, 0xbd, 0x68, 0x29, 0x40, 0xa4, 0x4d, 0xc5, 0xbf, + 0xb0, 0xdc, 0x21, 0x0a, 0x67, 0xbc, 0x41, 0x19, 0xdf, 0x46, 0x37, 0x3b, 0x60, 0x2c, 0x91, 0x1a, + 0xbe, 0xfd, 0x52, 0x43, 0x07, 0x00, 0x0e, 0x34, 0x90, 0xd6, 0xe8, 0xf5, 0x00, 0x71, 0xd7, 0x89, + 0x7f, 0x61, 0xa1, 0x4d, 0x6b, 0xce, 0xf6, 0x06, 0x65, 0x7b, 0x0d, 0xad, 0x74, 0xc2, 0xb6, 0xa6, + 0xdb, 0xd1, 0xcf, 0x00, 0xf6, 0x1d, 0x95, 0xaa, 0xe8, 0xb5, 0x00, 0x31, 0xba, 0x65, 0xbe, 0x30, + 0xd7, 0x8e, 0x29, 0xe7, 0x76, 0x9d, 0x72, 0x5b, 0x46, 0xc9, 0x4e, 0xb8, 0xd9, 0x7a, 0xf8, 0x2f, + 0x00, 0xfb, 0xeb, 0x74, 0x20, 0xf2, 0x11, 0x5e, 0x33, 0xd9, 0x2b, 0xcc, 0xb7, 0x65, 0xcb, 0xb9, + 0xa5, 0x29, 0xb7, 0xf7, 0xd0, 0x86, 0x27, 0xb7, 0xea, 0x15, 0x6d, 0x4a, 0xbb, 0x75, 0x37, 0xfc, + 0x9e, 0xc4, 0x77, 0x66, 0xc3, 0x9e, 0x7d, 0x06, 0xe0, 0x4b, 0x8d, 0xb5, 0x1e, 0x7a, 0x23, 0x48, + 0xe0, 0x0d, 0xd4, 0xa9, 0xf0, 0x66, 0xfb, 0x00, 0x81, 0x4a, 0xeb, 0x8f, 0x3e, 0x6d, 0xcc, 0x06, + 0x82, 0xcb, 0x4f, 0x63, 0x36, 0xd7, 0x86, 0x7e, 0x1a, 0xd3, 0x43, 0xe5, 0xf9, 0x6c, 0xcc, 0x16, + 0x0c, 0x6b, 0x7b, 0x1b, 0xfd, 0x0b, 0x60, 0xa4, 0x99, 0x1c, 0x43, 0x8b, 0x01, 0x62, 0x6d, 0xac, + 0x21, 0x85, 0x44, 0x27, 0x10, 0x9c, 0xf3, 0x3a, 0xe5, 0x7c, 0x03, 0xad, 0x76, 0xc2, 0xf9, 0xa8, + 0x9e, 0x44, 0xdf, 0x03, 0x78, 0xde, 0x25, 0xf9, 0xd0, 0x95, 0xd6, 0xb1, 0x36, 0x52, 0x90, 0xc2, + 0xab, 0x81, 0xed, 0x38, 0xb1, 0x59, 0x4a, 0x6c, 0x0a, 0x4d, 0x7a, 0x12, 0xcb, 0xda, 0xb6, 0xe9, + 0x8a, 0x48, 0x44, 0xff, 0x01, 0x38, 0xd4, 0x54, 0x5c, 0xf9, 0x51, 0x08, 0xad, 0xd4, 0xa5, 0x1f, + 0x85, 0xd0, 0x52, 0x2e, 0x8a, 0x29, 0xca, 0x6d, 0x15, 0xbd, 0xe3, 0xc9, 0x6d, 0xd7, 0xa5, 0x53, + 0xf7, 0x24, 0x8b, 0xe3, 0xa6, 0xcd, 0x0a, 0x70, 0xda, 0xa0, 0xc8, 0xf6, 0x55, 0x99, 0xb8, 0xfe, + 0xf8, 0x20, 0x0a, 0x9e, 0x1c, 0x44, 0xc1, 0x6f, 0x07, 0x51, 0xf0, 0xc5, 0x61, 0x34, 0xf4, 0xe4, + 0x30, 0x1a, 0xfa, 0xe5, 0x30, 0x1a, 0x7a, 0x7f, 0xda, 0x53, 0x0f, 0x7e, 0xe4, 0x76, 0x4e, 0xe5, + 0x61, 0xe6, 0x14, 0xfd, 0x9f, 0xf4, 0xec, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x94, 0xd7, + 0x10, 0xb9, 0x17, 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 { + // Params queries params of the distribution module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) + // ValidatorOutstandingRewards queries rewards of a validator address. + ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) + // ValidatorCommission queries accumulated commission for a validator. + ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) + // ValidatorSlashes queries slash events of a validator. + ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) + // DelegationRewards queries the total rewards accrued by a delegation. + DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) + // DelegatorValidators queries the validators of a delegator. + DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) + // DelegatorWithdrawAddress queries withdraw address of a delegator. + DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) + // CommunityPool queries the community pool coins. + CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) + // TokenizeShareRecordReward queries the tokenize share record rewards + TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) { + out := new(QueryValidatorDistributionInfoResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) { + out := new(QueryValidatorOutstandingRewardsResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) { + out := new(QueryValidatorCommissionResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorCommission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) { + out := new(QueryValidatorSlashesResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) { + out := new(QueryDelegationRewardsResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) { + out := new(QueryDelegationTotalRewardsResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { + out := new(QueryDelegatorValidatorsResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorValidators", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) { + out := new(QueryDelegatorWithdrawAddressResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { + out := new(QueryCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/CommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) { + out := new(QueryTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/TokenizeShareRecordReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries params of the distribution module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator + ValidatorDistributionInfo(context.Context, *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) + // ValidatorOutstandingRewards queries rewards of a validator address. + ValidatorOutstandingRewards(context.Context, *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) + // ValidatorCommission queries accumulated commission for a validator. + ValidatorCommission(context.Context, *QueryValidatorCommissionRequest) (*QueryValidatorCommissionResponse, error) + // ValidatorSlashes queries slash events of a validator. + ValidatorSlashes(context.Context, *QueryValidatorSlashesRequest) (*QueryValidatorSlashesResponse, error) + // DelegationRewards queries the total rewards accrued by a delegation. + DelegationRewards(context.Context, *QueryDelegationRewardsRequest) (*QueryDelegationRewardsResponse, error) + // DelegationTotalRewards queries the total rewards accrued by a each + // validator. + DelegationTotalRewards(context.Context, *QueryDelegationTotalRewardsRequest) (*QueryDelegationTotalRewardsResponse, error) + // DelegatorValidators queries the validators of a delegator. + DelegatorValidators(context.Context, *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) + // DelegatorWithdrawAddress queries withdraw address of a delegator. + DelegatorWithdrawAddress(context.Context, *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) + // CommunityPool queries the community pool coins. + CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) + // TokenizeShareRecordReward queries the tokenize share record rewards + TokenizeShareRecordReward(context.Context, *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) ValidatorDistributionInfo(ctx context.Context, req *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorDistributionInfo not implemented") +} +func (*UnimplementedQueryServer) ValidatorOutstandingRewards(ctx context.Context, req *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorOutstandingRewards not implemented") +} +func (*UnimplementedQueryServer) ValidatorCommission(ctx context.Context, req *QueryValidatorCommissionRequest) (*QueryValidatorCommissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorCommission not implemented") +} +func (*UnimplementedQueryServer) ValidatorSlashes(ctx context.Context, req *QueryValidatorSlashesRequest) (*QueryValidatorSlashesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorSlashes not implemented") +} +func (*UnimplementedQueryServer) DelegationRewards(ctx context.Context, req *QueryDelegationRewardsRequest) (*QueryDelegationRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegationRewards not implemented") +} +func (*UnimplementedQueryServer) DelegationTotalRewards(ctx context.Context, req *QueryDelegationTotalRewardsRequest) (*QueryDelegationTotalRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegationTotalRewards not implemented") +} +func (*UnimplementedQueryServer) DelegatorValidators(ctx context.Context, req *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidators not implemented") +} +func (*UnimplementedQueryServer) DelegatorWithdrawAddress(ctx context.Context, req *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelegatorWithdrawAddress not implemented") +} +func (*UnimplementedQueryServer) CommunityPool(ctx context.Context, req *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") +} +func (*UnimplementedQueryServer) TokenizeShareRecordReward(ctx context.Context, req *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordReward not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +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: "/cosmos.distribution.v1beta1.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_ValidatorDistributionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorDistributionInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorDistributionInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorDistributionInfo(ctx, req.(*QueryValidatorDistributionInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorOutstandingRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorOutstandingRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorOutstandingRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorOutstandingRewards(ctx, req.(*QueryValidatorOutstandingRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorCommissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorCommission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorCommission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorCommission(ctx, req.(*QueryValidatorCommissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ValidatorSlashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorSlashesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ValidatorSlashes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ValidatorSlashes(ctx, req.(*QueryValidatorSlashesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DelegationRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegationRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DelegationRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegationRewards(ctx, req.(*QueryDelegationRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DelegationTotalRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegationTotalRewardsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DelegationTotalRewards(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegationTotalRewards(ctx, req.(*QueryDelegationTotalRewardsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DelegatorValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorValidatorsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DelegatorValidators(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorValidators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorValidators(ctx, req.(*QueryDelegatorValidatorsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_DelegatorWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDelegatorWithdrawAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DelegatorWithdrawAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DelegatorWithdrawAddress(ctx, req.(*QueryDelegatorWithdrawAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCommunityPoolRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/CommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CommunityPool(ctx, req.(*QueryCommunityPoolRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenizeShareRecordRewardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Query/TokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenizeShareRecordReward(ctx, req.(*QueryTokenizeShareRecordRewardRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.distribution.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "ValidatorDistributionInfo", + Handler: _Query_ValidatorDistributionInfo_Handler, + }, + { + MethodName: "ValidatorOutstandingRewards", + Handler: _Query_ValidatorOutstandingRewards_Handler, + }, + { + MethodName: "ValidatorCommission", + Handler: _Query_ValidatorCommission_Handler, + }, + { + MethodName: "ValidatorSlashes", + Handler: _Query_ValidatorSlashes_Handler, + }, + { + MethodName: "DelegationRewards", + Handler: _Query_DelegationRewards_Handler, + }, + { + MethodName: "DelegationTotalRewards", + Handler: _Query_DelegationTotalRewards_Handler, + }, + { + MethodName: "DelegatorValidators", + Handler: _Query_DelegatorValidators_Handler, + }, + { + MethodName: "DelegatorWithdrawAddress", + Handler: _Query_DelegatorWithdrawAddress_Handler, + }, + { + MethodName: "CommunityPool", + Handler: _Query_CommunityPool_Handler, + }, + { + MethodName: "TokenizeShareRecordReward", + Handler: _Query_TokenizeShareRecordReward_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/distribution/v1beta1/query.proto", +} + +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 *QueryValidatorDistributionInfoRequest) 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 *QueryValidatorDistributionInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorDistributionInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorDistributionInfoResponse) 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 *QueryValidatorDistributionInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorDistributionInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Commission) > 0 { + for iNdEx := len(m.Commission) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Commission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.SelfBondRewards) > 0 { + for iNdEx := len(m.SelfBondRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SelfBondRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.OperatorAddress) > 0 { + i -= len(m.OperatorAddress) + copy(dAtA[i:], m.OperatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorOutstandingRewardsRequest) 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 *QueryValidatorOutstandingRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorOutstandingRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorOutstandingRewardsResponse) 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 *QueryValidatorOutstandingRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorOutstandingRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Rewards.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 *QueryValidatorCommissionRequest) 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 *QueryValidatorCommissionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorCommissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorCommissionResponse) 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 *QueryValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorCommissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Commission.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 *QueryValidatorSlashesRequest) 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 *QueryValidatorSlashesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorSlashesRequest) 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] = 0x22 + } + if m.EndingHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EndingHeight)) + i-- + dAtA[i] = 0x18 + } + if m.StartingHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.StartingHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorSlashesResponse) 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 *QueryValidatorSlashesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorSlashesResponse) 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.Slashes) > 0 { + for iNdEx := len(m.Slashes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Slashes[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 *QueryDelegationRewardsRequest) 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 *QueryDelegationRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegationRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegationRewardsResponse) 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 *QueryDelegationRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegationRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[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 *QueryDelegationTotalRewardsRequest) 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 *QueryDelegationTotalRewardsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegationTotalRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegationTotalRewardsResponse) 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 *QueryDelegationTotalRewardsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegationTotalRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[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 *QueryDelegatorValidatorsRequest) 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 *QueryDelegatorValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorValidatorsResponse) 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 *QueryDelegatorValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Validators[iNdEx]) + copy(dAtA[i:], m.Validators[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Validators[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorWithdrawAddressRequest) 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 *QueryDelegatorWithdrawAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorWithdrawAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDelegatorWithdrawAddressResponse) 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 *QueryDelegatorWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDelegatorWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WithdrawAddress) > 0 { + i -= len(m.WithdrawAddress) + copy(dAtA[i:], m.WithdrawAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.WithdrawAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCommunityPoolRequest) 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 *QueryCommunityPoolRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCommunityPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCommunityPoolResponse) 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 *QueryCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pool) > 0 { + for iNdEx := len(m.Pool) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pool[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 *QueryTokenizeShareRecordRewardRequest) 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 *QueryTokenizeShareRecordRewardRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTokenizeShareRecordRewardResponse) 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 *QueryTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Total) > 0 { + for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[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 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 *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 *QueryValidatorDistributionInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorDistributionInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.SelfBondRewards) > 0 { + for _, e := range m.SelfBondRewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Commission) > 0 { + for _, e := range m.Commission { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryValidatorOutstandingRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorOutstandingRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Rewards.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryValidatorCommissionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorCommissionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Commission.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryValidatorSlashesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.StartingHeight != 0 { + n += 1 + sovQuery(uint64(m.StartingHeight)) + } + if m.EndingHeight != 0 { + n += 1 + sovQuery(uint64(m.EndingHeight)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorSlashesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Slashes) > 0 { + for _, e := range m.Slashes { + 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 *QueryDelegationRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegationRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryDelegationTotalRewardsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegationTotalRewardsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryDelegatorValidatorsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorValidatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Validators) > 0 { + for _, s := range m.Validators { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryDelegatorWithdrawAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDelegatorWithdrawAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WithdrawAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCommunityPoolRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCommunityPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pool) > 0 { + for _, e := range m.Pool { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryTokenizeShareRecordRewardRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.Total) > 0 { + for _, e := range m.Total { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + 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 *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) || (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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorDistributionInfoRequest) 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: QueryValidatorDistributionInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorDistributionInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorDistributionInfoResponse) 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: QueryValidatorDistributionInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorDistributionInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", 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.OperatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SelfBondRewards", 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.SelfBondRewards = append(m.SelfBondRewards, types.DecCoin{}) + if err := m.SelfBondRewards[len(m.SelfBondRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission = append(m.Commission, types.DecCoin{}) + if err := m.Commission[len(m.Commission)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorOutstandingRewardsRequest) 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: QueryValidatorOutstandingRewardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorOutstandingRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorOutstandingRewardsResponse) 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: QueryValidatorOutstandingRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorOutstandingRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorCommissionRequest) 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: QueryValidatorCommissionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorCommissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorCommissionResponse) 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: QueryValidatorCommissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorSlashesRequest) 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: QueryValidatorSlashesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorSlashesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingHeight", wireType) + } + m.StartingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartingHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndingHeight", wireType) + } + m.EndingHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndingHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorSlashesResponse) 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: QueryValidatorSlashesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorSlashesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Slashes", 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.Slashes = append(m.Slashes, ValidatorSlashEvent{}) + if err := m.Slashes[len(m.Slashes)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationRewardsRequest) 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: QueryDelegationRewardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationRewardsResponse) 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: QueryDelegationRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, types.DecCoin{}) + if err := m.Rewards[len(m.Rewards)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationTotalRewardsRequest) 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: QueryDelegationTotalRewardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationTotalRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegationTotalRewardsResponse) 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: QueryDelegationTotalRewardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegationTotalRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, DelegationDelegatorReward{}) + if err := m.Rewards[len(m.Rewards)-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 Total", 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.Total = append(m.Total, types.DecCoin{}) + if err := m.Total[len(m.Total)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorValidatorsRequest) 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: QueryDelegatorValidatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorValidatorsResponse) 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: QueryDelegatorValidatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorWithdrawAddressRequest) 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: QueryDelegatorWithdrawAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorWithdrawAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDelegatorWithdrawAddressResponse) 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: QueryDelegatorWithdrawAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDelegatorWithdrawAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", 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.WithdrawAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCommunityPoolRequest) 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: QueryCommunityPoolRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCommunityPoolRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCommunityPoolResponse) 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: QueryCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCommunityPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pool", 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.Pool = append(m.Pool, types.DecCoin{}) + if err := m.Pool[len(m.Pool)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTokenizeShareRecordRewardRequest) 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: QueryTokenizeShareRecordRewardRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTokenizeShareRecordRewardResponse) 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: QueryTokenizeShareRecordRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenizeShareRecordRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, TokenizeShareRecordReward{}) + if err := m.Rewards[len(m.Rewards)-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 Total", 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.Total = append(m.Total, types.DecCoin{}) + if err := m.Total[len(m.Total)-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) || (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/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go new file mode 100644 index 000000000000..7dec9a7ed004 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go @@ -0,0 +1,1167 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/distribution/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ValidatorDistributionInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorDistributionInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := client.ValidatorDistributionInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorDistributionInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorDistributionInfoRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := server.ValidatorDistributionInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ValidatorOutstandingRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorOutstandingRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := client.ValidatorOutstandingRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorOutstandingRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorOutstandingRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := server.ValidatorOutstandingRewards(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_ValidatorCommission_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorCommissionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := client.ValidatorCommission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorCommission_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorCommissionRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := server.ValidatorCommission(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ValidatorSlashes_0 = &utilities.DoubleArray{Encoding: map[string]int{"validator_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_ValidatorSlashes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorSlashesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorSlashes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ValidatorSlashes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ValidatorSlashes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorSlashesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorSlashes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ValidatorSlashes(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_DelegationRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegationRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := client.DelegationRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DelegationRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegationRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + msg, err := server.DelegationRewards(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_DelegationTotalRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegationTotalRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := client.DelegationTotalRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DelegationTotalRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegationTotalRewardsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := server.DelegationTotalRewards(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_DelegatorValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorValidatorsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := client.DelegatorValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DelegatorValidators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorValidatorsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := server.DelegatorValidators(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_DelegatorWithdrawAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorWithdrawAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := client.DelegatorWithdrawAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DelegatorWithdrawAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDelegatorWithdrawAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["delegator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") + } + + protoReq.DelegatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) + } + + msg, err := server.DelegatorWithdrawAddress(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCommunityPoolRequest + var metadata runtime.ServerMetadata + + msg, err := client.CommunityPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCommunityPoolRequest + var metadata runtime.ServerMetadata + + msg, err := server.CommunityPool(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenizeShareRecordRewardRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") + } + + protoReq.OwnerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) + } + + msg, err := client.TokenizeShareRecordReward(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenizeShareRecordRewardRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["owner_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") + } + + protoReq.OwnerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) + } + + msg, err := server.TokenizeShareRecordReward(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorDistributionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorDistributionInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorDistributionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorOutstandingRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorOutstandingRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorOutstandingRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorCommission_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorCommission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorSlashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ValidatorSlashes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorSlashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegationRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DelegationRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegationRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegationTotalRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DelegationTotalRewards_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegationTotalRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DelegatorValidators_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegatorWithdrawAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DelegatorWithdrawAddress_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorWithdrawAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CommunityPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CommunityPool_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorDistributionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorDistributionInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorDistributionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorOutstandingRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorOutstandingRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorOutstandingRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorCommission_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorCommission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ValidatorSlashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ValidatorSlashes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ValidatorSlashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegationRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DelegationRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegationRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegationTotalRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DelegationTotalRewards_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegationTotalRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DelegatorValidators_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_DelegatorWithdrawAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DelegatorWithdrawAddress_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DelegatorWithdrawAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CommunityPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CommunityPool_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ValidatorDistributionInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ValidatorOutstandingRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "outstanding_rewards"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ValidatorCommission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "commission"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ValidatorSlashes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "slashes"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DelegationRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards", "validator_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DelegationTotalRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "validators"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DelegatorWithdrawAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "withdraw_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CommunityPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "community_pool"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TokenizeShareRecordReward_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"cosmos", "distribution", "v1beta1", "owner_address", "tokenize_share_record_rewards"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorDistributionInfo_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorOutstandingRewards_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorCommission_0 = runtime.ForwardResponseMessage + + forward_Query_ValidatorSlashes_0 = runtime.ForwardResponseMessage + + forward_Query_DelegationRewards_0 = runtime.ForwardResponseMessage + + forward_Query_DelegationTotalRewards_0 = runtime.ForwardResponseMessage + + forward_Query_DelegatorValidators_0 = runtime.ForwardResponseMessage + + forward_Query_DelegatorWithdrawAddress_0 = runtime.ForwardResponseMessage + + forward_Query_CommunityPool_0 = runtime.ForwardResponseMessage + + forward_Query_TokenizeShareRecordReward_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go new file mode 100644 index 000000000000..f72244e68b11 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go @@ -0,0 +1,3615 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/distribution/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 + +// MsgSetWithdrawAddress sets the withdraw address for +// a delegator (or validator self-delegation). +type MsgSetWithdrawAddress struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` +} + +func (m *MsgSetWithdrawAddress) Reset() { *m = MsgSetWithdrawAddress{} } +func (m *MsgSetWithdrawAddress) String() string { return proto.CompactTextString(m) } +func (*MsgSetWithdrawAddress) ProtoMessage() {} +func (*MsgSetWithdrawAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{0} +} +func (m *MsgSetWithdrawAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWithdrawAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWithdrawAddress.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 *MsgSetWithdrawAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWithdrawAddress.Merge(m, src) +} +func (m *MsgSetWithdrawAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWithdrawAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWithdrawAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWithdrawAddress proto.InternalMessageInfo + +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +// type. +type MsgSetWithdrawAddressResponse struct { +} + +func (m *MsgSetWithdrawAddressResponse) Reset() { *m = MsgSetWithdrawAddressResponse{} } +func (m *MsgSetWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetWithdrawAddressResponse) ProtoMessage() {} +func (*MsgSetWithdrawAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{1} +} +func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWithdrawAddressResponse.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 *MsgSetWithdrawAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWithdrawAddressResponse.Merge(m, src) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWithdrawAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWithdrawAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWithdrawAddressResponse proto.InternalMessageInfo + +// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +// from a single validator. +type MsgWithdrawDelegatorReward struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegatorReward{} } +func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawDelegatorReward) ProtoMessage() {} +func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{2} +} +func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawDelegatorReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawDelegatorReward.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 *MsgWithdrawDelegatorReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawDelegatorReward.Merge(m, src) +} +func (m *MsgWithdrawDelegatorReward) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawDelegatorReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawDelegatorReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawDelegatorReward proto.InternalMessageInfo + +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +// response type. +type MsgWithdrawDelegatorRewardResponse struct { + // Since: cosmos-sdk 0.46 + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawDelegatorRewardResponse{} } +func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} +func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{3} +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.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 *MsgWithdrawDelegatorRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawDelegatorRewardResponse proto.InternalMessageInfo + +func (m *MsgWithdrawDelegatorRewardResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +// MsgWithdrawValidatorCommission withdraws the full commission to the validator +// address. +type MsgWithdrawValidatorCommission struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` +} + +func (m *MsgWithdrawValidatorCommission) Reset() { *m = MsgWithdrawValidatorCommission{} } +func (m *MsgWithdrawValidatorCommission) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawValidatorCommission) ProtoMessage() {} +func (*MsgWithdrawValidatorCommission) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{4} +} +func (m *MsgWithdrawValidatorCommission) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawValidatorCommission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawValidatorCommission.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 *MsgWithdrawValidatorCommission) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawValidatorCommission.Merge(m, src) +} +func (m *MsgWithdrawValidatorCommission) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawValidatorCommission) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawValidatorCommission.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawValidatorCommission proto.InternalMessageInfo + +// MsgWithdrawValidatorCommissionResponse defines the +// Msg/WithdrawValidatorCommission response type. +type MsgWithdrawValidatorCommissionResponse struct { + // Since: cosmos-sdk 0.46 + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` +} + +func (m *MsgWithdrawValidatorCommissionResponse) Reset() { + *m = MsgWithdrawValidatorCommissionResponse{} +} +func (m *MsgWithdrawValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawValidatorCommissionResponse) ProtoMessage() {} +func (*MsgWithdrawValidatorCommissionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{5} +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.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 *MsgWithdrawValidatorCommissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.Merge(m, src) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawValidatorCommissionResponse proto.InternalMessageInfo + +func (m *MsgWithdrawValidatorCommissionResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +// MsgFundCommunityPool allows an account to directly +// fund the community pool. +type MsgFundCommunityPool struct { + Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` +} + +func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } +func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPool) ProtoMessage() {} +func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{6} +} +func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPool.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 *MsgFundCommunityPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPool.Merge(m, src) +} +func (m *MsgFundCommunityPool) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPool) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPool.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundCommunityPool proto.InternalMessageInfo + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +type MsgFundCommunityPoolResponse struct { +} + +func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPoolResponse{} } +func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPoolResponse) ProtoMessage() {} +func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{7} +} +func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPoolResponse.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 *MsgFundCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPoolResponse.Merge(m, src) +} +func (m *MsgFundCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +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 x/distribution 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_ed4f433d965e58ca, []int{8} +} +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. +// +// Since: cosmos-sdk 0.47 +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_ed4f433d965e58ca, []int{9} +} +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 + +// MsgCommunityPoolSpend defines a message for sending tokens from the community +// pool to another account. This message is typically executed via a governance +// proposal with the governance module being the executing authority. +// +// Since: cosmos-sdk 0.47 +type MsgCommunityPoolSpend 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"` + Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,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"` +} + +func (m *MsgCommunityPoolSpend) Reset() { *m = MsgCommunityPoolSpend{} } +func (m *MsgCommunityPoolSpend) String() string { return proto.CompactTextString(m) } +func (*MsgCommunityPoolSpend) ProtoMessage() {} +func (*MsgCommunityPoolSpend) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{10} +} +func (m *MsgCommunityPoolSpend) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCommunityPoolSpend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCommunityPoolSpend.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 *MsgCommunityPoolSpend) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCommunityPoolSpend.Merge(m, src) +} +func (m *MsgCommunityPoolSpend) XXX_Size() int { + return m.Size() +} +func (m *MsgCommunityPoolSpend) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCommunityPoolSpend.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCommunityPoolSpend proto.InternalMessageInfo + +func (m *MsgCommunityPoolSpend) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgCommunityPoolSpend) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *MsgCommunityPoolSpend) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Amount + } + return nil +} + +// MsgWithdrawTokenizeShareRecordReward withdraws tokenize share rewards for a specific record +type MsgWithdrawTokenizeShareRecordReward struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` + RecordId uint64 `protobuf:"varint,2,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` +} + +func (m *MsgWithdrawTokenizeShareRecordReward) Reset() { *m = MsgWithdrawTokenizeShareRecordReward{} } +func (m *MsgWithdrawTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawTokenizeShareRecordReward) ProtoMessage() {} +func (*MsgWithdrawTokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{11} +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.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 *MsgWithdrawTokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.Merge(m, src) +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawTokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward proto.InternalMessageInfo + +// MsgWithdrawTokenizeShareRecordReward defines the Msg/WithdrawTokenizeShareRecordReward response type. +type MsgWithdrawTokenizeShareRecordRewardResponse struct { +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Reset() { + *m = MsgWithdrawTokenizeShareRecordRewardResponse{} +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgWithdrawTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*MsgWithdrawTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{12} +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.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 *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse proto.InternalMessageInfo + +// MsgWithdrawAllTokenizeShareRecordReward withdraws tokenize share rewards or all +// records owned by the designated owner +type MsgWithdrawAllTokenizeShareRecordReward struct { + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) Reset() { + *m = MsgWithdrawAllTokenizeShareRecordReward{} +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawAllTokenizeShareRecordReward) ProtoMessage() {} +func (*MsgWithdrawAllTokenizeShareRecordReward) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{13} +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.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 *MsgWithdrawAllTokenizeShareRecordReward) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.Merge(m, src) +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward proto.InternalMessageInfo + +// MsgWithdrawAllTokenizeShareRecordRewardResponse defines the Msg/WithdrawTokenizeShareRecordReward response type. +type MsgWithdrawAllTokenizeShareRecordRewardResponse struct { +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Reset() { + *m = MsgWithdrawAllTokenizeShareRecordRewardResponse{} +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) ProtoMessage() {} +func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{14} +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse proto.InternalMessageInfo + +// MsgCommunityPoolSpendResponse defines the response to executing a +// MsgCommunityPoolSpend message. +// +// Since: cosmos-sdk 0.47 +type MsgCommunityPoolSpendResponse struct { +} + +func (m *MsgCommunityPoolSpendResponse) Reset() { *m = MsgCommunityPoolSpendResponse{} } +func (m *MsgCommunityPoolSpendResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCommunityPoolSpendResponse) ProtoMessage() {} +func (*MsgCommunityPoolSpendResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{15} +} +func (m *MsgCommunityPoolSpendResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCommunityPoolSpendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCommunityPoolSpendResponse.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 *MsgCommunityPoolSpendResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCommunityPoolSpendResponse.Merge(m, src) +} +func (m *MsgCommunityPoolSpendResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCommunityPoolSpendResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCommunityPoolSpendResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCommunityPoolSpendResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") + proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") + proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") + proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") + proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPool") + proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.distribution.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.distribution.v1beta1.MsgUpdateParamsResponse") + proto.RegisterType((*MsgCommunityPoolSpend)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpend") + proto.RegisterType((*MsgWithdrawTokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward") + proto.RegisterType((*MsgWithdrawTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordRewardResponse") + proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward") + proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordRewardResponse") + proto.RegisterType((*MsgCommunityPoolSpendResponse)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse") +} + +func init() { + proto.RegisterFile("cosmos/distribution/v1beta1/tx.proto", fileDescriptor_ed4f433d965e58ca) +} + +var fileDescriptor_ed4f433d965e58ca = []byte{ + // 998 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xde, 0x69, 0x20, 0x62, 0xa7, 0x45, 0x4d, 0xac, 0xa0, 0x24, 0x4e, 0xf1, 0x16, 0x37, 0x4a, + 0xa3, 0xa8, 0xb5, 0xb5, 0x81, 0x02, 0x35, 0x42, 0x28, 0x49, 0x1b, 0x29, 0x12, 0x2b, 0x2a, 0xa7, + 0x50, 0x89, 0x4b, 0xe4, 0xdd, 0x19, 0xbc, 0xa3, 0xae, 0x3d, 0x96, 0x67, 0x36, 0xdb, 0xe5, 0x04, + 0x88, 0x03, 0xe2, 0x80, 0x50, 0xf9, 0x03, 0xe8, 0xb1, 0xe2, 0x42, 0x90, 0x38, 0xc1, 0x89, 0x5b, + 0x2f, 0x48, 0x15, 0xa7, 0x9e, 0x0a, 0x4a, 0x0e, 0x41, 0xe2, 0x86, 0xe0, 0x8e, 0xfc, 0x73, 0xed, + 0xb5, 0xd7, 0xde, 0xed, 0x0f, 0x7a, 0x49, 0x76, 0x67, 0xde, 0xfb, 0xe6, 0xfb, 0xbe, 0x79, 0xf3, + 0x66, 0x16, 0x2e, 0xb7, 0x28, 0xb3, 0x28, 0x53, 0x11, 0x61, 0xdc, 0x25, 0xcd, 0x2e, 0x27, 0xd4, + 0x56, 0xf7, 0xeb, 0x4d, 0xcc, 0x8d, 0xba, 0xca, 0x6f, 0x29, 0x8e, 0x4b, 0x39, 0x15, 0x96, 0x82, + 0x28, 0x25, 0x19, 0xa5, 0x84, 0x51, 0xe2, 0x9c, 0x49, 0x4d, 0xea, 0xc7, 0xa9, 0xde, 0xa7, 0x20, + 0x45, 0x94, 0x42, 0xe0, 0xa6, 0xc1, 0x70, 0x0c, 0xd8, 0xa2, 0xc4, 0x0e, 0xe7, 0x17, 0x83, 0xf9, + 0xbd, 0x20, 0x31, 0xc4, 0x0f, 0xa6, 0xe6, 0xc3, 0x54, 0x8b, 0x99, 0xea, 0x7e, 0xdd, 0xfb, 0x17, + 0x4e, 0xcc, 0x1a, 0x16, 0xb1, 0xa9, 0xea, 0xff, 0x0d, 0x87, 0x94, 0x22, 0xfe, 0x29, 0xba, 0x7e, + 0xbc, 0xfc, 0x17, 0x80, 0x2f, 0x35, 0x98, 0xb9, 0x8b, 0xf9, 0x0d, 0xc2, 0xdb, 0xc8, 0x35, 0x7a, + 0x1b, 0x08, 0xb9, 0x98, 0x31, 0xe1, 0x2a, 0x9c, 0x45, 0xb8, 0x83, 0x4d, 0x83, 0x53, 0x77, 0xcf, + 0x08, 0x06, 0x17, 0xc0, 0x59, 0xb0, 0x5a, 0xdd, 0x5c, 0xf8, 0xed, 0xc7, 0x8b, 0x73, 0x21, 0xc5, + 0x30, 0x7c, 0x97, 0xbb, 0xc4, 0x36, 0xf5, 0x99, 0x38, 0x25, 0x82, 0xd9, 0x82, 0x33, 0xbd, 0x10, + 0x39, 0x46, 0x39, 0x51, 0x82, 0x72, 0xba, 0x97, 0xe6, 0xa2, 0x6d, 0x7f, 0x71, 0xa7, 0x56, 0xf9, + 0xf3, 0x4e, 0xad, 0xf2, 0xd9, 0xf1, 0xc1, 0x5a, 0x96, 0xd6, 0x97, 0xc7, 0x07, 0x6b, 0xe7, 0x02, + 0xa4, 0x8b, 0x0c, 0xdd, 0x54, 0x1b, 0xcc, 0x6c, 0x50, 0x44, 0x3e, 0xea, 0x0f, 0x69, 0x92, 0x6b, + 0xf0, 0xe5, 0x5c, 0xb1, 0x3a, 0x66, 0x0e, 0xb5, 0x19, 0x96, 0xff, 0x05, 0x50, 0x6c, 0x30, 0x33, + 0x9a, 0xbe, 0x12, 0xad, 0xa4, 0xe3, 0x9e, 0xe1, 0xa2, 0x27, 0xe5, 0xc9, 0x55, 0x38, 0xbb, 0x6f, + 0x74, 0x08, 0x4a, 0xc1, 0x94, 0x99, 0x32, 0x13, 0xa7, 0x44, 0xae, 0xec, 0x94, 0xbb, 0xb2, 0x92, + 0x76, 0x65, 0x48, 0x17, 0xa1, 0x76, 0x20, 0x4c, 0xfe, 0x0a, 0x40, 0x79, 0xb4, 0xee, 0xc8, 0x1e, + 0xa1, 0x0d, 0xa7, 0x0d, 0x8b, 0x76, 0x6d, 0xbe, 0x00, 0xce, 0x4e, 0xad, 0x9e, 0x5c, 0x5f, 0x0c, + 0xcb, 0x4d, 0xf1, 0xaa, 0x3a, 0x3a, 0x00, 0xca, 0x16, 0x25, 0xf6, 0xe6, 0xa5, 0x7b, 0x0f, 0x6b, + 0x95, 0xef, 0x7e, 0xaf, 0xad, 0x9a, 0x84, 0xb7, 0xbb, 0x4d, 0xa5, 0x45, 0xad, 0xb0, 0xaa, 0xd5, + 0x04, 0x27, 0xde, 0x77, 0x30, 0xf3, 0x13, 0xd8, 0xdd, 0xe3, 0x83, 0x35, 0xa0, 0x87, 0xf8, 0xf2, + 0xf7, 0x00, 0x4a, 0x09, 0x42, 0x1f, 0x44, 0xda, 0xb7, 0xa8, 0x65, 0x11, 0xc6, 0x08, 0xb5, 0xf3, + 0x5d, 0x04, 0x13, 0xbb, 0x98, 0xae, 0xad, 0x0c, 0x62, 0x4e, 0x6d, 0x25, 0x48, 0x0d, 0xe8, 0xc8, + 0xb7, 0x01, 0x5c, 0x29, 0x66, 0xfc, 0x0c, 0x6c, 0xfc, 0x07, 0xc0, 0xb9, 0x06, 0x33, 0xb7, 0xbb, + 0x36, 0xf2, 0x78, 0x74, 0x6d, 0xc2, 0xfb, 0xd7, 0x28, 0xed, 0xfc, 0x7f, 0x14, 0x84, 0xd7, 0x61, + 0x15, 0x61, 0x87, 0x32, 0xc2, 0xa9, 0x5b, 0x5a, 0xe4, 0x83, 0x50, 0x4d, 0x4b, 0xee, 0xcb, 0x60, + 0xdc, 0xdb, 0x8f, 0x5a, 0x7a, 0x3f, 0x32, 0xea, 0x64, 0x09, 0x9e, 0xc9, 0x1b, 0x8f, 0x8f, 0xf9, + 0xaf, 0x00, 0x9e, 0x6e, 0x30, 0xf3, 0x7d, 0x07, 0x19, 0x1c, 0x5f, 0x33, 0x5c, 0xc3, 0x62, 0x1e, + 0x4f, 0xa3, 0xcb, 0xdb, 0xd4, 0x25, 0xbc, 0x5f, 0x5a, 0x46, 0x83, 0x50, 0x61, 0x1b, 0x4e, 0x3b, + 0x3e, 0x82, 0x2f, 0xee, 0xe4, 0xfa, 0x39, 0xa5, 0xe0, 0x72, 0x50, 0x82, 0xc5, 0x36, 0xab, 0x9e, + 0xa7, 0xa1, 0x4f, 0x41, 0xb6, 0xa6, 0xf9, 0x3a, 0x63, 0x5c, 0x4f, 0xe7, 0xf9, 0x84, 0xce, 0x54, + 0x43, 0x1f, 0xe2, 0x2e, 0x2f, 0xc2, 0xf9, 0xa1, 0xa1, 0x58, 0xea, 0xed, 0x13, 0x7e, 0x83, 0x4f, + 0xf9, 0xb0, 0xeb, 0x60, 0x1b, 0x3d, 0xb2, 0xe0, 0x33, 0xb0, 0xea, 0xe2, 0x16, 0x71, 0x08, 0xb6, + 0x79, 0xb0, 0xa1, 0xfa, 0x60, 0x20, 0x51, 0x58, 0x53, 0x4f, 0xb7, 0xb0, 0xb4, 0xcb, 0x59, 0xc3, + 0x56, 0x86, 0x0d, 0x53, 0x73, 0xa5, 0xcb, 0x0f, 0x00, 0x5c, 0x4e, 0x9c, 0xd5, 0xeb, 0xf4, 0x26, + 0xb6, 0xc9, 0xc7, 0x78, 0xb7, 0x6d, 0xb8, 0x58, 0xc7, 0x2d, 0xea, 0xb5, 0x3c, 0xbf, 0xe1, 0xbf, + 0x0d, 0x5f, 0xa4, 0x3d, 0x1b, 0x67, 0xfa, 0xcb, 0xdf, 0x0f, 0x6b, 0x73, 0x7d, 0xc3, 0xea, 0x68, + 0x72, 0x6a, 0x5a, 0xd6, 0x4f, 0xf9, 0xdf, 0xa3, 0x46, 0xbf, 0xe4, 0x5b, 0x45, 0x5d, 0xb4, 0x47, + 0x90, 0x6f, 0xd5, 0x73, 0xfa, 0x0b, 0xc1, 0xc0, 0x0e, 0xd2, 0xae, 0x27, 0x0b, 0x3c, 0xbd, 0x8c, + 0xa7, 0xe5, 0x52, 0x9e, 0x96, 0x52, 0xc6, 0xb2, 0x02, 0x2f, 0x8c, 0x13, 0x17, 0xd7, 0xc7, 0x2f, + 0x00, 0x9e, 0x4f, 0x24, 0x6c, 0x74, 0x3a, 0x4f, 0xcb, 0x0d, 0xed, 0x46, 0xb1, 0xe0, 0x37, 0x8b, + 0x04, 0x17, 0xf1, 0x92, 0xeb, 0x70, 0xdc, 0xd0, 0x58, 0x76, 0xf0, 0x12, 0xc8, 0x96, 0x46, 0x14, + 0xb0, 0xfe, 0x73, 0x15, 0x4e, 0x35, 0x98, 0x29, 0x7c, 0x0e, 0xa0, 0x90, 0xf3, 0x3a, 0x5a, 0x2f, + 0x3c, 0xe5, 0xb9, 0x8f, 0x0c, 0x51, 0x9b, 0x3c, 0x27, 0xbe, 0x32, 0xbe, 0x01, 0x70, 0x7e, 0xd4, + 0xab, 0xe4, 0x8d, 0x32, 0xdc, 0x11, 0x89, 0xe2, 0x3b, 0x8f, 0x98, 0x18, 0xb3, 0xfa, 0x16, 0xc0, + 0xa5, 0xa2, 0x2b, 0xfa, 0xad, 0x71, 0x17, 0xc8, 0x49, 0x16, 0xb7, 0x1e, 0x23, 0x39, 0x66, 0xf8, + 0x29, 0x80, 0xb3, 0xd9, 0xdb, 0xaf, 0x5e, 0x06, 0x9d, 0x49, 0x11, 0x2f, 0x4f, 0x9c, 0x12, 0x73, + 0x70, 0xe1, 0xa9, 0xd4, 0x4d, 0x73, 0xa1, 0x0c, 0x2a, 0x19, 0x2d, 0xbe, 0x36, 0x49, 0x74, 0xbc, + 0xa6, 0x57, 0xb6, 0x39, 0x3d, 0xbf, 0xb4, 0x6c, 0xb3, 0x39, 0xe5, 0x65, 0x3b, 0xfa, 0x14, 0x09, + 0x3f, 0x00, 0xf8, 0x4a, 0x79, 0x97, 0xdd, 0x18, 0x77, 0xa7, 0x47, 0x42, 0x88, 0x3b, 0x8f, 0x0d, + 0x11, 0x73, 0xfe, 0x09, 0xc0, 0xe5, 0xb1, 0xda, 0xe1, 0x95, 0x71, 0xd7, 0x2c, 0x42, 0x11, 0xdf, + 0x7d, 0x12, 0x28, 0x11, 0x79, 0xf1, 0xf9, 0x4f, 0xbc, 0x3b, 0x72, 0xf3, 0xbd, 0xbb, 0x87, 0x12, + 0xb8, 0x77, 0x28, 0x81, 0xfb, 0x87, 0x12, 0xf8, 0xe3, 0x50, 0x02, 0x5f, 0x1f, 0x49, 0x95, 0xfb, + 0x47, 0x52, 0xe5, 0xc1, 0x91, 0x54, 0xf9, 0xb0, 0x5e, 0x78, 0xe1, 0xde, 0x4a, 0xbf, 0x35, 0xfc, + 0xfb, 0xb7, 0x39, 0xed, 0xff, 0x5c, 0x7c, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x06, + 0x36, 0xfb, 0x20, 0x0f, 0x00, 0x00, +} + +func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSetWithdrawAddressResponse) + if !ok { + that2, ok := that.(MsgSetWithdrawAddressResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawDelegatorRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawDelegatorRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawDelegatorRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + 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 +} +func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawValidatorCommissionResponse) + if !ok { + that2, ok := that.(MsgWithdrawValidatorCommissionResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + 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 +} +func (this *MsgFundCommunityPoolResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgFundCommunityPoolResponse) + if !ok { + that2, ok := that.(MsgFundCommunityPoolResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgUpdateParams) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgUpdateParams) + if !ok { + that2, ok := that.(MsgUpdateParams) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Authority != that1.Authority { + return false + } + if !this.Params.Equal(&that1.Params) { + return false + } + return true +} +func (this *MsgUpdateParamsResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgUpdateParamsResponse) + if !ok { + that2, ok := that.(MsgUpdateParamsResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgCommunityPoolSpend) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgCommunityPoolSpend) + if !ok { + that2, ok := that.(MsgCommunityPoolSpend) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Authority != that1.Authority { + return false + } + if this.Recipient != that1.Recipient { + 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 +} +func (this *MsgWithdrawTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawTokenizeShareRecordRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawTokenizeShareRecordRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawAllTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawAllTokenizeShareRecordRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawAllTokenizeShareRecordRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgCommunityPoolSpendResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgCommunityPoolSpendResponse) + if !ok { + that2, ok := that.(MsgCommunityPoolSpendResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + 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 { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) + // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord + WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) + // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord + WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { + out := new(MsgSetWithdrawAddressResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { + out := new(MsgWithdrawDelegatorRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { + out := new(MsgWithdrawValidatorCommissionResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + out := new(MsgFundCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", 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, "/cosmos.distribution.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) { + out := new(MsgCommunityPoolSpendResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { + out := new(MsgWithdrawTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { + out := new(MsgWithdrawAllTokenizeShareRecordRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) + // UpdateParams defines a governance operation for updating the x/distribution + // module parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) + // CommunityPoolSpend defines a governance operation for sending tokens from + // the community pool in the x/distribution module to another account, which + // could be the governance module itself. The authority is defined in the + // keeper. + // + // Since: cosmos-sdk 0.47 + CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) + // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord + WithdrawTokenizeShareRecordReward(context.Context, *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) + // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord + WithdrawAllTokenizeShareRecordReward(context.Context, *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetWithdrawAddress(ctx context.Context, req *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetWithdrawAddress not implemented") +} +func (*UnimplementedMsgServer) WithdrawDelegatorReward(ctx context.Context, req *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawDelegatorReward not implemented") +} +func (*UnimplementedMsgServer) WithdrawValidatorCommission(ctx context.Context, req *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawValidatorCommission not implemented") +} +func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} +func (*UnimplementedMsgServer) CommunityPoolSpend(ctx context.Context, req *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") +} +func (*UnimplementedMsgServer) WithdrawTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawTokenizeShareRecordReward not implemented") +} +func (*UnimplementedMsgServer) WithdrawAllTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawAllTokenizeShareRecordReward not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetWithdrawAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetWithdrawAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawDelegatorReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawValidatorCommission) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, req.(*MsgWithdrawValidatorCommission)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundCommunityPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundCommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) + } + 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: "/cosmos.distribution.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCommunityPoolSpend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CommunityPoolSpend(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CommunityPoolSpend(ctx, req.(*MsgCommunityPoolSpend)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawTokenizeShareRecordReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, req.(*MsgWithdrawTokenizeShareRecordReward)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawAllTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawAllTokenizeShareRecordReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, req.(*MsgWithdrawAllTokenizeShareRecordReward)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.distribution.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetWithdrawAddress", + Handler: _Msg_SetWithdrawAddress_Handler, + }, + { + MethodName: "WithdrawDelegatorReward", + Handler: _Msg_WithdrawDelegatorReward_Handler, + }, + { + MethodName: "WithdrawValidatorCommission", + Handler: _Msg_WithdrawValidatorCommission_Handler, + }, + { + MethodName: "FundCommunityPool", + Handler: _Msg_FundCommunityPool_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + { + MethodName: "CommunityPoolSpend", + Handler: _Msg_CommunityPoolSpend_Handler, + }, + { + MethodName: "WithdrawTokenizeShareRecordReward", + Handler: _Msg_WithdrawTokenizeShareRecordReward_Handler, + }, + { + MethodName: "WithdrawAllTokenizeShareRecordReward", + Handler: _Msg_WithdrawAllTokenizeShareRecordReward_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/distribution/v1beta1/tx.proto", +} + +func (m *MsgSetWithdrawAddress) 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 *MsgSetWithdrawAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWithdrawAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WithdrawAddress) > 0 { + i -= len(m.WithdrawAddress) + copy(dAtA[i:], m.WithdrawAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.WithdrawAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetWithdrawAddressResponse) 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 *MsgSetWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawDelegatorReward) 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 *MsgWithdrawDelegatorReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.DelegatorAddress) > 0 { + i -= len(m.DelegatorAddress) + copy(dAtA[i:], m.DelegatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawDelegatorRewardResponse) 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 *MsgWithdrawDelegatorRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawDelegatorRewardResponse) 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] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawValidatorCommission) 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 *MsgWithdrawValidatorCommission) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawValidatorCommission) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawValidatorCommissionResponse) 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 *MsgWithdrawValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawValidatorCommissionResponse) 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] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgFundCommunityPool) 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 *MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + 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] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgFundCommunityPoolResponse) 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 *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 (m *MsgCommunityPoolSpend) 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 *MsgCommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommunityPoolSpend) 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.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) + 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 *MsgWithdrawTokenizeShareRecordReward) 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 *MsgWithdrawTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RecordId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.RecordId)) + i-- + dAtA[i] = 0x10 + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) 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 *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) 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 *MsgWithdrawAllTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) 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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCommunityPoolSpendResponse) 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 *MsgCommunityPoolSpendResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCommunityPoolSpendResponse) 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 *MsgSetWithdrawAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.WithdrawAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetWithdrawAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawDelegatorReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DelegatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawDelegatorRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgWithdrawValidatorCommission) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawValidatorCommissionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgFundCommunityPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgFundCommunityPoolResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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 (m *MsgCommunityPoolSpend) 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 = len(m.Recipient) + 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 *MsgWithdrawTokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.RecordId != 0 { + n += 1 + sovTx(uint64(m.RecordId)) + } + return n +} + +func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawAllTokenizeShareRecordReward) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCommunityPoolSpendResponse) 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 *MsgSetWithdrawAddress) 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: MsgSetWithdrawAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWithdrawAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", 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.WithdrawAddress = string(dAtA[iNdEx:postIndex]) + 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 *MsgSetWithdrawAddressResponse) 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: MsgSetWithdrawAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWithdrawAddressResponse: 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 *MsgWithdrawDelegatorReward) 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: MsgWithdrawDelegatorReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawDelegatorReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + 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 *MsgWithdrawDelegatorRewardResponse) 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: MsgWithdrawDelegatorRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 *MsgWithdrawValidatorCommission) 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: MsgWithdrawValidatorCommission: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommission: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + 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 *MsgWithdrawValidatorCommissionResponse) 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: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 *MsgFundCommunityPool) 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: MsgFundCommunityPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + 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 *MsgFundCommunityPoolResponse) 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: MsgFundCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPoolResponse: 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 *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) || (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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCommunityPoolSpend) 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: MsgCommunityPoolSpend: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCommunityPoolSpend: 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 Recipient", 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.Recipient = 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 *MsgWithdrawTokenizeShareRecordReward) 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: MsgWithdrawTokenizeShareRecordReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) + } + m.RecordId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RecordId |= uint64(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 *MsgWithdrawTokenizeShareRecordRewardResponse) 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: MsgWithdrawTokenizeShareRecordRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordRewardResponse: 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 *MsgWithdrawAllTokenizeShareRecordReward) 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: MsgWithdrawAllTokenizeShareRecordReward: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) + 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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) 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: MsgWithdrawAllTokenizeShareRecordRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordRewardResponse: 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 *MsgCommunityPoolSpendResponse) 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: MsgCommunityPoolSpendResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCommunityPoolSpendResponse: 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") +) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go new file mode 100644 index 000000000000..ea366eb67314 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go @@ -0,0 +1,434 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evidence/v1beta1/evidence.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "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 + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +type Equivocation struct { + // height is the equivocation height. + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // time is the equivocation time. + Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` + // power is the equivocation validator power. + Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` + // consensus_address is the equivocation validator consensus address. + ConsensusAddress string `protobuf:"bytes,4,opt,name=consensus_address,json=consensusAddress,proto3" json:"consensus_address,omitempty"` +} + +func (m *Equivocation) Reset() { *m = Equivocation{} } +func (*Equivocation) ProtoMessage() {} +func (*Equivocation) Descriptor() ([]byte, []int) { + return fileDescriptor_dd143e71a177f0dd, []int{0} +} +func (m *Equivocation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Equivocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Equivocation.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 *Equivocation) XXX_Merge(src proto.Message) { + xxx_messageInfo_Equivocation.Merge(m, src) +} +func (m *Equivocation) XXX_Size() int { + return m.Size() +} +func (m *Equivocation) XXX_DiscardUnknown() { + xxx_messageInfo_Equivocation.DiscardUnknown(m) +} + +var xxx_messageInfo_Equivocation proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Equivocation)(nil), "cosmos.evidence.v1beta1.Equivocation") +} + +func init() { + proto.RegisterFile("cosmos/evidence/v1beta1/evidence.proto", fileDescriptor_dd143e71a177f0dd) +} + +var fileDescriptor_dd143e71a177f0dd = []byte{ + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0x84, 0x0b, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x89, 0x43, 0xd4, 0xe9, + 0xc1, 0x85, 0xa1, 0xea, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0xad, + 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd3, 0xf3, 0xf3, + 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, 0x34, 0xfd, 0x92, 0xcc, 0xdc, 0xd4, 0xe2, 0x92, + 0xc4, 0xdc, 0x02, 0xa8, 0x02, 0x49, 0x88, 0x15, 0xf1, 0x10, 0x9d, 0x50, 0xfb, 0xc0, 0x1c, 0xa5, + 0x37, 0x8c, 0x5c, 0x3c, 0xae, 0x85, 0xa5, 0x99, 0x65, 0xf9, 0xc9, 0x89, 0x25, 0x99, 0xf9, 0x79, + 0x42, 0x62, 0x5c, 0x6c, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, + 0x41, 0x50, 0x9e, 0x90, 0x2d, 0x17, 0x0b, 0xc8, 0x58, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, + 0x29, 0x3d, 0x88, 0x9d, 0x7a, 0x30, 0x3b, 0xf5, 0x42, 0x60, 0x76, 0x3a, 0xf1, 0x9e, 0xb8, 0x27, + 0xcf, 0x30, 0xe1, 0xbe, 0x3c, 0xe3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xc0, 0xda, 0x84, 0x44, + 0xb8, 0x58, 0x0b, 0xf2, 0xcb, 0x53, 0x8b, 0x24, 0x98, 0xc1, 0xa6, 0x42, 0x38, 0x42, 0xae, 0x5c, + 0x82, 0xc9, 0xf9, 0x79, 0xc5, 0xa9, 0x79, 0xc5, 0xa5, 0xc5, 0xf1, 0x89, 0x29, 0x29, 0x45, 0xa9, + 0xc5, 0xc5, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x12, 0x97, 0xb6, 0xe8, 0x8a, 0x40, 0x9d, + 0xea, 0x08, 0x91, 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x12, 0x80, 0x6b, 0x81, 0x8a, 0x5b, + 0x69, 0x74, 0x2c, 0x90, 0x67, 0x98, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0x86, 0xae, 0xe7, + 0x1b, 0xb4, 0xa0, 0x61, 0xaa, 0x5b, 0x9c, 0x92, 0xad, 0x8f, 0xec, 0x3b, 0x27, 0xef, 0x15, 0x8f, + 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, + 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x37, 0x3d, 0xb3, + 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, 0x1a, 0x4a, 0xfa, 0x48, 0x06, 0x55, 0x20, 0xa2, + 0xb2, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x79, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x8d, 0x61, 0xa8, 0x30, 0xea, 0x01, 0x00, 0x00, +} + +func (m *Equivocation) 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 *Equivocation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Equivocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsensusAddress) > 0 { + i -= len(m.ConsensusAddress) + copy(dAtA[i:], m.ConsensusAddress) + i = encodeVarintEvidence(dAtA, i, uint64(len(m.ConsensusAddress))) + i-- + dAtA[i] = 0x22 + } + if m.Power != 0 { + i = encodeVarintEvidence(dAtA, i, uint64(m.Power)) + i-- + dAtA[i] = 0x18 + } + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintEvidence(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + if m.Height != 0 { + i = encodeVarintEvidence(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvidence(dAtA []byte, offset int, v uint64) int { + offset -= sovEvidence(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Equivocation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovEvidence(uint64(m.Height)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) + n += 1 + l + sovEvidence(uint64(l)) + if m.Power != 0 { + n += 1 + sovEvidence(uint64(m.Power)) + } + l = len(m.ConsensusAddress) + if l > 0 { + n += 1 + l + sovEvidence(uint64(l)) + } + return n +} + +func sovEvidence(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvidence(x uint64) (n int) { + return sovEvidence(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Equivocation) 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 ErrIntOverflowEvidence + } + 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: Equivocation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Equivocation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowEvidence + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 ErrIntOverflowEvidence + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvidence + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvidence + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_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 Power", wireType) + } + m.Power = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvidence + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Power |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvidence + } + 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 ErrInvalidLengthEvidence + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvidence + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvidence(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvidence + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvidence(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, ErrIntOverflowEvidence + } + 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, ErrIntOverflowEvidence + } + 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, ErrIntOverflowEvidence + } + 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, ErrInvalidLengthEvidence + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvidence + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvidence + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvidence = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvidence = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvidence = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go new file mode 100644 index 000000000000..fdf89c8118dd --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go @@ -0,0 +1,333 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evidence/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the evidence module's genesis state. +type GenesisState struct { + // evidence defines all the evidence at genesis. + Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_c610c52c26e0e202, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetEvidence() []*types.Any { + if m != nil { + return m.Evidence + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.evidence.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/evidence/v1beta1/genesis.proto", fileDescriptor_c610c52c26e0e202) +} + +var fileDescriptor_c610c52c26e0e202 = []byte{ + // 195 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x12, 0x87, 0x28, 0xd3, 0x83, 0x29, 0xd3, 0x83, 0x2a, 0x93, 0x92, 0x4c, 0xcf, 0xcf, + 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0x2b, 0x4b, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xe8, 0x51, + 0x72, 0xe0, 0xe2, 0x71, 0x87, 0x18, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc0, 0xc5, 0x01, + 0xd3, 0x2e, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa2, 0x07, 0xd1, 0xad, 0x07, 0xd3, 0xad, + 0xe7, 0x98, 0x57, 0x19, 0x04, 0x57, 0xe5, 0xe4, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, + 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, + 0x72, 0x0c, 0x51, 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, + 0x1f, 0x40, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0x84, 0x77, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, + 0x93, 0xd8, 0xc0, 0x16, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x4b, 0xa9, 0xfe, 0xee, + 0x00, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Evidence) > 0 { + for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Evidence) > 0 { + for _, e := range m.Evidence { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Evidence = append(m.Evidence, &types.Any{}) + if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go new file mode 100644 index 000000000000..200881ef6c0f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go @@ -0,0 +1,1134 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evidence/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes" + types "github.com/cosmos/cosmos-sdk/codec/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +type QueryEvidenceRequest struct { + // evidence_hash defines the hash of the requested evidence. + // Deprecated: Use hash, a HEX encoded string, instead. + EvidenceHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=evidence_hash,json=evidenceHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"evidence_hash,omitempty"` // Deprecated: Do not use. + // hash defines the evidence hash of the requested evidence. + // + // Since: cosmos-sdk 0.47 + Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *QueryEvidenceRequest) Reset() { *m = QueryEvidenceRequest{} } +func (m *QueryEvidenceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEvidenceRequest) ProtoMessage() {} +func (*QueryEvidenceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_07043de1a84d215a, []int{0} +} +func (m *QueryEvidenceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEvidenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEvidenceRequest.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 *QueryEvidenceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEvidenceRequest.Merge(m, src) +} +func (m *QueryEvidenceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryEvidenceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEvidenceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEvidenceRequest proto.InternalMessageInfo + +// Deprecated: Do not use. +func (m *QueryEvidenceRequest) GetEvidenceHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { + if m != nil { + return m.EvidenceHash + } + return nil +} + +func (m *QueryEvidenceRequest) GetHash() string { + if m != nil { + return m.Hash + } + return "" +} + +// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +type QueryEvidenceResponse struct { + // evidence returns the requested evidence. + Evidence *types.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` +} + +func (m *QueryEvidenceResponse) Reset() { *m = QueryEvidenceResponse{} } +func (m *QueryEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEvidenceResponse) ProtoMessage() {} +func (*QueryEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07043de1a84d215a, []int{1} +} +func (m *QueryEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryEvidenceResponse.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 *QueryEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEvidenceResponse.Merge(m, src) +} +func (m *QueryEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryEvidenceResponse proto.InternalMessageInfo + +func (m *QueryEvidenceResponse) GetEvidence() *types.Any { + if m != nil { + return m.Evidence + } + return nil +} + +// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +// method. +type QueryAllEvidenceRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllEvidenceRequest) Reset() { *m = QueryAllEvidenceRequest{} } +func (m *QueryAllEvidenceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllEvidenceRequest) ProtoMessage() {} +func (*QueryAllEvidenceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_07043de1a84d215a, []int{2} +} +func (m *QueryAllEvidenceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllEvidenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllEvidenceRequest.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 *QueryAllEvidenceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllEvidenceRequest.Merge(m, src) +} +func (m *QueryAllEvidenceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllEvidenceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllEvidenceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllEvidenceRequest proto.InternalMessageInfo + +func (m *QueryAllEvidenceRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +// method. +type QueryAllEvidenceResponse struct { + // evidence returns all evidences. + Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllEvidenceResponse) Reset() { *m = QueryAllEvidenceResponse{} } +func (m *QueryAllEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllEvidenceResponse) ProtoMessage() {} +func (*QueryAllEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_07043de1a84d215a, []int{3} +} +func (m *QueryAllEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllEvidenceResponse.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 *QueryAllEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllEvidenceResponse.Merge(m, src) +} +func (m *QueryAllEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllEvidenceResponse proto.InternalMessageInfo + +func (m *QueryAllEvidenceResponse) GetEvidence() []*types.Any { + if m != nil { + return m.Evidence + } + return nil +} + +func (m *QueryAllEvidenceResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryEvidenceRequest)(nil), "cosmos.evidence.v1beta1.QueryEvidenceRequest") + proto.RegisterType((*QueryEvidenceResponse)(nil), "cosmos.evidence.v1beta1.QueryEvidenceResponse") + proto.RegisterType((*QueryAllEvidenceRequest)(nil), "cosmos.evidence.v1beta1.QueryAllEvidenceRequest") + proto.RegisterType((*QueryAllEvidenceResponse)(nil), "cosmos.evidence.v1beta1.QueryAllEvidenceResponse") +} + +func init() { + proto.RegisterFile("cosmos/evidence/v1beta1/query.proto", fileDescriptor_07043de1a84d215a) +} + +var fileDescriptor_07043de1a84d215a = []byte{ + // 480 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0xeb, 0xf2, 0x43, 0xc3, 0x1b, 0x17, 0xab, 0x68, 0x25, 0x42, 0x61, 0x64, 0x12, 0x94, + 0x49, 0xb5, 0xd3, 0x21, 0x71, 0x5f, 0x25, 0xd8, 0xb8, 0x41, 0x8e, 0x70, 0x40, 0x76, 0xe6, 0x25, + 0x11, 0xa9, 0x9d, 0xcd, 0xce, 0xb4, 0x08, 0x71, 0xe1, 0xc2, 0x15, 0x09, 0x71, 0x42, 0xfc, 0x39, + 0x48, 0x1c, 0x27, 0x71, 0xe1, 0x84, 0x50, 0xcb, 0x5f, 0xc1, 0x09, 0xc5, 0x76, 0xda, 0xee, 0x17, + 0x85, 0x53, 0x5f, 0xed, 0xf7, 0xfd, 0xbe, 0xcf, 0x7b, 0xcf, 0x81, 0xeb, 0xb1, 0x54, 0x23, 0xa9, + 0x08, 0x3f, 0xcc, 0x76, 0xb9, 0x88, 0x39, 0x39, 0x1c, 0x30, 0xae, 0xe9, 0x80, 0xec, 0x97, 0xfc, + 0xa0, 0xc2, 0xc5, 0x81, 0xd4, 0x12, 0xad, 0xda, 0x24, 0xdc, 0x24, 0x61, 0x97, 0xe4, 0x6d, 0x38, + 0x35, 0xa3, 0x8a, 0x5b, 0xc5, 0x54, 0x5f, 0xd0, 0x24, 0x13, 0x54, 0x67, 0x52, 0x58, 0x13, 0xaf, + 0x93, 0xc8, 0x44, 0x9a, 0x90, 0xd4, 0x91, 0x3b, 0xbd, 0x99, 0x48, 0x99, 0xe4, 0x9c, 0x98, 0x7f, + 0xac, 0xdc, 0x23, 0x54, 0xb8, 0xaa, 0xde, 0x2d, 0x77, 0x45, 0x8b, 0x8c, 0x50, 0x21, 0xa4, 0x36, + 0x6e, 0xca, 0xde, 0x06, 0xef, 0x00, 0xec, 0x3c, 0xab, 0x2b, 0x3e, 0x72, 0x50, 0x11, 0xdf, 0x2f, + 0xb9, 0xd2, 0xe8, 0x05, 0xbc, 0xde, 0x70, 0xbe, 0x4c, 0xa9, 0x4a, 0xbb, 0x60, 0x0d, 0xf4, 0x56, + 0x86, 0x0f, 0x7f, 0xff, 0xb8, 0x1d, 0x26, 0x99, 0x4e, 0x4b, 0x86, 0x63, 0x39, 0x22, 0xb1, 0x1c, + 0x71, 0xcd, 0xf6, 0xf4, 0x2c, 0xc8, 0x33, 0xa6, 0x08, 0xab, 0x34, 0x57, 0x78, 0x87, 0x1f, 0x0d, + 0xeb, 0xa0, 0x0b, 0xa2, 0x95, 0xc6, 0x6c, 0x87, 0xaa, 0x14, 0x21, 0x78, 0xd9, 0x78, 0xb6, 0xd7, + 0x40, 0xef, 0x5a, 0x64, 0xe2, 0xe0, 0x09, 0xbc, 0x71, 0x0a, 0x44, 0x15, 0x52, 0x28, 0x8e, 0x42, + 0xb8, 0xd4, 0x88, 0x0d, 0xc4, 0xf2, 0x66, 0x07, 0xdb, 0x9e, 0x70, 0xd3, 0x2e, 0xde, 0x12, 0x55, + 0x34, 0xcd, 0x0a, 0x28, 0x5c, 0x35, 0x56, 0x5b, 0x79, 0x7e, 0xba, 0xad, 0xc7, 0x10, 0xce, 0x46, + 0xea, 0xec, 0xee, 0x62, 0xb7, 0x98, 0x7a, 0xfe, 0xd8, 0x6e, 0xcc, 0xcd, 0x1f, 0x3f, 0xa5, 0x49, + 0xa3, 0x8d, 0xe6, 0x94, 0xc1, 0x47, 0x00, 0xbb, 0x67, 0x6b, 0x9c, 0x4b, 0x7c, 0x69, 0x31, 0x31, + 0xda, 0x3e, 0x81, 0xd5, 0x36, 0x58, 0xf7, 0x16, 0x62, 0xd9, 0x72, 0xf3, 0x5c, 0x9b, 0x5f, 0xda, + 0xf0, 0x8a, 0xe1, 0x42, 0x9f, 0x00, 0x5c, 0x6a, 0xc8, 0x50, 0x1f, 0x5f, 0xf0, 0xf6, 0xf0, 0x79, + 0xcb, 0xf7, 0xf0, 0xbf, 0xa6, 0x5b, 0x82, 0x20, 0x7c, 0xfb, 0xed, 0xd7, 0x87, 0xf6, 0x06, 0xea, + 0x91, 0x8b, 0xbe, 0x83, 0xe9, 0xc1, 0xeb, 0x7a, 0xd9, 0x6f, 0xd0, 0x67, 0x00, 0x97, 0xe7, 0x46, + 0x87, 0xc2, 0xbf, 0x57, 0x3c, 0xbb, 0x49, 0x6f, 0xf0, 0x1f, 0x0a, 0x87, 0x79, 0xdf, 0x60, 0xae, + 0xa3, 0x3b, 0x0b, 0x31, 0x87, 0xdb, 0x5f, 0xc7, 0x3e, 0x38, 0x1e, 0xfb, 0xe0, 0xe7, 0xd8, 0x07, + 0xef, 0x27, 0x7e, 0xeb, 0x78, 0xe2, 0xb7, 0xbe, 0x4f, 0xfc, 0xd6, 0xf3, 0xfe, 0x89, 0xd7, 0x6f, + 0x6c, 0xec, 0x4f, 0x5f, 0xed, 0xbe, 0x22, 0x47, 0x33, 0x4f, 0x5d, 0x15, 0x5c, 0xb1, 0xab, 0x66, + 0xe3, 0x0f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x76, 0x1c, 0x26, 0x0a, 0x22, 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 + +// 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 { + // Evidence queries evidence based on evidence hash. + Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) + // AllEvidence queries all evidence. + AllEvidence(ctx context.Context, in *QueryAllEvidenceRequest, opts ...grpc.CallOption) (*QueryAllEvidenceResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) { + out := new(QueryEvidenceResponse) + err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Query/Evidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllEvidence(ctx context.Context, in *QueryAllEvidenceRequest, opts ...grpc.CallOption) (*QueryAllEvidenceResponse, error) { + out := new(QueryAllEvidenceResponse) + err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Query/AllEvidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Evidence queries evidence based on evidence hash. + Evidence(context.Context, *QueryEvidenceRequest) (*QueryEvidenceResponse, error) + // AllEvidence queries all evidence. + AllEvidence(context.Context, *QueryAllEvidenceRequest) (*QueryAllEvidenceResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Evidence(ctx context.Context, req *QueryEvidenceRequest) (*QueryEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Evidence not implemented") +} +func (*UnimplementedQueryServer) AllEvidence(ctx context.Context, req *QueryAllEvidenceRequest) (*QueryAllEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllEvidence not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Evidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEvidenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Evidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evidence.v1beta1.Query/Evidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Evidence(ctx, req.(*QueryEvidenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllEvidenceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllEvidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evidence.v1beta1.Query/AllEvidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllEvidence(ctx, req.(*QueryAllEvidenceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evidence.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Evidence", + Handler: _Query_Evidence_Handler, + }, + { + MethodName: "AllEvidence", + Handler: _Query_AllEvidence_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evidence/v1beta1/query.proto", +} + +func (m *QueryEvidenceRequest) 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 *QueryEvidenceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEvidenceRequest) 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] = 0x12 + } + if len(m.EvidenceHash) > 0 { + i -= len(m.EvidenceHash) + copy(dAtA[i:], m.EvidenceHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.EvidenceHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryEvidenceResponse) 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 *QueryEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryEvidenceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Evidence != nil { + { + size, err := m.Evidence.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 *QueryAllEvidenceRequest) 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 *QueryAllEvidenceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllEvidenceRequest) 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 *QueryAllEvidenceResponse) 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 *QueryAllEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllEvidenceResponse) 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.Evidence) > 0 { + for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Evidence[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 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 *QueryEvidenceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.EvidenceHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllEvidenceRequest) 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 *QueryAllEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Evidence) > 0 { + for _, e := range m.Evidence { + 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 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 *QueryEvidenceRequest) 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: QueryEvidenceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEvidenceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) + if m.EvidenceHash == nil { + m.EvidenceHash = []byte{} + } + iNdEx = postIndex + case 2: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryEvidenceResponse) 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: QueryEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence == nil { + m.Evidence = &types.Any{} + } + if err := m.Evidence.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllEvidenceRequest) 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: QueryAllEvidenceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllEvidenceRequest: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllEvidenceResponse) 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: QueryAllEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence = append(m.Evidence, &types.Any{}) + if err := m.Evidence[len(m.Evidence)-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) || (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/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go new file mode 100644 index 000000000000..fb112060574d --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go @@ -0,0 +1,290 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/evidence/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_Evidence_0 = &utilities.DoubleArray{Encoding: map[string]int{"hash": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Evidence_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEvidenceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Evidence_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Evidence(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Evidence_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEvidenceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["hash"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") + } + + protoReq.Hash, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Evidence_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Evidence(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllEvidence_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllEvidenceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllEvidence_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllEvidence(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllEvidenceRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllEvidence_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllEvidence(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Evidence_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Evidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllEvidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllEvidence_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllEvidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Evidence_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Evidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllEvidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AllEvidence_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllEvidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Evidence_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"cosmos", "evidence", "v1beta1", "hash"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllEvidence_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"cosmos", "evidence", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Evidence_0 = runtime.ForwardResponseMessage + + forward_Query_AllEvidence_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go new file mode 100644 index 000000000000..c2969960122f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go @@ -0,0 +1,673 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/evidence/v1beta1/tx.proto + +package types + +import ( + bytes "bytes" + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// MsgSubmitEvidence represents a message that supports submitting arbitrary +// Evidence of misbehavior such as equivocation or counterfactual signing. +type MsgSubmitEvidence struct { + // submitter is the signer account address of evidence. + Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` + // evidence defines the evidence of misbehavior. + Evidence *types.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` +} + +func (m *MsgSubmitEvidence) Reset() { *m = MsgSubmitEvidence{} } +func (m *MsgSubmitEvidence) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitEvidence) ProtoMessage() {} +func (*MsgSubmitEvidence) Descriptor() ([]byte, []int) { + return fileDescriptor_3e3242cb23c956e0, []int{0} +} +func (m *MsgSubmitEvidence) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitEvidence.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 *MsgSubmitEvidence) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitEvidence.Merge(m, src) +} +func (m *MsgSubmitEvidence) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitEvidence.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +type MsgSubmitEvidenceResponse struct { + // hash defines the hash of the evidence. + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *MsgSubmitEvidenceResponse) Reset() { *m = MsgSubmitEvidenceResponse{} } +func (m *MsgSubmitEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitEvidenceResponse) ProtoMessage() {} +func (*MsgSubmitEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3e3242cb23c956e0, []int{1} +} +func (m *MsgSubmitEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitEvidenceResponse.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 *MsgSubmitEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitEvidenceResponse.Merge(m, src) +} +func (m *MsgSubmitEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitEvidenceResponse proto.InternalMessageInfo + +func (m *MsgSubmitEvidenceResponse) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + +func init() { + proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidence") + proto.RegisterType((*MsgSubmitEvidenceResponse)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") +} + +func init() { proto.RegisterFile("cosmos/evidence/v1beta1/tx.proto", fileDescriptor_3e3242cb23c956e0) } + +var fileDescriptor_3e3242cb23c956e0 = []byte{ + // 390 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, + 0xd0, 0x83, 0xa9, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, + 0xb1, 0x20, 0xca, 0xa5, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, + 0x34, 0xfd, 0xc4, 0xbc, 0x4a, 0x98, 0x14, 0xc4, 0xa4, 0x78, 0x88, 0x1e, 0xa8, 0xb1, 0x10, 0x29, + 0xa8, 0x25, 0xfa, 0xb9, 0xc5, 0xe9, 0xfa, 0x65, 0x86, 0x20, 0x0a, 0x2a, 0x21, 0x98, 0x98, 0x9b, + 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x77, 0x18, 0xb9, 0x04, 0x7d, 0x8b, 0xd3, 0x83, + 0x4b, 0x93, 0x72, 0x33, 0x4b, 0x5c, 0xa1, 0xae, 0x12, 0x32, 0xe3, 0xe2, 0x2c, 0x06, 0x8b, 0x94, + 0xa4, 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, 0xb5, + 0xc6, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, 0x2f, 0x3d, 0x08, 0xa1, + 0x54, 0x28, 0x8c, 0x8b, 0x03, 0xe6, 0x33, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x11, 0x3d, + 0x88, 0x17, 0xf4, 0x60, 0x5e, 0xd0, 0x73, 0xcc, 0xab, 0x74, 0x52, 0x39, 0xb5, 0x45, 0x57, 0x01, + 0x47, 0x50, 0xe8, 0xc1, 0x5c, 0x11, 0x04, 0x37, 0xcb, 0xca, 0xbc, 0x63, 0x81, 0x3c, 0xc3, 0x8b, + 0x05, 0xf2, 0x0c, 0x4d, 0xcf, 0x37, 0x68, 0x21, 0xec, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x06, 0x62, + 0x8c, 0x6e, 0x71, 0x4a, 0xb6, 0x3e, 0x86, 0x47, 0x94, 0xf4, 0xb9, 0x24, 0x31, 0x04, 0x83, 0x52, + 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x58, + 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa3, 0x3a, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x02, + 0x2e, 0x3e, 0xb4, 0x20, 0xd1, 0xd2, 0xc3, 0xe5, 0x5e, 0x0c, 0x0b, 0xa4, 0x8c, 0x88, 0x57, 0x0b, + 0x73, 0x8c, 0x14, 0x6b, 0xc3, 0xf3, 0x0d, 0x5a, 0x8c, 0x4e, 0xde, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, + 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, + 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, + 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0xca, 0xf5, 0x91, 0xbc, 0x5f, 0x81, 0x48, 0x78, 0x25, 0x95, + 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x40, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x53, 0x46, + 0x2d, 0x75, 0x98, 0x02, 0x00, 0x00, +} + +func (this *MsgSubmitEvidenceResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSubmitEvidenceResponse) + if !ok { + that2, ok := that.(MsgSubmitEvidenceResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Hash, that1.Hash) { + 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 { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) { + out := new(MsgSubmitEvidenceResponse) + err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitEvidence(ctx context.Context, req *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitEvidence not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitEvidence) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitEvidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitEvidence(ctx, req.(*MsgSubmitEvidence)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evidence.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitEvidence", + Handler: _Msg_SubmitEvidence_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evidence/v1beta1/tx.proto", +} + +func (m *MsgSubmitEvidence) 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 *MsgSubmitEvidence) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Evidence != nil { + { + size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Submitter) > 0 { + i -= len(m.Submitter) + copy(dAtA[i:], m.Submitter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitEvidenceResponse) 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 *MsgSubmitEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitEvidenceResponse) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 + } + 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 *MsgSubmitEvidence) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Submitter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Evidence != nil { + l = m.Evidence.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + if l > 0 { + n += 1 + l + sovTx(uint64(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 *MsgSubmitEvidence) 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: MsgSubmitEvidence: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitEvidence: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Submitter", 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.Submitter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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 m.Evidence == nil { + m.Evidence = &types.Any{} + } + if err := m.Evidence.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 *MsgSubmitEvidenceResponse) 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: MsgSubmitEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []byte{} + } + 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 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/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go new file mode 100644 index 000000000000..52ca7e6326c3 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go @@ -0,0 +1,1349 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/feegrant.proto + +package feegrant + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types1 "github.com/cosmos/cosmos-sdk/codec/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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 + +// BasicAllowance implements Allowance with a one-time grant of coins +// that optionally expires. The grantee can use up to SpendLimit to cover fees. +type BasicAllowance struct { + // spend_limit specifies the maximum amount of coins that can be spent + // by this allowance and will be updated as coins are spent. If it is + // empty, there is no spend limit and any amount of coins can be spent. + SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` + // expiration specifies an optional time when this allowance expires + Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` +} + +func (m *BasicAllowance) Reset() { *m = BasicAllowance{} } +func (m *BasicAllowance) String() string { return proto.CompactTextString(m) } +func (*BasicAllowance) ProtoMessage() {} +func (*BasicAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{0} +} +func (m *BasicAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasicAllowance.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 *BasicAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicAllowance.Merge(m, src) +} +func (m *BasicAllowance) XXX_Size() int { + return m.Size() +} +func (m *BasicAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_BasicAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicAllowance proto.InternalMessageInfo + +func (m *BasicAllowance) GetSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.SpendLimit + } + return nil +} + +func (m *BasicAllowance) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +// PeriodicAllowance extends Allowance to allow for both a maximum cap, +// as well as a limit per time period. +type PeriodicAllowance struct { + // basic specifies a struct of `BasicAllowance` + Basic BasicAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"` + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + Period time.Duration `protobuf:"bytes,2,opt,name=period,proto3,stdduration" json:"period"` + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + PeriodSpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=period_spend_limit,json=periodSpendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_spend_limit"` + // period_can_spend is the number of coins left to be spent before the period_reset time + PeriodCanSpend github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=period_can_spend,json=periodCanSpend,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_can_spend"` + // period_reset is the time at which this period resets and a new one begins, + // it is calculated from the start time of the first transaction after the + // last period ended + PeriodReset time.Time `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3,stdtime" json:"period_reset"` +} + +func (m *PeriodicAllowance) Reset() { *m = PeriodicAllowance{} } +func (m *PeriodicAllowance) String() string { return proto.CompactTextString(m) } +func (*PeriodicAllowance) ProtoMessage() {} +func (*PeriodicAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{1} +} +func (m *PeriodicAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PeriodicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PeriodicAllowance.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 *PeriodicAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeriodicAllowance.Merge(m, src) +} +func (m *PeriodicAllowance) XXX_Size() int { + return m.Size() +} +func (m *PeriodicAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_PeriodicAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_PeriodicAllowance proto.InternalMessageInfo + +func (m *PeriodicAllowance) GetBasic() BasicAllowance { + if m != nil { + return m.Basic + } + return BasicAllowance{} +} + +func (m *PeriodicAllowance) GetPeriod() time.Duration { + if m != nil { + return m.Period + } + return 0 +} + +func (m *PeriodicAllowance) GetPeriodSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PeriodSpendLimit + } + return nil +} + +func (m *PeriodicAllowance) GetPeriodCanSpend() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PeriodCanSpend + } + return nil +} + +func (m *PeriodicAllowance) GetPeriodReset() time.Time { + if m != nil { + return m.PeriodReset + } + return time.Time{} +} + +// AllowedMsgAllowance creates allowance only for specified message types. +type AllowedMsgAllowance struct { + // allowance can be any of basic and periodic fee allowance. + Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` + // allowed_messages are the messages for which the grantee has the access. + AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"` +} + +func (m *AllowedMsgAllowance) Reset() { *m = AllowedMsgAllowance{} } +func (m *AllowedMsgAllowance) String() string { return proto.CompactTextString(m) } +func (*AllowedMsgAllowance) ProtoMessage() {} +func (*AllowedMsgAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{2} +} +func (m *AllowedMsgAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllowedMsgAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllowedMsgAllowance.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 *AllowedMsgAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllowedMsgAllowance.Merge(m, src) +} +func (m *AllowedMsgAllowance) XXX_Size() int { + return m.Size() +} +func (m *AllowedMsgAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_AllowedMsgAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_AllowedMsgAllowance proto.InternalMessageInfo + +// Grant is stored in the KVStore to record a grant with full context +type Grant struct { + // granter is the address of the user granting an allowance of their funds. + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // grantee is the address of the user being granted an allowance of another user's funds. + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + // allowance can be any of basic, periodic, allowed fee allowance. + Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` +} + +func (m *Grant) Reset() { *m = Grant{} } +func (m *Grant) String() string { return proto.CompactTextString(m) } +func (*Grant) ProtoMessage() {} +func (*Grant) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{3} +} +func (m *Grant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Grant.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 *Grant) XXX_Merge(src proto.Message) { + xxx_messageInfo_Grant.Merge(m, src) +} +func (m *Grant) XXX_Size() int { + return m.Size() +} +func (m *Grant) XXX_DiscardUnknown() { + xxx_messageInfo_Grant.DiscardUnknown(m) +} + +var xxx_messageInfo_Grant proto.InternalMessageInfo + +func (m *Grant) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *Grant) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *Grant) GetAllowance() *types1.Any { + if m != nil { + return m.Allowance + } + return nil +} + +func init() { + proto.RegisterType((*BasicAllowance)(nil), "cosmos.feegrant.v1beta1.BasicAllowance") + proto.RegisterType((*PeriodicAllowance)(nil), "cosmos.feegrant.v1beta1.PeriodicAllowance") + proto.RegisterType((*AllowedMsgAllowance)(nil), "cosmos.feegrant.v1beta1.AllowedMsgAllowance") + proto.RegisterType((*Grant)(nil), "cosmos.feegrant.v1beta1.Grant") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/feegrant.proto", fileDescriptor_7279582900c30aea) +} + +var fileDescriptor_7279582900c30aea = []byte{ + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0x8f, 0x9b, 0xb6, 0x28, 0x17, 0x28, 0xad, 0xa9, 0x84, 0x53, 0x21, 0xbb, 0x8a, 0x04, 0x4d, + 0x2b, 0xd5, 0x56, 0x8b, 0x58, 0x3a, 0x35, 0x2e, 0xa2, 0x80, 0x5a, 0xa9, 0x72, 0x99, 0x90, 0x50, + 0x74, 0xb6, 0xaf, 0xe6, 0x44, 0xec, 0x33, 0x3e, 0x17, 0x1a, 0x06, 0x66, 0xc4, 0x80, 0x32, 0x32, + 0x32, 0x22, 0xa6, 0x0e, 0xe5, 0x3b, 0x54, 0x0c, 0xa8, 0x62, 0x62, 0x22, 0x28, 0x19, 0x3a, 0xf3, + 0x0d, 0x90, 0xef, 0xce, 0x8e, 0x9b, 0x50, 0x68, 0x25, 0xba, 0x24, 0x77, 0xef, 0xde, 0xfb, 0xfd, + 0x79, 0xef, 0x45, 0x01, 0xb7, 0x1c, 0x42, 0x7d, 0x42, 0x8d, 0x1d, 0x84, 0xbc, 0x08, 0x06, 0xb1, + 0xf1, 0x62, 0xc9, 0x46, 0x31, 0x5c, 0xca, 0x02, 0x7a, 0x18, 0x91, 0x98, 0xc8, 0xd7, 0x79, 0x9e, + 0x9e, 0x85, 0x45, 0xde, 0xcc, 0xb4, 0x47, 0x3c, 0xc2, 0x72, 0x8c, 0xe4, 0xc4, 0xd3, 0x67, 0x2a, + 0x1e, 0x21, 0x5e, 0x13, 0x19, 0xec, 0x66, 0xef, 0xee, 0x18, 0x30, 0x68, 0xa5, 0x4f, 0x1c, 0xa9, + 0xc1, 0x6b, 0x04, 0x2c, 0x7f, 0x52, 0x85, 0x18, 0x1b, 0x52, 0x94, 0x09, 0x71, 0x08, 0x0e, 0xc4, + 0xfb, 0x14, 0xf4, 0x71, 0x40, 0x0c, 0xf6, 0x29, 0x42, 0xda, 0x20, 0x51, 0x8c, 0x7d, 0x44, 0x63, + 0xe8, 0x87, 0x29, 0xe6, 0x60, 0x82, 0xbb, 0x1b, 0xc1, 0x18, 0x13, 0x81, 0x59, 0x7d, 0x37, 0x02, + 0x26, 0x4c, 0x48, 0xb1, 0x53, 0x6f, 0x36, 0xc9, 0x4b, 0x18, 0x38, 0x48, 0x7e, 0x0e, 0xca, 0x34, + 0x44, 0x81, 0xdb, 0x68, 0x62, 0x1f, 0xc7, 0x8a, 0x34, 0x5b, 0xac, 0x95, 0x97, 0x2b, 0xba, 0x90, + 0x9a, 0x88, 0x4b, 0xdd, 0xeb, 0x6b, 0x04, 0x07, 0xe6, 0x9d, 0xc3, 0x1f, 0x5a, 0xe1, 0x53, 0x47, + 0xab, 0x79, 0x38, 0x7e, 0xba, 0x6b, 0xeb, 0x0e, 0xf1, 0x85, 0x2f, 0xf1, 0xb5, 0x48, 0xdd, 0x67, + 0x46, 0xdc, 0x0a, 0x11, 0x65, 0x05, 0xf4, 0xe3, 0xf1, 0xfe, 0x82, 0x64, 0x01, 0x46, 0xb2, 0x91, + 0x70, 0xc8, 0xab, 0x00, 0xa0, 0xbd, 0x10, 0x73, 0x65, 0xca, 0xc8, 0xac, 0x54, 0x2b, 0x2f, 0xcf, + 0xe8, 0x5c, 0xba, 0x9e, 0x4a, 0xd7, 0x1f, 0xa5, 0xde, 0xcc, 0xd1, 0x76, 0x47, 0x93, 0xac, 0x5c, + 0xcd, 0xca, 0xfa, 0x97, 0x83, 0xc5, 0x9b, 0xa7, 0x0c, 0x49, 0xbf, 0x87, 0x50, 0x66, 0xef, 0xc1, + 0xdb, 0xe3, 0xfd, 0x85, 0x4a, 0x4e, 0xd8, 0x49, 0xf7, 0xd5, 0xcf, 0xa3, 0x60, 0x6a, 0x0b, 0x45, + 0x98, 0xb8, 0xf9, 0x9e, 0xdc, 0x07, 0x63, 0x76, 0x92, 0xa7, 0x48, 0x4c, 0xdb, 0x9c, 0x7e, 0x1a, + 0xd5, 0x49, 0x34, 0xb3, 0x94, 0xf4, 0x86, 0xfb, 0xe5, 0x00, 0xf2, 0x2a, 0x18, 0x0f, 0x19, 0xbc, + 0xb0, 0x59, 0x19, 0xb2, 0x79, 0x57, 0x4c, 0xc8, 0xbc, 0x92, 0x14, 0xbf, 0xef, 0x68, 0x12, 0x07, + 0x10, 0x75, 0xf2, 0x6b, 0x20, 0xf3, 0x53, 0x23, 0x3f, 0xa6, 0xe2, 0x05, 0x8d, 0x69, 0x92, 0x73, + 0x6d, 0xf7, 0x87, 0xf5, 0x0a, 0x88, 0x58, 0xc3, 0x81, 0x01, 0xd7, 0xa0, 0x8c, 0x5e, 0x10, 0xfb, + 0x04, 0x67, 0x5a, 0x83, 0x01, 0x13, 0x20, 0x6f, 0x80, 0xcb, 0x82, 0x3b, 0x42, 0x14, 0xc5, 0xca, + 0xd8, 0x3f, 0x57, 0x85, 0x35, 0xb1, 0x9d, 0x35, 0xb1, 0xcc, 0xcb, 0xad, 0xa4, 0x7a, 0xe5, 0xe1, + 0xb9, 0x96, 0xe6, 0x46, 0x4e, 0xe8, 0xd0, 0x86, 0x54, 0x7f, 0x49, 0xe0, 0x1a, 0xbb, 0x21, 0x77, + 0x93, 0x7a, 0xfd, 0xcd, 0x79, 0x02, 0x4a, 0x30, 0xbd, 0x88, 0xed, 0x99, 0x1e, 0x92, 0x5b, 0x0f, + 0x5a, 0xe6, 0xfc, 0x99, 0xc5, 0x58, 0x7d, 0x44, 0x79, 0x1e, 0x4c, 0x42, 0xce, 0xda, 0xf0, 0x11, + 0xa5, 0xd0, 0x43, 0x54, 0x19, 0x99, 0x2d, 0xd6, 0x4a, 0xd6, 0x55, 0x11, 0xdf, 0x14, 0xe1, 0x95, + 0xad, 0x37, 0x1f, 0xb4, 0xc2, 0xb9, 0x1c, 0xab, 0x39, 0xc7, 0x7f, 0xf0, 0x56, 0xfd, 0x2a, 0x81, + 0xb1, 0xf5, 0x04, 0x42, 0x5e, 0x06, 0x97, 0x18, 0x16, 0x8a, 0x98, 0xc7, 0x92, 0xa9, 0x7c, 0x3b, + 0x58, 0x9c, 0x16, 0x44, 0x75, 0xd7, 0x8d, 0x10, 0xa5, 0xdb, 0x71, 0x84, 0x03, 0xcf, 0x4a, 0x13, + 0xfb, 0x35, 0x88, 0xfd, 0x14, 0xce, 0x50, 0x33, 0xd0, 0xcd, 0xe2, 0xff, 0xee, 0xa6, 0x59, 0x3f, + 0xec, 0xaa, 0xd2, 0x51, 0x57, 0x95, 0x7e, 0x76, 0x55, 0xa9, 0xdd, 0x53, 0x0b, 0x47, 0x3d, 0xb5, + 0xf0, 0xbd, 0xa7, 0x16, 0x1e, 0xcf, 0xfd, 0x75, 0x6f, 0xf7, 0xb2, 0xff, 0x0b, 0x7b, 0x9c, 0xc9, + 0xb8, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x3d, 0x09, 0x1d, 0x5a, 0x06, 0x00, 0x00, +} + +func (m *BasicAllowance) 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 *BasicAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Expiration != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintFeegrant(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + } + if len(m.SpendLimit) > 0 { + for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PeriodicAllowance) 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 *PeriodicAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PeriodicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PeriodReset, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintFeegrant(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + if len(m.PeriodCanSpend) > 0 { + for iNdEx := len(m.PeriodCanSpend) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PeriodCanSpend[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.PeriodSpendLimit) > 0 { + for iNdEx := len(m.PeriodSpendLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PeriodSpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintFeegrant(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x12 + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *AllowedMsgAllowance) 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 *AllowedMsgAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllowedMsgAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllowedMessages) > 0 { + for iNdEx := len(m.AllowedMessages) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowedMessages[iNdEx]) + copy(dAtA[i:], m.AllowedMessages[iNdEx]) + i = encodeVarintFeegrant(dAtA, i, uint64(len(m.AllowedMessages[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Allowance != nil { + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Grant) 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 *Grant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Allowance != nil { + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintFeegrant(dAtA []byte, offset int, v uint64) int { + offset -= sovFeegrant(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BasicAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SpendLimit) > 0 { + for _, e := range m.SpendLimit { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + if m.Expiration != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovFeegrant(uint64(l)) + } + return n +} + +func (m *PeriodicAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Basic.Size() + n += 1 + l + sovFeegrant(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period) + n += 1 + l + sovFeegrant(uint64(l)) + if len(m.PeriodSpendLimit) > 0 { + for _, e := range m.PeriodSpendLimit { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + if len(m.PeriodCanSpend) > 0 { + for _, e := range m.PeriodCanSpend { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset) + n += 1 + l + sovFeegrant(uint64(l)) + return n +} + +func (m *AllowedMsgAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + if len(m.AllowedMessages) > 0 { + for _, s := range m.AllowedMessages { + l = len(s) + n += 1 + l + sovFeegrant(uint64(l)) + } + } + return n +} + +func (m *Grant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovFeegrant(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovFeegrant(uint64(l)) + } + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + return n +} + +func sovFeegrant(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFeegrant(x uint64) (n int) { + return sovFeegrant(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BasicAllowance) 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 ErrIntOverflowFeegrant + } + 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: BasicAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendLimit = append(m.SpendLimit, types.Coin{}) + if err := m.SpendLimit[len(m.SpendLimit)-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 Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PeriodicAllowance) 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 ErrIntOverflowFeegrant + } + 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: PeriodicAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PeriodicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Period, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodSpendLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeriodSpendLimit = append(m.PeriodSpendLimit, types.Coin{}) + if err := m.PeriodSpendLimit[len(m.PeriodSpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodCanSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeriodCanSpend = append(m.PeriodCanSpend, types.Coin{}) + if err := m.PeriodCanSpend[len(m.PeriodCanSpend)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodReset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PeriodReset, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AllowedMsgAllowance) 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 ErrIntOverflowFeegrant + } + 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: AllowedMsgAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllowedMsgAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Allowance == nil { + m.Allowance = &types1.Any{} + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedMessages", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + 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 ErrInvalidLengthFeegrant + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedMessages = append(m.AllowedMessages, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Grant) 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 ErrIntOverflowFeegrant + } + 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: Grant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + 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 ErrInvalidLengthFeegrant + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + 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 ErrInvalidLengthFeegrant + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Allowance == nil { + m.Allowance = &types1.Any{} + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFeegrant(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, ErrIntOverflowFeegrant + } + 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, ErrIntOverflowFeegrant + } + 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, ErrIntOverflowFeegrant + } + 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, ErrInvalidLengthFeegrant + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFeegrant + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFeegrant + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFeegrant = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFeegrant = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFeegrant = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go new file mode 100644 index 000000000000..2c00644c93f3 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go @@ -0,0 +1,334 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/genesis.proto + +package feegrant + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState contains a set of fee allowances, persisted from the store +type GenesisState struct { + Allowances []Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_ac719d2d0954d1bf, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetAllowances() []Grant { + if m != nil { + return m.Allowances + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.feegrant.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/genesis.proto", fileDescriptor_ac719d2d0954d1bf) +} + +var fileDescriptor_ac719d2d0954d1bf = []byte{ + // 219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x12, 0x87, 0x28, 0xd3, 0x83, 0x29, 0xd3, 0x83, 0x2a, 0x93, 0x12, 0x49, 0xcf, 0x4f, + 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, 0x20, 0xca, 0xa5, 0xd4, 0x70, 0x99, 0x0a, 0xd7, 0x0f, 0x51, + 0x27, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x91, 0x5c, 0x3c, 0xee, + 0x10, 0xab, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x3c, 0xb9, 0xb8, 0x12, 0x73, 0x72, 0xf2, 0xcb, + 0x13, 0xf3, 0x92, 0x53, 0x8b, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xe4, 0xf4, 0x70, 0x38, + 0x47, 0xcf, 0x1d, 0xc4, 0x73, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, + 0x41, 0x48, 0x9a, 0x9d, 0x1c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, + 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, + 0x3d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xea, 0x74, 0x08, 0xa5, + 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x01, 0x77, 0x76, 0x12, 0x1b, 0xd8, 0x91, 0xc6, 0x80, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xd4, 0x41, 0xa3, 0x2b, 0x37, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Allowances) > 0 { + for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Allowances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allowances) > 0 { + for _, e := range m.Allowances { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Allowances = append(m.Allowances, Grant{}) + if err := m.Allowances[len(m.Allowances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go new file mode 100644 index 000000000000..e6bf83de5bbc --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go @@ -0,0 +1,1700 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/query.proto + +package feegrant + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +type QueryAllowanceRequest struct { + // granter is the address of the user granting an allowance of their funds. + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // grantee is the address of the user being granted an allowance of another user's funds. + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *QueryAllowanceRequest) Reset() { *m = QueryAllowanceRequest{} } +func (m *QueryAllowanceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllowanceRequest) ProtoMessage() {} +func (*QueryAllowanceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{0} +} +func (m *QueryAllowanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowanceRequest.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 *QueryAllowanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowanceRequest.Merge(m, src) +} +func (m *QueryAllowanceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowanceRequest proto.InternalMessageInfo + +func (m *QueryAllowanceRequest) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *QueryAllowanceRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +type QueryAllowanceResponse struct { + // allowance is a allowance granted for grantee by granter. + Allowance *Grant `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` +} + +func (m *QueryAllowanceResponse) Reset() { *m = QueryAllowanceResponse{} } +func (m *QueryAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllowanceResponse) ProtoMessage() {} +func (*QueryAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{1} +} +func (m *QueryAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowanceResponse.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 *QueryAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowanceResponse.Merge(m, src) +} +func (m *QueryAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowanceResponse proto.InternalMessageInfo + +func (m *QueryAllowanceResponse) GetAllowance() *Grant { + if m != nil { + return m.Allowance + } + return nil +} + +// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +type QueryAllowancesRequest struct { + Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowancesRequest) Reset() { *m = QueryAllowancesRequest{} } +func (m *QueryAllowancesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllowancesRequest) ProtoMessage() {} +func (*QueryAllowancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{2} +} +func (m *QueryAllowancesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowancesRequest.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 *QueryAllowancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowancesRequest.Merge(m, src) +} +func (m *QueryAllowancesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowancesRequest proto.InternalMessageInfo + +func (m *QueryAllowancesRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *QueryAllowancesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +type QueryAllowancesResponse struct { + // allowances are allowance's granted for grantee by granter. + Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowancesResponse) Reset() { *m = QueryAllowancesResponse{} } +func (m *QueryAllowancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllowancesResponse) ProtoMessage() {} +func (*QueryAllowancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{3} +} +func (m *QueryAllowancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowancesResponse.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 *QueryAllowancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowancesResponse.Merge(m, src) +} +func (m *QueryAllowancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowancesResponse proto.InternalMessageInfo + +func (m *QueryAllowancesResponse) GetAllowances() []*Grant { + if m != nil { + return m.Allowances + } + return nil +} + +func (m *QueryAllowancesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +type QueryAllowancesByGranterRequest struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowancesByGranterRequest) Reset() { *m = QueryAllowancesByGranterRequest{} } +func (m *QueryAllowancesByGranterRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllowancesByGranterRequest) ProtoMessage() {} +func (*QueryAllowancesByGranterRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{4} +} +func (m *QueryAllowancesByGranterRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowancesByGranterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowancesByGranterRequest.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 *QueryAllowancesByGranterRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowancesByGranterRequest.Merge(m, src) +} +func (m *QueryAllowancesByGranterRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowancesByGranterRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowancesByGranterRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowancesByGranterRequest proto.InternalMessageInfo + +func (m *QueryAllowancesByGranterRequest) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *QueryAllowancesByGranterRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +// +// Since: cosmos-sdk 0.46 +type QueryAllowancesByGranterResponse struct { + // allowances that have been issued by the granter. + Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllowancesByGranterResponse) Reset() { *m = QueryAllowancesByGranterResponse{} } +func (m *QueryAllowancesByGranterResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllowancesByGranterResponse) ProtoMessage() {} +func (*QueryAllowancesByGranterResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{5} +} +func (m *QueryAllowancesByGranterResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllowancesByGranterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllowancesByGranterResponse.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 *QueryAllowancesByGranterResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllowancesByGranterResponse.Merge(m, src) +} +func (m *QueryAllowancesByGranterResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllowancesByGranterResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllowancesByGranterResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllowancesByGranterResponse proto.InternalMessageInfo + +func (m *QueryAllowancesByGranterResponse) GetAllowances() []*Grant { + if m != nil { + return m.Allowances + } + return nil +} + +func (m *QueryAllowancesByGranterResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryAllowanceRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowanceRequest") + proto.RegisterType((*QueryAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowanceResponse") + proto.RegisterType((*QueryAllowancesRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesRequest") + proto.RegisterType((*QueryAllowancesResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesResponse") + proto.RegisterType((*QueryAllowancesByGranterRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest") + proto.RegisterType((*QueryAllowancesByGranterResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/query.proto", fileDescriptor_59efc303945de53f) +} + +var fileDescriptor_59efc303945de53f = []byte{ + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xbd, 0x8b, 0x13, 0x41, + 0x18, 0xc6, 0x33, 0xe7, 0x17, 0x79, 0xaf, 0x1b, 0x3f, 0x2e, 0x2e, 0xb2, 0x86, 0x15, 0xee, 0xfc, + 0x20, 0x3b, 0x26, 0xa2, 0x9c, 0x20, 0x07, 0x49, 0x61, 0x5a, 0x8d, 0x60, 0x61, 0x23, 0x93, 0xe4, + 0x75, 0x5d, 0xcc, 0xed, 0xe4, 0x76, 0x36, 0xea, 0x21, 0x87, 0xe0, 0x5f, 0x20, 0x68, 0x2b, 0x82, + 0x85, 0x8d, 0x96, 0xb6, 0xf6, 0x96, 0x87, 0x36, 0x96, 0x92, 0xf8, 0x87, 0x48, 0xe6, 0x63, 0x37, + 0xe6, 0xb2, 0x64, 0x51, 0x0b, 0xab, 0x64, 0x76, 0x9f, 0xe7, 0xdd, 0xdf, 0xf3, 0xbe, 0x33, 0x03, + 0xe7, 0x7a, 0x42, 0x6e, 0x0b, 0xc9, 0x1e, 0x20, 0x06, 0x31, 0x8f, 0x12, 0xf6, 0xb8, 0xde, 0xc5, + 0x84, 0xd7, 0xd9, 0xce, 0x08, 0xe3, 0x5d, 0x7f, 0x18, 0x8b, 0x44, 0xd0, 0x35, 0x2d, 0xf2, 0xad, + 0xc8, 0x37, 0x22, 0x67, 0x3d, 0xcf, 0x9d, 0x2a, 0x55, 0x01, 0xe7, 0xa2, 0xd1, 0x75, 0xb9, 0x44, + 0x5d, 0x39, 0x55, 0x0e, 0x79, 0x10, 0x46, 0x3c, 0x09, 0x45, 0x64, 0xb4, 0x67, 0x02, 0x21, 0x82, + 0x01, 0x32, 0x3e, 0x0c, 0x19, 0x8f, 0x22, 0x91, 0xa8, 0x97, 0xd2, 0xbc, 0x3d, 0xad, 0x2b, 0xdd, + 0x57, 0x2b, 0x66, 0xb8, 0xd4, 0xc2, 0x7b, 0x0e, 0x27, 0x6f, 0x4f, 0x4b, 0x37, 0x07, 0x03, 0xf1, + 0x84, 0x47, 0x3d, 0xec, 0xe0, 0xce, 0x08, 0x65, 0x42, 0x1b, 0x70, 0x4c, 0xc1, 0x60, 0x5c, 0x21, + 0x55, 0x72, 0xbe, 0xdc, 0xaa, 0x7c, 0xfd, 0x54, 0x3b, 0x61, 0xbc, 0xcd, 0x7e, 0x3f, 0x46, 0x29, + 0xef, 0x24, 0x71, 0x18, 0x05, 0x1d, 0x2b, 0xcc, 0x3c, 0x58, 0x59, 0x29, 0xe6, 0x41, 0xef, 0x2e, + 0x9c, 0x9a, 0x07, 0x90, 0x43, 0x11, 0x49, 0xa4, 0x37, 0xa0, 0xcc, 0xed, 0x43, 0xc5, 0xb0, 0xda, + 0x70, 0xfd, 0x9c, 0xa6, 0xfa, 0xed, 0xe9, 0xaa, 0x93, 0x19, 0xbc, 0xd7, 0x64, 0xbe, 0xb0, 0x3c, + 0x10, 0x0d, 0x8b, 0x46, 0x43, 0x7a, 0x13, 0x20, 0x6b, 0xba, 0x4a, 0xb7, 0xda, 0x58, 0xb7, 0x34, + 0xd3, 0x09, 0xf9, 0x7a, 0xf6, 0x96, 0xe7, 0x16, 0x0f, 0x6c, 0x2b, 0x3b, 0x33, 0x4e, 0xef, 0x1d, + 0x81, 0xb5, 0x03, 0x58, 0x26, 0xf0, 0x16, 0x40, 0xca, 0x2f, 0x2b, 0xa4, 0x7a, 0xa8, 0x40, 0xe2, + 0x19, 0x07, 0x6d, 0x2f, 0x60, 0xdc, 0x58, 0xca, 0xa8, 0x3f, 0xfe, 0x1b, 0xe4, 0x1b, 0x02, 0x67, + 0xe7, 0x20, 0x5b, 0xbb, 0x6d, 0x3d, 0xe4, 0xbf, 0xd9, 0x1f, 0xff, 0xaa, 0x89, 0x1f, 0x08, 0x54, + 0xf3, 0xf9, 0xfe, 0xb3, 0x6e, 0x36, 0xde, 0x1e, 0x86, 0x23, 0x8a, 0x96, 0x7e, 0x24, 0x50, 0x4e, + 0x91, 0xa9, 0x9f, 0x0b, 0xb3, 0xf0, 0x44, 0x3a, 0xac, 0xb0, 0x5e, 0x43, 0x78, 0x5b, 0x2f, 0xbe, + 0xfd, 0x7c, 0xb5, 0xb2, 0x49, 0xaf, 0xb1, 0xbc, 0x1b, 0x27, 0x8d, 0xcb, 0x9e, 0x99, 0x19, 0xed, + 0xd9, 0x7f, 0xb8, 0x47, 0xdf, 0x13, 0x80, 0xac, 0xc3, 0xb4, 0xe8, 0xf7, 0xed, 0x39, 0x73, 0x2e, + 0x17, 0x37, 0x18, 0xe2, 0xab, 0x8a, 0x98, 0xd1, 0xda, 0x72, 0x62, 0x39, 0x03, 0xfa, 0x99, 0xc0, + 0xf1, 0x05, 0x5b, 0x81, 0x6e, 0x16, 0x05, 0x98, 0xdf, 0xdd, 0xce, 0xf5, 0x3f, 0x70, 0x9a, 0x0c, + 0x75, 0x95, 0xe1, 0x12, 0xbd, 0x90, 0x9b, 0x21, 0x94, 0x72, 0x84, 0xfd, 0xac, 0xe5, 0xad, 0xe6, + 0x97, 0xb1, 0x4b, 0xf6, 0xc7, 0x2e, 0xf9, 0x31, 0x76, 0xc9, 0xcb, 0x89, 0x5b, 0xda, 0x9f, 0xb8, + 0xa5, 0xef, 0x13, 0xb7, 0x74, 0x6f, 0x23, 0x08, 0x93, 0x87, 0xa3, 0xae, 0xdf, 0x13, 0xdb, 0xb6, + 0x9c, 0xfe, 0xa9, 0xc9, 0xfe, 0x23, 0xf6, 0x34, 0xad, 0xdd, 0x3d, 0xaa, 0xae, 0xf3, 0x2b, 0xbf, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xde, 0x8f, 0xb5, 0x9b, 0x06, 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 { + // Allowance returns fee granted to the grantee by the granter. + Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) + // Allowances returns all the grants for address. + Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) + // AllowancesByGranter returns all the grants given by an address + // + // Since: cosmos-sdk 0.46 + AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) { + out := new(QueryAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/Allowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) { + out := new(QueryAllowancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/Allowances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error) { + out := new(QueryAllowancesByGranterResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Allowance returns fee granted to the grantee by the granter. + Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) + // Allowances returns all the grants for address. + Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) + // AllowancesByGranter returns all the grants given by an address + // + // Since: cosmos-sdk 0.46 + AllowancesByGranter(context.Context, *QueryAllowancesByGranterRequest) (*QueryAllowancesByGranterResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Allowance(ctx context.Context, req *QueryAllowanceRequest) (*QueryAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Allowance not implemented") +} +func (*UnimplementedQueryServer) Allowances(ctx context.Context, req *QueryAllowancesRequest) (*QueryAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Allowances not implemented") +} +func (*UnimplementedQueryServer) AllowancesByGranter(ctx context.Context, req *QueryAllowancesByGranterRequest) (*QueryAllowancesByGranterResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowancesByGranter not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Allowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllowanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Allowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Query/Allowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Allowance(ctx, req.(*QueryAllowanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Allowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllowancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Allowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Query/Allowances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Allowances(ctx, req.(*QueryAllowancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllowancesByGranter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllowancesByGranterRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllowancesByGranter(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllowancesByGranter(ctx, req.(*QueryAllowancesByGranterRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.feegrant.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Allowance", + Handler: _Query_Allowance_Handler, + }, + { + MethodName: "Allowances", + Handler: _Query_Allowances_Handler, + }, + { + MethodName: "AllowancesByGranter", + Handler: _Query_AllowancesByGranter_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/feegrant/v1beta1/query.proto", +} + +func (m *QueryAllowanceRequest) 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 *QueryAllowanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllowanceResponse) 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 *QueryAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Allowance != nil { + { + size, err := m.Allowance.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 *QueryAllowancesRequest) 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 *QueryAllowancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowancesRequest) 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.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllowancesResponse) 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 *QueryAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowancesResponse) 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.Allowances) > 0 { + for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Allowances[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 *QueryAllowancesByGranterRequest) 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 *QueryAllowancesByGranterRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowancesByGranterRequest) 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.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllowancesByGranterResponse) 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 *QueryAllowancesByGranterResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllowancesByGranterResponse) 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.Allowances) > 0 { + for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Allowances[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 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 *QueryAllowanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowancesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allowances) > 0 { + for _, e := range m.Allowances { + 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 *QueryAllowancesByGranterRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllowancesByGranterResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Allowances) > 0 { + for _, e := range m.Allowances { + 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 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 *QueryAllowanceRequest) 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: QueryAllowanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowanceResponse) 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: QueryAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", 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.Allowance == nil { + m.Allowance = &Grant{} + } + if err := m.Allowance.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowancesRequest) 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: QueryAllowancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowancesResponse) 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: QueryAllowancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowances", 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.Allowances = append(m.Allowances, &Grant{}) + if err := m.Allowances[len(m.Allowances)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowancesByGranterRequest) 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: QueryAllowancesByGranterRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowancesByGranterRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllowancesByGranterResponse) 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: QueryAllowancesByGranterResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllowancesByGranterResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowances", 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.Allowances = append(m.Allowances, &Grant{}) + if err := m.Allowances[len(m.Allowances)-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) || (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/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go new file mode 100644 index 000000000000..a34118fd88a5 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go @@ -0,0 +1,449 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/query.proto + +/* +Package feegrant is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package feegrant + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Allowance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + msg, err := client.Allowance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Allowance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + msg, err := server.Allowance(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Allowances_0 = &utilities.DoubleArray{Encoding: map[string]int{"grantee": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Allowances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Allowances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Allowances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Allowances(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllowancesByGranter_0 = &utilities.DoubleArray{Encoding: map[string]int{"granter": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_AllowancesByGranter_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowancesByGranterRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowancesByGranter_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllowancesByGranter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllowancesByGranter_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllowancesByGranterRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowancesByGranter_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllowancesByGranter(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Allowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Allowance_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Allowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Allowances_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllowancesByGranter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllowancesByGranter_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllowancesByGranter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Allowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Allowance_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Allowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Allowances_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllowancesByGranter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AllowancesByGranter_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllowancesByGranter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Allowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "feegrant", "v1beta1", "allowance", "granter", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Allowances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "feegrant", "v1beta1", "allowances", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllowancesByGranter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "feegrant", "v1beta1", "issued", "granter"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Allowance_0 = runtime.ForwardResponseMessage + + forward_Query_Allowances_0 = runtime.ForwardResponseMessage + + forward_Query_AllowancesByGranter_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go new file mode 100644 index 000000000000..4b9ea6ad8a6f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go @@ -0,0 +1,1043 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/tx.proto + +package feegrant + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + 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 + +// MsgGrantAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +type MsgGrantAllowance struct { + // granter is the address of the user granting an allowance of their funds. + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // grantee is the address of the user being granted an allowance of another user's funds. + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + // allowance can be any of basic, periodic, allowed fee allowance. + Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` +} + +func (m *MsgGrantAllowance) Reset() { *m = MsgGrantAllowance{} } +func (m *MsgGrantAllowance) String() string { return proto.CompactTextString(m) } +func (*MsgGrantAllowance) ProtoMessage() {} +func (*MsgGrantAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{0} +} +func (m *MsgGrantAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrantAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrantAllowance.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 *MsgGrantAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantAllowance.Merge(m, src) +} +func (m *MsgGrantAllowance) XXX_Size() int { + return m.Size() +} +func (m *MsgGrantAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrantAllowance proto.InternalMessageInfo + +func (m *MsgGrantAllowance) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *MsgGrantAllowance) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *MsgGrantAllowance) GetAllowance() *types.Any { + if m != nil { + return m.Allowance + } + return nil +} + +// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +type MsgGrantAllowanceResponse struct { +} + +func (m *MsgGrantAllowanceResponse) Reset() { *m = MsgGrantAllowanceResponse{} } +func (m *MsgGrantAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGrantAllowanceResponse) ProtoMessage() {} +func (*MsgGrantAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{1} +} +func (m *MsgGrantAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrantAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrantAllowanceResponse.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 *MsgGrantAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantAllowanceResponse.Merge(m, src) +} +func (m *MsgGrantAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGrantAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrantAllowanceResponse proto.InternalMessageInfo + +// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +type MsgRevokeAllowance struct { + // granter is the address of the user granting an allowance of their funds. + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + // grantee is the address of the user being granted an allowance of another user's funds. + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *MsgRevokeAllowance) Reset() { *m = MsgRevokeAllowance{} } +func (m *MsgRevokeAllowance) String() string { return proto.CompactTextString(m) } +func (*MsgRevokeAllowance) ProtoMessage() {} +func (*MsgRevokeAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{2} +} +func (m *MsgRevokeAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevokeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevokeAllowance.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 *MsgRevokeAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevokeAllowance.Merge(m, src) +} +func (m *MsgRevokeAllowance) XXX_Size() int { + return m.Size() +} +func (m *MsgRevokeAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevokeAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevokeAllowance proto.InternalMessageInfo + +func (m *MsgRevokeAllowance) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *MsgRevokeAllowance) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +type MsgRevokeAllowanceResponse struct { +} + +func (m *MsgRevokeAllowanceResponse) Reset() { *m = MsgRevokeAllowanceResponse{} } +func (m *MsgRevokeAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRevokeAllowanceResponse) ProtoMessage() {} +func (*MsgRevokeAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{3} +} +func (m *MsgRevokeAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevokeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevokeAllowanceResponse.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 *MsgRevokeAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevokeAllowanceResponse.Merge(m, src) +} +func (m *MsgRevokeAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRevokeAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevokeAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevokeAllowanceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgGrantAllowance)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowance") + proto.RegisterType((*MsgGrantAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse") + proto.RegisterType((*MsgRevokeAllowance)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowance") + proto.RegisterType((*MsgRevokeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse") +} + +func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } + +var fileDescriptor_dd44ad7946dad783 = []byte{ + // 416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, + 0xd0, 0x83, 0xa9, 0xd0, 0x83, 0xaa, 0x90, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, + 0x2b, 0x4b, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xe8, 0x91, 0x92, 0x84, 0xe8, 0x89, 0x07, + 0xf3, 0xf4, 0xa1, 0x06, 0x40, 0xa4, 0xa0, 0xc6, 0xe9, 0xe7, 0x16, 0xa7, 0xeb, 0x97, 0x19, 0x82, + 0x28, 0xa8, 0x84, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x08, 0x29, 0x75, 0x32, + 0x71, 0x09, 0xfa, 0x16, 0xa7, 0xbb, 0x83, 0xac, 0x75, 0xcc, 0xc9, 0xc9, 0x2f, 0x4f, 0xcc, 0x4b, + 0x4e, 0x15, 0x32, 0xe2, 0x62, 0x07, 0x3b, 0x24, 0xb5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, + 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x25, 0x8e, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0xc1, + 0x25, 0x45, 0x99, 0x79, 0xe9, 0x41, 0x30, 0x85, 0x08, 0x3d, 0xa9, 0x12, 0x4c, 0xc4, 0xe9, 0x49, + 0x15, 0x8a, 0xe5, 0xe2, 0x4c, 0x84, 0x59, 0x2a, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa2, + 0x07, 0xf1, 0xb3, 0x1e, 0xcc, 0xcf, 0x7a, 0x8e, 0x79, 0x95, 0x4e, 0x9a, 0xa7, 0xb6, 0xe8, 0xaa, + 0xe2, 0x08, 0x25, 0x3d, 0xb7, 0xd4, 0x54, 0xb8, 0xd3, 0x3d, 0x83, 0x10, 0x26, 0x5a, 0xe9, 0x36, + 0x3d, 0xdf, 0xa0, 0x05, 0x73, 0x60, 0xd7, 0xf3, 0x0d, 0x5a, 0x32, 0x10, 0x23, 0x74, 0x8b, 0x53, + 0xb2, 0xf5, 0x31, 0x7c, 0xad, 0x24, 0xcd, 0x25, 0x89, 0x21, 0x18, 0x94, 0x5a, 0x5c, 0x90, 0x9f, + 0x57, 0x9c, 0xaa, 0xb4, 0x86, 0x91, 0x4b, 0xc8, 0xb7, 0x38, 0x3d, 0x28, 0xb5, 0x2c, 0x3f, 0x3b, + 0x95, 0xee, 0x21, 0x65, 0xa5, 0x87, 0xee, 0x15, 0x59, 0x54, 0xaf, 0xa0, 0xb9, 0x4b, 0x49, 0x86, + 0x4b, 0x0a, 0x53, 0x14, 0xe6, 0x19, 0xa3, 0xcf, 0x8c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x05, + 0x5c, 0x7c, 0x68, 0x31, 0xaf, 0xa5, 0x87, 0x2b, 0x94, 0x31, 0x82, 0x46, 0xca, 0x88, 0x78, 0xb5, + 0x30, 0x9b, 0x85, 0x8a, 0xb9, 0xf8, 0xd1, 0x83, 0x50, 0x1b, 0x9f, 0x31, 0x68, 0x8a, 0xa5, 0x8c, + 0x49, 0x50, 0x0c, 0xb3, 0x54, 0x8a, 0xb5, 0xe1, 0xf9, 0x06, 0x2d, 0x46, 0x27, 0xc7, 0x13, 0x8f, + 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, + 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, + 0x4b, 0xce, 0xcf, 0x85, 0x66, 0x25, 0x7d, 0xa4, 0xe0, 0xad, 0x80, 0x67, 0xdd, 0x24, 0x36, 0x70, + 0xaa, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x31, 0x95, 0xae, 0xd4, 0x03, 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 { + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error) + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error) { + out := new(MsgGrantAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) { + out := new(MsgRevokeAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // GrantAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + GrantAllowance(context.Context, *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error) + // RevokeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) GrantAllowance(ctx context.Context, req *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GrantAllowance not implemented") +} +func (*UnimplementedMsgServer) RevokeAllowance(ctx context.Context, req *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeAllowance not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_GrantAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGrantAllowance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GrantAllowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GrantAllowance(ctx, req.(*MsgGrantAllowance)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RevokeAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRevokeAllowance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RevokeAllowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RevokeAllowance(ctx, req.(*MsgRevokeAllowance)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.feegrant.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GrantAllowance", + Handler: _Msg_GrantAllowance_Handler, + }, + { + MethodName: "RevokeAllowance", + Handler: _Msg_RevokeAllowance_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/feegrant/v1beta1/tx.proto", +} + +func (m *MsgGrantAllowance) 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 *MsgGrantAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrantAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Allowance != nil { + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGrantAllowanceResponse) 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 *MsgGrantAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrantAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRevokeAllowance) 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 *MsgRevokeAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevokeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRevokeAllowanceResponse) 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 *MsgRevokeAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevokeAllowanceResponse) 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 *MsgGrantAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgGrantAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRevokeAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRevokeAllowanceResponse) 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 *MsgGrantAllowance) 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: MsgGrantAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrantAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", 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 m.Allowance == nil { + m.Allowance = &types.Any{} + } + if err := m.Allowance.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 *MsgGrantAllowanceResponse) 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: MsgGrantAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrantAllowanceResponse: 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 *MsgRevokeAllowance) 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: MsgRevokeAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevokeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) + 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 *MsgRevokeAllowanceResponse) 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: MsgRevokeAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevokeAllowanceResponse: 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") +) diff --git a/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go new file mode 100644 index 000000000000..ca3ee3fed20f --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go @@ -0,0 +1,331 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/genutil/v1beta1/genesis.proto + +package types + +import ( + encoding_json "encoding/json" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the raw genesis transaction in JSON. +type GenesisState struct { + // gen_txs defines the genesis transactions. + GenTxs []encoding_json.RawMessage `protobuf:"bytes,1,rep,name=gen_txs,json=genTxs,proto3,casttype=encoding/json.RawMessage" json:"gentxs"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_31771d25e8d8f90f, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetGenTxs() []encoding_json.RawMessage { + if m != nil { + return m.GenTxs + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.genutil.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/genutil/v1beta1/genesis.proto", fileDescriptor_31771d25e8d8f90f) +} + +var fileDescriptor_31771d25e8d8f90f = []byte{ + // 244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4f, 0xcd, 0x2b, 0x2d, 0xc9, 0xcc, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0x04, 0xf1, 0x53, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xc4, + 0x20, 0xaa, 0xf4, 0xa0, 0xaa, 0xf4, 0xa0, 0xaa, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, + 0xf4, 0x41, 0x2c, 0x88, 0x6a, 0x29, 0xc1, 0xc4, 0xdc, 0xcc, 0xbc, 0x7c, 0x7d, 0x30, 0x09, 0x11, + 0x52, 0x8a, 0xe7, 0xe2, 0x71, 0x87, 0x98, 0x18, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xcf, 0xc5, + 0x9e, 0x9e, 0x9a, 0x17, 0x5f, 0x52, 0x51, 0x2c, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0xe3, 0x64, 0xf6, + 0xea, 0x9e, 0x3c, 0x5b, 0x7a, 0x6a, 0x5e, 0x49, 0x45, 0xf1, 0xaf, 0x7b, 0xf2, 0x12, 0xa9, 0x79, + 0xc9, 0xf9, 0x29, 0x99, 0x79, 0xe9, 0xfa, 0x59, 0xc5, 0xf9, 0x79, 0x7a, 0x41, 0x89, 0xe5, 0xbe, + 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x8b, 0x9e, 0x6f, 0xd0, 0x82, 0x2a, 0x5b, 0xf1, 0x7c, 0x83, + 0x16, 0x63, 0x10, 0x88, 0x13, 0x52, 0x51, 0xec, 0xe4, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, + 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, + 0xc7, 0x72, 0x0c, 0x51, 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, + 0x50, 0xcf, 0x42, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0xb8, 0xcf, 0x4b, 0x2a, 0x0b, 0x52, + 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x4e, 0x6d, 0x9e, + 0x18, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.GenTxs) > 0 { + for iNdEx := len(m.GenTxs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GenTxs[iNdEx]) + copy(dAtA[i:], m.GenTxs[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.GenTxs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.GenTxs) > 0 { + for _, b := range m.GenTxs { + l = len(b) + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenTxs", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenTxs = append(m.GenTxs, make([]byte, postIndex-iNdEx)) + copy(m.GenTxs[len(m.GenTxs)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go new file mode 100644 index 000000000000..dac10386d51d --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go @@ -0,0 +1,754 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1/genesis.proto + +package v1 + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the gov module's genesis state. +type GenesisState struct { + // starting_proposal_id is the ID of the starting proposal. + StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` + // deposits defines all the deposits present at genesis. + Deposits []*Deposit `protobuf:"bytes,2,rep,name=deposits,proto3" json:"deposits,omitempty"` + // votes defines all the votes present at genesis. + Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` + // proposals defines all the proposals present at genesis. + Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` + // Deprecated: Prefer to use `params` instead. + // deposit_params defines all the paramaters of related to deposit. + DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // voting_params defines all the paramaters of related to voting. + VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // tally_params defines all the paramaters of related to tally. + TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_ef7cfd15e3ded621, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetStartingProposalId() uint64 { + if m != nil { + return m.StartingProposalId + } + return 0 +} + +func (m *GenesisState) GetDeposits() []*Deposit { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *GenesisState) GetVotes() []*Vote { + if m != nil { + return m.Votes + } + return nil +} + +func (m *GenesisState) GetProposals() []*Proposal { + if m != nil { + return m.Proposals + } + return nil +} + +// Deprecated: Do not use. +func (m *GenesisState) GetDepositParams() *DepositParams { + if m != nil { + return m.DepositParams + } + return nil +} + +// Deprecated: Do not use. +func (m *GenesisState) GetVotingParams() *VotingParams { + if m != nil { + return m.VotingParams + } + return nil +} + +// Deprecated: Do not use. +func (m *GenesisState) GetTallyParams() *TallyParams { + if m != nil { + return m.TallyParams + } + return nil +} + +func (m *GenesisState) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } + +var fileDescriptor_ef7cfd15e3ded621 = []byte{ + // 358 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4e, 0xfa, 0x40, + 0x14, 0xc5, 0x19, 0xbe, 0xfe, 0xfc, 0x07, 0x70, 0x31, 0x7e, 0xd0, 0x80, 0x69, 0x88, 0x2b, 0x8c, + 0xa1, 0x15, 0x8c, 0x0f, 0x20, 0xc1, 0x10, 0x77, 0xa4, 0x1a, 0x17, 0x6e, 0x48, 0xa1, 0x93, 0xda, + 0x08, 0xdc, 0xa6, 0x77, 0x9c, 0xc8, 0x5b, 0xf8, 0x58, 0x2e, 0xd9, 0xe9, 0xd2, 0xc0, 0x8b, 0x18, + 0x66, 0x5a, 0xc1, 0xea, 0x6a, 0x92, 0x7b, 0x7e, 0xe7, 0xcc, 0xc9, 0xcd, 0xa5, 0x8d, 0x09, 0xe0, + 0x0c, 0xd0, 0xf6, 0x41, 0xda, 0xb2, 0x63, 0xfb, 0x7c, 0xce, 0x31, 0x40, 0x2b, 0x8c, 0x40, 0x00, + 0xab, 0x6a, 0xd1, 0xf2, 0x41, 0x5a, 0xb2, 0x53, 0xaf, 0xa5, 0x58, 0x90, 0x9a, 0x3b, 0x79, 0xcf, + 0xd1, 0xca, 0x40, 0x3b, 0x6f, 0x85, 0x2b, 0x38, 0x3b, 0xa7, 0x07, 0x28, 0xdc, 0x48, 0x04, 0x73, + 0x7f, 0x14, 0x46, 0x10, 0x02, 0xba, 0xd3, 0x51, 0xe0, 0x19, 0xa4, 0x49, 0x5a, 0x79, 0x87, 0x25, + 0xda, 0x30, 0x96, 0x6e, 0x3c, 0xd6, 0xa5, 0x25, 0x8f, 0x87, 0x80, 0x81, 0x40, 0x23, 0xdb, 0xcc, + 0xb5, 0xca, 0xdd, 0x23, 0xeb, 0xc7, 0xef, 0x56, 0x5f, 0xcb, 0xce, 0x37, 0xc7, 0x4e, 0x69, 0x41, + 0x82, 0xe0, 0x68, 0xe4, 0x94, 0x61, 0x3f, 0x65, 0xb8, 0x07, 0xc1, 0x1d, 0x4d, 0xb0, 0x4b, 0xfa, + 0x3f, 0xe9, 0x81, 0x46, 0x5e, 0xe1, 0xb5, 0x14, 0x9e, 0x94, 0x71, 0xb6, 0x24, 0x1b, 0xd0, 0xbd, + 0xf8, 0xb7, 0x51, 0xe8, 0x46, 0xee, 0x0c, 0x8d, 0x42, 0x93, 0xb4, 0xca, 0xdd, 0xe3, 0xbf, 0xbb, + 0x0d, 0x15, 0xd3, 0xcb, 0x1a, 0xc4, 0xa9, 0x7a, 0xbb, 0x23, 0xd6, 0xa7, 0x55, 0x09, 0x7a, 0x1d, + 0x3a, 0xa7, 0xa8, 0x72, 0x1a, 0xbf, 0x2b, 0x6f, 0xd6, 0xb2, 0x8d, 0xa9, 0xc8, 0x9d, 0x09, 0xbb, + 0xa2, 0x15, 0xe1, 0x4e, 0xa7, 0x8b, 0x24, 0xe4, 0x9f, 0x0a, 0xa9, 0xa7, 0x42, 0xee, 0x36, 0xc8, + 0x4e, 0x46, 0x59, 0x6c, 0x07, 0xac, 0x4d, 0x8b, 0xb1, 0xb9, 0xa4, 0xcc, 0x87, 0xe9, 0x2d, 0x28, + 0xd1, 0x89, 0xa1, 0xde, 0xf5, 0xdb, 0xca, 0x24, 0xcb, 0x95, 0x49, 0x3e, 0x57, 0x26, 0x79, 0x5d, + 0x9b, 0x99, 0xe5, 0xda, 0xcc, 0x7c, 0xac, 0xcd, 0xcc, 0xc3, 0x99, 0x1f, 0x88, 0xc7, 0xe7, 0xb1, + 0x35, 0x81, 0x99, 0x1d, 0xdf, 0x85, 0x7e, 0xda, 0xe8, 0x3d, 0xd9, 0x2f, 0xea, 0x48, 0xc4, 0x22, + 0xe4, 0x68, 0xcb, 0xce, 0xb8, 0xa8, 0xee, 0xe4, 0xe2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb2, + 0x17, 0xb2, 0x6e, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.TallyParams != nil { + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.VotingParams != nil { + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.DepositParams != nil { + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.StartingProposalId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartingProposalId != 0 { + n += 1 + sovGenesis(uint64(m.StartingProposalId)) + } + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.DepositParams != nil { + l = m.DepositParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.VotingParams != nil { + l = m.VotingParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.TallyParams != nil { + l = m.TallyParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) + } + m.StartingProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartingProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposits = append(m.Deposits, &Deposit{}) + if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Votes = append(m.Votes, &Vote{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposals = append(m.Proposals, &Proposal{}) + if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DepositParams == nil { + m.DepositParams = &DepositParams{} + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingParams == nil { + m.VotingParams = &VotingParams{} + } + if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TallyParams == nil { + m.TallyParams = &TallyParams{} + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + 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 ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go new file mode 100644 index 000000000000..747eab5c4ca6 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go @@ -0,0 +1,3618 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1/gov.proto + +package v1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types1 "github.com/cosmos/cosmos-sdk/codec/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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 + +// VoteOption enumerates the valid vote options for a given governance proposal. +type VoteOption int32 + +const ( + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 + // VOTE_OPTION_YES defines a yes vote option. + VoteOption_VOTE_OPTION_YES VoteOption = 1 + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 + // VOTE_OPTION_NO defines a no vote option. + VoteOption_VOTE_OPTION_NO VoteOption = 3 + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 +) + +var VoteOption_name = map[int32]string{ + 0: "VOTE_OPTION_UNSPECIFIED", + 1: "VOTE_OPTION_YES", + 2: "VOTE_OPTION_ABSTAIN", + 3: "VOTE_OPTION_NO", + 4: "VOTE_OPTION_NO_WITH_VETO", +} + +var VoteOption_value = map[string]int32{ + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_YES": 1, + "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_NO": 3, + "VOTE_OPTION_NO_WITH_VETO": 4, +} + +func (x VoteOption) String() string { + return proto.EnumName(VoteOption_name, int32(x)) +} + +func (VoteOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{0} +} + +// ProposalStatus enumerates the valid statuses of a proposal. +type ProposalStatus int32 + +const ( + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 +) + +var ProposalStatus_name = map[int32]string{ + 0: "PROPOSAL_STATUS_UNSPECIFIED", + 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", + 2: "PROPOSAL_STATUS_VOTING_PERIOD", + 3: "PROPOSAL_STATUS_PASSED", + 4: "PROPOSAL_STATUS_REJECTED", + 5: "PROPOSAL_STATUS_FAILED", +} + +var ProposalStatus_value = map[string]int32{ + "PROPOSAL_STATUS_UNSPECIFIED": 0, + "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, + "PROPOSAL_STATUS_VOTING_PERIOD": 2, + "PROPOSAL_STATUS_PASSED": 3, + "PROPOSAL_STATUS_REJECTED": 4, + "PROPOSAL_STATUS_FAILED": 5, +} + +func (x ProposalStatus) String() string { + return proto.EnumName(ProposalStatus_name, int32(x)) +} + +func (ProposalStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{1} +} + +// WeightedVoteOption defines a unit of vote for vote split. +type WeightedVoteOption struct { + // option defines the valid vote options, it must not contain duplicate vote options. + Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` + // weight is the vote weight associated with the vote option. + Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` +} + +func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } +func (m *WeightedVoteOption) String() string { return proto.CompactTextString(m) } +func (*WeightedVoteOption) ProtoMessage() {} +func (*WeightedVoteOption) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{0} +} +func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WeightedVoteOption.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 *WeightedVoteOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_WeightedVoteOption.Merge(m, src) +} +func (m *WeightedVoteOption) XXX_Size() int { + return m.Size() +} +func (m *WeightedVoteOption) XXX_DiscardUnknown() { + xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) +} + +var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo + +func (m *WeightedVoteOption) GetOption() VoteOption { + if m != nil { + return m.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} + +func (m *WeightedVoteOption) GetWeight() string { + if m != nil { + return m.Weight + } + return "" +} + +// Deposit defines an amount deposited by an account address to an active +// proposal. +type Deposit struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount to be deposited by depositor. + Amount []types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` +} + +func (m *Deposit) Reset() { *m = Deposit{} } +func (m *Deposit) String() string { return proto.CompactTextString(m) } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{1} +} +func (m *Deposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Deposit.Merge(m, src) +} +func (m *Deposit) XXX_Size() int { + return m.Size() +} +func (m *Deposit) XXX_DiscardUnknown() { + xxx_messageInfo_Deposit.DiscardUnknown(m) +} + +var xxx_messageInfo_Deposit proto.InternalMessageInfo + +func (m *Deposit) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *Deposit) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *Deposit) GetAmount() []types.Coin { + if m != nil { + return m.Amount + } + return nil +} + +// Proposal defines the core field members of a governance proposal. +type Proposal struct { + // id defines the unique id of the proposal. + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // messages are the arbitrary messages to be executed if the proposal passes. + Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` + // status defines the proposal status. + Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"status,omitempty"` + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"` + // submit_time is the time of proposal submission. + SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"` + // deposit_end_time is the end time for deposition. + DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"` + // total_deposit is the total deposit on the proposal. + TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"` + // voting_start_time is the starting time to vote on a proposal. + VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` + // voting_end_time is the end time of voting on a proposal. + VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` + // metadata is any arbitrary metadata attached to the proposal. + Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` + // title is the title of the proposal + // + // Since: cosmos-sdk 0.47 + Title string `protobuf:"bytes,11,opt,name=title,proto3" json:"title,omitempty"` + // summary is a short summary of the proposal + // + // Since: cosmos-sdk 0.47 + Summary string `protobuf:"bytes,12,opt,name=summary,proto3" json:"summary,omitempty"` + // Proposer is the address of the proposal sumbitter + // + // Since: cosmos-sdk 0.47 + Proposer string `protobuf:"bytes,13,opt,name=proposer,proto3" json:"proposer,omitempty"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (m *Proposal) String() string { return proto.CompactTextString(m) } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{2} +} +func (m *Proposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal.Merge(m, src) +} +func (m *Proposal) XXX_Size() int { + return m.Size() +} +func (m *Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal proto.InternalMessageInfo + +func (m *Proposal) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *Proposal) GetMessages() []*types1.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *Proposal) GetStatus() ProposalStatus { + if m != nil { + return m.Status + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (m *Proposal) GetFinalTallyResult() *TallyResult { + if m != nil { + return m.FinalTallyResult + } + return nil +} + +func (m *Proposal) GetSubmitTime() *time.Time { + if m != nil { + return m.SubmitTime + } + return nil +} + +func (m *Proposal) GetDepositEndTime() *time.Time { + if m != nil { + return m.DepositEndTime + } + return nil +} + +func (m *Proposal) GetTotalDeposit() []types.Coin { + if m != nil { + return m.TotalDeposit + } + return nil +} + +func (m *Proposal) GetVotingStartTime() *time.Time { + if m != nil { + return m.VotingStartTime + } + return nil +} + +func (m *Proposal) GetVotingEndTime() *time.Time { + if m != nil { + return m.VotingEndTime + } + return nil +} + +func (m *Proposal) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +func (m *Proposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Proposal) GetSummary() string { + if m != nil { + return m.Summary + } + return "" +} + +func (m *Proposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + +// TallyResult defines a standard tally for a governance proposal. +type TallyResult struct { + // yes_count is the number of yes votes on a proposal. + YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"` + // abstain_count is the number of abstain votes on a proposal. + AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"` + // no_count is the number of no votes on a proposal. + NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` + // no_with_veto_count is the number of no with veto votes on a proposal. + NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` +} + +func (m *TallyResult) Reset() { *m = TallyResult{} } +func (m *TallyResult) String() string { return proto.CompactTextString(m) } +func (*TallyResult) ProtoMessage() {} +func (*TallyResult) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{3} +} +func (m *TallyResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyResult.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 *TallyResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyResult.Merge(m, src) +} +func (m *TallyResult) XXX_Size() int { + return m.Size() +} +func (m *TallyResult) XXX_DiscardUnknown() { + xxx_messageInfo_TallyResult.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyResult proto.InternalMessageInfo + +func (m *TallyResult) GetYesCount() string { + if m != nil { + return m.YesCount + } + return "" +} + +func (m *TallyResult) GetAbstainCount() string { + if m != nil { + return m.AbstainCount + } + return "" +} + +func (m *TallyResult) GetNoCount() string { + if m != nil { + return m.NoCount + } + return "" +} + +func (m *TallyResult) GetNoWithVetoCount() string { + if m != nil { + return m.NoWithVetoCount + } + return "" +} + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +type Vote struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter is the voter address of the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // options is the weighted vote options. + Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` + // metadata is any arbitrary metadata to attached to the vote. + Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (m *Vote) String() string { return proto.CompactTextString(m) } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{4} +} +func (m *Vote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { + xxx_messageInfo_Vote.Merge(m, src) +} +func (m *Vote) XXX_Size() int { + return m.Size() +} +func (m *Vote) XXX_DiscardUnknown() { + xxx_messageInfo_Vote.DiscardUnknown(m) +} + +var xxx_messageInfo_Vote proto.InternalMessageInfo + +func (m *Vote) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *Vote) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *Vote) GetOptions() []*WeightedVoteOption { + if m != nil { + return m.Options + } + return nil +} + +func (m *Vote) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +// DepositParams defines the params for deposits on governance proposals. +type DepositParams struct { + // Minimum deposit for a proposal to enter voting period. + MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` +} + +func (m *DepositParams) Reset() { *m = DepositParams{} } +func (m *DepositParams) String() string { return proto.CompactTextString(m) } +func (*DepositParams) ProtoMessage() {} +func (*DepositParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{5} +} +func (m *DepositParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositParams.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 *DepositParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositParams.Merge(m, src) +} +func (m *DepositParams) XXX_Size() int { + return m.Size() +} +func (m *DepositParams) XXX_DiscardUnknown() { + xxx_messageInfo_DepositParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositParams proto.InternalMessageInfo + +func (m *DepositParams) GetMinDeposit() []types.Coin { + if m != nil { + return m.MinDeposit + } + return nil +} + +func (m *DepositParams) GetMaxDepositPeriod() *time.Duration { + if m != nil { + return m.MaxDepositPeriod + } + return nil +} + +// VotingParams defines the params for voting on governance proposals. +type VotingParams struct { + // Duration of the voting period. + VotingPeriod *time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` +} + +func (m *VotingParams) Reset() { *m = VotingParams{} } +func (m *VotingParams) String() string { return proto.CompactTextString(m) } +func (*VotingParams) ProtoMessage() {} +func (*VotingParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{6} +} +func (m *VotingParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingParams.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 *VotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingParams.Merge(m, src) +} +func (m *VotingParams) XXX_Size() int { + return m.Size() +} +func (m *VotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_VotingParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingParams proto.InternalMessageInfo + +func (m *VotingParams) GetVotingPeriod() *time.Duration { + if m != nil { + return m.VotingPeriod + } + return nil +} + +// TallyParams defines the params for tallying votes on governance proposals. +type TallyParams struct { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + VetoThreshold string `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` +} + +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (m *TallyParams) String() string { return proto.CompactTextString(m) } +func (*TallyParams) ProtoMessage() {} +func (*TallyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{7} +} +func (m *TallyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyParams.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 *TallyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyParams.Merge(m, src) +} +func (m *TallyParams) XXX_Size() int { + return m.Size() +} +func (m *TallyParams) XXX_DiscardUnknown() { + xxx_messageInfo_TallyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyParams proto.InternalMessageInfo + +func (m *TallyParams) GetQuorum() string { + if m != nil { + return m.Quorum + } + return "" +} + +func (m *TallyParams) GetThreshold() string { + if m != nil { + return m.Threshold + } + return "" +} + +func (m *TallyParams) GetVetoThreshold() string { + if m != nil { + return m.VetoThreshold + } + return "" +} + +// Params defines the parameters for the x/gov module. +// +// Since: cosmos-sdk 0.47 +type Params struct { + // Minimum deposit for a proposal to enter voting period. + MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` + // Duration of the voting period. + VotingPeriod *time.Duration `protobuf:"bytes,3,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` + // The ratio representing the proportion of the deposit value that must be paid at proposal submission. + MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` + // burn deposits if a proposal does not meet quorum + BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` + // burn deposits if the proposal does not enter voting period + BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` + // burn deposits if quorum with vote type no_veto is met + BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,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_e05cb1c0d030febb, []int{8} +} +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) GetMinDeposit() []types.Coin { + if m != nil { + return m.MinDeposit + } + return nil +} + +func (m *Params) GetMaxDepositPeriod() *time.Duration { + if m != nil { + return m.MaxDepositPeriod + } + return nil +} + +func (m *Params) GetVotingPeriod() *time.Duration { + if m != nil { + return m.VotingPeriod + } + return nil +} + +func (m *Params) GetQuorum() string { + if m != nil { + return m.Quorum + } + return "" +} + +func (m *Params) GetThreshold() string { + if m != nil { + return m.Threshold + } + return "" +} + +func (m *Params) GetVetoThreshold() string { + if m != nil { + return m.VetoThreshold + } + return "" +} + +func (m *Params) GetMinInitialDepositRatio() string { + if m != nil { + return m.MinInitialDepositRatio + } + return "" +} + +func (m *Params) GetBurnVoteQuorum() bool { + if m != nil { + return m.BurnVoteQuorum + } + return false +} + +func (m *Params) GetBurnProposalDepositPrevote() bool { + if m != nil { + return m.BurnProposalDepositPrevote + } + return false +} + +func (m *Params) GetBurnVoteVeto() bool { + if m != nil { + return m.BurnVoteVeto + } + return false +} + +func init() { + proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) + proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") + proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1.Deposit") + proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") + proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1.TallyResult") + proto.RegisterType((*Vote)(nil), "cosmos.gov.v1.Vote") + proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") + proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1.VotingParams") + proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1.TallyParams") + proto.RegisterType((*Params)(nil), "cosmos.gov.v1.Params") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } + +var fileDescriptor_e05cb1c0d030febb = []byte{ + // 1276 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x73, 0xd3, 0xc6, + 0x17, 0x8f, 0x6c, 0xd9, 0x71, 0x9e, 0x63, 0x47, 0x2c, 0xf9, 0x82, 0x12, 0x88, 0x1d, 0x3c, 0x0c, + 0x93, 0x2f, 0x3f, 0xec, 0x6f, 0xe0, 0x4b, 0x2f, 0xf4, 0xe2, 0xc4, 0xa2, 0x88, 0xa1, 0xb1, 0x2b, + 0x8b, 0x30, 0xf4, 0xa2, 0x91, 0xa3, 0xc5, 0xd9, 0xa9, 0xa5, 0x75, 0xa5, 0xb5, 0xc1, 0x7f, 0x42, + 0x6f, 0x1c, 0x3b, 0x3d, 0xf5, 0xd8, 0x63, 0x0f, 0x4c, 0xef, 0xbd, 0x71, 0x6a, 0x19, 0x2e, 0x6d, + 0x2f, 0xb4, 0x03, 0x87, 0xce, 0xf0, 0x57, 0x74, 0x76, 0xb5, 0xb2, 0x1d, 0xc7, 0x9d, 0x04, 0x2e, + 0xb1, 0xf4, 0xde, 0xe7, 0xf3, 0xde, 0xdb, 0xf7, 0x6b, 0x15, 0x38, 0x7f, 0x40, 0x23, 0x9f, 0x46, + 0xb5, 0x2e, 0x1d, 0xd6, 0x86, 0xdb, 0xfc, 0xa7, 0xda, 0x0f, 0x29, 0xa3, 0xa8, 0x10, 0x2b, 0xaa, + 0x5c, 0x32, 0xdc, 0x5e, 0x2f, 0x49, 0x5c, 0xc7, 0x8d, 0x70, 0x6d, 0xb8, 0xdd, 0xc1, 0xcc, 0xdd, + 0xae, 0x1d, 0x50, 0x12, 0xc4, 0xf0, 0xf5, 0xd5, 0x2e, 0xed, 0x52, 0xf1, 0x58, 0xe3, 0x4f, 0x52, + 0x5a, 0xee, 0x52, 0xda, 0xed, 0xe1, 0x9a, 0x78, 0xeb, 0x0c, 0x9e, 0xd4, 0x18, 0xf1, 0x71, 0xc4, + 0x5c, 0xbf, 0x2f, 0x01, 0x6b, 0xb3, 0x00, 0x37, 0x18, 0x49, 0x55, 0x69, 0x56, 0xe5, 0x0d, 0x42, + 0x97, 0x11, 0x9a, 0x78, 0x5c, 0x8b, 0x23, 0x72, 0x62, 0xa7, 0x32, 0xda, 0x58, 0x75, 0xc6, 0xf5, + 0x49, 0x40, 0x6b, 0xe2, 0x6f, 0x2c, 0xaa, 0x50, 0x40, 0x8f, 0x30, 0xe9, 0x1e, 0x32, 0xec, 0xed, + 0x53, 0x86, 0x9b, 0x7d, 0x6e, 0x09, 0x6d, 0x43, 0x96, 0x8a, 0x27, 0x5d, 0xd9, 0x54, 0xb6, 0x8a, + 0x37, 0xd7, 0xaa, 0x47, 0x4e, 0x5d, 0x9d, 0x40, 0x2d, 0x09, 0x44, 0x57, 0x20, 0xfb, 0x54, 0x18, + 0xd2, 0x53, 0x9b, 0xca, 0xd6, 0xd2, 0x4e, 0xf1, 0xf5, 0x8b, 0x1b, 0x20, 0x59, 0x0d, 0x7c, 0x60, + 0x49, 0x6d, 0xe5, 0x7b, 0x05, 0x16, 0x1b, 0xb8, 0x4f, 0x23, 0xc2, 0x50, 0x19, 0xf2, 0xfd, 0x90, + 0xf6, 0x69, 0xe4, 0xf6, 0x1c, 0xe2, 0x09, 0x5f, 0xaa, 0x05, 0x89, 0xc8, 0xf4, 0xd0, 0x27, 0xb0, + 0xe4, 0xc5, 0x58, 0x1a, 0x4a, 0xbb, 0xfa, 0xeb, 0x17, 0x37, 0x56, 0xa5, 0xdd, 0xba, 0xe7, 0x85, + 0x38, 0x8a, 0xda, 0x2c, 0x24, 0x41, 0xd7, 0x9a, 0x40, 0xd1, 0xa7, 0x90, 0x75, 0x7d, 0x3a, 0x08, + 0x98, 0x9e, 0xde, 0x4c, 0x6f, 0xe5, 0x27, 0xf1, 0xf3, 0x32, 0x55, 0x65, 0x99, 0xaa, 0xbb, 0x94, + 0x04, 0x3b, 0x4b, 0x2f, 0xdf, 0x94, 0x17, 0x7e, 0xf8, 0xfb, 0xc7, 0xab, 0x8a, 0x25, 0x39, 0x95, + 0x9f, 0x33, 0x90, 0x6b, 0xc9, 0x20, 0x50, 0x11, 0x52, 0xe3, 0xd0, 0x52, 0xc4, 0x43, 0xff, 0x83, + 0x9c, 0x8f, 0xa3, 0xc8, 0xed, 0xe2, 0x48, 0x4f, 0x09, 0xe3, 0xab, 0xd5, 0xb8, 0x22, 0xd5, 0xa4, + 0x22, 0xd5, 0x7a, 0x30, 0xb2, 0xc6, 0x28, 0x74, 0x1b, 0xb2, 0x11, 0x73, 0xd9, 0x20, 0xd2, 0xd3, + 0x22, 0x99, 0x1b, 0x33, 0xc9, 0x4c, 0x5c, 0xb5, 0x05, 0xc8, 0x92, 0x60, 0x74, 0x0f, 0xd0, 0x13, + 0x12, 0xb8, 0x3d, 0x87, 0xb9, 0xbd, 0xde, 0xc8, 0x09, 0x71, 0x34, 0xe8, 0x31, 0x5d, 0xdd, 0x54, + 0xb6, 0xf2, 0x37, 0xd7, 0x67, 0x4c, 0xd8, 0x1c, 0x62, 0x09, 0x84, 0xa5, 0x09, 0xd6, 0x94, 0x04, + 0xd5, 0x21, 0x1f, 0x0d, 0x3a, 0x3e, 0x61, 0x0e, 0x6f, 0x33, 0x3d, 0x23, 0x4d, 0xcc, 0x46, 0x6d, + 0x27, 0x3d, 0xb8, 0xa3, 0x3e, 0xff, 0xb3, 0xac, 0x58, 0x10, 0x93, 0xb8, 0x18, 0xdd, 0x07, 0x4d, + 0x66, 0xd7, 0xc1, 0x81, 0x17, 0xdb, 0xc9, 0x9e, 0xd2, 0x4e, 0x51, 0x32, 0x8d, 0xc0, 0x13, 0xb6, + 0x4c, 0x28, 0x30, 0xca, 0xdc, 0x9e, 0x23, 0xe5, 0xfa, 0xe2, 0x07, 0xd4, 0x68, 0x59, 0x50, 0x93, + 0x06, 0x7a, 0x00, 0x67, 0x86, 0x94, 0x91, 0xa0, 0xeb, 0x44, 0xcc, 0x0d, 0xe5, 0xf9, 0x72, 0xa7, + 0x8c, 0x6b, 0x25, 0xa6, 0xb6, 0x39, 0x53, 0x04, 0x76, 0x0f, 0xa4, 0x68, 0x72, 0xc6, 0xa5, 0x53, + 0xda, 0x2a, 0xc4, 0xc4, 0xe4, 0x88, 0xeb, 0xbc, 0x49, 0x98, 0xeb, 0xb9, 0xcc, 0xd5, 0x81, 0xb7, + 0xad, 0x35, 0x7e, 0x47, 0xab, 0x90, 0x61, 0x84, 0xf5, 0xb0, 0x9e, 0x17, 0x8a, 0xf8, 0x05, 0xe9, + 0xb0, 0x18, 0x0d, 0x7c, 0xdf, 0x0d, 0x47, 0xfa, 0xb2, 0x90, 0x27, 0xaf, 0xe8, 0xff, 0x90, 0x8b, + 0x27, 0x02, 0x87, 0x7a, 0xe1, 0x84, 0x11, 0x18, 0x23, 0x2b, 0xbf, 0x29, 0x90, 0x9f, 0xee, 0x81, + 0x6b, 0xb0, 0x34, 0xc2, 0x91, 0x73, 0x20, 0x86, 0x42, 0x39, 0x36, 0xa1, 0x66, 0xc0, 0xac, 0xdc, + 0x08, 0x47, 0xbb, 0x5c, 0x8f, 0x6e, 0x41, 0xc1, 0xed, 0x44, 0xcc, 0x25, 0x81, 0x24, 0xa4, 0xe6, + 0x12, 0x96, 0x25, 0x28, 0x26, 0xfd, 0x17, 0x72, 0x01, 0x95, 0xf8, 0xf4, 0x5c, 0xfc, 0x62, 0x40, + 0x63, 0xe8, 0x1d, 0x40, 0x01, 0x75, 0x9e, 0x12, 0x76, 0xe8, 0x0c, 0x31, 0x4b, 0x48, 0xea, 0x5c, + 0xd2, 0x4a, 0x40, 0x1f, 0x11, 0x76, 0xb8, 0x8f, 0x59, 0x4c, 0xae, 0xfc, 0xa4, 0x80, 0xca, 0xf7, + 0xcf, 0xc9, 0xdb, 0xa3, 0x0a, 0x99, 0x21, 0x65, 0xf8, 0xe4, 0xcd, 0x11, 0xc3, 0xd0, 0x1d, 0x58, + 0x8c, 0x97, 0x59, 0xa4, 0xab, 0xa2, 0x25, 0x2f, 0xcd, 0x8c, 0xd9, 0xf1, 0x4d, 0x69, 0x25, 0x8c, + 0x23, 0x25, 0xcf, 0x1c, 0x2d, 0xf9, 0x7d, 0x35, 0x97, 0xd6, 0xd4, 0xca, 0x1f, 0x0a, 0x14, 0x64, + 0xe3, 0xb6, 0xdc, 0xd0, 0xf5, 0x23, 0xf4, 0x18, 0xf2, 0x3e, 0x09, 0xc6, 0x73, 0xa0, 0x9c, 0x34, + 0x07, 0x1b, 0x7c, 0x0e, 0xde, 0xbf, 0x29, 0xff, 0x67, 0x8a, 0x75, 0x9d, 0xfa, 0x84, 0x61, 0xbf, + 0xcf, 0x46, 0x16, 0xf8, 0x24, 0x48, 0x26, 0xc3, 0x07, 0xe4, 0xbb, 0xcf, 0x12, 0x90, 0xd3, 0xc7, + 0x21, 0xa1, 0x9e, 0x48, 0x04, 0xf7, 0x30, 0xdb, 0xce, 0x0d, 0x79, 0x85, 0xec, 0x5c, 0x7e, 0xff, + 0xa6, 0x7c, 0xf1, 0x38, 0x71, 0xe2, 0xe4, 0x5b, 0xde, 0xed, 0x9a, 0xef, 0x3e, 0x4b, 0x4e, 0x22, + 0xf4, 0x15, 0x1b, 0x96, 0xf7, 0xc5, 0x04, 0xc8, 0x93, 0x35, 0x40, 0x4e, 0x44, 0xe2, 0x59, 0x39, + 0xc9, 0xb3, 0x2a, 0x2c, 0x2f, 0xc7, 0x2c, 0x69, 0xf5, 0xbb, 0xa4, 0x89, 0xa5, 0xd5, 0x2b, 0x90, + 0xfd, 0x7a, 0x40, 0xc3, 0x81, 0x3f, 0xa7, 0x83, 0xc5, 0x1d, 0x13, 0x6b, 0xd1, 0x75, 0x58, 0x62, + 0x87, 0x21, 0x8e, 0x0e, 0x69, 0xcf, 0xfb, 0x97, 0xeb, 0x68, 0x02, 0x40, 0xb7, 0xa1, 0x28, 0xba, + 0x70, 0x42, 0x49, 0xcf, 0xa5, 0x14, 0x38, 0xca, 0x4e, 0x40, 0x95, 0x5f, 0x55, 0xc8, 0xca, 0xb8, + 0x8c, 0x0f, 0xac, 0xe3, 0xd4, 0x3e, 0x9b, 0xae, 0xd9, 0xe7, 0x1f, 0x57, 0x33, 0x75, 0x7e, 0x4d, + 0x8e, 0xd7, 0x20, 0xfd, 0x11, 0x35, 0x98, 0xca, 0xb9, 0x7a, 0xfa, 0x9c, 0x67, 0x3e, 0x3c, 0xe7, + 0xd9, 0x53, 0xe4, 0x1c, 0x99, 0xb0, 0xc6, 0x13, 0x4d, 0x02, 0xc2, 0xc8, 0xe4, 0x02, 0x71, 0x44, + 0xf8, 0xfa, 0xe2, 0x5c, 0x0b, 0xe7, 0x7c, 0x12, 0x98, 0x31, 0x5e, 0xa6, 0xc7, 0xe2, 0x68, 0xb4, + 0x05, 0x5a, 0x67, 0x10, 0x06, 0x0e, 0x1f, 0x7d, 0x47, 0x9e, 0x90, 0xaf, 0xd7, 0x9c, 0x55, 0xe4, + 0x72, 0x3e, 0xe2, 0x5f, 0xc4, 0x27, 0xab, 0xc3, 0x86, 0x40, 0x8e, 0x97, 0xcd, 0xb8, 0x40, 0x21, + 0xe6, 0x6c, 0xbd, 0x28, 0x68, 0xeb, 0x1c, 0x94, 0xdc, 0xe5, 0x49, 0x25, 0x62, 0x04, 0xba, 0x0c, + 0xc5, 0x89, 0x33, 0x7e, 0x24, 0x7d, 0x45, 0x70, 0x96, 0x13, 0x57, 0x7c, 0xbd, 0x5d, 0xfd, 0x46, + 0x01, 0x98, 0xfa, 0x08, 0xbb, 0x00, 0xe7, 0xf7, 0x9b, 0xb6, 0xe1, 0x34, 0x5b, 0xb6, 0xd9, 0xdc, + 0x73, 0x1e, 0xee, 0xb5, 0x5b, 0xc6, 0xae, 0x79, 0xd7, 0x34, 0x1a, 0xda, 0x02, 0x3a, 0x0b, 0x2b, + 0xd3, 0xca, 0xc7, 0x46, 0x5b, 0x53, 0xd0, 0x79, 0x38, 0x3b, 0x2d, 0xac, 0xef, 0xb4, 0xed, 0xba, + 0xb9, 0xa7, 0xa5, 0x10, 0x82, 0xe2, 0xb4, 0x62, 0xaf, 0xa9, 0xa5, 0xd1, 0x45, 0xd0, 0x8f, 0xca, + 0x9c, 0x47, 0xa6, 0x7d, 0xcf, 0xd9, 0x37, 0xec, 0xa6, 0xa6, 0x5e, 0xfd, 0x45, 0x81, 0xe2, 0xd1, + 0x0f, 0x13, 0x54, 0x86, 0x0b, 0x2d, 0xab, 0xd9, 0x6a, 0xb6, 0xeb, 0x0f, 0x9c, 0xb6, 0x5d, 0xb7, + 0x1f, 0xb6, 0x67, 0x62, 0xaa, 0x40, 0x69, 0x16, 0xd0, 0x30, 0x5a, 0xcd, 0xb6, 0x69, 0x3b, 0x2d, + 0xc3, 0x32, 0x9b, 0x0d, 0x4d, 0x41, 0x97, 0x60, 0x63, 0x16, 0xb3, 0xdf, 0xb4, 0xcd, 0xbd, 0xcf, + 0x12, 0x48, 0x0a, 0xad, 0xc3, 0xb9, 0x59, 0x48, 0xab, 0xde, 0x6e, 0x1b, 0x8d, 0x38, 0xe8, 0x59, + 0x9d, 0x65, 0xdc, 0x37, 0x76, 0x6d, 0xa3, 0xa1, 0xa9, 0xf3, 0x98, 0x77, 0xeb, 0xe6, 0x03, 0xa3, + 0xa1, 0x65, 0x76, 0x8c, 0x97, 0x6f, 0x4b, 0xca, 0xab, 0xb7, 0x25, 0xe5, 0xaf, 0xb7, 0x25, 0xe5, + 0xf9, 0xbb, 0xd2, 0xc2, 0xab, 0x77, 0xa5, 0x85, 0xdf, 0xdf, 0x95, 0x16, 0xbe, 0xbc, 0xd6, 0x25, + 0xec, 0x70, 0xd0, 0xa9, 0x1e, 0x50, 0x5f, 0x7e, 0x2e, 0xcb, 0x9f, 0x1b, 0x91, 0xf7, 0x55, 0xed, + 0x99, 0xf8, 0x17, 0x80, 0x8d, 0xfa, 0x38, 0xe2, 0xdf, 0xf7, 0x59, 0x31, 0x35, 0xb7, 0xfe, 0x09, + 0x00, 0x00, 0xff, 0xff, 0xbc, 0x24, 0x6f, 0xb5, 0x20, 0x0c, 0x00, 0x00, +} + +func (m *WeightedVoteOption) 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 *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Weight) > 0 { + i -= len(m.Weight) + copy(dAtA[i:], m.Weight) + i = encodeVarintGov(dAtA, i, uint64(len(m.Weight))) + i-- + dAtA[i] = 0x12 + } + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Deposit) 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 = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintGov(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x6a + } + if len(m.Summary) > 0 { + i -= len(m.Summary) + copy(dAtA[i:], m.Summary) + i = encodeVarintGov(dAtA, i, uint64(len(m.Summary))) + i-- + dAtA[i] = 0x62 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x5a + } + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintGov(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x52 + } + if m.VotingEndTime != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.VotingEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingEndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGov(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x4a + } + if m.VotingStartTime != nil { + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.VotingStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingStartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGov(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x42 + } + if len(m.TotalDeposit) > 0 { + for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.DepositEndTime != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.DepositEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DepositEndTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGov(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 + } + if m.SubmitTime != nil { + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.SubmitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SubmitTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintGov(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x2a + } + if m.FinalTallyResult != nil { + { + size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Status != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x18 + } + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Id != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TallyResult) 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 *TallyResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.NoWithVetoCount) > 0 { + i -= len(m.NoWithVetoCount) + copy(dAtA[i:], m.NoWithVetoCount) + i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVetoCount))) + i-- + dAtA[i] = 0x22 + } + if len(m.NoCount) > 0 { + i -= len(m.NoCount) + copy(dAtA[i:], m.NoCount) + i = encodeVarintGov(dAtA, i, uint64(len(m.NoCount))) + i-- + dAtA[i] = 0x1a + } + if len(m.AbstainCount) > 0 { + i -= len(m.AbstainCount) + copy(dAtA[i:], m.AbstainCount) + i = encodeVarintGov(dAtA, i, uint64(len(m.AbstainCount))) + i-- + dAtA[i] = 0x12 + } + if len(m.YesCount) > 0 { + i -= len(m.YesCount) + copy(dAtA[i:], m.YesCount) + i = encodeVarintGov(dAtA, i, uint64(len(m.YesCount))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintGov(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x2a + } + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DepositParams) 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 *DepositParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaxDepositPeriod != nil { + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintGov(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + } + if len(m.MinDeposit) > 0 { + for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *VotingParams) 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 *VotingParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VotingPeriod != nil { + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintGov(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TallyParams) 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 *TallyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VetoThreshold) > 0 { + i -= len(m.VetoThreshold) + copy(dAtA[i:], m.VetoThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) + i-- + dAtA[i] = 0x1a + } + if len(m.Threshold) > 0 { + i -= len(m.Threshold) + copy(dAtA[i:], m.Threshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) + i-- + dAtA[i] = 0x12 + } + if len(m.Quorum) > 0 { + i -= len(m.Quorum) + copy(dAtA[i:], m.Quorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) + 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.BurnVoteVeto { + i-- + if m.BurnVoteVeto { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x78 + } + if m.BurnProposalDepositPrevote { + i-- + if m.BurnProposalDepositPrevote { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x70 + } + if m.BurnVoteQuorum { + i-- + if m.BurnVoteQuorum { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if len(m.MinInitialDepositRatio) > 0 { + i -= len(m.MinInitialDepositRatio) + copy(dAtA[i:], m.MinInitialDepositRatio) + i = encodeVarintGov(dAtA, i, uint64(len(m.MinInitialDepositRatio))) + i-- + dAtA[i] = 0x3a + } + if len(m.VetoThreshold) > 0 { + i -= len(m.VetoThreshold) + copy(dAtA[i:], m.VetoThreshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) + i-- + dAtA[i] = 0x32 + } + if len(m.Threshold) > 0 { + i -= len(m.Threshold) + copy(dAtA[i:], m.Threshold) + i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) + i-- + dAtA[i] = 0x2a + } + if len(m.Quorum) > 0 { + i -= len(m.Quorum) + copy(dAtA[i:], m.Quorum) + i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) + i-- + dAtA[i] = 0x22 + } + if m.VotingPeriod != nil { + n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0x1a + } + if m.MaxDepositPeriod != nil { + n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintGov(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x12 + } + if len(m.MinDeposit) > 0 { + for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *WeightedVoteOption) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } + l = len(m.Weight) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *Deposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovGov(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func (m *Proposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovGov(uint64(m.Id)) + } + if len(m.Messages) > 0 { + for _, e := range m.Messages { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + if m.Status != 0 { + n += 1 + sovGov(uint64(m.Status)) + } + if m.FinalTallyResult != nil { + l = m.FinalTallyResult.Size() + n += 1 + l + sovGov(uint64(l)) + } + if m.SubmitTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SubmitTime) + n += 1 + l + sovGov(uint64(l)) + } + if m.DepositEndTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DepositEndTime) + n += 1 + l + sovGov(uint64(l)) + } + if len(m.TotalDeposit) > 0 { + for _, e := range m.TotalDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + if m.VotingStartTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingStartTime) + n += 1 + l + sovGov(uint64(l)) + } + if m.VotingEndTime != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingEndTime) + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Summary) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *TallyResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.YesCount) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.AbstainCount) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.NoCount) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.NoWithVetoCount) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *Vote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovGov(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.Options) > 0 { + for _, e := range m.Options { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *DepositParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinDeposit) > 0 { + for _, e := range m.MinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + if m.MaxDepositPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *VotingParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VotingPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *TallyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Quorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Threshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.VetoThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinDeposit) > 0 { + for _, e := range m.MinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + if m.MaxDepositPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + } + if m.VotingPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Quorum) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Threshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.VetoThreshold) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.MinInitialDepositRatio) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if m.BurnVoteQuorum { + n += 2 + } + if m.BurnProposalDepositPrevote { + n += 2 + } + if m.BurnVoteVeto { + n += 2 + } + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WeightedVoteOption) 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 ErrIntOverflowGov + } + 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: WeightedVoteOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Weight = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Deposit) 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 ErrIntOverflowGov + } + 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: Deposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = 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 ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + 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 := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal) 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 ErrIntOverflowGov + } + 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: Proposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Messages = append(m.Messages, &types1.Any{}) + if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FinalTallyResult == nil { + m.FinalTallyResult = &TallyResult{} + } + if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubmitTime == nil { + m.SubmitTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DepositEndTime == nil { + m.DepositEndTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TotalDeposit = append(m.TotalDeposit, types.Coin{}) + if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingStartTime == nil { + m.VotingStartTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingEndTime == nil { + m.VotingEndTime = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TallyResult) 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 ErrIntOverflowGov + } + 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: TallyResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field YesCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.YesCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AbstainCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AbstainCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NoCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWithVetoCount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NoWithVetoCount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Vote) 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 ErrIntOverflowGov + } + 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: Vote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, &WeightedVoteOption{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DepositParams) 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 ErrIntOverflowGov + } + 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: DepositParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDeposit = append(m.MinDeposit, types.Coin{}) + if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxDepositPeriod == nil { + m.MaxDepositPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VotingParams) 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 ErrIntOverflowGov + } + 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: VotingParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingPeriod == nil { + m.VotingPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TallyParams) 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 ErrIntOverflowGov + } + 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: TallyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Threshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VetoThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + 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 ErrIntOverflowGov + } + 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 MinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDeposit = append(m.MinDeposit, types.Coin{}) + if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxDepositPeriod == nil { + m.MaxDepositPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VotingPeriod == nil { + m.VotingPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Quorum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Threshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VetoThreshold = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinInitialDepositRatio", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteQuorum", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BurnVoteQuorum = bool(v != 0) + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnProposalDepositPrevote", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BurnProposalDepositPrevote = bool(v != 0) + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteVeto", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BurnVoteVeto = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go new file mode 100644 index 000000000000..12e9a222efd5 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go @@ -0,0 +1,4036 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1/query.proto + +package v1 + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + query "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +type QueryProposalRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } +func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalRequest) ProtoMessage() {} +func (*QueryProposalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{0} +} +func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalRequest.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 *QueryProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalRequest.Merge(m, src) +} +func (m *QueryProposalRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo + +func (m *QueryProposalRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +type QueryProposalResponse struct { + // proposal is the requested governance proposal. + Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` +} + +func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } +func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalResponse) ProtoMessage() {} +func (*QueryProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{1} +} +func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalResponse.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 *QueryProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalResponse.Merge(m, src) +} +func (m *QueryProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo + +func (m *QueryProposalResponse) GetProposal() *Proposal { + if m != nil { + return m.Proposal + } + return nil +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +type QueryProposalsRequest struct { + // proposal_status defines the status of the proposals. + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"proposal_status,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } +func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsRequest) ProtoMessage() {} +func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{2} +} +func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsRequest.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 *QueryProposalsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsRequest.Merge(m, src) +} +func (m *QueryProposalsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo + +func (m *QueryProposalsRequest) GetProposalStatus() ProposalStatus { + if m != nil { + return m.ProposalStatus + } + return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED +} + +func (m *QueryProposalsRequest) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *QueryProposalsRequest) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *QueryProposalsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +type QueryProposalsResponse struct { + // proposals defines all the requested governance proposals. + Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} } +func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsResponse) ProtoMessage() {} +func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{3} +} +func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsResponse.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 *QueryProposalsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsResponse.Merge(m, src) +} +func (m *QueryProposalsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo + +func (m *QueryProposalsResponse) GetProposals() []*Proposal { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *QueryProposalsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +type QueryVoteRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` +} + +func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } +func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVoteRequest) ProtoMessage() {} +func (*QueryVoteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{4} +} +func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteRequest.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 *QueryVoteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteRequest.Merge(m, src) +} +func (m *QueryVoteRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo + +func (m *QueryVoteRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVoteRequest) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +type QueryVoteResponse struct { + // vote defines the queried vote. + Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` +} + +func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } +func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVoteResponse) ProtoMessage() {} +func (*QueryVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{5} +} +func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteResponse.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 *QueryVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteResponse.Merge(m, src) +} +func (m *QueryVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo + +func (m *QueryVoteResponse) GetVote() *Vote { + if m != nil { + return m.Vote + } + return nil +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +type QueryVotesRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } +func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVotesRequest) ProtoMessage() {} +func (*QueryVotesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{6} +} +func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesRequest.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 *QueryVotesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesRequest.Merge(m, src) +} +func (m *QueryVotesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo + +func (m *QueryVotesRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVotesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +type QueryVotesResponse struct { + // votes defines the queried votes. + Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } +func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVotesResponse) ProtoMessage() {} +func (*QueryVotesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{7} +} +func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesResponse.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 *QueryVotesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesResponse.Merge(m, src) +} +func (m *QueryVotesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo + +func (m *QueryVotesResponse) GetVotes() []*Vote { + if m != nil { + return m.Votes + } + return nil +} + +func (m *QueryVotesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` +} + +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_46a436d1109b50d0, []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 + +func (m *QueryParamsRequest) GetParamsType() string { + if m != nil { + return m.ParamsType + } + return "" +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // Deprecated: Prefer to use `params` instead. + // voting_params defines the parameters related to voting. + VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // deposit_params defines the parameters related to deposit. + DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. + // Deprecated: Prefer to use `params` instead. + // tally_params defines the parameters related to tally. + TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. + // params defines all the paramaters of x/gov module. + // + // Since: cosmos-sdk 0.47 + Params *Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` +} + +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_46a436d1109b50d0, []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 + +// Deprecated: Do not use. +func (m *QueryParamsResponse) GetVotingParams() *VotingParams { + if m != nil { + return m.VotingParams + } + return nil +} + +// Deprecated: Do not use. +func (m *QueryParamsResponse) GetDepositParams() *DepositParams { + if m != nil { + return m.DepositParams + } + return nil +} + +// Deprecated: Do not use. +func (m *QueryParamsResponse) GetTallyParams() *TallyParams { + if m != nil { + return m.TallyParams + } + return nil +} + +func (m *QueryParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +type QueryDepositRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` +} + +func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } +func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositRequest) ProtoMessage() {} +func (*QueryDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{10} +} +func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositRequest.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 *QueryDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositRequest.Merge(m, src) +} +func (m *QueryDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo + +func (m *QueryDepositRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositRequest) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +type QueryDepositResponse struct { + // deposit defines the requested deposit. + Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } +func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositResponse) ProtoMessage() {} +func (*QueryDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{11} +} +func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositResponse.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 *QueryDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositResponse.Merge(m, src) +} +func (m *QueryDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo + +func (m *QueryDepositResponse) GetDeposit() *Deposit { + if m != nil { + return m.Deposit + } + return nil +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +type QueryDepositsRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } +func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsRequest) ProtoMessage() {} +func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{12} +} +func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsRequest.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 *QueryDepositsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsRequest.Merge(m, src) +} +func (m *QueryDepositsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsRequest proto.InternalMessageInfo + +func (m *QueryDepositsRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +type QueryDepositsResponse struct { + // deposits defines the requested deposits. + Deposits []*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } +func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsResponse) ProtoMessage() {} +func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{13} +} +func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsResponse.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 *QueryDepositsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsResponse.Merge(m, src) +} +func (m *QueryDepositsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo + +func (m *QueryDepositsResponse) GetDeposits() []*Deposit { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *QueryDepositsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +type QueryTallyResultRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest{} } +func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultRequest) ProtoMessage() {} +func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{14} +} +func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultRequest.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 *QueryTallyResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultRequest.Merge(m, src) +} +func (m *QueryTallyResultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultRequest proto.InternalMessageInfo + +func (m *QueryTallyResultRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +type QueryTallyResultResponse struct { + // tally defines the requested tally. + Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` +} + +func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } +func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultResponse) ProtoMessage() {} +func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{15} +} +func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultResponse.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 *QueryTallyResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) +} +func (m *QueryTallyResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo + +func (m *QueryTallyResultResponse) GetTally() *TallyResult { + if m != nil { + return m.Tally + } + return nil +} + +func init() { + proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } + +var fileDescriptor_46a436d1109b50d0 = []byte{ + // 964 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xdc, 0x54, + 0x14, 0x8e, 0x27, 0x8f, 0xce, 0x9c, 0x34, 0x01, 0x4e, 0x1f, 0x19, 0x4c, 0x99, 0x06, 0x87, 0x26, + 0x81, 0x12, 0x5f, 0x26, 0x7d, 0x49, 0x50, 0x16, 0x0d, 0x25, 0x05, 0x89, 0x45, 0x98, 0x56, 0x2c, + 0xd8, 0x44, 0x4e, 0xc6, 0x32, 0x16, 0x13, 0x5f, 0x77, 0xee, 0x9d, 0x11, 0x21, 0x8d, 0x90, 0x2a, + 0x21, 0x58, 0x01, 0x12, 0x15, 0xf0, 0x43, 0xf8, 0x11, 0x2c, 0x2b, 0xd8, 0x20, 0x56, 0x28, 0xe1, + 0x87, 0x20, 0xdf, 0x7b, 0xec, 0xb1, 0x1d, 0x8f, 0x33, 0x53, 0x55, 0xac, 0x22, 0xdf, 0xfb, 0x9d, + 0xef, 0x7c, 0xe7, 0x79, 0x33, 0xf0, 0xf2, 0x2e, 0x17, 0x7b, 0x5c, 0x30, 0x8f, 0xf7, 0x59, 0xbf, + 0xc9, 0x1e, 0xf6, 0xdc, 0xee, 0xbe, 0x1d, 0x76, 0xb9, 0xe4, 0x38, 0xa7, 0xaf, 0x6c, 0x8f, 0xf7, + 0xed, 0x7e, 0xd3, 0x7c, 0x93, 0x90, 0x3b, 0x8e, 0x70, 0x35, 0x8e, 0xf5, 0x9b, 0x3b, 0xae, 0x74, + 0x9a, 0x2c, 0x74, 0x3c, 0x3f, 0x70, 0xa4, 0xcf, 0x03, 0x6d, 0x6a, 0x5e, 0xf2, 0x38, 0xf7, 0x3a, + 0x2e, 0x73, 0x42, 0x9f, 0x39, 0x41, 0xc0, 0xa5, 0xba, 0x14, 0x74, 0xbb, 0x90, 0xf5, 0x19, 0xf1, + 0xeb, 0x0b, 0x12, 0xb3, 0xad, 0xbe, 0x18, 0xb9, 0x57, 0x1f, 0xd6, 0x2d, 0x38, 0xff, 0x49, 0xe4, + 0x73, 0xab, 0xcb, 0x43, 0x2e, 0x9c, 0x4e, 0xcb, 0x7d, 0xd8, 0x73, 0x85, 0xc4, 0xcb, 0x30, 0x1b, + 0xd2, 0xd1, 0xb6, 0xdf, 0xae, 0x1b, 0x8b, 0xc6, 0xea, 0x54, 0x0b, 0xe2, 0xa3, 0x8f, 0xda, 0xd6, + 0xc7, 0x70, 0x21, 0x67, 0x28, 0x42, 0x1e, 0x08, 0x17, 0xaf, 0x41, 0x35, 0x86, 0x29, 0xb3, 0xd9, + 0xf5, 0x05, 0x3b, 0x13, 0xb1, 0x9d, 0x98, 0x24, 0x40, 0xeb, 0x87, 0x4a, 0x8e, 0x4e, 0xc4, 0x42, + 0x36, 0xe1, 0x85, 0x44, 0x88, 0x90, 0x8e, 0xec, 0x09, 0xc5, 0x3a, 0xbf, 0xfe, 0xea, 0x10, 0xd6, + 0xfb, 0x0a, 0xd4, 0x9a, 0x0f, 0x33, 0xdf, 0x68, 0xc3, 0x74, 0x9f, 0x4b, 0xb7, 0x5b, 0xaf, 0x2c, + 0x1a, 0xab, 0xb5, 0x8d, 0xfa, 0x1f, 0xbf, 0xad, 0x9d, 0x27, 0x82, 0x3b, 0xed, 0x76, 0xd7, 0x15, + 0xe2, 0xbe, 0xec, 0xfa, 0x81, 0xd7, 0xd2, 0x30, 0xbc, 0x09, 0xb5, 0xb6, 0x1b, 0x72, 0xe1, 0x4b, + 0xde, 0xad, 0x4f, 0x9e, 0x62, 0x33, 0x80, 0xe2, 0x26, 0xc0, 0xa0, 0x6c, 0xf5, 0x29, 0x95, 0x80, + 0xe5, 0x58, 0x6a, 0x54, 0x63, 0x5b, 0xf7, 0x02, 0xd5, 0xd8, 0xde, 0x72, 0x3c, 0x97, 0x62, 0x6d, + 0xa5, 0x2c, 0xad, 0x5f, 0x0d, 0xb8, 0x98, 0xcf, 0x08, 0x65, 0xf8, 0x06, 0xd4, 0xe2, 0xe0, 0xa2, + 0x64, 0x4c, 0x96, 0xa5, 0x78, 0x80, 0xc4, 0x7b, 0x19, 0x65, 0x15, 0xa5, 0x6c, 0xe5, 0x54, 0x65, + 0xda, 0x67, 0x46, 0xda, 0x2e, 0xbc, 0xa8, 0x94, 0x7d, 0xca, 0xa5, 0x3b, 0x6a, 0xbf, 0x8c, 0x9b, + 0x7f, 0xeb, 0x36, 0xbc, 0x94, 0x72, 0x42, 0x91, 0xaf, 0xc0, 0x54, 0x74, 0x4b, 0x7d, 0x75, 0x2e, + 0x17, 0xb4, 0x82, 0x2a, 0x80, 0xf5, 0x28, 0x65, 0x2d, 0x46, 0xd6, 0xb8, 0x59, 0x90, 0xa1, 0x67, + 0xa9, 0xdd, 0x77, 0x06, 0x60, 0xda, 0x3d, 0xa9, 0x7f, 0x43, 0xa7, 0x20, 0xae, 0x59, 0xa1, 0x7c, + 0x8d, 0x78, 0x7e, 0xb5, 0xba, 0x41, 0x4a, 0xb6, 0x9c, 0xae, 0xb3, 0x97, 0xc9, 0x84, 0x3a, 0xd8, + 0x96, 0xfb, 0xa1, 0x4e, 0x67, 0x2d, 0x32, 0x8b, 0x8e, 0x1e, 0xec, 0x87, 0xae, 0xf5, 0x73, 0x05, + 0xce, 0x65, 0xec, 0x28, 0x84, 0xbb, 0x30, 0xd7, 0xe7, 0xd2, 0x0f, 0xbc, 0x6d, 0x0d, 0xa6, 0x4a, + 0xbc, 0x72, 0x32, 0x14, 0x3f, 0xf0, 0xb4, 0xed, 0x46, 0xa5, 0x6e, 0xb4, 0xce, 0xf6, 0x53, 0x27, + 0x78, 0x0f, 0xe6, 0x69, 0x60, 0x62, 0x1a, 0x1d, 0xe1, 0xa5, 0x1c, 0xcd, 0x5d, 0x0d, 0x4a, 0xf1, + 0xcc, 0xb5, 0xd3, 0x47, 0x78, 0x07, 0xce, 0x4a, 0xa7, 0xd3, 0xd9, 0x8f, 0x69, 0x26, 0x15, 0x8d, + 0x99, 0xa3, 0x79, 0x10, 0x41, 0x52, 0x24, 0xb3, 0x72, 0x70, 0x80, 0x6b, 0x30, 0x43, 0xc6, 0x7a, + 0x56, 0x2f, 0xe4, 0x27, 0x49, 0x27, 0x80, 0x40, 0x56, 0x40, 0x79, 0x21, 0x69, 0x23, 0xb7, 0x56, + 0x66, 0x9d, 0x54, 0x46, 0x5e, 0x27, 0xd6, 0x87, 0xb4, 0x9f, 0x13, 0x7f, 0x54, 0x88, 0xb7, 0xe1, + 0x0c, 0x81, 0xa8, 0x04, 0x17, 0x8b, 0x73, 0xd7, 0x8a, 0x61, 0xd6, 0xd7, 0x59, 0xa6, 0xff, 0x7f, + 0x2a, 0x9e, 0x18, 0xb4, 0xe3, 0x07, 0x0a, 0x28, 0x98, 0x75, 0xa8, 0x92, 0xca, 0x78, 0x36, 0x86, + 0x45, 0x93, 0xe0, 0x9e, 0xdf, 0x84, 0xbc, 0x03, 0x0b, 0x4a, 0x95, 0xea, 0x92, 0x96, 0x2b, 0x7a, + 0x1d, 0x39, 0xc6, 0x23, 0x58, 0x3f, 0x69, 0x9b, 0x54, 0x68, 0x5a, 0xf5, 0x19, 0xd5, 0xa7, 0xb0, + 0x29, 0xc9, 0x44, 0x03, 0xd7, 0xff, 0xae, 0xc2, 0xb4, 0xa2, 0xc3, 0x6f, 0x0c, 0xa8, 0xc6, 0x2b, + 0x1c, 0x97, 0x72, 0x96, 0x45, 0xef, 0xb5, 0xf9, 0x7a, 0x39, 0x48, 0x6b, 0xb2, 0xec, 0xc7, 0x7f, + 0xfe, 0xfb, 0x53, 0x65, 0x15, 0x97, 0x59, 0xf6, 0x5f, 0x85, 0xe4, 0x91, 0x60, 0x07, 0xa9, 0x80, + 0x0f, 0xf1, 0x2b, 0xa8, 0x25, 0xcf, 0x0f, 0x96, 0xba, 0x88, 0xdb, 0xc9, 0xbc, 0x72, 0x0a, 0x8a, + 0x94, 0x2c, 0x2a, 0x25, 0x26, 0xd6, 0x87, 0x29, 0xc1, 0x6f, 0x0d, 0x98, 0x8a, 0x56, 0x22, 0x5e, + 0x2e, 0x62, 0x4c, 0xbd, 0x3d, 0xe6, 0xe2, 0x70, 0x00, 0x79, 0xbb, 0xad, 0xbc, 0xdd, 0xc4, 0xeb, + 0xa3, 0xc5, 0xcd, 0xd4, 0x12, 0x66, 0x07, 0xea, 0x25, 0x3a, 0xc4, 0xc7, 0x06, 0x4c, 0xab, 0x4d, + 0x8e, 0x43, 0x3d, 0x25, 0xe1, 0xbf, 0x56, 0x82, 0x20, 0x31, 0xd7, 0x95, 0x18, 0x1b, 0xdf, 0x1a, + 0x47, 0x0c, 0x3e, 0x82, 0x19, 0xda, 0x58, 0x85, 0x2e, 0x32, 0xfb, 0xdd, 0xb4, 0xca, 0x20, 0x24, + 0xe3, 0xaa, 0x92, 0x71, 0x05, 0x97, 0xf2, 0x32, 0x14, 0x8c, 0x1d, 0xa4, 0x1e, 0x88, 0x43, 0xfc, + 0xc5, 0x80, 0x33, 0x34, 0x83, 0x58, 0x48, 0x9e, 0xdd, 0x87, 0xe6, 0x52, 0x29, 0x86, 0x14, 0xbc, + 0xaf, 0x14, 0xbc, 0x87, 0xef, 0x8e, 0x98, 0x88, 0x78, 0xf6, 0xd9, 0x41, 0xb2, 0x1f, 0x0f, 0xf1, + 0x7b, 0x03, 0xaa, 0xf1, 0x42, 0xc1, 0x32, 0xb7, 0xa2, 0x74, 0x54, 0xf2, 0x3b, 0xc9, 0xba, 0xa5, + 0xc4, 0x35, 0x91, 0x8d, 0x29, 0x0e, 0x9f, 0x18, 0x30, 0x9b, 0x1a, 0x6e, 0x5c, 0x2e, 0x72, 0x77, + 0x72, 0xd9, 0x98, 0x2b, 0xa7, 0xe2, 0x9e, 0xb1, 0x7f, 0xd4, 0x72, 0xd9, 0xf8, 0xe0, 0xf7, 0xa3, + 0x86, 0xf1, 0xf4, 0xa8, 0x61, 0xfc, 0x73, 0xd4, 0x30, 0x7e, 0x3c, 0x6e, 0x4c, 0x3c, 0x3d, 0x6e, + 0x4c, 0xfc, 0x75, 0xdc, 0x98, 0xf8, 0xec, 0xaa, 0xe7, 0xcb, 0xcf, 0x7b, 0x3b, 0xf6, 0x2e, 0xdf, + 0x8b, 0x19, 0xf5, 0x9f, 0x35, 0xd1, 0xfe, 0x82, 0x7d, 0xa9, 0xe8, 0xa3, 0x2e, 0x10, 0xd1, 0xef, + 0x92, 0x19, 0xf5, 0xb3, 0xe1, 0xda, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xe4, 0xf6, 0xe9, + 0xe0, 0x0c, 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 { + // Proposal queries proposal details based on ProposalID. + Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + out := new(QueryProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + out := new(QueryProposalsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + out := new(QueryVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + out := new(QueryVotesResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Votes", 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, "/cosmos.gov.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + out := new(QueryDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + out := new(QueryDepositsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposits", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + out := new(QueryTallyResultResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/TallyResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Proposal queries proposal details based on ProposalID. + Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") +} +func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") +} +func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} +func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") +} +func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Proposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Proposals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVotesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Votes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Votes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) + } + 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: "/cosmos.gov.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_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/Deposits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTallyResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TallyResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/TallyResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Proposal", + Handler: _Query_Proposal_Handler, + }, + { + MethodName: "Proposals", + Handler: _Query_Proposals_Handler, + }, + { + MethodName: "Vote", + Handler: _Query_Vote_Handler, + }, + { + MethodName: "Votes", + Handler: _Query_Votes_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Deposit", + Handler: _Query_Deposit_Handler, + }, + { + MethodName: "Deposits", + Handler: _Query_Deposits_Handler, + }, + { + MethodName: "TallyResult", + Handler: _Query_TallyResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1/query.proto", +} + +func (m *QueryProposalRequest) 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 *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalResponse) 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 *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proposal != nil { + { + size, err := m.Proposal.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 *QueryProposalsRequest) 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 *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsRequest) 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] = 0x22 + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x1a + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalStatus != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalsResponse) 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 *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsResponse) 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.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[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 *QueryVoteRequest) 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 *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteResponse) 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 *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Vote != nil { + { + size, err := m.Vote.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 *QueryVotesRequest) 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 *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesRequest) 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 m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVotesResponse) 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 *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesResponse) 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.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[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 *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 + if len(m.ParamsType) > 0 { + i -= len(m.ParamsType) + copy(dAtA[i:], m.ParamsType) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) + i-- + dAtA[i] = 0xa + } + 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 + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.TallyParams != nil { + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.DepositParams != nil { + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.VotingParams != nil { + { + size, err := m.VotingParams.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 *QueryDepositRequest) 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 *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) 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 *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deposit != nil { + { + size, err := m.Deposit.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 *QueryDepositsRequest) 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 *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsRequest) 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 m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositsResponse) 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 *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsResponse) 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.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[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 *QueryTallyResultRequest) 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 *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultResponse) 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 *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Tally != nil { + { + size, err := m.Tally.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 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 *QueryProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Proposal != nil { + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalStatus != 0 { + n += 1 + sovQuery(uint64(m.ProposalStatus)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + 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 *QueryVoteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Vote != nil { + l = m.Vote.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Votes) > 0 { + for _, e := range m.Votes { + 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 *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ParamsType) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VotingParams != nil { + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.DepositParams != nil { + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.TallyParams != nil { + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Deposit != nil { + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + 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 *QueryTallyResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryTallyResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tally != nil { + l = m.Tally.Size() + n += 1 + l + sovQuery(uint64(l)) + } + 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 *QueryProposalRequest) 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: QueryProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalResponse) 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: QueryProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", 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.Proposal == nil { + m.Proposal = &Proposal{} + } + if err := m.Proposal.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsRequest) 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: QueryProposalsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) + } + m.ProposalStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalStatus |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsResponse) 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: QueryProposalsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", 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.Proposals = append(m.Proposals, &Proposal{}) + if err := m.Proposals[len(m.Proposals)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteRequest) 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: QueryVoteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteResponse) 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: QueryVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", 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.Vote == nil { + m.Vote = &Vote{} + } + if err := m.Vote.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesRequest) 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: QueryVotesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesResponse) 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: QueryVotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", 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.Votes = append(m.Votes, &Vote{}) + if err := m.Votes[len(m.Votes)-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) || (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 { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", 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.ParamsType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 VotingParams", 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.VotingParams == nil { + m.VotingParams = &VotingParams{} + } + if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", 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.DepositParams == nil { + m.DepositParams = &DepositParams{} + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", 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.TallyParams == nil { + m.TallyParams = &TallyParams{} + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + 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 m.Params == nil { + m.Params = &Params{} + } + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositRequest) 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: QueryDepositRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositResponse) 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: QueryDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", 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.Deposit == nil { + m.Deposit = &Deposit{} + } + if err := m.Deposit.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsRequest) 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: QueryDepositsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsResponse) 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: QueryDepositsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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.Deposits = append(m.Deposits, &Deposit{}) + if err := m.Deposits[len(m.Deposits)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultRequest) 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: QueryTallyResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultResponse) 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: QueryTallyResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tally", 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.Tally == nil { + m.Tally = &TallyResult{} + } + if err := m.Tally.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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go new file mode 100644 index 000000000000..18bdf04d96c7 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go @@ -0,0 +1,958 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/gov/v1/query.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := server.Proposal(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Proposals(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVoteRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["voter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") + } + + protoReq.Voter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) + } + + msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVoteRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["voter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") + } + + protoReq.Voter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) + } + + msg, err := server.Vote(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVotesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVotesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Votes(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["params_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") + } + + protoReq.ParamsType, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) + } + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["params_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") + } + + protoReq.ParamsType, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) + } + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["depositor"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") + } + + protoReq.Depositor, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) + } + + msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["depositor"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") + } + + protoReq.Depositor, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) + } + + msg, err := server.Deposit(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Deposits(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTallyResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTallyResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := server.TallyResult(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Proposal_0 = runtime.ForwardResponseMessage + + forward_Query_Proposals_0 = runtime.ForwardResponseMessage + + forward_Query_Vote_0 = runtime.ForwardResponseMessage + + forward_Query_Votes_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Deposit_0 = runtime.ForwardResponseMessage + + forward_Query_Deposits_0 = runtime.ForwardResponseMessage + + forward_Query_TallyResult_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go new file mode 100644 index 000000000000..4a27b2077ef6 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go @@ -0,0 +1,3054 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1/tx.proto + +package v1 + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "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 + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +type MsgSubmitProposal struct { + // messages are the arbitrary messages to be executed if proposal passes. + Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` + // initial_deposit is the deposit value that must be paid at proposal submission. + InitialDeposit []types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` + // metadata is any arbitrary metadata attached to the proposal. + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` + // title is the title of the proposal. + // + // Since: cosmos-sdk 0.47 + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + // summary is the summary of the proposal + // + // Since: cosmos-sdk 0.47 + Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` +} + +func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } +func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposal) ProtoMessage() {} +func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{0} +} +func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposal.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 *MsgSubmitProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposal.Merge(m, src) +} +func (m *MsgSubmitProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo + +func (m *MsgSubmitProposal) GetMessages() []*types.Any { + if m != nil { + return m.Messages + } + return nil +} + +func (m *MsgSubmitProposal) GetInitialDeposit() []types1.Coin { + if m != nil { + return m.InitialDeposit + } + return nil +} + +func (m *MsgSubmitProposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + +func (m *MsgSubmitProposal) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +func (m *MsgSubmitProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *MsgSubmitProposal) GetSummary() string { + if m != nil { + return m.Summary + } + return "" +} + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +type MsgSubmitProposalResponse struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } +func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposalResponse) ProtoMessage() {} +func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{1} +} +func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) +} +func (m *MsgSubmitProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo + +func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// MsgExecLegacyContent is used to wrap the legacy content field into a message. +// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +type MsgExecLegacyContent struct { + // content is the proposal's content. + Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // authority must be the gov module address. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` +} + +func (m *MsgExecLegacyContent) Reset() { *m = MsgExecLegacyContent{} } +func (m *MsgExecLegacyContent) String() string { return proto.CompactTextString(m) } +func (*MsgExecLegacyContent) ProtoMessage() {} +func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{2} +} +func (m *MsgExecLegacyContent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecLegacyContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecLegacyContent.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 *MsgExecLegacyContent) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecLegacyContent.Merge(m, src) +} +func (m *MsgExecLegacyContent) XXX_Size() int { + return m.Size() +} +func (m *MsgExecLegacyContent) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecLegacyContent.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecLegacyContent proto.InternalMessageInfo + +func (m *MsgExecLegacyContent) GetContent() *types.Any { + if m != nil { + return m.Content + } + return nil +} + +func (m *MsgExecLegacyContent) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +type MsgExecLegacyContentResponse struct { +} + +func (m *MsgExecLegacyContentResponse) Reset() { *m = MsgExecLegacyContentResponse{} } +func (m *MsgExecLegacyContentResponse) String() string { return proto.CompactTextString(m) } +func (*MsgExecLegacyContentResponse) ProtoMessage() {} +func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{3} +} +func (m *MsgExecLegacyContentResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExecLegacyContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExecLegacyContentResponse.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 *MsgExecLegacyContentResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExecLegacyContentResponse.Merge(m, src) +} +func (m *MsgExecLegacyContentResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExecLegacyContentResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExecLegacyContentResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExecLegacyContentResponse proto.InternalMessageInfo + +// MsgVote defines a message to cast a vote. +type MsgVote struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // option defines the vote option. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` + // metadata is any arbitrary metadata attached to the Vote. + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *MsgVote) Reset() { *m = MsgVote{} } +func (m *MsgVote) String() string { return proto.CompactTextString(m) } +func (*MsgVote) ProtoMessage() {} +func (*MsgVote) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{4} +} +func (m *MsgVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVote.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 *MsgVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVote.Merge(m, src) +} +func (m *MsgVote) XXX_Size() int { + return m.Size() +} +func (m *MsgVote) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVote.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVote proto.InternalMessageInfo + +func (m *MsgVote) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgVote) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *MsgVote) GetOption() VoteOption { + if m != nil { + return m.Option + } + return VoteOption_VOTE_OPTION_UNSPECIFIED +} + +func (m *MsgVote) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +// MsgVoteResponse defines the Msg/Vote response type. +type MsgVoteResponse struct { +} + +func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } +func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteResponse) ProtoMessage() {} +func (*MsgVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{5} +} +func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteResponse.Merge(m, src) +} +func (m *MsgVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo + +// MsgVoteWeighted defines a message to cast a vote. +type MsgVoteWeighted struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // options defines the weighted vote options. + Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` + // metadata is any arbitrary metadata attached to the VoteWeighted. + Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } +func (m *MsgVoteWeighted) String() string { return proto.CompactTextString(m) } +func (*MsgVoteWeighted) ProtoMessage() {} +func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{6} +} +func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteWeighted.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 *MsgVoteWeighted) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteWeighted.Merge(m, src) +} +func (m *MsgVoteWeighted) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteWeighted) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteWeighted.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo + +func (m *MsgVoteWeighted) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgVoteWeighted) GetVoter() string { + if m != nil { + return m.Voter + } + return "" +} + +func (m *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { + if m != nil { + return m.Options + } + return nil +} + +func (m *MsgVoteWeighted) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +type MsgVoteWeightedResponse struct { +} + +func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse{} } +func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteWeightedResponse) ProtoMessage() {} +func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{7} +} +func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteWeightedResponse.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 *MsgVoteWeightedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteWeightedResponse.Merge(m, src) +} +func (m *MsgVoteWeightedResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteWeightedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +type MsgDeposit struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount to be deposited by depositor. + Amount []types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` +} + +func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } +func (*MsgDeposit) ProtoMessage() {} +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{8} +} +func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeposit.Merge(m, src) +} +func (m *MsgDeposit) XXX_Size() int { + return m.Size() +} +func (m *MsgDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo + +func (m *MsgDeposit) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *MsgDeposit) GetDepositor() string { + if m != nil { + return m.Depositor + } + return "" +} + +func (m *MsgDeposit) GetAmount() []types1.Coin { + if m != nil { + return m.Amount + } + return nil +} + +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{9} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + +// MsgUpdateParams is the Msg/UpdateParams request type. +// +// Since: cosmos-sdk 0.47 +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 x/gov 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_9ff8f4a63b6fc9a9, []int{10} +} +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. +// +// Since: cosmos-sdk 0.47 +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_9ff8f4a63b6fc9a9, []int{11} +} +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((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") + proto.RegisterType((*MsgExecLegacyContent)(nil), "cosmos.gov.v1.MsgExecLegacyContent") + proto.RegisterType((*MsgExecLegacyContentResponse)(nil), "cosmos.gov.v1.MsgExecLegacyContentResponse") + proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1.MsgVoteResponse") + proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1.MsgVoteWeighted") + proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") + proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.gov.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.gov.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } + +var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ + // 908 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xe6, 0x87, 0xdd, 0xbc, 0x40, 0xaa, 0x8c, 0xdc, 0x76, 0xbd, 0x2a, 0x9b, 0x74, 0x8b, + 0x50, 0x94, 0x90, 0x5d, 0x1c, 0x68, 0x85, 0x4c, 0x85, 0x54, 0x97, 0x0a, 0x21, 0x61, 0xa8, 0x5c, + 0x51, 0x24, 0x84, 0x14, 0x8d, 0xbd, 0xc3, 0x64, 0x45, 0x76, 0x67, 0xb5, 0x33, 0xb6, 0xe2, 0x1b, + 0xe2, 0xd8, 0x13, 0x7f, 0x06, 0xc7, 0x1c, 0x7a, 0xeb, 0x3f, 0x50, 0x38, 0x55, 0x9c, 0x38, 0x55, + 0x28, 0x11, 0x44, 0xe2, 0x9f, 0x00, 0xcd, 0x8f, 0x5d, 0xff, 0x58, 0xc7, 0xa9, 0x38, 0x70, 0xb1, + 0x76, 0xbe, 0xf7, 0xbd, 0x37, 0xef, 0xfb, 0xf6, 0xcd, 0xac, 0xe1, 0x7a, 0x8f, 0xf1, 0x98, 0xf1, + 0x80, 0xb2, 0x41, 0x30, 0x68, 0x04, 0xe2, 0xd8, 0x4f, 0x33, 0x26, 0x18, 0x7a, 0x53, 0xe3, 0x3e, + 0x65, 0x03, 0x7f, 0xd0, 0x70, 0x5c, 0x43, 0xeb, 0x62, 0x4e, 0x82, 0x41, 0xa3, 0x4b, 0x04, 0x6e, + 0x04, 0x3d, 0x16, 0x25, 0x9a, 0xee, 0xdc, 0x98, 0x2c, 0x23, 0xb3, 0x74, 0xa0, 0x46, 0x19, 0x65, + 0xea, 0x31, 0x90, 0x4f, 0x06, 0xad, 0x6b, 0xfa, 0x81, 0x0e, 0x98, 0xad, 0x4c, 0x88, 0x32, 0x46, + 0x8f, 0x48, 0xa0, 0x56, 0xdd, 0xfe, 0x77, 0x01, 0x4e, 0x86, 0x53, 0x9b, 0xc4, 0x9c, 0xca, 0x4d, + 0x62, 0x4e, 0x4d, 0x60, 0x03, 0xc7, 0x51, 0xc2, 0x02, 0xf5, 0xab, 0x21, 0xef, 0x97, 0x45, 0xd8, + 0x68, 0x73, 0xfa, 0xb8, 0xdf, 0x8d, 0x23, 0xf1, 0x28, 0x63, 0x29, 0xe3, 0xf8, 0x08, 0xbd, 0x07, + 0x57, 0x62, 0xc2, 0x39, 0xa6, 0x84, 0xdb, 0xd6, 0xd6, 0xd2, 0xf6, 0xda, 0x7e, 0xcd, 0xd7, 0xfb, + 0xf9, 0xf9, 0x7e, 0xfe, 0xfd, 0x64, 0xd8, 0x29, 0x58, 0xa8, 0x0d, 0x57, 0xa3, 0x24, 0x12, 0x11, + 0x3e, 0x3a, 0x08, 0x49, 0xca, 0x78, 0x24, 0xec, 0x45, 0x95, 0x58, 0xf7, 0x4d, 0xdb, 0xd2, 0x12, + 0xdf, 0x58, 0xe2, 0x3f, 0x60, 0x51, 0xd2, 0x5a, 0x7d, 0xf1, 0x6a, 0x73, 0xe1, 0xe7, 0xf3, 0x93, + 0x1d, 0xab, 0xb3, 0x6e, 0x92, 0x3f, 0xd1, 0xb9, 0xe8, 0x03, 0xb8, 0x92, 0xaa, 0x66, 0x48, 0x66, + 0x2f, 0x6d, 0x59, 0xdb, 0xab, 0x2d, 0xfb, 0xb7, 0x67, 0x7b, 0x35, 0x53, 0xea, 0x7e, 0x18, 0x66, + 0x84, 0xf3, 0xc7, 0x22, 0x8b, 0x12, 0xda, 0x29, 0x98, 0xc8, 0x91, 0x6d, 0x0b, 0x1c, 0x62, 0x81, + 0xed, 0x65, 0x99, 0xd5, 0x29, 0xd6, 0xa8, 0x06, 0x2b, 0x22, 0x12, 0x47, 0xc4, 0x5e, 0x51, 0x01, + 0xbd, 0x40, 0x36, 0x54, 0x79, 0x3f, 0x8e, 0x71, 0x36, 0xb4, 0x2b, 0x0a, 0xcf, 0x97, 0xcd, 0xc6, + 0x8f, 0xe7, 0x27, 0x3b, 0x45, 0xe9, 0xa7, 0xe7, 0x27, 0x3b, 0x9b, 0x7a, 0xf7, 0x3d, 0x1e, 0x7e, + 0x2f, 0x6d, 0x2d, 0xb9, 0xe6, 0xdd, 0x83, 0x7a, 0x09, 0xec, 0x10, 0x9e, 0xb2, 0x84, 0x13, 0xb4, + 0x09, 0x6b, 0xa9, 0xc1, 0x0e, 0xa2, 0xd0, 0xb6, 0xb6, 0xac, 0xed, 0xe5, 0x0e, 0xe4, 0xd0, 0x67, + 0xa1, 0xf7, 0xdc, 0x82, 0x5a, 0x9b, 0xd3, 0x87, 0xc7, 0xa4, 0xf7, 0x39, 0xa1, 0xb8, 0x37, 0x7c, + 0xc0, 0x12, 0x41, 0x12, 0x81, 0xbe, 0x80, 0x6a, 0x4f, 0x3f, 0xaa, 0xac, 0x0b, 0xde, 0x45, 0xcb, + 0xfd, 0xf5, 0xd9, 0x9e, 0x33, 0x31, 0x8d, 0xb9, 0xd5, 0x2a, 0xb7, 0x93, 0x17, 0x41, 0x37, 0x61, + 0x15, 0xf7, 0xc5, 0x21, 0xcb, 0x22, 0x31, 0xb4, 0x17, 0x95, 0xea, 0x11, 0xd0, 0xbc, 0x23, 0x75, + 0x8f, 0xd6, 0x52, 0xb8, 0x57, 0x12, 0x5e, 0x6a, 0xd2, 0x73, 0xe1, 0xe6, 0x2c, 0x3c, 0x97, 0xef, + 0xfd, 0x69, 0x41, 0xb5, 0xcd, 0xe9, 0x13, 0x26, 0x08, 0xba, 0x33, 0xc3, 0x8a, 0x56, 0xed, 0xef, + 0x57, 0x9b, 0xe3, 0xb0, 0x9e, 0x8b, 0x31, 0x83, 0x90, 0x0f, 0x2b, 0x03, 0x26, 0x48, 0xa6, 0x7b, + 0x9e, 0x33, 0x10, 0x9a, 0x86, 0x1a, 0x50, 0x61, 0xa9, 0x88, 0x58, 0xa2, 0x26, 0x68, 0x7d, 0x34, + 0x89, 0xda, 0x1d, 0x5f, 0xf6, 0xf2, 0xa5, 0x22, 0x74, 0x0c, 0x71, 0xde, 0x00, 0x35, 0xdf, 0x96, + 0xc6, 0xe8, 0xd2, 0xd2, 0x94, 0x6b, 0x25, 0x53, 0x64, 0x3d, 0x6f, 0x03, 0xae, 0x9a, 0xc7, 0x42, + 0xfa, 0x3f, 0x56, 0x81, 0x7d, 0x4d, 0x22, 0x7a, 0x28, 0x48, 0xf8, 0x7f, 0x59, 0xf0, 0x11, 0x54, + 0xb5, 0x32, 0x6e, 0x2f, 0xa9, 0xd3, 0x78, 0x6b, 0xca, 0x83, 0xbc, 0xa1, 0x31, 0x2f, 0xf2, 0x8c, + 0xb9, 0x66, 0xbc, 0x3b, 0x69, 0xc6, 0x5b, 0x33, 0xcd, 0xc8, 0x8b, 0x7b, 0x75, 0xb8, 0x31, 0x05, + 0x15, 0xe6, 0xfc, 0x65, 0x01, 0xb4, 0x39, 0xcd, 0xcf, 0xfd, 0x7f, 0xf4, 0xe5, 0x2e, 0xac, 0x9a, + 0x5b, 0x87, 0x5d, 0xee, 0xcd, 0x88, 0x8a, 0xee, 0x41, 0x05, 0xc7, 0xac, 0x9f, 0x08, 0x63, 0xcf, + 0xeb, 0x5d, 0x56, 0x26, 0xa7, 0xb9, 0xab, 0x8e, 0x4a, 0x51, 0x4d, 0x1a, 0x61, 0x97, 0x8c, 0x30, + 0xca, 0xbc, 0x1a, 0xa0, 0xd1, 0xaa, 0x90, 0xff, 0x5c, 0xcf, 0xc6, 0x57, 0x69, 0x88, 0x05, 0x79, + 0x84, 0x33, 0x1c, 0x73, 0x29, 0x66, 0x74, 0x3e, 0xad, 0xcb, 0xc4, 0x14, 0x54, 0xf4, 0x21, 0x54, + 0x52, 0x55, 0x41, 0x39, 0xb0, 0xb6, 0x7f, 0x6d, 0xea, 0x5d, 0xeb, 0xf2, 0x13, 0x42, 0x34, 0xbf, + 0x79, 0xb7, 0x7c, 0xe6, 0x6f, 0x8f, 0x09, 0x39, 0xce, 0x3f, 0x57, 0x53, 0x9d, 0x9a, 0xf7, 0x3a, + 0x0e, 0xe5, 0xc2, 0xf6, 0x9f, 0x2e, 0xc3, 0x52, 0x9b, 0x53, 0xf4, 0x2d, 0xac, 0x4f, 0x7d, 0x5b, + 0xb6, 0xa6, 0xda, 0x2a, 0x5d, 0x99, 0xce, 0xf6, 0x65, 0x8c, 0xe2, 0x52, 0x25, 0xb0, 0x51, 0xbe, + 0x2f, 0x6f, 0x97, 0xd3, 0x4b, 0x24, 0x67, 0xf7, 0x35, 0x48, 0xc5, 0x36, 0x1f, 0xc3, 0xb2, 0xba, + 0xb8, 0xae, 0x97, 0x93, 0x24, 0xee, 0xb8, 0xb3, 0xf1, 0x22, 0xff, 0x09, 0xbc, 0x31, 0x71, 0xfa, + 0x2f, 0xe0, 0xe7, 0x71, 0xe7, 0x9d, 0xf9, 0xf1, 0xa2, 0xee, 0xa7, 0x50, 0xcd, 0x0f, 0x4e, 0xbd, + 0x9c, 0x62, 0x42, 0xce, 0xad, 0x0b, 0x43, 0xe3, 0x0d, 0x4e, 0x8c, 0xe0, 0x8c, 0x06, 0xc7, 0xe3, + 0xb3, 0x1a, 0x9c, 0x35, 0x05, 0xce, 0xca, 0x0f, 0x72, 0xce, 0x5a, 0x0f, 0x5f, 0x9c, 0xba, 0xd6, + 0xcb, 0x53, 0xd7, 0xfa, 0xe3, 0xd4, 0xb5, 0x7e, 0x3a, 0x73, 0x17, 0x5e, 0x9e, 0xb9, 0x0b, 0xbf, + 0x9f, 0xb9, 0x0b, 0xdf, 0xec, 0xd2, 0x48, 0x1c, 0xf6, 0xbb, 0x7e, 0x8f, 0xc5, 0xe6, 0xef, 0x4d, + 0x50, 0x1a, 0x3c, 0x31, 0x4c, 0x09, 0x97, 0x7f, 0xa6, 0x2a, 0xea, 0x7b, 0xf7, 0xfe, 0xbf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0xc2, 0x00, 0x8f, 0x53, 0x8c, 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 + +// 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 { + // SubmitProposal defines a method to create new proposal given the messages. + SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + 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) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + out := new(MsgSubmitProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/SubmitProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { + out := new(MsgExecLegacyContentResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/ExecLegacyContent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + out := new(MsgVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + out := new(MsgVoteWeightedResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/VoteWeighted", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Deposit", 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, "/cosmos.gov.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 { + // SubmitProposal defines a method to create new proposal given the messages. + SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + // to execute a legacy content-based proposal. + ExecLegacyContent(context.Context, *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + // UpdateParams defines a governance operation for updating the x/gov module + // parameters. The authority is defined in the keeper. + // + // Since: cosmos-sdk 0.47 + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") +} +func (*UnimplementedMsgServer) ExecLegacyContent(ctx context.Context, req *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecLegacyContent not implemented") +} +func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VoteWeighted not implemented") +} +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit 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_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/SubmitProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ExecLegacyContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExecLegacyContent) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExecLegacyContent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/ExecLegacyContent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExecLegacyContent(ctx, req.(*MsgExecLegacyContent)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVote) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVoteWeighted) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VoteWeighted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/VoteWeighted", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + 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: "/cosmos.gov.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: "cosmos.gov.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitProposal", + Handler: _Msg_SubmitProposal_Handler, + }, + { + MethodName: "ExecLegacyContent", + Handler: _Msg_ExecLegacyContent_Handler, + }, + { + MethodName: "Vote", + Handler: _Msg_Vote_Handler, + }, + { + MethodName: "VoteWeighted", + Handler: _Msg_VoteWeighted_Handler, + }, + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1/tx.proto", +} + +func (m *MsgSubmitProposal) 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 *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Summary) > 0 { + i -= len(m.Summary) + copy(dAtA[i:], m.Summary) + i = encodeVarintTx(dAtA, i, uint64(len(m.Summary))) + i-- + dAtA[i] = 0x32 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x2a + } + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x1a + } + if len(m.InitialDeposit) > 0 { + for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgExecLegacyContent) 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 *MsgExecLegacyContent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecLegacyContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0x12 + } + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgExecLegacyContentResponse) 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 *MsgExecLegacyContentResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExecLegacyContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgVote) 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 *MsgVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } + if m.Option != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgVoteWeighted) 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 *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x22 + } + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Options[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.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgVoteWeightedResponse) 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 *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeposit) 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.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgSubmitProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Messages) > 0 { + for _, e := range m.Messages { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.InitialDeposit) > 0 { + for _, e := range m.InitialDeposit { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Summary) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + +func (m *MsgExecLegacyContent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgExecLegacyContentResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovTx(uint64(m.Option)) + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgVoteWeighted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Options) > 0 { + for _, e := range m.Options { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgVoteWeightedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Depositor) + 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 *MsgDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + 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 *MsgSubmitProposal) 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: MsgSubmitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Messages", 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.Messages = append(m.Messages, &types.Any{}) + if err := m.Messages[len(m.Messages)-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 InitialDeposit", 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.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 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.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", 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.Summary = string(dAtA[iNdEx:postIndex]) + 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 *MsgSubmitProposalResponse) 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: MsgSubmitProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(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 *MsgExecLegacyContent) 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: MsgExecLegacyContent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", 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 m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 + 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 *MsgExecLegacyContentResponse) 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: MsgExecLegacyContentResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExecLegacyContentResponse: 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 *MsgVote) 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: MsgVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) + 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 *MsgVoteResponse) 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: MsgVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteResponse: 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 *MsgVoteWeighted) 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: MsgVoteWeighted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, &WeightedVoteOption{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) + 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 *MsgVoteWeightedResponse) 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: MsgVoteWeightedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteWeightedResponse: 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 *MsgDeposit) 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: MsgDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = 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, types1.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 *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: 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 *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) || (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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go new file mode 100644 index 000000000000..d40095e9828a --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go @@ -0,0 +1,669 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/genesis.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the gov module's genesis state. +type GenesisState struct { + // starting_proposal_id is the ID of the starting proposal. + StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` + // deposits defines all the deposits present at genesis. + Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` + // votes defines all the votes present at genesis. + Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` + // proposals defines all the proposals present at genesis. + Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` + // params defines all the parameters of related to deposit. + DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + // params defines all the parameters of related to voting. + VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + // params defines all the parameters of related to tally. + TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_43cd825e0fa7a627, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetStartingProposalId() uint64 { + if m != nil { + return m.StartingProposalId + } + return 0 +} + +func (m *GenesisState) GetDeposits() Deposits { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *GenesisState) GetVotes() Votes { + if m != nil { + return m.Votes + } + return nil +} + +func (m *GenesisState) GetProposals() Proposals { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *GenesisState) GetDepositParams() DepositParams { + if m != nil { + return m.DepositParams + } + return DepositParams{} +} + +func (m *GenesisState) GetVotingParams() VotingParams { + if m != nil { + return m.VotingParams + } + return VotingParams{} +} + +func (m *GenesisState) GetTallyParams() TallyParams { + if m != nil { + return m.TallyParams + } + return TallyParams{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/genesis.proto", fileDescriptor_43cd825e0fa7a627) } + +var fileDescriptor_43cd825e0fa7a627 = []byte{ + // 409 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0xd2, 0x4d, 0x6e, 0xda, 0x40, + 0x14, 0x07, 0x70, 0xbb, 0x7c, 0x14, 0x06, 0xa8, 0xd4, 0x11, 0xad, 0x2c, 0x8a, 0x8c, 0xdb, 0x15, + 0xaa, 0x54, 0x1b, 0xe8, 0x0d, 0xac, 0x4a, 0x55, 0x2b, 0x25, 0x42, 0x10, 0x65, 0x91, 0x0d, 0x1a, + 0xf0, 0xc8, 0xb1, 0x82, 0x79, 0x96, 0x67, 0x62, 0x85, 0x5b, 0xe4, 0x04, 0x59, 0x47, 0x59, 0xe5, + 0x18, 0x2c, 0x59, 0x66, 0x95, 0x44, 0xb0, 0xc8, 0x35, 0x22, 0xcf, 0x8c, 0x13, 0x24, 0x9c, 0x6c, + 0xfc, 0xf1, 0xde, 0xdf, 0x3f, 0xcf, 0x8c, 0x1e, 0xb2, 0x66, 0xc0, 0x42, 0x60, 0x8e, 0x0f, 0x89, + 0x93, 0xf4, 0xa7, 0x94, 0x93, 0xbe, 0xe3, 0xd3, 0x05, 0x65, 0x01, 0xb3, 0xa3, 0x18, 0x38, 0x60, + 0x2c, 0x13, 0xb6, 0x0f, 0x89, 0xad, 0x12, 0xad, 0xa6, 0x0f, 0x3e, 0x88, 0xb6, 0x93, 0x3e, 0xc9, + 0x64, 0xab, 0x9d, 0x67, 0x41, 0xa2, 0xba, 0x9f, 0x49, 0x18, 0x2c, 0xc0, 0x11, 0x57, 0x59, 0xfa, + 0x71, 0x55, 0x44, 0xf5, 0xbf, 0xf2, 0x67, 0x63, 0x4e, 0x38, 0xc5, 0x3d, 0xd4, 0x64, 0x9c, 0xc4, + 0x3c, 0x58, 0xf8, 0x93, 0x28, 0x86, 0x08, 0x18, 0x99, 0x4f, 0x02, 0xcf, 0xd0, 0x2d, 0xbd, 0x5b, + 0x1c, 0xe1, 0xac, 0x37, 0x54, 0xad, 0x7f, 0x1e, 0x3e, 0x44, 0x15, 0x8f, 0x46, 0xc0, 0x02, 0xce, + 0x8c, 0x0f, 0x56, 0xa1, 0x5b, 0x1b, 0x7c, 0xb3, 0xf7, 0x17, 0x6c, 0xff, 0x91, 0x19, 0xf7, 0xcb, + 0xea, 0xbe, 0xa3, 0xdd, 0x3c, 0x74, 0x2a, 0xaa, 0xc0, 0xae, 0x9f, 0x6e, 0x7f, 0xea, 0xa3, 0x17, + 0x03, 0xbb, 0xa8, 0x94, 0x00, 0xa7, 0xcc, 0x28, 0x08, 0xcc, 0xc8, 0xc3, 0x8e, 0x81, 0x53, 0x17, + 0x2b, 0xa9, 0x94, 0xbe, 0x29, 0x46, 0x7e, 0x8a, 0x47, 0xa8, 0x9a, 0x2d, 0x9e, 0x19, 0x45, 0xe1, + 0xb4, 0xf3, 0x9c, 0x6c, 0x1b, 0xee, 0x57, 0x65, 0x55, 0xb3, 0x8a, 0xf2, 0x5e, 0x19, 0x3c, 0x46, + 0x9f, 0xd4, 0x1a, 0x27, 0x11, 0x89, 0x49, 0xc8, 0x8c, 0x92, 0xa5, 0x77, 0x6b, 0x83, 0xef, 0xef, + 0xec, 0x76, 0x28, 0x82, 0x6e, 0x35, 0xd5, 0x25, 0xd8, 0xf0, 0x76, 0x3b, 0x78, 0x88, 0x1a, 0x09, + 0xc8, 0xc3, 0x96, 0x66, 0x59, 0x98, 0xd6, 0x1b, 0x9b, 0x4e, 0x4f, 0x7e, 0x8f, 0xac, 0x27, 0x3b, + 0x0d, 0x7c, 0x80, 0xea, 0x9c, 0xcc, 0xe7, 0xcb, 0x0c, 0xfc, 0x28, 0xc0, 0x4e, 0x1e, 0x78, 0x94, + 0xe6, 0xf6, 0xbd, 0x1a, 0xdf, 0xa9, 0xff, 0x5f, 0x6d, 0x4c, 0x7d, 0xbd, 0x31, 0xf5, 0xc7, 0x8d, + 0xa9, 0x5f, 0x6e, 0x4d, 0x6d, 0xbd, 0x35, 0xb5, 0xbb, 0xad, 0xa9, 0x9d, 0xf4, 0xfc, 0x80, 0x9f, + 0x9e, 0x4f, 0xed, 0x19, 0x84, 0x8e, 0x1a, 0x3b, 0x79, 0xfb, 0xc5, 0xbc, 0x33, 0xe7, 0x42, 0xcc, + 0x20, 0x5f, 0x46, 0x94, 0x65, 0x93, 0x38, 0x2d, 0x8b, 0x99, 0xfb, 0xfd, 0x1c, 0x00, 0x00, 0xff, + 0xff, 0xcb, 0x8b, 0x44, 0x6f, 0xf2, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + { + size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.StartingProposalId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StartingProposalId != 0 { + n += 1 + sovGenesis(uint64(m.StartingProposalId)) + } + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.DepositParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.VotingParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.TallyParams.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) + } + m.StartingProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartingProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Deposits = append(m.Deposits, Deposit{}) + if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Votes = append(m.Votes, Vote{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposals = append(m.Proposals, Proposal{}) + if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go new file mode 100644 index 000000000000..ce00989f4c3e --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go @@ -0,0 +1,2852 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/gov.proto + +package v1beta1 + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types1 "github.com/cosmos/cosmos-sdk/codec/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "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 + +// VoteOption enumerates the valid vote options for a given governance proposal. +type VoteOption int32 + +const ( + // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + OptionEmpty VoteOption = 0 + // VOTE_OPTION_YES defines a yes vote option. + OptionYes VoteOption = 1 + // VOTE_OPTION_ABSTAIN defines an abstain vote option. + OptionAbstain VoteOption = 2 + // VOTE_OPTION_NO defines a no vote option. + OptionNo VoteOption = 3 + // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + OptionNoWithVeto VoteOption = 4 +) + +var VoteOption_name = map[int32]string{ + 0: "VOTE_OPTION_UNSPECIFIED", + 1: "VOTE_OPTION_YES", + 2: "VOTE_OPTION_ABSTAIN", + 3: "VOTE_OPTION_NO", + 4: "VOTE_OPTION_NO_WITH_VETO", +} + +var VoteOption_value = map[string]int32{ + "VOTE_OPTION_UNSPECIFIED": 0, + "VOTE_OPTION_YES": 1, + "VOTE_OPTION_ABSTAIN": 2, + "VOTE_OPTION_NO": 3, + "VOTE_OPTION_NO_WITH_VETO": 4, +} + +func (x VoteOption) String() string { + return proto.EnumName(VoteOption_name, int32(x)) +} + +func (VoteOption) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{0} +} + +// ProposalStatus enumerates the valid statuses of a proposal. +type ProposalStatus int32 + +const ( + // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + StatusNil ProposalStatus = 0 + // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + // period. + StatusDepositPeriod ProposalStatus = 1 + // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + // period. + StatusVotingPeriod ProposalStatus = 2 + // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + // passed. + StatusPassed ProposalStatus = 3 + // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + // been rejected. + StatusRejected ProposalStatus = 4 + // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + // failed. + StatusFailed ProposalStatus = 5 +) + +var ProposalStatus_name = map[int32]string{ + 0: "PROPOSAL_STATUS_UNSPECIFIED", + 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", + 2: "PROPOSAL_STATUS_VOTING_PERIOD", + 3: "PROPOSAL_STATUS_PASSED", + 4: "PROPOSAL_STATUS_REJECTED", + 5: "PROPOSAL_STATUS_FAILED", +} + +var ProposalStatus_value = map[string]int32{ + "PROPOSAL_STATUS_UNSPECIFIED": 0, + "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, + "PROPOSAL_STATUS_VOTING_PERIOD": 2, + "PROPOSAL_STATUS_PASSED": 3, + "PROPOSAL_STATUS_REJECTED": 4, + "PROPOSAL_STATUS_FAILED": 5, +} + +func (x ProposalStatus) String() string { + return proto.EnumName(ProposalStatus_name, int32(x)) +} + +func (ProposalStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{1} +} + +// WeightedVoteOption defines a unit of vote for vote split. +// +// Since: cosmos-sdk 0.43 +type WeightedVoteOption struct { + // option defines the valid vote options, it must not contain duplicate vote options. + Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` + // weight is the vote weight associated with the vote option. + Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` +} + +func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } +func (*WeightedVoteOption) ProtoMessage() {} +func (*WeightedVoteOption) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{0} +} +func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WeightedVoteOption.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 *WeightedVoteOption) XXX_Merge(src proto.Message) { + xxx_messageInfo_WeightedVoteOption.Merge(m, src) +} +func (m *WeightedVoteOption) XXX_Size() int { + return m.Size() +} +func (m *WeightedVoteOption) XXX_DiscardUnknown() { + xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) +} + +var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo + +// TextProposal defines a standard text proposal whose changes need to be +// manually updated in case of approval. +type TextProposal struct { + // title of the proposal. + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // description associated with the proposal. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (m *TextProposal) Reset() { *m = TextProposal{} } +func (*TextProposal) ProtoMessage() {} +func (*TextProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{1} +} +func (m *TextProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TextProposal.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 *TextProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_TextProposal.Merge(m, src) +} +func (m *TextProposal) XXX_Size() int { + return m.Size() +} +func (m *TextProposal) XXX_DiscardUnknown() { + xxx_messageInfo_TextProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_TextProposal proto.InternalMessageInfo + +// Deposit defines an amount deposited by an account address to an active +// proposal. +type Deposit struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount to be deposited by depositor. + Amount 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 *Deposit) Reset() { *m = Deposit{} } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{2} +} +func (m *Deposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Deposit.Merge(m, src) +} +func (m *Deposit) XXX_Size() int { + return m.Size() +} +func (m *Deposit) XXX_DiscardUnknown() { + xxx_messageInfo_Deposit.DiscardUnknown(m) +} + +var xxx_messageInfo_Deposit proto.InternalMessageInfo + +// Proposal defines the core field members of a governance proposal. +type Proposal struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // content is the proposal's content. + Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + // status defines the proposal status. + Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"` + // final_tally_result is the final tally result of the proposal. When + // querying a proposal via gRPC, this field is not populated until the + // proposal's voting period has ended. + FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` + // submit_time is the time of proposal submission. + SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` + // deposit_end_time is the end time for deposition. + DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time"` + // total_deposit is the total deposit on the proposal. + TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_deposit"` + // voting_start_time is the starting time to vote on a proposal. + VotingStartTime time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time"` + // voting_end_time is the end time of voting on a proposal. + VotingEndTime time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time"` +} + +func (m *Proposal) Reset() { *m = Proposal{} } +func (*Proposal) ProtoMessage() {} +func (*Proposal) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{3} +} +func (m *Proposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_Proposal.Merge(m, src) +} +func (m *Proposal) XXX_Size() int { + return m.Size() +} +func (m *Proposal) XXX_DiscardUnknown() { + xxx_messageInfo_Proposal.DiscardUnknown(m) +} + +var xxx_messageInfo_Proposal proto.InternalMessageInfo + +// TallyResult defines a standard tally for a governance proposal. +type TallyResult struct { + // yes is the number of yes votes on a proposal. + Yes github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"yes"` + // abstain is the number of abstain votes on a proposal. + Abstain github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"abstain"` + // no is the number of no votes on a proposal. + No github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no"` + // no_with_veto is the number of no with veto votes on a proposal. + NoWithVeto github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no_with_veto"` +} + +func (m *TallyResult) Reset() { *m = TallyResult{} } +func (*TallyResult) ProtoMessage() {} +func (*TallyResult) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{4} +} +func (m *TallyResult) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyResult.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 *TallyResult) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyResult.Merge(m, src) +} +func (m *TallyResult) XXX_Size() int { + return m.Size() +} +func (m *TallyResult) XXX_DiscardUnknown() { + xxx_messageInfo_TallyResult.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyResult proto.InternalMessageInfo + +// Vote defines a vote on a governance proposal. +// A Vote consists of a proposal ID, the voter, and the vote option. +type Vote struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id"` + // voter is the voter address of the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + // options is the weighted vote options. + // + // Since: cosmos-sdk 0.43 + Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` +} + +func (m *Vote) Reset() { *m = Vote{} } +func (*Vote) ProtoMessage() {} +func (*Vote) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{5} +} +func (m *Vote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { + xxx_messageInfo_Vote.Merge(m, src) +} +func (m *Vote) XXX_Size() int { + return m.Size() +} +func (m *Vote) XXX_DiscardUnknown() { + xxx_messageInfo_Vote.DiscardUnknown(m) +} + +var xxx_messageInfo_Vote proto.InternalMessageInfo + +// DepositParams defines the params for deposits on governance proposals. +type DepositParams struct { + // Minimum deposit for a proposal to enter voting period. + MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit,omitempty"` + // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + // months. + MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` +} + +func (m *DepositParams) Reset() { *m = DepositParams{} } +func (*DepositParams) ProtoMessage() {} +func (*DepositParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{6} +} +func (m *DepositParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DepositParams.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 *DepositParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_DepositParams.Merge(m, src) +} +func (m *DepositParams) XXX_Size() int { + return m.Size() +} +func (m *DepositParams) XXX_DiscardUnknown() { + xxx_messageInfo_DepositParams.DiscardUnknown(m) +} + +var xxx_messageInfo_DepositParams proto.InternalMessageInfo + +// VotingParams defines the params for voting on governance proposals. +type VotingParams struct { + // Duration of the voting period. + VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` +} + +func (m *VotingParams) Reset() { *m = VotingParams{} } +func (*VotingParams) ProtoMessage() {} +func (*VotingParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{7} +} +func (m *VotingParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VotingParams.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 *VotingParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_VotingParams.Merge(m, src) +} +func (m *VotingParams) XXX_Size() int { + return m.Size() +} +func (m *VotingParams) XXX_DiscardUnknown() { + xxx_messageInfo_VotingParams.DiscardUnknown(m) +} + +var xxx_messageInfo_VotingParams proto.InternalMessageInfo + +// TallyParams defines the params for tallying votes on governance proposals. +type TallyParams struct { + // Minimum percentage of total stake needed to vote for a result to be + // considered valid. + Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"` + // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"` + // Minimum value of Veto votes to Total votes ratio for proposal to be + // vetoed. Default value: 1/3. + VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold,omitempty"` +} + +func (m *TallyParams) Reset() { *m = TallyParams{} } +func (*TallyParams) ProtoMessage() {} +func (*TallyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_6e82113c1a9a4b7c, []int{8} +} +func (m *TallyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TallyParams.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 *TallyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_TallyParams.Merge(m, src) +} +func (m *TallyParams) XXX_Size() int { + return m.Size() +} +func (m *TallyParams) XXX_DiscardUnknown() { + xxx_messageInfo_TallyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_TallyParams proto.InternalMessageInfo + +func init() { + proto.RegisterEnum("cosmos.gov.v1beta1.VoteOption", VoteOption_name, VoteOption_value) + proto.RegisterEnum("cosmos.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) + proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta1.WeightedVoteOption") + proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal") + proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit") + proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal") + proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta1.TallyResult") + proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta1.Vote") + proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta1.DepositParams") + proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta1.VotingParams") + proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta1.TallyParams") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } + +var fileDescriptor_6e82113c1a9a4b7c = []byte{ + // 1401 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0x47, + 0x14, 0xf6, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x21, 0x25, 0xce, 0x96, 0xee, 0xae, 0x5c, 0x09, + 0x45, 0x11, 0x71, 0x20, 0xa8, 0x48, 0x4d, 0xab, 0x4a, 0x36, 0x5e, 0x5a, 0x53, 0x64, 0xbb, 0xeb, + 0xc5, 0x14, 0x0e, 0x5d, 0x6d, 0xbc, 0x83, 0xb3, 0xad, 0x77, 0xc7, 0x78, 0xc7, 0x21, 0xb9, 0xf5, + 0xd2, 0x0a, 0xf9, 0xc4, 0x91, 0x8b, 0x25, 0x44, 0x2f, 0x55, 0x4f, 0x1c, 0xf8, 0x07, 0x7a, 0x43, + 0x55, 0x0f, 0x88, 0x43, 0x45, 0x7b, 0x08, 0x25, 0x48, 0x85, 0xf2, 0x47, 0x54, 0xd5, 0xce, 0xcc, + 0xc6, 0x1b, 0x27, 0x22, 0xb8, 0xa8, 0x97, 0x64, 0x3d, 0xef, 0x7b, 0xdf, 0xf7, 0xde, 0xf3, 0x7b, + 0x6f, 0xc7, 0xe0, 0x44, 0x03, 0xfb, 0x2e, 0xf6, 0x97, 0x9b, 0x78, 0x63, 0x79, 0xe3, 0xcc, 0x1a, + 0x22, 0xd6, 0x99, 0xe0, 0x39, 0xd7, 0xee, 0x60, 0x82, 0x21, 0x64, 0xd6, 0x5c, 0x70, 0xc2, 0xad, + 0x92, 0xcc, 0x3d, 0xd6, 0x2c, 0x1f, 0xed, 0xba, 0x34, 0xb0, 0xe3, 0x31, 0x1f, 0x69, 0xb6, 0x89, + 0x9b, 0x98, 0x3e, 0x2e, 0x07, 0x4f, 0xfc, 0x54, 0x69, 0x62, 0xdc, 0x6c, 0xa1, 0x65, 0xfa, 0x69, + 0xad, 0x7b, 0x7d, 0x99, 0x38, 0x2e, 0xf2, 0x89, 0xe5, 0xb6, 0x39, 0x60, 0x7e, 0x18, 0x60, 0x79, + 0x5b, 0xdc, 0x24, 0x0f, 0x9b, 0xec, 0x6e, 0xc7, 0x22, 0x0e, 0x0e, 0x15, 0xe7, 0x59, 0x44, 0x26, + 0x13, 0xe5, 0x21, 0x33, 0xd3, 0x51, 0xcb, 0x75, 0x3c, 0xbc, 0x4c, 0xff, 0xb2, 0xa3, 0xec, 0x3d, + 0x01, 0xc0, 0x2b, 0xc8, 0x69, 0xae, 0x13, 0x64, 0xd7, 0x31, 0x41, 0x95, 0x76, 0x40, 0x05, 0xcf, + 0x81, 0x71, 0x4c, 0x9f, 0x32, 0x82, 0x2a, 0x2c, 0xcc, 0xac, 0xc8, 0xb9, 0xfd, 0xb9, 0xe7, 0x06, + 0x78, 0x9d, 0xa3, 0xa1, 0x01, 0xc6, 0x6f, 0x52, 0xb6, 0x4c, 0x5c, 0x15, 0x16, 0xa6, 0x0a, 0x1f, + 0x3f, 0xdc, 0x56, 0x62, 0x7f, 0x6c, 0x2b, 0x27, 0x9b, 0x0e, 0x59, 0xef, 0xae, 0xe5, 0x1a, 0xd8, + 0xe5, 0x21, 0xf1, 0x7f, 0x4b, 0xbe, 0xfd, 0xcd, 0x32, 0xd9, 0x6a, 0x23, 0x3f, 0x57, 0x44, 0x8d, + 0xc7, 0x0f, 0x96, 0x00, 0x17, 0x2a, 0xa2, 0x86, 0xce, 0xb9, 0xb2, 0xdf, 0x0b, 0x20, 0x6d, 0xa0, + 0x4d, 0x52, 0xed, 0xe0, 0x36, 0xf6, 0xad, 0x16, 0x9c, 0x05, 0x63, 0xc4, 0x21, 0x2d, 0x44, 0xa3, + 0x9b, 0xd2, 0xd9, 0x07, 0xa8, 0x82, 0x94, 0x8d, 0xfc, 0x46, 0xc7, 0x61, 0x91, 0xd3, 0x08, 0xf4, + 0xe8, 0xd1, 0xea, 0x27, 0x2f, 0xef, 0x2a, 0xc2, 0x2f, 0x0f, 0x96, 0xa4, 0x03, 0xb2, 0x39, 0x8f, + 0x3d, 0x82, 0x3c, 0xd2, 0x7b, 0x71, 0x7f, 0x71, 0x2e, 0x12, 0x5b, 0x54, 0x37, 0xfb, 0x9b, 0x00, + 0x26, 0x8a, 0xa8, 0x8d, 0x7d, 0x87, 0x40, 0x05, 0xa4, 0xda, 0xfc, 0xdc, 0x74, 0x6c, 0x1a, 0x49, + 0x52, 0x07, 0xe1, 0x51, 0xc9, 0x86, 0xe7, 0xc0, 0x94, 0xcd, 0xb0, 0xb8, 0xc3, 0xcb, 0x91, 0x79, + 0xfc, 0x60, 0x69, 0x96, 0x6b, 0xe7, 0x6d, 0xbb, 0x83, 0x7c, 0xbf, 0x46, 0x3a, 0x8e, 0xd7, 0xd4, + 0x07, 0x50, 0xb8, 0x0e, 0xc6, 0x2d, 0x17, 0x77, 0x3d, 0x92, 0x49, 0xa8, 0x89, 0x85, 0xd4, 0xca, + 0x7c, 0x58, 0xfb, 0xa0, 0xc7, 0x22, 0xe1, 0x3a, 0x5e, 0xe1, 0x83, 0xa0, 0xbc, 0x3f, 0x3d, 0x55, + 0x16, 0xde, 0xa0, 0xbc, 0x81, 0x83, 0xff, 0xe3, 0x8b, 0xfb, 0x8b, 0x82, 0xce, 0xf9, 0x57, 0x27, + 0x6f, 0xdd, 0x55, 0x62, 0x2f, 0xef, 0x2a, 0xb1, 0xec, 0xef, 0x63, 0x60, 0x72, 0xb7, 0xba, 0x87, + 0x66, 0x56, 0x06, 0x13, 0x0d, 0x56, 0x2d, 0x9a, 0x57, 0x6a, 0x65, 0x36, 0xc7, 0x9a, 0x32, 0x17, + 0x36, 0x65, 0x2e, 0xef, 0x6d, 0x15, 0xe4, 0xd7, 0x57, 0x5a, 0x0f, 0x49, 0xe0, 0x2a, 0x18, 0xf7, + 0x89, 0x45, 0xba, 0x7e, 0x26, 0x41, 0xbb, 0x2d, 0x7b, 0x50, 0xb7, 0x85, 0xe1, 0xd5, 0x28, 0x52, + 0xe7, 0x1e, 0xf0, 0x4b, 0x00, 0xaf, 0x3b, 0x9e, 0xd5, 0x32, 0x89, 0xd5, 0x6a, 0x6d, 0x99, 0x1d, + 0xe4, 0x77, 0x5b, 0x24, 0x93, 0xa4, 0x61, 0x29, 0x07, 0xf1, 0x18, 0x01, 0x4e, 0xa7, 0xb0, 0xc2, + 0x54, 0x50, 0x3f, 0x56, 0x13, 0x91, 0xb2, 0x44, 0x8c, 0xf0, 0x22, 0x48, 0xf9, 0xdd, 0x35, 0xd7, + 0x21, 0x66, 0x30, 0x9d, 0x99, 0x31, 0x4a, 0x29, 0xed, 0xcb, 0xd4, 0x08, 0x47, 0xb7, 0x30, 0x1d, + 0xb0, 0xdd, 0x7e, 0xaa, 0x08, 0x8c, 0x11, 0x30, 0xef, 0xc0, 0x0e, 0x6b, 0x40, 0xe4, 0x5f, 0xb0, + 0x89, 0x3c, 0x9b, 0x11, 0x8e, 0x8f, 0x4a, 0x38, 0xc3, 0x29, 0x34, 0xcf, 0xa6, 0xa4, 0x5d, 0x30, + 0x4d, 0x30, 0xb1, 0x5a, 0x26, 0x3f, 0xcf, 0x4c, 0xfc, 0x4f, 0xfd, 0x92, 0xa6, 0x32, 0x61, 0xe3, + 0x5f, 0x06, 0x47, 0x37, 0x30, 0x71, 0xbc, 0xa6, 0xe9, 0x13, 0xab, 0xc3, 0xab, 0x33, 0x39, 0x6a, + 0x32, 0x47, 0x18, 0x47, 0x2d, 0xa0, 0xa0, 0xd9, 0x7c, 0x01, 0xf8, 0xd1, 0xa0, 0x42, 0x53, 0xa3, + 0x92, 0x4e, 0x33, 0x06, 0x5e, 0xa0, 0xd5, 0x64, 0x30, 0xee, 0xd9, 0xbf, 0xe3, 0x20, 0x15, 0xfd, + 0x5e, 0xcb, 0x20, 0xb1, 0x85, 0x7c, 0xb6, 0x3a, 0x46, 0x5a, 0x50, 0x25, 0x8f, 0x44, 0x16, 0x54, + 0xc9, 0x23, 0x7a, 0x40, 0x04, 0xeb, 0x60, 0xc2, 0x5a, 0xf3, 0x89, 0xe5, 0x78, 0xff, 0x61, 0xe9, + 0xed, 0xe7, 0x0c, 0xc9, 0xe0, 0x25, 0x10, 0xf7, 0x30, 0x9d, 0x88, 0xb7, 0xa5, 0x8c, 0x7b, 0x18, + 0x7e, 0x05, 0xd2, 0x1e, 0x36, 0x6f, 0x3a, 0x64, 0xdd, 0xdc, 0x40, 0x04, 0xd3, 0x09, 0x79, 0x5b, + 0x5e, 0xe0, 0xe1, 0x2b, 0x0e, 0x59, 0xaf, 0x23, 0x82, 0x79, 0xad, 0xff, 0x11, 0x40, 0x32, 0x78, + 0x2d, 0xc0, 0xb3, 0x07, 0xec, 0x90, 0x02, 0x7c, 0xb5, 0xad, 0xc4, 0x1d, 0xfb, 0xde, 0x8b, 0xfb, + 0x8b, 0x71, 0xc7, 0xe6, 0x53, 0x12, 0xd9, 0x2b, 0x39, 0x30, 0xb6, 0x81, 0x09, 0x3a, 0x7c, 0x5b, + 0x32, 0x58, 0xb0, 0x37, 0xf8, 0x5b, 0x2a, 0xf1, 0x26, 0x6f, 0xa9, 0x42, 0x3c, 0x23, 0xec, 0xbe, + 0xa9, 0x3e, 0x07, 0x13, 0xec, 0xc9, 0xcf, 0x24, 0xe9, 0xd8, 0x9c, 0x3c, 0xc8, 0x79, 0xff, 0xab, + 0x31, 0xba, 0x33, 0x42, 0x86, 0xd5, 0xc9, 0x3b, 0xe1, 0x22, 0xed, 0xc5, 0xc1, 0x34, 0x1f, 0x94, + 0xaa, 0xd5, 0xb1, 0x5c, 0x1f, 0x7e, 0x27, 0x80, 0x94, 0xeb, 0x78, 0xbb, 0x43, 0x2a, 0x1c, 0x36, + 0xa4, 0xa5, 0x40, 0xe0, 0xd5, 0xb6, 0xf2, 0x4e, 0xc4, 0xeb, 0x14, 0x76, 0x1d, 0x82, 0xdc, 0x36, + 0xd9, 0x1a, 0x65, 0x7a, 0x75, 0xe0, 0x3a, 0x5e, 0x38, 0xb6, 0x37, 0x00, 0x74, 0xad, 0xcd, 0x90, + 0xd0, 0x6c, 0xa3, 0x8e, 0x83, 0x6d, 0xbe, 0xbf, 0xe7, 0xf7, 0x8d, 0x58, 0x91, 0x5f, 0x2a, 0x0a, + 0x0b, 0x3c, 0x9a, 0x13, 0xfb, 0x9d, 0x07, 0x41, 0xdd, 0x79, 0xaa, 0x08, 0xba, 0xe8, 0x5a, 0x9b, + 0x61, 0xea, 0xd4, 0x9e, 0xf5, 0x41, 0xba, 0x4e, 0x07, 0x92, 0x97, 0xa2, 0x01, 0xf8, 0x80, 0x86, + 0xea, 0xc2, 0x61, 0xea, 0xef, 0x73, 0xf5, 0xb9, 0x3d, 0x7e, 0x43, 0xc2, 0x69, 0x66, 0xe4, 0xa2, + 0x3f, 0x87, 0xe3, 0xce, 0x45, 0xaf, 0x81, 0xf1, 0x1b, 0x5d, 0xdc, 0xe9, 0xba, 0x54, 0x2d, 0x5d, + 0x28, 0x8c, 0x76, 0x25, 0x79, 0xb5, 0xad, 0x88, 0xcc, 0x7f, 0xa0, 0xaa, 0x73, 0x46, 0xd8, 0x00, + 0x53, 0x64, 0xbd, 0x83, 0xfc, 0x75, 0xdc, 0x62, 0xa5, 0x4c, 0x17, 0xb4, 0x91, 0xe9, 0x8f, 0xed, + 0x52, 0x44, 0x14, 0x06, 0xbc, 0xf0, 0x06, 0x98, 0x09, 0x26, 0xd6, 0x1c, 0x28, 0x25, 0xa8, 0xd2, + 0xc5, 0x91, 0x95, 0x32, 0x7b, 0x79, 0x22, 0x72, 0xd3, 0x81, 0xc5, 0x08, 0x0d, 0x8b, 0x7f, 0x09, + 0x00, 0x44, 0x6e, 0x83, 0xa7, 0xc0, 0x5c, 0xbd, 0x62, 0x68, 0x66, 0xa5, 0x6a, 0x94, 0x2a, 0x65, + 0xf3, 0x72, 0xb9, 0x56, 0xd5, 0xce, 0x97, 0x2e, 0x94, 0xb4, 0xa2, 0x18, 0x93, 0x8e, 0xf4, 0xfa, + 0x6a, 0x8a, 0x01, 0xb5, 0x80, 0x0b, 0x66, 0xc1, 0x91, 0x28, 0xfa, 0xaa, 0x56, 0x13, 0x05, 0x69, + 0xba, 0xd7, 0x57, 0xa7, 0x18, 0xea, 0x2a, 0xf2, 0xe1, 0x22, 0x38, 0x16, 0xc5, 0xe4, 0x0b, 0x35, + 0x23, 0x5f, 0x2a, 0x8b, 0x71, 0xe9, 0x68, 0xaf, 0xaf, 0x4e, 0x33, 0x5c, 0x9e, 0xef, 0x41, 0x15, + 0xcc, 0x44, 0xb1, 0xe5, 0x8a, 0x98, 0x90, 0xd2, 0xbd, 0xbe, 0x3a, 0xc9, 0x60, 0x65, 0x0c, 0x57, + 0x40, 0x66, 0x2f, 0xc2, 0xbc, 0x52, 0x32, 0x3e, 0x33, 0xeb, 0x9a, 0x51, 0x11, 0x93, 0xd2, 0x6c, + 0xaf, 0xaf, 0x8a, 0x21, 0x36, 0xdc, 0x57, 0x52, 0xf2, 0xd6, 0x0f, 0x72, 0x6c, 0xf1, 0xd7, 0x38, + 0x98, 0xd9, 0x7b, 0xb1, 0x80, 0x39, 0xf0, 0x6e, 0x55, 0xaf, 0x54, 0x2b, 0xb5, 0xfc, 0x25, 0xb3, + 0x66, 0xe4, 0x8d, 0xcb, 0xb5, 0xa1, 0x84, 0x69, 0x2a, 0x0c, 0x5c, 0x76, 0x5a, 0xf0, 0x23, 0x20, + 0x0f, 0xe3, 0x8b, 0x5a, 0xb5, 0x52, 0x2b, 0x19, 0x66, 0x55, 0xd3, 0x4b, 0x95, 0xa2, 0x28, 0x48, + 0x73, 0xbd, 0xbe, 0x7a, 0x8c, 0xb9, 0xec, 0x99, 0x10, 0xf8, 0x21, 0x78, 0x6f, 0xd8, 0xb9, 0x5e, + 0x31, 0x4a, 0xe5, 0x4f, 0x43, 0xdf, 0xb8, 0x74, 0xbc, 0xd7, 0x57, 0x21, 0xf3, 0xad, 0x47, 0xfa, + 0x1c, 0x9e, 0x02, 0xc7, 0x87, 0x5d, 0xab, 0xf9, 0x5a, 0x4d, 0x2b, 0x8a, 0x09, 0x49, 0xec, 0xf5, + 0xd5, 0x34, 0xf3, 0xa9, 0x5a, 0xbe, 0x8f, 0x6c, 0x78, 0x1a, 0x64, 0x86, 0xd1, 0xba, 0x76, 0x51, + 0x3b, 0x6f, 0x68, 0x45, 0x31, 0x29, 0xc1, 0x5e, 0x5f, 0x9d, 0xe1, 0x17, 0x2b, 0xf4, 0x35, 0x6a, + 0x10, 0x74, 0x20, 0xff, 0x85, 0x7c, 0xe9, 0x92, 0x56, 0x14, 0xc7, 0xa2, 0xfc, 0x17, 0x2c, 0xa7, + 0x85, 0x6c, 0x56, 0xce, 0x42, 0xfd, 0xe1, 0x33, 0x39, 0xf6, 0xe4, 0x99, 0x1c, 0xfb, 0x76, 0x47, + 0x8e, 0x3d, 0xdc, 0x91, 0x85, 0x47, 0x3b, 0xb2, 0xf0, 0xe7, 0x8e, 0x2c, 0xdc, 0x7e, 0x2e, 0xc7, + 0x1e, 0x3d, 0x97, 0x63, 0x4f, 0x9e, 0xcb, 0xb1, 0x6b, 0xa7, 0x5f, 0xdb, 0xb0, 0x9b, 0xf4, 0xd7, + 0x17, 0x6d, 0xdb, 0xf0, 0x07, 0xd5, 0xda, 0x38, 0xdd, 0x0c, 0x67, 0xff, 0x0d, 0x00, 0x00, 0xff, + 0xff, 0x4a, 0x3c, 0x8e, 0x3e, 0xa0, 0x0d, 0x00, 0x00, +} + +func (this *TextProposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TextProposal) + if !ok { + that2, ok := that.(TextProposal) + 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 *Proposal) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Proposal) + if !ok { + that2, ok := that.(Proposal) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.ProposalId != that1.ProposalId { + return false + } + if !this.Content.Equal(that1.Content) { + return false + } + if this.Status != that1.Status { + return false + } + if !this.FinalTallyResult.Equal(&that1.FinalTallyResult) { + return false + } + if !this.SubmitTime.Equal(that1.SubmitTime) { + return false + } + if !this.DepositEndTime.Equal(that1.DepositEndTime) { + return false + } + if len(this.TotalDeposit) != len(that1.TotalDeposit) { + return false + } + for i := range this.TotalDeposit { + if !this.TotalDeposit[i].Equal(&that1.TotalDeposit[i]) { + return false + } + } + if !this.VotingStartTime.Equal(that1.VotingStartTime) { + return false + } + if !this.VotingEndTime.Equal(that1.VotingEndTime) { + return false + } + return true +} +func (this *TallyResult) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*TallyResult) + if !ok { + that2, ok := that.(TallyResult) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.Yes.Equal(that1.Yes) { + return false + } + if !this.Abstain.Equal(that1.Abstain) { + return false + } + if !this.No.Equal(that1.No) { + return false + } + if !this.NoWithVeto.Equal(that1.NoWithVeto) { + return false + } + return true +} +func (m *WeightedVoteOption) 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 *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Weight.Size() + i -= size + if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TextProposal) 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 *TextProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TextProposal) 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 = encodeVarintGov(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 = encodeVarintGov(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Deposit) 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 = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingEndTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintGov(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x4a + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingStartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintGov(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x42 + if len(m.TotalDeposit) > 0 { + for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DepositEndTime):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintGov(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x32 + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SubmitTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintGov(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x2a + { + size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if m.Status != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x18 + } + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TallyResult) 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 *TallyResult) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.NoWithVeto.Size() + i -= size + if _, err := m.NoWithVeto.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.No.Size() + i -= size + if _, err := m.No.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.Abstain.Size() + i -= size + if _, err := m.Abstain.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Yes.Size() + i -= size + if _, err := m.Yes.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DepositParams) 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 *DepositParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxDepositPeriod):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintGov(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + if len(m.MinDeposit) > 0 { + for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *VotingParams) 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 *VotingParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.VotingPeriod):]) + if err8 != nil { + return 0, err8 + } + i -= n8 + i = encodeVarintGov(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *TallyParams) 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 *TallyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.VetoThreshold.Size() + i -= size + if _, err := m.VetoThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.Threshold.Size() + i -= size + if _, err := m.Threshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.Quorum.Size() + i -= size + if _, err := m.Quorum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGov(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGov(dAtA []byte, offset int, v uint64) int { + offset -= sovGov(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *WeightedVoteOption) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } + l = m.Weight.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TextProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + +func (m *Deposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovGov(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if len(m.Amount) > 0 { + for _, e := range m.Amount { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func (m *Proposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovGov(uint64(m.ProposalId)) + } + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovGov(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovGov(uint64(m.Status)) + } + l = m.FinalTallyResult.Size() + n += 1 + l + sovGov(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SubmitTime) + n += 1 + l + sovGov(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DepositEndTime) + n += 1 + l + sovGov(uint64(l)) + if len(m.TotalDeposit) > 0 { + for _, e := range m.TotalDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingStartTime) + n += 1 + l + sovGov(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingEndTime) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TallyResult) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Yes.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Abstain.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.No.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.NoWithVeto.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *Vote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovGov(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } + if len(m.Options) > 0 { + for _, e := range m.Options { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + return n +} + +func (m *DepositParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinDeposit) > 0 { + for _, e := range m.MinDeposit { + l = e.Size() + n += 1 + l + sovGov(uint64(l)) + } + } + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxDepositPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *VotingParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.VotingPeriod) + n += 1 + l + sovGov(uint64(l)) + return n +} + +func (m *TallyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Quorum.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.Threshold.Size() + n += 1 + l + sovGov(uint64(l)) + l = m.VetoThreshold.Size() + n += 1 + l + sovGov(uint64(l)) + return n +} + +func sovGov(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGov(x uint64) (n int) { + return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WeightedVoteOption) 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 ErrIntOverflowGov + } + 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: WeightedVoteOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TextProposal) 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 ErrIntOverflowGov + } + 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: TextProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TextProposal: 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + 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 ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Deposit) 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 ErrIntOverflowGov + } + 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: Deposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Depositor = 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 ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + 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 := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Proposal) 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 ErrIntOverflowGov + } + 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: Proposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Content == nil { + m.Content = &types1.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TotalDeposit = append(m.TotalDeposit, types.Coin{}) + if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TallyResult) 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 ErrIntOverflowGov + } + 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: TallyResult: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NoWithVeto.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Vote) 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 ErrIntOverflowGov + } + 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: Vote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + 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 ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = append(m.Options, WeightedVoteOption{}) + if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DepositParams) 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 ErrIntOverflowGov + } + 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: DepositParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinDeposit = append(m.MinDeposit, types.Coin{}) + if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VotingParams) 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 ErrIntOverflowGov + } + 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: VotingParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TallyParams) 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 ErrIntOverflowGov + } + 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: TallyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.VetoThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGov(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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrIntOverflowGov + } + 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, ErrInvalidLengthGov + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGov + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGov + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go new file mode 100644 index 000000000000..39597345ced4 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go @@ -0,0 +1,3866 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/query.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "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 + +// QueryProposalRequest is the request type for the Query/Proposal RPC method. +type QueryProposalRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } +func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalRequest) ProtoMessage() {} +func (*QueryProposalRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{0} +} +func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalRequest.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 *QueryProposalRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalRequest.Merge(m, src) +} +func (m *QueryProposalRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo + +func (m *QueryProposalRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryProposalResponse is the response type for the Query/Proposal RPC method. +type QueryProposalResponse struct { + Proposal Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` +} + +func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } +func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalResponse) ProtoMessage() {} +func (*QueryProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{1} +} +func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalResponse.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 *QueryProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalResponse.Merge(m, src) +} +func (m *QueryProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo + +func (m *QueryProposalResponse) GetProposal() Proposal { + if m != nil { + return m.Proposal + } + return Proposal{} +} + +// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +type QueryProposalsRequest struct { + // proposal_status defines the status of the proposals. + ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"proposal_status,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } +func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsRequest) ProtoMessage() {} +func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{2} +} +func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsRequest.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 *QueryProposalsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsRequest.Merge(m, src) +} +func (m *QueryProposalsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo + +// QueryProposalsResponse is the response type for the Query/Proposals RPC +// method. +type QueryProposalsResponse struct { + // proposals defines all the requested governance proposals. + Proposals []Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} } +func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalsResponse) ProtoMessage() {} +func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{3} +} +func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalsResponse.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 *QueryProposalsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalsResponse.Merge(m, src) +} +func (m *QueryProposalsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo + +func (m *QueryProposalsResponse) GetProposals() []Proposal { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *QueryProposalsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryVoteRequest is the request type for the Query/Vote RPC method. +type QueryVoteRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter defines the voter address for the proposals. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` +} + +func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } +func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVoteRequest) ProtoMessage() {} +func (*QueryVoteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{4} +} +func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteRequest.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 *QueryVoteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteRequest.Merge(m, src) +} +func (m *QueryVoteRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo + +// QueryVoteResponse is the response type for the Query/Vote RPC method. +type QueryVoteResponse struct { + // vote defines the queried vote. + Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` +} + +func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } +func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVoteResponse) ProtoMessage() {} +func (*QueryVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{5} +} +func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVoteResponse.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 *QueryVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVoteResponse.Merge(m, src) +} +func (m *QueryVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo + +func (m *QueryVoteResponse) GetVote() Vote { + if m != nil { + return m.Vote + } + return Vote{} +} + +// QueryVotesRequest is the request type for the Query/Votes RPC method. +type QueryVotesRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } +func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryVotesRequest) ProtoMessage() {} +func (*QueryVotesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{6} +} +func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesRequest.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 *QueryVotesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesRequest.Merge(m, src) +} +func (m *QueryVotesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo + +func (m *QueryVotesRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryVotesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryVotesResponse is the response type for the Query/Votes RPC method. +type QueryVotesResponse struct { + // votes defines the queried votes. + Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } +func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryVotesResponse) ProtoMessage() {} +func (*QueryVotesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{7} +} +func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryVotesResponse.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 *QueryVotesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryVotesResponse.Merge(m, src) +} +func (m *QueryVotesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryVotesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo + +func (m *QueryVotesResponse) GetVotes() []Vote { + if m != nil { + return m.Votes + } + return nil +} + +func (m *QueryVotesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { + // params_type defines which parameters to query for, can be one of "voting", + // "tallying" or "deposit". + ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` +} + +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_e35c0d133e91c0a2, []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 + +func (m *QueryParamsRequest) GetParamsType() string { + if m != nil { + return m.ParamsType + } + return "" +} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // voting_params defines the parameters related to voting. + VotingParams VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` + // deposit_params defines the parameters related to deposit. + DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` + // tally_params defines the parameters related to tally. + TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_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_e35c0d133e91c0a2, []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) GetVotingParams() VotingParams { + if m != nil { + return m.VotingParams + } + return VotingParams{} +} + +func (m *QueryParamsResponse) GetDepositParams() DepositParams { + if m != nil { + return m.DepositParams + } + return DepositParams{} +} + +func (m *QueryParamsResponse) GetTallyParams() TallyParams { + if m != nil { + return m.TallyParams + } + return TallyParams{} +} + +// QueryDepositRequest is the request type for the Query/Deposit RPC method. +type QueryDepositRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` +} + +func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } +func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositRequest) ProtoMessage() {} +func (*QueryDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{10} +} +func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositRequest.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 *QueryDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositRequest.Merge(m, src) +} +func (m *QueryDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo + +// QueryDepositResponse is the response type for the Query/Deposit RPC method. +type QueryDepositResponse struct { + // deposit defines the requested deposit. + Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` +} + +func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } +func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositResponse) ProtoMessage() {} +func (*QueryDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{11} +} +func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositResponse.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 *QueryDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositResponse.Merge(m, src) +} +func (m *QueryDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo + +func (m *QueryDepositResponse) GetDeposit() Deposit { + if m != nil { + return m.Deposit + } + return Deposit{} +} + +// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +type QueryDepositsRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } +func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsRequest) ProtoMessage() {} +func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{12} +} +func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsRequest.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 *QueryDepositsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsRequest.Merge(m, src) +} +func (m *QueryDepositsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsRequest proto.InternalMessageInfo + +func (m *QueryDepositsRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +type QueryDepositsResponse struct { + // deposits defines the requested deposits. + Deposits []Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } +func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositsResponse) ProtoMessage() {} +func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{13} +} +func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositsResponse.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 *QueryDepositsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositsResponse.Merge(m, src) +} +func (m *QueryDepositsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo + +func (m *QueryDepositsResponse) GetDeposits() []Deposit { + if m != nil { + return m.Deposits + } + return nil +} + +func (m *QueryDepositsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +type QueryTallyResultRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest{} } +func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultRequest) ProtoMessage() {} +func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{14} +} +func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultRequest.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 *QueryTallyResultRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultRequest.Merge(m, src) +} +func (m *QueryTallyResultRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultRequest proto.InternalMessageInfo + +func (m *QueryTallyResultRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +type QueryTallyResultResponse struct { + // tally defines the requested tally. + Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` +} + +func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } +func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTallyResultResponse) ProtoMessage() {} +func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e35c0d133e91c0a2, []int{15} +} +func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTallyResultResponse.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 *QueryTallyResultResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) +} +func (m *QueryTallyResultResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo + +func (m *QueryTallyResultResponse) GetTally() TallyResult { + if m != nil { + return m.Tally + } + return TallyResult{} +} + +func init() { + proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta1.QueryProposalRequest") + proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta1.QueryProposalResponse") + proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta1.QueryProposalsRequest") + proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta1.QueryProposalsResponse") + proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta1.QueryVoteRequest") + proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta1.QueryVoteResponse") + proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta1.QueryVotesRequest") + proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta1.QueryVotesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta1.QueryParamsResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta1.QueryDepositResponse") + proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta1.QueryDepositsRequest") + proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta1.QueryDepositsResponse") + proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta1.QueryTallyResultRequest") + proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta1.QueryTallyResultResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/query.proto", fileDescriptor_e35c0d133e91c0a2) } + +var fileDescriptor_e35c0d133e91c0a2 = []byte{ + // 1014 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0x38, 0x49, 0x6b, 0xbf, 0xb4, 0x81, 0x3e, 0x02, 0x18, 0x53, 0xec, 0xb0, 0xa2, 0xad, + 0x49, 0x89, 0xb7, 0x49, 0xa0, 0x55, 0x0a, 0x87, 0xd6, 0x40, 0xf9, 0x96, 0x82, 0x53, 0x21, 0x84, + 0x90, 0xa2, 0x4d, 0xbd, 0x5a, 0x56, 0xd8, 0x3b, 0xdb, 0x9d, 0xb1, 0xd5, 0x28, 0x44, 0x48, 0x9c, + 0x40, 0xbd, 0x80, 0x40, 0x88, 0x0b, 0xa8, 0x12, 0x08, 0xf5, 0xc8, 0x81, 0x3f, 0xa2, 0xc7, 0x0a, + 0x38, 0x70, 0x42, 0x28, 0x41, 0x82, 0x3f, 0x03, 0xed, 0x7c, 0xac, 0x77, 0xe3, 0x75, 0x76, 0x5d, + 0x2a, 0x2e, 0x89, 0x33, 0xf3, 0xfb, 0xbd, 0xf7, 0x7b, 0x1f, 0xf3, 0x9e, 0x03, 0xb5, 0x6b, 0x94, + 0xf5, 0x28, 0x33, 0x1d, 0x3a, 0x30, 0x07, 0xcb, 0x5b, 0x36, 0xb7, 0x96, 0xcd, 0xeb, 0x7d, 0x3b, + 0xd8, 0x6e, 0xfa, 0x01, 0xe5, 0x14, 0x51, 0xde, 0x37, 0x1d, 0x3a, 0x68, 0xaa, 0xfb, 0xea, 0xa2, + 0xe2, 0x6c, 0x59, 0xcc, 0x96, 0xe0, 0x88, 0xea, 0x5b, 0x8e, 0xeb, 0x59, 0xdc, 0xa5, 0x9e, 0xe4, + 0x57, 0xe7, 0x1d, 0xea, 0x50, 0xf1, 0xd1, 0x0c, 0x3f, 0xa9, 0xd3, 0x93, 0x0e, 0xa5, 0x4e, 0xd7, + 0x36, 0x2d, 0xdf, 0x35, 0x2d, 0xcf, 0xa3, 0x5c, 0x50, 0x98, 0xbe, 0x4d, 0xd1, 0x14, 0xfa, 0x97, + 0xb7, 0x8f, 0xc9, 0xdb, 0x4d, 0x69, 0x54, 0xc9, 0x93, 0x57, 0x27, 0xac, 0x9e, 0xeb, 0x51, 0x53, + 0xfc, 0x94, 0x47, 0xc6, 0x05, 0x98, 0x7f, 0x3b, 0x54, 0xb8, 0x1e, 0x50, 0x9f, 0x32, 0xab, 0xdb, + 0xb6, 0xaf, 0xf7, 0x6d, 0xc6, 0xb1, 0x0e, 0xb3, 0xbe, 0x3a, 0xda, 0x74, 0x3b, 0x15, 0xb2, 0x40, + 0x1a, 0xd3, 0x6d, 0xd0, 0x47, 0xaf, 0x75, 0x8c, 0xf7, 0xe1, 0xe1, 0x03, 0x44, 0xe6, 0x53, 0x8f, + 0xd9, 0xf8, 0x22, 0x94, 0x34, 0x4c, 0xd0, 0x66, 0x57, 0x4e, 0x36, 0x47, 0x93, 0xd4, 0xd4, 0xbc, + 0x56, 0xf9, 0xce, 0x1f, 0xf5, 0xc2, 0xed, 0xbf, 0x7f, 0x5a, 0x24, 0xed, 0x88, 0x68, 0x7c, 0x57, + 0x3c, 0x60, 0x9e, 0x69, 0x61, 0x6f, 0xc0, 0x03, 0x91, 0x30, 0xc6, 0x2d, 0xde, 0x67, 0xc2, 0xcb, + 0xdc, 0x8a, 0x71, 0x98, 0x97, 0x0d, 0x81, 0x6c, 0xcf, 0xf9, 0x89, 0xbf, 0xb1, 0x09, 0x33, 0x03, + 0xca, 0xed, 0xa0, 0x52, 0x5c, 0x20, 0x8d, 0x72, 0xab, 0xf2, 0xcb, 0xcf, 0x4b, 0xf3, 0xca, 0xca, + 0xe5, 0x4e, 0x27, 0xb0, 0x19, 0xdb, 0xe0, 0x81, 0xeb, 0x39, 0x6d, 0x09, 0xc3, 0xf3, 0x50, 0xee, + 0xd8, 0x3e, 0x65, 0x2e, 0xa7, 0x41, 0x65, 0x2a, 0x83, 0x33, 0x84, 0xe2, 0x15, 0x80, 0x61, 0xe5, + 0x2b, 0xd3, 0x22, 0x2b, 0xa7, 0xb5, 0xde, 0xb0, 0x4d, 0x9a, 0xb2, 0xa7, 0x22, 0xd9, 0x96, 0x63, + 0xab, 0x80, 0xdb, 0x31, 0xe6, 0xc5, 0xd2, 0xa7, 0xb7, 0xea, 0x85, 0x7f, 0x6e, 0xd5, 0x0b, 0xc6, + 0x6d, 0x02, 0x8f, 0x1c, 0x4c, 0x90, 0x2a, 0xc0, 0xcb, 0x50, 0xd6, 0x61, 0x86, 0xb9, 0x99, 0x9a, + 0xa4, 0x02, 0x43, 0x26, 0xbe, 0x92, 0xd0, 0x5c, 0x14, 0x9a, 0xcf, 0x64, 0x6a, 0x96, 0x1a, 0xe2, + 0xa2, 0x8d, 0x1e, 0x3c, 0x28, 0x94, 0xbe, 0x43, 0xb9, 0x9d, 0xb7, 0xbd, 0x26, 0xad, 0x4c, 0x2c, + 0x33, 0x6f, 0xc2, 0x89, 0x98, 0x3b, 0x95, 0x93, 0x0b, 0x30, 0x1d, 0xe2, 0x54, 0x43, 0x56, 0xd2, + 0xd2, 0x11, 0xe2, 0xe3, 0xa9, 0x10, 0x04, 0xe3, 0xa3, 0x98, 0x35, 0x96, 0x5b, 0xfd, 0x95, 0x94, + 0xdc, 0xdd, 0x43, 0xbd, 0x8d, 0x6f, 0x08, 0x60, 0xdc, 0xbd, 0x8a, 0x66, 0x4d, 0x26, 0x47, 0x57, + 0x37, 0x57, 0x38, 0x92, 0x71, 0xff, 0xaa, 0xfa, 0x9c, 0x52, 0xb6, 0x6e, 0x05, 0x56, 0x2f, 0x91, + 0x19, 0x71, 0xb0, 0xc9, 0xb7, 0x7d, 0x99, 0xee, 0x72, 0x48, 0x0b, 0x8f, 0xae, 0x6e, 0xfb, 0xb6, + 0x71, 0xb3, 0x08, 0x0f, 0x25, 0x78, 0x2a, 0xa4, 0x75, 0x38, 0x3e, 0xa0, 0xdc, 0xf5, 0x9c, 0x4d, + 0x09, 0x56, 0x95, 0x5a, 0x18, 0x13, 0x9a, 0xeb, 0x39, 0xd2, 0x40, 0x3c, 0xc4, 0x63, 0x83, 0xd8, + 0x05, 0x6e, 0xc0, 0x9c, 0x7a, 0x80, 0xda, 0xa4, 0x8c, 0xf6, 0xc9, 0x34, 0x93, 0x2f, 0x49, 0xe4, + 0xa8, 0xcd, 0xe3, 0x9d, 0xf8, 0x0d, 0xbe, 0x05, 0xc7, 0xb8, 0xd5, 0xed, 0x6e, 0x6b, 0x93, 0x53, + 0xc2, 0x64, 0x3d, 0xcd, 0xe4, 0xd5, 0x10, 0x37, 0x6a, 0x70, 0x96, 0x0f, 0xcf, 0x8d, 0x1b, 0x2a, + 0x19, 0xca, 0x7d, 0xee, 0xfe, 0x4a, 0xcc, 0xa1, 0x62, 0xee, 0x39, 0x14, 0x7b, 0x25, 0xef, 0xaa, + 0xb9, 0x1f, 0x79, 0x56, 0x75, 0xb8, 0x04, 0x47, 0x15, 0x5c, 0x55, 0xe0, 0xf1, 0x43, 0xd2, 0x15, + 0x8f, 0x4b, 0xd3, 0x8c, 0x8f, 0x93, 0x96, 0xff, 0xff, 0x47, 0xf3, 0x03, 0x51, 0xbb, 0x63, 0xa8, + 0x40, 0x05, 0xd7, 0x82, 0x92, 0x52, 0xa9, 0x9f, 0x4e, 0xde, 0xe8, 0x22, 0xde, 0xfd, 0x7b, 0x40, + 0x17, 0xe1, 0x51, 0xa1, 0x52, 0xf4, 0x49, 0xdb, 0x66, 0xfd, 0x2e, 0x9f, 0x60, 0xf9, 0x56, 0x46, + 0xb9, 0x51, 0x05, 0x67, 0x44, 0x8b, 0xa9, 0xfa, 0x8d, 0xef, 0x4d, 0xc9, 0x4b, 0xcc, 0x08, 0x41, + 0x5c, 0xf9, 0xad, 0x0c, 0x33, 0xc2, 0x3c, 0x7e, 0x45, 0xa0, 0xa4, 0xd7, 0x04, 0x36, 0xd2, 0x2c, + 0xa5, 0x7d, 0x79, 0xa8, 0x3e, 0x9d, 0x03, 0x29, 0xd5, 0x1a, 0xab, 0x9f, 0xfc, 0xfa, 0xd7, 0x97, + 0xc5, 0x25, 0x3c, 0x6b, 0xa6, 0x7c, 0xa9, 0x89, 0x96, 0x91, 0xb9, 0x13, 0xcb, 0xc7, 0x2e, 0x7e, + 0x46, 0xa0, 0x1c, 0xed, 0x3d, 0xcc, 0xf6, 0xa6, 0x7b, 0xb0, 0xba, 0x98, 0x07, 0xaa, 0x94, 0x9d, + 0x12, 0xca, 0xea, 0xf8, 0xc4, 0xa1, 0xca, 0xf0, 0x6b, 0x02, 0xd3, 0xe1, 0xac, 0xc5, 0xa7, 0xc6, + 0xda, 0x8e, 0x2d, 0xbe, 0xea, 0xa9, 0x0c, 0x94, 0x72, 0x7e, 0x59, 0x38, 0x7f, 0x1e, 0xd7, 0x26, + 0x48, 0x8b, 0x29, 0x26, 0xbc, 0xb9, 0x23, 0x16, 0xe2, 0x2e, 0x7e, 0x41, 0x60, 0x46, 0xac, 0x0d, + 0x3c, 0xdc, 0x67, 0x94, 0x9c, 0xd3, 0x59, 0x30, 0xa5, 0x6d, 0x4d, 0x68, 0x5b, 0xc5, 0xe5, 0x89, + 0xb5, 0xe1, 0x4d, 0x02, 0x47, 0xd4, 0x24, 0x1d, 0xef, 0x2d, 0xb1, 0x51, 0xaa, 0x67, 0x32, 0x71, + 0x4a, 0xd6, 0x39, 0x21, 0x6b, 0x11, 0x1b, 0xa9, 0xb2, 0x04, 0xd6, 0xdc, 0x89, 0x2d, 0xa7, 0x5d, + 0xfc, 0x91, 0xc0, 0x51, 0xf5, 0xd6, 0x71, 0xbc, 0x9b, 0xe4, 0x6c, 0xae, 0x36, 0xb2, 0x81, 0x4a, + 0xd0, 0xab, 0x42, 0x50, 0x0b, 0x2f, 0x4d, 0x92, 0x27, 0x3d, 0x67, 0xcc, 0x9d, 0x68, 0x6a, 0xef, + 0xe2, 0xb7, 0x04, 0x4a, 0x7a, 0x98, 0x61, 0xa6, 0x00, 0x96, 0xfd, 0x0c, 0x0f, 0x4e, 0x46, 0xe3, + 0x05, 0xa1, 0xf5, 0x3c, 0x3e, 0x7b, 0x2f, 0x5a, 0xf1, 0x7b, 0x02, 0xb3, 0xb1, 0x91, 0x82, 0x67, + 0xc7, 0x3a, 0x1e, 0x1d, 0x76, 0xd5, 0x67, 0xf2, 0x81, 0xff, 0x4b, 0xf3, 0x89, 0xb1, 0xd6, 0x7a, + 0xfd, 0xce, 0x5e, 0x8d, 0xdc, 0xdd, 0xab, 0x91, 0x3f, 0xf7, 0x6a, 0xe4, 0xf3, 0xfd, 0x5a, 0xe1, + 0xee, 0x7e, 0xad, 0xf0, 0xfb, 0x7e, 0xad, 0xf0, 0xde, 0x39, 0xc7, 0xe5, 0x1f, 0xf4, 0xb7, 0x9a, + 0xd7, 0x68, 0x4f, 0x9b, 0x95, 0xbf, 0x96, 0x58, 0xe7, 0x43, 0xf3, 0x86, 0xf0, 0x11, 0xb6, 0x0c, + 0xd3, 0x9e, 0xb6, 0x8e, 0x88, 0xff, 0x9e, 0x56, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x10, 0xb6, + 0xa8, 0x92, 0x1f, 0x0e, 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 { + // Proposal queries proposal details based on ProposalID. + Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { + out := new(QueryProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { + out := new(QueryProposalsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposals", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { + out := new(QueryVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { + out := new(QueryVotesResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Votes", 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, "/cosmos.gov.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + out := new(QueryDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { + out := new(QueryDepositsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposits", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { + out := new(QueryTallyResultResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/TallyResult", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Proposal queries proposal details based on ProposalID. + Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) + // Proposals queries all proposals based on given status. + Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) + // Vote queries voted information based on proposalID, voterAddr. + Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) + // Votes queries votes of a given proposal. + Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) + // Params queries all parameters of the gov module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Deposit queries single deposit information based proposalID, depositAddr. + Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) + // Deposits queries all deposits of a single proposal. + Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) + // TallyResult queries the tally of a proposal vote. + TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") +} +func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") +} +func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") +} +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} +func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") +} +func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Proposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposals(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Proposals", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVoteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryVotesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Votes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Votes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) + } + 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: "/cosmos.gov.v1beta1.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_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/Deposits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTallyResultRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TallyResult(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Query/TallyResult", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Proposal", + Handler: _Query_Proposal_Handler, + }, + { + MethodName: "Proposals", + Handler: _Query_Proposals_Handler, + }, + { + MethodName: "Vote", + Handler: _Query_Vote_Handler, + }, + { + MethodName: "Votes", + Handler: _Query_Votes_Handler, + }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Deposit", + Handler: _Query_Deposit_Handler, + }, + { + MethodName: "Deposits", + Handler: _Query_Deposits_Handler, + }, + { + MethodName: "TallyResult", + Handler: _Query_TallyResult_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1beta1/query.proto", +} + +func (m *QueryProposalRequest) 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 *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalResponse) 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 *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Proposal.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 *QueryProposalsRequest) 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 *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsRequest) 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] = 0x22 + } + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x1a + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalStatus != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalsResponse) 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 *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalsResponse) 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.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[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 *QueryVoteRequest) 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 *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVoteResponse) 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 *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Vote.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 *QueryVotesRequest) 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 *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesRequest) 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 m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryVotesResponse) 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 *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryVotesResponse) 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.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[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 *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 + if len(m.ParamsType) > 0 { + i -= len(m.ParamsType) + copy(dAtA[i:], m.ParamsType) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) + i-- + dAtA[i] = 0xa + } + 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.TallyParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.VotingParams.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 *QueryDepositRequest) 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 *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) 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 *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Deposit.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 *QueryDepositsRequest) 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 *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsRequest) 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 m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositsResponse) 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 *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositsResponse) 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.Deposits) > 0 { + for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Deposits[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 *QueryTallyResultRequest) 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 *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTallyResultResponse) 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 *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Tally.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 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 *QueryProposalRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Proposal.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryProposalsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalStatus != 0 { + n += 1 + sovQuery(uint64(m.ProposalStatus)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposalsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + 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 *QueryVoteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Vote.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryVotesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryVotesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Votes) > 0 { + for _, e := range m.Votes { + 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 *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ParamsType) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.VotingParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.DepositParams.Size() + n += 1 + l + sovQuery(uint64(l)) + l = m.TallyParams.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + l = len(m.Depositor) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDepositsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Deposits) > 0 { + for _, e := range m.Deposits { + 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 *QueryTallyResultRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryTallyResultResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Tally.Size() + n += 1 + l + sovQuery(uint64(l)) + 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 *QueryProposalRequest) 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: QueryProposalRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalResponse) 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: QueryProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposal", 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.Proposal.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsRequest) 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: QueryProposalsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) + } + m.ProposalStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalStatus |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalsResponse) 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: QueryProposalsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", 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.Proposals = append(m.Proposals, Proposal{}) + if err := m.Proposals[len(m.Proposals)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteRequest) 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: QueryVoteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVoteResponse) 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: QueryVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vote", 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.Vote.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesRequest) 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: QueryVotesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryVotesResponse) 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: QueryVotesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", 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.Votes = append(m.Votes, Vote{}) + if err := m.Votes[len(m.Votes)-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) || (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 { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", 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.ParamsType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 VotingParams", 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.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", 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.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", 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.TallyParams.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositRequest) 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: QueryDepositRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositResponse) 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: QueryDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", 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.Deposit.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsRequest) 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: QueryDepositsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositsResponse) 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: QueryDepositsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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.Deposits = append(m.Deposits, Deposit{}) + if err := m.Deposits[len(m.Deposits)-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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultRequest) 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: QueryTallyResultRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTallyResultResponse) 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: QueryTallyResultResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tally", 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.Tally.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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go new file mode 100644 index 000000000000..57e602beadfa --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go @@ -0,0 +1,958 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/gov/v1beta1/query.proto + +/* +Package v1beta1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1beta1 + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := server.Proposal(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Proposals(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVoteRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["voter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") + } + + protoReq.Voter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) + } + + msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVoteRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["voter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") + } + + protoReq.Voter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) + } + + msg, err := server.Vote(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVotesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryVotesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Votes(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["params_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") + } + + protoReq.ParamsType, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) + } + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["params_type"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") + } + + protoReq.ParamsType, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) + } + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["depositor"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") + } + + protoReq.Depositor, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) + } + + msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + val, ok = pathParams["depositor"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") + } + + protoReq.Depositor, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) + } + + msg, err := server.Deposit(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Deposits(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTallyResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTallyResultRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := server.TallyResult(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1beta1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta1", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Proposal_0 = runtime.ForwardResponseMessage + + forward_Query_Proposals_0 = runtime.ForwardResponseMessage + + forward_Query_Vote_0 = runtime.ForwardResponseMessage + + forward_Query_Votes_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Deposit_0 = runtime.ForwardResponseMessage + + forward_Query_Deposits_0 = runtime.ForwardResponseMessage + + forward_Query_TallyResult_0 = runtime.ForwardResponseMessage +) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go new file mode 100644 index 000000000000..bba3fa870ee2 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go @@ -0,0 +1,1908 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/gov/v1beta1/tx.proto + +package v1beta1 + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "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 + +// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +// proposal Content. +type MsgSubmitProposal struct { + // content is the proposal's content. + Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // initial_deposit is the deposit value that must be paid at proposal submission. + InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` +} + +func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } +func (*MsgSubmitProposal) ProtoMessage() {} +func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{0} +} +func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposal.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 *MsgSubmitProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposal.Merge(m, src) +} +func (m *MsgSubmitProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo + +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +type MsgSubmitProposalResponse struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` +} + +func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } +func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposalResponse) ProtoMessage() {} +func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{1} +} +func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) +} +func (m *MsgSubmitProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo + +func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// MsgVote defines a message to cast a vote. +type MsgVote struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // option defines the vote option. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` +} + +func (m *MsgVote) Reset() { *m = MsgVote{} } +func (*MsgVote) ProtoMessage() {} +func (*MsgVote) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{2} +} +func (m *MsgVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVote.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 *MsgVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVote.Merge(m, src) +} +func (m *MsgVote) XXX_Size() int { + return m.Size() +} +func (m *MsgVote) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVote.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVote proto.InternalMessageInfo + +// MsgVoteResponse defines the Msg/Vote response type. +type MsgVoteResponse struct { +} + +func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } +func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteResponse) ProtoMessage() {} +func (*MsgVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{3} +} +func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteResponse.Merge(m, src) +} +func (m *MsgVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo + +// MsgVoteWeighted defines a message to cast a vote. +// +// Since: cosmos-sdk 0.43 +type MsgVoteWeighted struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // voter is the voter address for the proposal. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // options defines the weighted vote options. + Options []WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options"` +} + +func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } +func (*MsgVoteWeighted) ProtoMessage() {} +func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{4} +} +func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteWeighted.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 *MsgVoteWeighted) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteWeighted.Merge(m, src) +} +func (m *MsgVoteWeighted) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteWeighted) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteWeighted.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo + +// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +// +// Since: cosmos-sdk 0.43 +type MsgVoteWeightedResponse struct { +} + +func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse{} } +func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteWeightedResponse) ProtoMessage() {} +func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{5} +} +func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteWeightedResponse.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 *MsgVoteWeightedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteWeightedResponse.Merge(m, src) +} +func (m *MsgVoteWeightedResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteWeightedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo + +// MsgDeposit defines a message to submit a deposit to an existing proposal. +type MsgDeposit struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` + // depositor defines the deposit addresses from the proposals. + Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` + // amount to be deposited by depositor. + Amount 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 *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (*MsgDeposit) ProtoMessage() {} +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{6} +} +func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeposit.Merge(m, src) +} +func (m *MsgDeposit) XXX_Size() int { + return m.Size() +} +func (m *MsgDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo + +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{7} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") + proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") + proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") + proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") + proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") +} + +func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } + +var fileDescriptor_3c053992595e3dce = []byte{ + // 743 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xc7, 0xed, 0xa4, 0x6d, 0x7e, 0xbd, 0xfe, 0xd4, 0xaa, 0x56, 0x50, 0x13, 0xb7, 0x72, 0x22, + 0x23, 0xaa, 0xa8, 0x28, 0x36, 0x09, 0xb4, 0x82, 0x0c, 0x48, 0x0d, 0x0c, 0xfc, 0x51, 0xf8, 0x93, + 0x4a, 0x20, 0xb1, 0x14, 0x27, 0xbe, 0x5e, 0x2d, 0x1a, 0x9f, 0x95, 0xbb, 0x44, 0xcd, 0x56, 0x31, + 0x21, 0x26, 0x46, 0x36, 0x3a, 0x22, 0xa6, 0x0e, 0x7d, 0x0b, 0x48, 0x15, 0x53, 0x85, 0x18, 0x18, + 0x50, 0x41, 0xed, 0x50, 0xc4, 0xca, 0x1b, 0x40, 0xf6, 0xdd, 0x39, 0x69, 0xe3, 0xa6, 0xa5, 0x62, + 0x89, 0xed, 0xe7, 0xfb, 0x7c, 0x9f, 0xc7, 0xf7, 0xf1, 0x3d, 0x39, 0x30, 0x5d, 0xc7, 0xa4, 0x81, + 0x89, 0x89, 0x70, 0xdb, 0x6c, 0x17, 0x6a, 0x90, 0x5a, 0x05, 0x93, 0xae, 0x1b, 0x5e, 0x13, 0x53, + 0xac, 0x28, 0x4c, 0x34, 0x10, 0x6e, 0x1b, 0x5c, 0x54, 0x35, 0x6e, 0xa8, 0x59, 0x04, 0x86, 0x8e, + 0x3a, 0x76, 0x5c, 0xe6, 0x51, 0x67, 0x22, 0x0a, 0xfa, 0x7e, 0xa6, 0xa6, 0x99, 0xba, 0x1c, 0x3c, + 0x99, 0xbc, 0x3c, 0x93, 0x92, 0x08, 0x23, 0xcc, 0xe2, 0xfe, 0x9d, 0x30, 0x20, 0x8c, 0xd1, 0x1a, + 0x34, 0x83, 0xa7, 0x5a, 0x6b, 0xc5, 0xb4, 0xdc, 0x0e, 0x97, 0xa6, 0x78, 0xa7, 0x06, 0x41, 0x66, + 0xbb, 0xe0, 0x5f, 0xb8, 0x30, 0x69, 0x35, 0x1c, 0x17, 0x9b, 0xc1, 0x2f, 0x0b, 0xe9, 0x5f, 0x62, + 0x60, 0xb2, 0x42, 0xd0, 0x52, 0xab, 0xd6, 0x70, 0xe8, 0xa3, 0x26, 0xf6, 0x30, 0xb1, 0xd6, 0x94, + 0x07, 0x20, 0x51, 0xc7, 0x2e, 0x85, 0x2e, 0x4d, 0xc9, 0x59, 0x39, 0x37, 0x56, 0x4c, 0x1a, 0xac, + 0x9d, 0x21, 0xda, 0x19, 0x8b, 0x6e, 0xa7, 0xac, 0x7d, 0xda, 0xce, 0xab, 0xfd, 0x28, 0x8c, 0x5b, + 0xcc, 0x5b, 0x15, 0x45, 0x94, 0x0e, 0x98, 0x70, 0x5c, 0x87, 0x3a, 0xd6, 0xda, 0xb2, 0x0d, 0x3d, + 0x4c, 0x1c, 0x9a, 0x8a, 0x65, 0xe3, 0xb9, 0xb1, 0x62, 0xda, 0xe0, 0x76, 0x9f, 0x5a, 0x8f, 0xdf, + 0x71, 0xcb, 0xf3, 0x3b, 0x7b, 0x19, 0xe9, 0xc3, 0xf7, 0x4c, 0x0e, 0x39, 0x74, 0xb5, 0x55, 0x33, + 0xea, 0xb8, 0xc1, 0xb9, 0xf0, 0x4b, 0x9e, 0xd8, 0x2f, 0x4c, 0xda, 0xf1, 0x20, 0x09, 0x0c, 0xe4, + 0xfd, 0xe1, 0xd6, 0x9c, 0x5c, 0x1d, 0xe7, 0x8d, 0x6e, 0xb3, 0x3e, 0xca, 0x35, 0xf0, 0x9f, 0x17, + 0x2c, 0x0b, 0x36, 0x53, 0xf1, 0xac, 0x9c, 0x1b, 0x2d, 0xa7, 0x3e, 0x6f, 0xe7, 0x93, 0xbc, 0xed, + 0xa2, 0x6d, 0x37, 0x21, 0x21, 0x4b, 0xb4, 0xe9, 0xb8, 0xa8, 0x1a, 0x66, 0x96, 0x6e, 0xbe, 0xda, + 0xcc, 0x48, 0x6f, 0x37, 0x33, 0xd2, 0xcf, 0xcd, 0x8c, 0xb4, 0xf1, 0x2d, 0x2b, 0xbd, 0x3c, 0xdc, + 0x9a, 0x0b, 0xe5, 0xd7, 0x87, 0x5b, 0x73, 0x33, 0x3d, 0x2f, 0xd1, 0x07, 0x50, 0xaf, 0x82, 0x74, + 0x5f, 0xb0, 0x0a, 0x89, 0x87, 0x5d, 0x02, 0x95, 0x79, 0x30, 0xe6, 0xf1, 0xd8, 0xb2, 0x63, 0x07, + 0x84, 0x87, 0xca, 0xc9, 0x5f, 0x7b, 0x99, 0xde, 0x30, 0x5b, 0x0d, 0x10, 0x91, 0xbb, 0xb6, 0xfe, + 0x51, 0x06, 0x89, 0x0a, 0x41, 0x4f, 0x30, 0x85, 0x4a, 0x26, 0xa2, 0x44, 0x6f, 0xb2, 0x62, 0x80, + 0xe1, 0x36, 0xa6, 0xb0, 0x99, 0x8a, 0x9d, 0xb2, 0x66, 0x96, 0xa6, 0x2c, 0x80, 0x11, 0xec, 0x51, + 0x07, 0xbb, 0x01, 0xa4, 0xf1, 0xa2, 0x66, 0x44, 0x7c, 0x57, 0xbf, 0xf5, 0xc3, 0x20, 0xab, 0xca, + 0xb3, 0x4b, 0x85, 0x28, 0x50, 0xac, 0xa6, 0x4f, 0x49, 0x39, 0x4a, 0xc9, 0x2f, 0xa0, 0x4f, 0x82, + 0x09, 0x7e, 0x2b, 0x88, 0xe8, 0x1b, 0xb1, 0x30, 0xf6, 0x14, 0x3a, 0x68, 0x95, 0x42, 0xfb, 0x9c, + 0x94, 0xfe, 0x7a, 0xe1, 0xf7, 0x41, 0x82, 0x2d, 0x85, 0xa4, 0xe2, 0xc1, 0x96, 0x9c, 0x8d, 0x5a, + 0xb9, 0x78, 0xab, 0x2e, 0x81, 0xf2, 0xa8, 0xbf, 0x3f, 0x59, 0x7f, 0x51, 0xa1, 0x74, 0x63, 0x30, + 0x0d, 0xb5, 0x9f, 0x86, 0x28, 0xac, 0xa7, 0xc1, 0xd4, 0xb1, 0x50, 0x48, 0xe7, 0x5d, 0x0c, 0x80, + 0x0a, 0x41, 0x62, 0x47, 0x9f, 0x13, 0xcc, 0x02, 0x18, 0xe5, 0xb3, 0x87, 0x4f, 0x87, 0xd3, 0x4d, + 0x55, 0x56, 0xc1, 0x88, 0xd5, 0xc0, 0x2d, 0x97, 0x72, 0x3e, 0xff, 0x7e, 0x64, 0x79, 0xfd, 0xd2, + 0xf5, 0x28, 0x7a, 0xdd, 0x37, 0xf1, 0x09, 0x5e, 0x38, 0x4a, 0x90, 0x23, 0xd1, 0x93, 0x40, 0xe9, + 0x3e, 0x09, 0x6e, 0xc5, 0xdf, 0x31, 0x10, 0xaf, 0x10, 0xa4, 0xac, 0x80, 0xf1, 0x63, 0xff, 0x6f, + 0x97, 0xa2, 0xbe, 0x71, 0xdf, 0xc0, 0xaa, 0xf9, 0x33, 0xa5, 0x85, 0x73, 0x7d, 0x07, 0x0c, 0x05, + 0xc3, 0x39, 0x7d, 0x82, 0xcd, 0x17, 0xd5, 0x8b, 0x03, 0xc4, 0xb0, 0xd2, 0x73, 0xf0, 0xff, 0x91, + 0x59, 0x18, 0x64, 0x12, 0x49, 0xea, 0xe5, 0x33, 0x24, 0x85, 0x1d, 0x1e, 0x83, 0x84, 0xd8, 0x4f, + 0xda, 0x09, 0x3e, 0xae, 0xab, 0xb3, 0x83, 0x75, 0x51, 0x52, 0x1d, 0xde, 0xf0, 0xbf, 0x66, 0xf9, + 0xde, 0xce, 0xbe, 0x26, 0xef, 0xee, 0x6b, 0xf2, 0x8f, 0x7d, 0x4d, 0x7e, 0x73, 0xa0, 0x49, 0xbb, + 0x07, 0x9a, 0xf4, 0xf5, 0x40, 0x93, 0x9e, 0x5d, 0x19, 0xb8, 0x2d, 0xd6, 0x83, 0x93, 0x31, 0xd8, + 0x1c, 0xe2, 0x7c, 0xac, 0x8d, 0x04, 0xc7, 0xcd, 0xd5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2c, + 0x40, 0xe3, 0x51, 0x8d, 0x07, 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 { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + out := new(MsgSubmitProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/SubmitProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + out := new(MsgVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { + out := new(MsgVoteWeightedResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/VoteWeighted", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) + // VoteWeighted defines a method to add a weighted vote on a specific proposal. + // + // Since: cosmos-sdk 0.43 + VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") +} +func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VoteWeighted not implemented") +} +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/SubmitProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVote) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVoteWeighted) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VoteWeighted(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/VoteWeighted", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitProposal", + Handler: _Msg_SubmitProposal_Handler, + }, + { + MethodName: "Vote", + Handler: _Msg_Vote_Handler, + }, + { + MethodName: "VoteWeighted", + Handler: _Msg_VoteWeighted_Handler, + }, + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1beta1/tx.proto", +} + +func (m *MsgSubmitProposal) 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 *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x1a + } + if len(m.InitialDeposit) > 0 { + for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Content != nil { + { + size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgVote) 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 *MsgVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Option != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgVoteWeighted) 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 *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Options) > 0 { + for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Options[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.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgVoteWeightedResponse) 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 *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeposit) 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.Depositor) > 0 { + i -= len(m.Depositor) + copy(dAtA[i:], m.Depositor) + i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) + i-- + dAtA[i] = 0x12 + } + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) 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 *MsgSubmitProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Content != nil { + l = m.Content.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.InitialDeposit) > 0 { + for _, e := range m.InitialDeposit { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + +func (m *MsgVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Option != 0 { + n += 1 + sovTx(uint64(m.Option)) + } + return n +} + +func (m *MsgVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgVoteWeighted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Options) > 0 { + for _, e := range m.Options { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgVoteWeightedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + l = len(m.Depositor) + 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 *MsgDepositResponse) 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 *MsgSubmitProposal) 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: MsgSubmitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Content", 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 m.Content == nil { + m.Content = &types.Any{} + } + if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", 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.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) + 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 *MsgSubmitProposalResponse) 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: MsgSubmitProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(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 *MsgVote) 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: MsgVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(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 *MsgVoteResponse) 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: MsgVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteResponse: 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 *MsgVoteWeighted) 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: MsgVoteWeighted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, WeightedVoteOption{}) + if err := m.Options[len(m.Options)-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 *MsgVoteWeightedResponse) 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: MsgVoteWeightedResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteWeightedResponse: 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 *MsgDeposit) 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: MsgDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = 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, types1.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 *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: 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") +) diff --git a/github.com/cosmos/cosmos-sdk/x/group/events.pb.go b/github.com/cosmos/cosmos-sdk/x/group/events.pb.go new file mode 100644 index 000000000000..dc869b695c66 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/group/events.pb.go @@ -0,0 +1,1992 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/group/v1/events.proto + +package group + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventCreateGroup is an event emitted when a group is created. +type EventCreateGroup struct { + // group_id is the unique ID of the group. + GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` +} + +func (m *EventCreateGroup) Reset() { *m = EventCreateGroup{} } +func (m *EventCreateGroup) String() string { return proto.CompactTextString(m) } +func (*EventCreateGroup) ProtoMessage() {} +func (*EventCreateGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{0} +} +func (m *EventCreateGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventCreateGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventCreateGroup.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 *EventCreateGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateGroup.Merge(m, src) +} +func (m *EventCreateGroup) XXX_Size() int { + return m.Size() +} +func (m *EventCreateGroup) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_EventCreateGroup proto.InternalMessageInfo + +func (m *EventCreateGroup) GetGroupId() uint64 { + if m != nil { + return m.GroupId + } + return 0 +} + +// EventUpdateGroup is an event emitted when a group is updated. +type EventUpdateGroup struct { + // group_id is the unique ID of the group. + GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` +} + +func (m *EventUpdateGroup) Reset() { *m = EventUpdateGroup{} } +func (m *EventUpdateGroup) String() string { return proto.CompactTextString(m) } +func (*EventUpdateGroup) ProtoMessage() {} +func (*EventUpdateGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{1} +} +func (m *EventUpdateGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateGroup.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 *EventUpdateGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateGroup.Merge(m, src) +} +func (m *EventUpdateGroup) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateGroup) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateGroup proto.InternalMessageInfo + +func (m *EventUpdateGroup) GetGroupId() uint64 { + if m != nil { + return m.GroupId + } + return 0 +} + +// EventCreateGroupPolicy is an event emitted when a group policy is created. +type EventCreateGroupPolicy struct { + // address is the account address of the group policy. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *EventCreateGroupPolicy) Reset() { *m = EventCreateGroupPolicy{} } +func (m *EventCreateGroupPolicy) String() string { return proto.CompactTextString(m) } +func (*EventCreateGroupPolicy) ProtoMessage() {} +func (*EventCreateGroupPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{2} +} +func (m *EventCreateGroupPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventCreateGroupPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventCreateGroupPolicy.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 *EventCreateGroupPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventCreateGroupPolicy.Merge(m, src) +} +func (m *EventCreateGroupPolicy) XXX_Size() int { + return m.Size() +} +func (m *EventCreateGroupPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_EventCreateGroupPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_EventCreateGroupPolicy proto.InternalMessageInfo + +func (m *EventCreateGroupPolicy) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +type EventUpdateGroupPolicy struct { + // address is the account address of the group policy. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *EventUpdateGroupPolicy) Reset() { *m = EventUpdateGroupPolicy{} } +func (m *EventUpdateGroupPolicy) String() string { return proto.CompactTextString(m) } +func (*EventUpdateGroupPolicy) ProtoMessage() {} +func (*EventUpdateGroupPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{3} +} +func (m *EventUpdateGroupPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateGroupPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateGroupPolicy.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 *EventUpdateGroupPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateGroupPolicy.Merge(m, src) +} +func (m *EventUpdateGroupPolicy) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateGroupPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateGroupPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateGroupPolicy proto.InternalMessageInfo + +func (m *EventUpdateGroupPolicy) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// EventSubmitProposal is an event emitted when a proposal is created. +type EventSubmitProposal struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *EventSubmitProposal) Reset() { *m = EventSubmitProposal{} } +func (m *EventSubmitProposal) String() string { return proto.CompactTextString(m) } +func (*EventSubmitProposal) ProtoMessage() {} +func (*EventSubmitProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{4} +} +func (m *EventSubmitProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventSubmitProposal.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 *EventSubmitProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventSubmitProposal.Merge(m, src) +} +func (m *EventSubmitProposal) XXX_Size() int { + return m.Size() +} +func (m *EventSubmitProposal) XXX_DiscardUnknown() { + xxx_messageInfo_EventSubmitProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_EventSubmitProposal proto.InternalMessageInfo + +func (m *EventSubmitProposal) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +type EventWithdrawProposal struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *EventWithdrawProposal) Reset() { *m = EventWithdrawProposal{} } +func (m *EventWithdrawProposal) String() string { return proto.CompactTextString(m) } +func (*EventWithdrawProposal) ProtoMessage() {} +func (*EventWithdrawProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{5} +} +func (m *EventWithdrawProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventWithdrawProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventWithdrawProposal.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 *EventWithdrawProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventWithdrawProposal.Merge(m, src) +} +func (m *EventWithdrawProposal) XXX_Size() int { + return m.Size() +} +func (m *EventWithdrawProposal) XXX_DiscardUnknown() { + xxx_messageInfo_EventWithdrawProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_EventWithdrawProposal proto.InternalMessageInfo + +func (m *EventWithdrawProposal) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// EventVote is an event emitted when a voter votes on a proposal. +type EventVote struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *EventVote) Reset() { *m = EventVote{} } +func (m *EventVote) String() string { return proto.CompactTextString(m) } +func (*EventVote) ProtoMessage() {} +func (*EventVote) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{6} +} +func (m *EventVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventVote.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 *EventVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventVote.Merge(m, src) +} +func (m *EventVote) XXX_Size() int { + return m.Size() +} +func (m *EventVote) XXX_DiscardUnknown() { + xxx_messageInfo_EventVote.DiscardUnknown(m) +} + +var xxx_messageInfo_EventVote proto.InternalMessageInfo + +func (m *EventVote) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// EventExec is an event emitted when a proposal is executed. +type EventExec struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // result is the proposal execution result. + Result ProposalExecutorResult `protobuf:"varint,2,opt,name=result,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"result,omitempty"` + // logs contains error logs in case the execution result is FAILURE. + Logs string `protobuf:"bytes,3,opt,name=logs,proto3" json:"logs,omitempty"` +} + +func (m *EventExec) Reset() { *m = EventExec{} } +func (m *EventExec) String() string { return proto.CompactTextString(m) } +func (*EventExec) ProtoMessage() {} +func (*EventExec) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{7} +} +func (m *EventExec) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventExec.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 *EventExec) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventExec.Merge(m, src) +} +func (m *EventExec) XXX_Size() int { + return m.Size() +} +func (m *EventExec) XXX_DiscardUnknown() { + xxx_messageInfo_EventExec.DiscardUnknown(m) +} + +var xxx_messageInfo_EventExec proto.InternalMessageInfo + +func (m *EventExec) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *EventExec) GetResult() ProposalExecutorResult { + if m != nil { + return m.Result + } + return PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED +} + +func (m *EventExec) GetLogs() string { + if m != nil { + return m.Logs + } + return "" +} + +// EventLeaveGroup is an event emitted when group member leaves the group. +type EventLeaveGroup struct { + // group_id is the unique ID of the group. + GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` + // address is the account address of the group member. + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *EventLeaveGroup) Reset() { *m = EventLeaveGroup{} } +func (m *EventLeaveGroup) String() string { return proto.CompactTextString(m) } +func (*EventLeaveGroup) ProtoMessage() {} +func (*EventLeaveGroup) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{8} +} +func (m *EventLeaveGroup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventLeaveGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventLeaveGroup.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 *EventLeaveGroup) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventLeaveGroup.Merge(m, src) +} +func (m *EventLeaveGroup) XXX_Size() int { + return m.Size() +} +func (m *EventLeaveGroup) XXX_DiscardUnknown() { + xxx_messageInfo_EventLeaveGroup.DiscardUnknown(m) +} + +var xxx_messageInfo_EventLeaveGroup proto.InternalMessageInfo + +func (m *EventLeaveGroup) GetGroupId() uint64 { + if m != nil { + return m.GroupId + } + return 0 +} + +func (m *EventLeaveGroup) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// EventProposalPruned is an event emitted when a proposal is pruned. +type EventProposalPruned struct { + // proposal_id is the unique ID of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` + // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos.group.v1.ProposalStatus" json:"status,omitempty"` + // tally_result is the proposal tally result (when applicable). + TallyResult *TallyResult `protobuf:"bytes,3,opt,name=tally_result,json=tallyResult,proto3" json:"tally_result,omitempty"` +} + +func (m *EventProposalPruned) Reset() { *m = EventProposalPruned{} } +func (m *EventProposalPruned) String() string { return proto.CompactTextString(m) } +func (*EventProposalPruned) ProtoMessage() {} +func (*EventProposalPruned) Descriptor() ([]byte, []int) { + return fileDescriptor_e8d753981546f032, []int{9} +} +func (m *EventProposalPruned) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventProposalPruned) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventProposalPruned.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 *EventProposalPruned) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventProposalPruned.Merge(m, src) +} +func (m *EventProposalPruned) XXX_Size() int { + return m.Size() +} +func (m *EventProposalPruned) XXX_DiscardUnknown() { + xxx_messageInfo_EventProposalPruned.DiscardUnknown(m) +} + +var xxx_messageInfo_EventProposalPruned proto.InternalMessageInfo + +func (m *EventProposalPruned) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +func (m *EventProposalPruned) GetStatus() ProposalStatus { + if m != nil { + return m.Status + } + return PROPOSAL_STATUS_UNSPECIFIED +} + +func (m *EventProposalPruned) GetTallyResult() *TallyResult { + if m != nil { + return m.TallyResult + } + return nil +} + +func init() { + proto.RegisterType((*EventCreateGroup)(nil), "cosmos.group.v1.EventCreateGroup") + proto.RegisterType((*EventUpdateGroup)(nil), "cosmos.group.v1.EventUpdateGroup") + proto.RegisterType((*EventCreateGroupPolicy)(nil), "cosmos.group.v1.EventCreateGroupPolicy") + proto.RegisterType((*EventUpdateGroupPolicy)(nil), "cosmos.group.v1.EventUpdateGroupPolicy") + proto.RegisterType((*EventSubmitProposal)(nil), "cosmos.group.v1.EventSubmitProposal") + proto.RegisterType((*EventWithdrawProposal)(nil), "cosmos.group.v1.EventWithdrawProposal") + proto.RegisterType((*EventVote)(nil), "cosmos.group.v1.EventVote") + proto.RegisterType((*EventExec)(nil), "cosmos.group.v1.EventExec") + proto.RegisterType((*EventLeaveGroup)(nil), "cosmos.group.v1.EventLeaveGroup") + proto.RegisterType((*EventProposalPruned)(nil), "cosmos.group.v1.EventProposalPruned") +} + +func init() { proto.RegisterFile("cosmos/group/v1/events.proto", fileDescriptor_e8d753981546f032) } + +var fileDescriptor_e8d753981546f032 = []byte{ + // 442 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0xef, 0xd2, 0x30, + 0x18, 0xc7, 0xe9, 0x4f, 0x02, 0x52, 0x8c, 0x98, 0xfa, 0x27, 0x03, 0xc9, 0x20, 0xc4, 0x44, 0x0e, + 0xb2, 0x05, 0x4c, 0xd4, 0x93, 0x44, 0x0c, 0x31, 0x24, 0x1c, 0xc8, 0xf0, 0x4f, 0xe2, 0x05, 0xc7, + 0xda, 0x8c, 0xc5, 0x41, 0x97, 0xb6, 0x9b, 0x70, 0xf4, 0x1d, 0xf8, 0x52, 0x3c, 0xf8, 0x22, 0x3c, + 0x12, 0x4f, 0x1e, 0x0d, 0xbc, 0x11, 0xb3, 0xae, 0x03, 0x82, 0x31, 0x23, 0xf9, 0x9d, 0x68, 0xfb, + 0xfd, 0x7c, 0xbf, 0x3c, 0x4f, 0x9f, 0x15, 0xd6, 0x1d, 0xca, 0x97, 0x94, 0x9b, 0x2e, 0xa3, 0x61, + 0x60, 0x46, 0x5d, 0x93, 0x44, 0x64, 0x25, 0xb8, 0x11, 0x30, 0x2a, 0x28, 0xaa, 0x24, 0xaa, 0x21, + 0x55, 0x23, 0xea, 0xd6, 0xaa, 0xc9, 0xc1, 0x4c, 0xca, 0xa6, 0x52, 0xe5, 0xa6, 0xf6, 0xf0, 0x3c, + 0x49, 0x6c, 0x02, 0xa2, 0xc4, 0x56, 0x07, 0xde, 0x19, 0xc6, 0xc1, 0xaf, 0x19, 0xb1, 0x05, 0x79, + 0x13, 0x23, 0xa8, 0x0a, 0x6f, 0x4a, 0x76, 0xe6, 0x61, 0x0d, 0x34, 0x41, 0x3b, 0x6f, 0x15, 0xe5, + 0x7e, 0x84, 0x0f, 0xf8, 0xbb, 0x00, 0x5f, 0x82, 0x8f, 0xe1, 0x83, 0xf3, 0xf4, 0x09, 0xf5, 0x3d, + 0x67, 0x83, 0x7a, 0xb0, 0x68, 0x63, 0xcc, 0x08, 0xe7, 0xd2, 0x53, 0x1a, 0x68, 0xbf, 0x7e, 0x74, + 0xee, 0xa9, 0xba, 0x5f, 0x25, 0xca, 0x54, 0x30, 0x6f, 0xe5, 0x5a, 0x29, 0x78, 0x48, 0x3b, 0xf9, + 0xf3, 0x6b, 0xa4, 0x3d, 0x83, 0x77, 0x65, 0xda, 0x34, 0x9c, 0x2f, 0x3d, 0x31, 0x61, 0x34, 0xa0, + 0xdc, 0xf6, 0x51, 0x03, 0x96, 0x03, 0xb5, 0x3e, 0x36, 0x04, 0xd3, 0xa3, 0x11, 0x6e, 0xbd, 0x80, + 0xf7, 0xa5, 0xef, 0x83, 0x27, 0x16, 0x98, 0xd9, 0x5f, 0x2e, 0x77, 0x3e, 0x81, 0x25, 0xe9, 0x7c, + 0x4f, 0x05, 0xc9, 0xa6, 0xbf, 0x02, 0x85, 0x0f, 0xd7, 0xc4, 0xc9, 0xc4, 0x51, 0x1f, 0x16, 0x18, + 0xe1, 0xa1, 0x2f, 0xb4, 0xab, 0x26, 0x68, 0xdf, 0xee, 0x3d, 0x36, 0xce, 0x3e, 0x11, 0x23, 0x2d, + 0x34, 0xce, 0x0b, 0x05, 0x65, 0x96, 0xc4, 0x2d, 0x65, 0x43, 0x08, 0xe6, 0x7d, 0xea, 0x72, 0xed, + 0x46, 0x7c, 0x81, 0x96, 0x5c, 0xb7, 0x3e, 0xc1, 0x8a, 0x2c, 0x61, 0x4c, 0xec, 0x28, 0x73, 0xda, + 0xa7, 0x53, 0xb8, 0xba, 0x74, 0x0a, 0xdf, 0x81, 0x1a, 0x43, 0x5a, 0xdd, 0x84, 0x85, 0x2b, 0x82, + 0xb3, 0xfb, 0x7d, 0x0e, 0x0b, 0x5c, 0xd8, 0x22, 0xe4, 0xaa, 0xdf, 0xc6, 0x7f, 0xfb, 0x9d, 0x4a, + 0xcc, 0x52, 0x38, 0xea, 0xc3, 0x5b, 0xc2, 0xf6, 0xfd, 0xcd, 0x4c, 0x5d, 0x57, 0xdc, 0x6f, 0xb9, + 0x57, 0xff, 0xc7, 0xfe, 0x36, 0x86, 0xd4, 0x1d, 0x95, 0xc5, 0x71, 0x33, 0x78, 0xf9, 0x73, 0xa7, + 0x83, 0xed, 0x4e, 0x07, 0x7f, 0x76, 0x3a, 0xf8, 0xb6, 0xd7, 0x73, 0xdb, 0xbd, 0x9e, 0xfb, 0xbd, + 0xd7, 0x73, 0x1f, 0x1f, 0xb9, 0x9e, 0x58, 0x84, 0x73, 0xc3, 0xa1, 0x4b, 0xf5, 0x04, 0xd5, 0x4f, + 0x87, 0xe3, 0xcf, 0xe6, 0x3a, 0x79, 0x81, 0xf3, 0x82, 0x7c, 0x79, 0x4f, 0xff, 0x06, 0x00, 0x00, + 0xff, 0xff, 0xa5, 0x1a, 0x1c, 0xb9, 0xe2, 0x03, 0x00, 0x00, +} + +func (m *EventCreateGroup) 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 *EventCreateGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventCreateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GroupId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateGroup) 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 *EventUpdateGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GroupId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventCreateGroupPolicy) 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 *EventCreateGroupPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventCreateGroupPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateGroupPolicy) 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 *EventUpdateGroupPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateGroupPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventSubmitProposal) 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 *EventSubmitProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventWithdrawProposal) 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 *EventWithdrawProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventWithdrawProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventVote) 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 *EventVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventExec) 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 *EventExec) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Logs) > 0 { + i -= len(m.Logs) + copy(dAtA[i:], m.Logs) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Logs))) + i-- + dAtA[i] = 0x1a + } + if m.Result != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x10 + } + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventLeaveGroup) 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 *EventLeaveGroup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventLeaveGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if m.GroupId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EventProposalPruned) 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 *EventProposalPruned) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventProposalPruned) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TallyResult != nil { + { + size, err := m.TallyResult.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Status != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if m.ProposalId != 0 { + i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventCreateGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GroupId != 0 { + n += 1 + sovEvents(uint64(m.GroupId)) + } + return n +} + +func (m *EventUpdateGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GroupId != 0 { + n += 1 + sovEvents(uint64(m.GroupId)) + } + return n +} + +func (m *EventCreateGroupPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventUpdateGroupPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventSubmitProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + return n +} + +func (m *EventWithdrawProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + return n +} + +func (m *EventVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + return n +} + +func (m *EventExec) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + if m.Result != 0 { + n += 1 + sovEvents(uint64(m.Result)) + } + l = len(m.Logs) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventLeaveGroup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GroupId != 0 { + n += 1 + sovEvents(uint64(m.GroupId)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventProposalPruned) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovEvents(uint64(m.ProposalId)) + } + if m.Status != 0 { + n += 1 + sovEvents(uint64(m.Status)) + } + if m.TallyResult != nil { + l = m.TallyResult.Size() + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventCreateGroup) 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 ErrIntOverflowEvents + } + 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: EventCreateGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCreateGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + m.GroupId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateGroup) 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 ErrIntOverflowEvents + } + 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: EventUpdateGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + m.GroupId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventCreateGroupPolicy) 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 ErrIntOverflowEvents + } + 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: EventCreateGroupPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventCreateGroupPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateGroupPolicy) 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 ErrIntOverflowEvents + } + 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: EventUpdateGroupPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateGroupPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventSubmitProposal) 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 ErrIntOverflowEvents + } + 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: EventSubmitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventWithdrawProposal) 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 ErrIntOverflowEvents + } + 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: EventWithdrawProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventWithdrawProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventVote) 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 ErrIntOverflowEvents + } + 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: EventVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventExec) 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 ErrIntOverflowEvents + } + 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: EventExec: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventExec: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + m.Result = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Result |= ProposalExecutorResult(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventLeaveGroup) 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 ErrIntOverflowEvents + } + 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: EventLeaveGroup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventLeaveGroup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) + } + m.GroupId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventProposalPruned) 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 ErrIntOverflowEvents + } + 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: EventProposalPruned: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventProposalPruned: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= ProposalStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TallyResult", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TallyResult == nil { + m.TallyResult = &TallyResult{} + } + if err := m.TallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrIntOverflowEvents + } + 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, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go new file mode 100644 index 000000000000..274fa9a447c5 --- /dev/null +++ b/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go @@ -0,0 +1,702 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/group/v1/genesis.proto + +package group + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the group module's genesis state. +type GenesisState struct { + // group_seq is the group table orm.Sequence, + // it is used to get the next group ID. + GroupSeq uint64 `protobuf:"varint,1,opt,name=group_seq,json=groupSeq,proto3" json:"group_seq,omitempty"` + // groups is the list of groups info. + Groups []*GroupInfo `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` + // group_members is the list of groups members. + GroupMembers []*GroupMember `protobuf:"bytes,3,rep,name=group_members,json=groupMembers,proto3" json:"group_members,omitempty"` + // group_policy_seq is the group policy table orm.Sequence, + // it is used to generate the next group policy account address. + GroupPolicySeq uint64 `protobuf:"varint,4,opt,name=group_policy_seq,json=groupPolicySeq,proto3" json:"group_policy_seq,omitempty"` + // group_policies is the list of group policies info. + GroupPolicies []*GroupPolicyInfo `protobuf:"bytes,5,rep,name=group_policies,json=groupPolicies,proto3" json:"group_policies,omitempty"` + // proposal_seq is the proposal table orm.Sequence, + // it is used to get the next proposal ID. + ProposalSeq uint64 `protobuf:"varint,6,opt,name=proposal_seq,json=proposalSeq,proto3" json:"proposal_seq,omitempty"` + // proposals is the list of proposals. + Proposals []*Proposal `protobuf:"bytes,7,rep,name=proposals,proto3" json:"proposals,omitempty"` + // votes is the list of votes. + Votes []*Vote `protobuf:"bytes,8,rep,name=votes,proto3" json:"votes,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_cc6105fe3ef99f06, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetGroupSeq() uint64 { + if m != nil { + return m.GroupSeq + } + return 0 +} + +func (m *GenesisState) GetGroups() []*GroupInfo { + if m != nil { + return m.Groups + } + return nil +} + +func (m *GenesisState) GetGroupMembers() []*GroupMember { + if m != nil { + return m.GroupMembers + } + return nil +} + +func (m *GenesisState) GetGroupPolicySeq() uint64 { + if m != nil { + return m.GroupPolicySeq + } + return 0 +} + +func (m *GenesisState) GetGroupPolicies() []*GroupPolicyInfo { + if m != nil { + return m.GroupPolicies + } + return nil +} + +func (m *GenesisState) GetProposalSeq() uint64 { + if m != nil { + return m.ProposalSeq + } + return 0 +} + +func (m *GenesisState) GetProposals() []*Proposal { + if m != nil { + return m.Proposals + } + return nil +} + +func (m *GenesisState) GetVotes() []*Vote { + if m != nil { + return m.Votes + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.group.v1.GenesisState") +} + +func init() { proto.RegisterFile("cosmos/group/v1/genesis.proto", fileDescriptor_cc6105fe3ef99f06) } + +var fileDescriptor_cc6105fe3ef99f06 = []byte{ + // 341 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xfa, 0x40, + 0x10, 0xc7, 0xe9, 0x8f, 0x3f, 0x3f, 0x58, 0xfe, 0x68, 0x36, 0x31, 0xa9, 0xa0, 0x0d, 0x1a, 0x0f, + 0x24, 0xc6, 0x36, 0xe0, 0xc1, 0x9b, 0x89, 0x5e, 0x88, 0x07, 0x13, 0x52, 0x12, 0x0f, 0x5e, 0x0c, + 0xe0, 0x58, 0x1b, 0x29, 0x53, 0x3a, 0x0b, 0x91, 0xb7, 0xf0, 0x09, 0x7c, 0x1e, 0x8f, 0x1c, 0x3d, + 0x1a, 0x78, 0x11, 0xc3, 0x6c, 0x49, 0x0d, 0x70, 0xda, 0xdd, 0xd9, 0xcf, 0x77, 0x3e, 0x93, 0x8c, + 0x38, 0x1e, 0x20, 0x05, 0x48, 0x8e, 0x17, 0xe1, 0x24, 0x74, 0xa6, 0x4d, 0xc7, 0x83, 0x11, 0x90, + 0x4f, 0x76, 0x18, 0xa1, 0x42, 0xb9, 0xa7, 0xbf, 0x6d, 0xfe, 0xb6, 0xa7, 0xcd, 0x6a, 0x6d, 0x93, + 0x57, 0xb3, 0x10, 0x62, 0xfa, 0xf4, 0x33, 0x2d, 0x4a, 0x6d, 0x9d, 0xef, 0xaa, 0x9e, 0x02, 0x59, + 0x13, 0x05, 0x06, 0x9f, 0x08, 0xc6, 0xa6, 0x51, 0x37, 0x1a, 0x19, 0x37, 0xcf, 0x85, 0x2e, 0x8c, + 0x65, 0x4b, 0xe4, 0xf8, 0x4e, 0xe6, 0xbf, 0x7a, 0xba, 0x51, 0x6c, 0x55, 0xed, 0x0d, 0x99, 0xdd, + 0x5e, 0x5d, 0xee, 0x46, 0x2f, 0xe8, 0xc6, 0xa4, 0xbc, 0x11, 0x65, 0xdd, 0x30, 0x80, 0xa0, 0x0f, + 0x11, 0x99, 0x69, 0x8e, 0x1e, 0xed, 0x8e, 0xde, 0x33, 0xe4, 0x96, 0xbc, 0xe4, 0x41, 0xb2, 0x21, + 0xf6, 0x75, 0x8b, 0x10, 0x87, 0xfe, 0x60, 0xc6, 0xa3, 0x65, 0x78, 0xb4, 0x0a, 0xd7, 0x3b, 0x5c, + 0x5e, 0x0d, 0xd8, 0x16, 0x95, 0x3f, 0xa4, 0x0f, 0x64, 0x66, 0xd9, 0x56, 0xdf, 0x6d, 0xd3, 0x41, + 0x1e, 0xb7, 0x9c, 0x74, 0xf2, 0x81, 0xe4, 0x89, 0x28, 0x85, 0x11, 0x86, 0x48, 0xbd, 0x21, 0xeb, + 0x72, 0xac, 0x2b, 0xae, 0x6b, 0x2b, 0xd7, 0x95, 0x28, 0xac, 0x9f, 0x64, 0xfe, 0x67, 0xcd, 0xe1, + 0x96, 0xa6, 0x13, 0x13, 0x6e, 0xc2, 0xca, 0x73, 0x91, 0x9d, 0xa2, 0x02, 0x32, 0xf3, 0x1c, 0x3a, + 0xd8, 0x0a, 0x3d, 0xa0, 0x02, 0x57, 0x33, 0xb7, 0xd7, 0x5f, 0x0b, 0xcb, 0x98, 0x2f, 0x2c, 0xe3, + 0x67, 0x61, 0x19, 0x1f, 0x4b, 0x2b, 0x35, 0x5f, 0x5a, 0xa9, 0xef, 0xa5, 0x95, 0x7a, 0x3c, 0xf3, + 0x7c, 0xf5, 0x3a, 0xe9, 0xdb, 0x03, 0x0c, 0x9c, 0x78, 0xc5, 0xfa, 0xb8, 0xa0, 0xe7, 0x37, 0xe7, + 0x5d, 0xef, 0xbb, 0x9f, 0xe3, 0x3d, 0x5f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x99, 0x5b, 0x30, + 0xc4, 0x36, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Votes) > 0 { + for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if len(m.Proposals) > 0 { + for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.ProposalSeq != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.ProposalSeq)) + i-- + dAtA[i] = 0x30 + } + if len(m.GroupPolicies) > 0 { + for iNdEx := len(m.GroupPolicies) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GroupPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.GroupPolicySeq != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.GroupPolicySeq)) + i-- + dAtA[i] = 0x20 + } + if len(m.GroupMembers) > 0 { + for iNdEx := len(m.GroupMembers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GroupMembers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.GroupSeq != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.GroupSeq)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.GroupSeq != 0 { + n += 1 + sovGenesis(uint64(m.GroupSeq)) + } + if len(m.Groups) > 0 { + for _, e := range m.Groups { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.GroupMembers) > 0 { + for _, e := range m.GroupMembers { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.GroupPolicySeq != 0 { + n += 1 + sovGenesis(uint64(m.GroupPolicySeq)) + } + if len(m.GroupPolicies) > 0 { + for _, e := range m.GroupPolicies { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if m.ProposalSeq != 0 { + n += 1 + sovGenesis(uint64(m.ProposalSeq)) + } + if len(m.Proposals) > 0 { + for _, e := range m.Proposals { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Votes) > 0 { + for _, e := range m.Votes { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupSeq", wireType) + } + m.GroupSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupSeq |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, &GroupInfo{}) + if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupMembers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupMembers = append(m.GroupMembers, &GroupMember{}) + if err := m.GroupMembers[len(m.GroupMembers)-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 GroupPolicySeq", wireType) + } + m.GroupPolicySeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GroupPolicySeq |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicies", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GroupPolicies = append(m.GroupPolicies, &GroupPolicyInfo{}) + if err := m.GroupPolicies[len(m.GroupPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalSeq", wireType) + } + m.ProposalSeq = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalSeq |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposals = append(m.Proposals, &Proposal{}) + if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Votes = append(m.Votes, &Vote{}) + if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index 7678c981195f..a438f68a41c7 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -76,68 +76,6 @@ func (s *KeeperTestSuite) SetupTest() { s.msgServer = slashingkeeper.NewMsgServerImpl(s.slashingKeeper) } -func (s *KeeperTestSuite) TestUnJailNotBonded() { - ctx := s.ctx - - p := s.stakingKeeper.GetParams(ctx) - p.MaxValidators = 5 - s.stakingKeeper.SetParams(ctx, p) - - addrDels := simtestutil.AddTestAddrsIncremental(s.bankKeeper, s.stakingKeeper, ctx, 6, s.stakingKeeper.TokensFromConsensusPower(ctx, 200)) - valAddrs := simtestutil.ConvertAddrsToValAddrs(addrDels) - pks := simtestutil.CreateTestPubKeys(6) - tstaking := stakingtestutil.NewHelper(s.T(), ctx, s.stakingKeeper) - - // create max (5) validators all with the same power - for i := uint32(0); i < p.MaxValidators; i++ { - addr, val := valAddrs[i], pks[i] - tstaking.CreateValidatorWithValPower(addr, val, 100, true) - } - - staking.EndBlocker(ctx, s.stakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // create a 6th validator with less power than the cliff validator (won't be bonded) - addr, val := valAddrs[5], pks[5] - amt := s.stakingKeeper.TokensFromConsensusPower(ctx, 50) - msg := tstaking.CreateValidatorMsg(addr, val, amt) - msg.MinSelfDelegation = amt - res, err := tstaking.CreateValidatorWithMsg(sdk.WrapSDKContext(ctx), msg) - s.Require().NoError(err) - s.Require().NotNil(res) - - staking.EndBlocker(ctx, s.stakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - tstaking.CheckValidator(addr, stakingtypes.Unbonded, false) - - // unbond below minimum self-delegation - s.Require().Equal(p.BondDenom, tstaking.Denom) - tstaking.Undelegate(sdk.AccAddress(addr), addr, s.stakingKeeper.TokensFromConsensusPower(ctx, 1), true) - - staking.EndBlocker(ctx, s.stakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // verify that validator is jailed - tstaking.CheckValidator(addr, -1, true) - - // verify we cannot unjail (yet) - s.Require().Error(s.slashingKeeper.Unjail(ctx, addr)) - - staking.EndBlocker(ctx, s.stakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - // bond to meet minimum self-delegation - tstaking.DelegateWithPower(sdk.AccAddress(addr), addr, 1) - - staking.EndBlocker(ctx, s.stakingKeeper) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // verify we can immediately unjail - s.Require().NoError(s.slashingKeeper.Unjail(ctx, addr)) - - tstaking.CheckValidator(addr, -1, false) -} - // Test a new validator entering the validator set // Ensure that SigningInfo.StartHeight is set correctly // and that they are not immediately jailed diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index b0e10ab33ab9..a6942023e722 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -91,6 +91,6 @@ func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { return nil } -func (h Hooks) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordID uint64) error { +func (h Hooks) BeforeTokenizeShareRecordRemoved(_ sdk.Context, _ uint64) error { return nil } diff --git a/x/slashing/keeper/unjail.go b/x/slashing/keeper/unjail.go index 23a9121e5472..f417bdc546f4 100644 --- a/x/slashing/keeper/unjail.go +++ b/x/slashing/keeper/unjail.go @@ -2,7 +2,6 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -20,14 +19,6 @@ func (k Keeper) Unjail(ctx sdk.Context, validatorAddr sdk.ValAddress) error { return types.ErrMissingSelfDelegation } - tokens := validator.TokensFromShares(selfDel.GetShares()).TruncateInt() - minSelfBond := validator.GetMinSelfDelegation() - if tokens.LT(minSelfBond) { - return sdkerrors.Wrapf( - types.ErrSelfDelegationTooLowToUnjail, "%s less than %s", tokens, minSelfBond, - ) - } - // cannot be unjailed if not jailed if !validator.IsJailed() { return types.ErrValidatorNotJailed diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 991ac17f0b3c..2582116f4826 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -150,7 +150,8 @@ func (suite *SimTestSuite) TestSimulateMsgUnjail() { suite.Require().NoError(err) // setup validator0 by consensus address - suite.stakingKeeper.SetValidatorByConsAddr(ctx, validator0) + err = suite.stakingKeeper.SetValidatorByConsAddr(ctx, validator0) + suite.Require().NoError(err) val0ConsAddress, err := validator0.GetConsAddr() suite.Require().NoError(err) info := types.NewValidatorSigningInfo(val0ConsAddress, int64(4), int64(3), @@ -178,7 +179,8 @@ func (suite *SimTestSuite) TestSimulateMsgUnjail() { suite.Require().NoError(err) var msg types.MsgUnjail - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(types.TypeMsgUnjail, msg.Type()) diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 30b250dd672f..06dfad471852 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -53,7 +53,6 @@ func (k Keeper) ValidatorBondFactor(ctx sdk.Context) (res sdk.Dec) { // Global liquid staking cap across all liquid staking providers func (k Keeper) GlobalLiquidStakingCap(ctx sdk.Context) (res sdk.Dec) { return k.GetParams(ctx).GlobalLiquidStakingCap - } // Liquid staking cap for each validator diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go index 9977c13c58ac..0fc9043f96cf 100644 --- a/x/staking/keeper/tokenize_share_record_test.go +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -10,7 +10,8 @@ func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { } // TODO: refactor LSM test -// Note it might be moved to integration test +// Note that this test might be moved to the integration tests +// // func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { // app, ctx := suite.app, suite.ctx // owner1, owner2 := suite.addrs[0], suite.addrs[1] From 5e42e2acb4b2a0dd6ecec0c8438206415f5d2510 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 29 Nov 2023 16:01:08 +0100 Subject: [PATCH 14/31] nit --- tests/integration/gov/keeper/common_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/gov/keeper/common_test.go b/tests/integration/gov/keeper/common_test.go index f187ddfcb5a2..62451f605596 100644 --- a/tests/integration/gov/keeper/common_test.go +++ b/tests/integration/gov/keeper/common_test.go @@ -62,7 +62,7 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers app.StakingKeeper.SetValidator(ctx, val1) app.StakingKeeper.SetValidator(ctx, val2) app.StakingKeeper.SetValidator(ctx, val3) - err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) require.NoError(t, err) err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) require.NoError(t, err) From aa7029cdbc5251c3d94879eff822326626ef9fa5 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 29 Nov 2023 17:38:42 +0100 Subject: [PATCH 15/31] comments more failing tests --- .../staking/keeper/genesis_test.go | 83 +- .../staking/keeper/msg_server_test.go | 2664 +++++++++-------- ...te_TestGRPCParams-20231129173630-9882.fail | 32 + .../testutil/expected_keepers_mocks.go | 57 - 4 files changed, 1419 insertions(+), 1417 deletions(-) create mode 100644 tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 57639ccbbf6d..7e453a59fbec 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "fmt" "testing" - "time" "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" @@ -220,46 +219,46 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { require.Equal(t, abcivals, vals) } -// TODO: review LSM TEST +// TODO: refactor LSM TEST func TestInitExportLiquidStakingGenesis(t *testing.T) { - app, ctx, addrs := bootstrapGenesisTest(t, 2) - address1, address2 := addrs[0], addrs[1] - - // Mock out a genesis state - inGenesisState := types.GenesisState{ - Params: types.DefaultParams(), - TokenizeShareRecords: []types.TokenizeShareRecord{ - {Id: 1, Owner: address1.String(), ModuleAccount: "module1", Validator: "val1"}, - {Id: 2, Owner: address2.String(), ModuleAccount: "module2", Validator: "val2"}, - }, - LastTokenizeShareRecordId: 2, - TotalLiquidStakedTokens: sdk.NewInt(1_000_000), - TokenizeShareLocks: []types.TokenizeShareLock{ - { - Address: address1.String(), - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), - }, - { - Address: address2.String(), - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), - CompletionTime: time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC), - }, - }, - } - - // Call init and then export genesis - confirming the same state is returned - staking.InitGenesis(ctx, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, &inGenesisState) - outGenesisState := *staking.ExportGenesis(ctx, app.StakingKeeper) - - require.ElementsMatch(t, inGenesisState.TokenizeShareRecords, outGenesisState.TokenizeShareRecords, - "tokenize share records") - - require.Equal(t, inGenesisState.LastTokenizeShareRecordId, outGenesisState.LastTokenizeShareRecordId, - "last tokenize share record ID") - - require.Equal(t, inGenesisState.TotalLiquidStakedTokens.Int64(), outGenesisState.TotalLiquidStakedTokens.Int64(), - "total liquid staked") - - require.ElementsMatch(t, inGenesisState.TokenizeShareLocks, outGenesisState.TokenizeShareLocks, - "tokenize share locks") + // app, ctx, addrs := bootstrapGenesisTest(t, 2) + // address1, address2 := addrs[0], addrs[1] + + // // Mock out a genesis state + // inGenesisState := types.GenesisState{ + // Params: types.DefaultParams(), + // TokenizeShareRecords: []types.TokenizeShareRecord{ + // {Id: 1, Owner: address1.String(), ModuleAccount: "module1", Validator: "val1"}, + // {Id: 2, Owner: address2.String(), ModuleAccount: "module2", Validator: "val2"}, + // }, + // LastTokenizeShareRecordId: 2, + // TotalLiquidStakedTokens: sdk.NewInt(1_000_000), + // TokenizeShareLocks: []types.TokenizeShareLock{ + // { + // Address: address1.String(), + // Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + // }, + // { + // Address: address2.String(), + // Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + // CompletionTime: time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC), + // }, + // }, + // } + + // // Call init and then export genesis - confirming the same state is returned + // staking.InitGenesis(ctx, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, &inGenesisState) + // outGenesisState := *staking.ExportGenesis(ctx, app.StakingKeeper) + + // require.ElementsMatch(t, inGenesisState.TokenizeShareRecords, outGenesisState.TokenizeShareRecords, + // "tokenize share records") + + // require.Equal(t, inGenesisState.LastTokenizeShareRecordId, outGenesisState.LastTokenizeShareRecordId, + // "last tokenize share record ID") + + // require.Equal(t, inGenesisState.TotalLiquidStakedTokens.Int64(), outGenesisState.TotalLiquidStakedTokens.Int64(), + // "total liquid staked") + + // require.ElementsMatch(t, inGenesisState.TokenizeShareLocks, outGenesisState.TokenizeShareLocks, + // "tokenize share locks") } diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 3420180468c9..76ac622175f7 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -1,54 +1,43 @@ package keeper_test import ( - "fmt" "testing" "time" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" sdk "github.com/cosmos/cosmos-sdk/types" - simapp "github.com/cosmos/cosmos-sdk/simapp" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" - sdkstaking "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" ) func TestCancelUnbondingDelegation(t *testing.T) { // setup the app - _, app, ctx := createTestInput() + app := simapp.Setup(t, false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) bondDenom := app.StakingKeeper.BondDenom(ctx) // set the not bonded pool module account notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 5) - startCoin := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoin)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) moduleBalance := app.BankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)) require.Equal(t, sdk.NewInt64Coin(bondDenom, startTokens.Int64()), moduleBalance) - // create a validator - validatorPubKey := simapp.CreateTestPubKeys(1)[0] - validatorAddr := sdk.ValAddress(validatorPubKey.Address()) - - validator := teststaking.NewValidator(t, validatorAddr, validatorPubKey) - validator.Tokens = startTokens - validator.DelegatorShares = sdk.NewDecFromInt(startTokens) - validator.Status = types.Bonded - app.StakingKeeper.SetValidator(ctx, validator) - - // create a delegator + // accounts delAddrs := simapp.AddTestAddrsIncremental(app, ctx, 2, sdk.NewInt(10000)) + validators := app.StakingKeeper.GetValidators(ctx, 10) + require.Equal(t, len(validators), 1) + + validatorAddr, err := sdk.ValAddressFromBech32(validators[0].OperatorAddress) + require.NoError(t, err) delegatorAddr := delAddrs[0] // setting the ubd entry @@ -57,7 +46,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { delegatorAddr, validatorAddr, 10, ctx.BlockTime().Add(time.Minute*10), unbondingAmount.Amount, - 1, + 0, ) // set and retrieve a record @@ -81,6 +70,16 @@ func TestCancelUnbondingDelegation(t *testing.T) { CreationHeight: 0, }, }, + { + Name: "invalid coin", + ExceptErr: true, + req: types.MsgCancelUnbondingDelegation{ + DelegatorAddress: resUnbond.DelegatorAddress, + ValidatorAddress: resUnbond.ValidatorAddress, + Amount: sdk.NewCoin("dump_coin", sdk.NewInt(4)), + CreationHeight: 0, + }, + }, { Name: "validator not exists", ExceptErr: true, @@ -135,7 +134,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.Name, func(t *testing.T) { - _, err := msgServer.CancelUnbondingDelegation(sdk.WrapSDKContext(ctx), &testCase.req) + _, err := msgServer.CancelUnbondingDelegation(ctx, &testCase.req) if testCase.ExceptErr { require.Error(t, err) } else { @@ -148,1361 +147,1390 @@ func TestCancelUnbondingDelegation(t *testing.T) { } } +// TODO refactor LSM test func TestTokenizeSharesAndRedeemTokens(t *testing.T) { - _, app, ctx := createTestInput() - - liquidStakingCapStrict := sdk.ZeroDec() - liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") - liquidStakingCapDisabled := sdk.OneDec() - - validatorBondStrict := sdk.OneDec() - validatorBondConservative := sdk.NewDec(10) - validatorBondDisabled := sdk.NewDec(-1) - - testCases := []struct { - name string - vestingAmount sdk.Int - delegationAmount sdk.Int - tokenizeShareAmount sdk.Int - redeemAmount sdk.Int - targetVestingDelAfterShare sdk.Int - targetVestingDelAfterRedeem sdk.Int - globalLiquidStakingCap sdk.Dec - slashFactor sdk.Dec - validatorLiquidStakingCap sdk.Dec - validatorBondFactor sdk.Dec - validatorBondDelegation bool - validatorBondDelegatorIndex int - delegatorIsLSTP bool - expTokenizeErr bool - expRedeemErr bool - prevAccountDelegationExists bool - recordAccountDelegationExists bool - }{ - { - name: "full amount tokenize and redeem", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: false, - recordAccountDelegationExists: false, - }, - { - name: "full amount tokenize and partial redeem", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: false, - recordAccountDelegationExists: true, - }, - { - name: "partial amount tokenize and full redeem", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - recordAccountDelegationExists: false, - }, - { - name: "tokenize and redeem with slash", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.MustNewDecFromStr("0.1"), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: false, - recordAccountDelegationExists: true, - }, - { - name: "over tokenize", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 30), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: true, - expRedeemErr: false, - }, - { - name: "over redeem", - vestingAmount: sdk.NewInt(0), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 40), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: true, - }, - { - name: "vesting account tokenize share failure", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: true, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "vesting account tokenize share success", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: false, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "try tokenize share for a validator-bond delegation", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondConservative, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 1, - expTokenizeErr: true, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "strict validator-bond - tokenization fails", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondStrict, - validatorBondDelegation: false, - expTokenizeErr: true, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "conservative validator-bond - successful tokenization", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondConservative, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "strict global liquid staking cap - tokenization fails", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapStrict, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: true, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "conservative global liquid staking cap - successful tokenization", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapConservative, - validatorLiquidStakingCap: liquidStakingCapDisabled, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "strict validator liquid staking cap - tokenization fails", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapStrict, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: true, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "conservative validator liquid staking cap - successful tokenization", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapDisabled, - validatorLiquidStakingCap: liquidStakingCapConservative, - validatorBondFactor: validatorBondDisabled, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "all caps set conservatively - successful tokenize share", - vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapConservative, - validatorLiquidStakingCap: liquidStakingCapConservative, - validatorBondFactor: validatorBondConservative, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - { - name: "delegator is a liquid staking provider - accounting should not update", - vestingAmount: sdk.ZeroInt(), - delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - slashFactor: sdk.ZeroDec(), - globalLiquidStakingCap: liquidStakingCapConservative, - validatorLiquidStakingCap: liquidStakingCapConservative, - validatorBondFactor: validatorBondConservative, - delegatorIsLSTP: true, - validatorBondDelegation: true, - validatorBondDelegatorIndex: 0, - expTokenizeErr: false, - expRedeemErr: false, - prevAccountDelegationExists: true, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, app, ctx = createTestInput() - addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - addrAcc1, addrAcc2 := addrs[0], addrs[1] - addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) - - // Create ICA module account - icaAccountAddress := createICAAccount(app, ctx) - - // Fund module account - delegationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.delegationAmount) - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) - require.NoError(t, err) - err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) - require.NoError(t, err) - - // set the delegator address depending on whether the delegator should be a liquid staking provider - delegatorAccount := addrAcc2 - if tc.delegatorIsLSTP { - delegatorAccount = icaAccountAddress - } - - // set validator bond factor and global liquid staking cap - params := app.StakingKeeper.GetParams(ctx) - params.ValidatorBondFactor = tc.validatorBondFactor - params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap - params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap - app.StakingKeeper.SetParams(ctx, params) - - // set the total liquid staked tokens - app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.ZeroInt()) - - if !tc.vestingAmount.IsZero() { - // create vesting account - pubkey := secp256k1.GenPrivKey().PubKey() - baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) - initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) - baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) - delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) - app.AccountKeeper.SetAccount(ctx, delayedVestingAccount) - } - - pubKeys := simapp.CreateTestPubKeys(2) - pk1, pk2 := pubKeys[0], pubKeys[1] - - // Create Validators and Delegation - val1 := teststaking.NewValidator(t, addrVal1, pk1) - val1.Status = sdkstaking.Bonded - app.StakingKeeper.SetValidator(ctx, val1) - app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) - err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) - require.NoError(t, err) - - val2 := teststaking.NewValidator(t, addrVal2, pk2) - val2.Status = sdkstaking.Bonded - app.StakingKeeper.SetValidator(ctx, val2) - app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) - err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) - require.NoError(t, err) - - // Delegate from both the main delegator as well as a random account so there is a - // non-zero delegation after redemption - err = delegateCoinsFromAccount(ctx, app, delegatorAccount, tc.delegationAmount, val1) - require.NoError(t, err) - - // apply TM updates - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) - - _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - require.True(t, found, "delegation not found after delegate") - - lastRecordID := app.StakingKeeper.GetLastTokenizeShareRecordID(ctx) - oldValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - if tc.validatorBondDelegation { - err := delegateCoinsFromAccount(ctx, app, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) - require.NoError(t, err) - _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), - ValidatorAddress: addrVal1.String(), - }) - require.NoError(t, err) - } - - resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - DelegatorAddress: delegatorAccount.String(), - ValidatorAddress: addrVal1.String(), - Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), - TokenizedShareOwner: delegatorAccount.String(), - }) - if tc.expTokenizeErr { - require.Error(t, err) - return - } - require.NoError(t, err) - - // check last record id increase - require.Equal(t, lastRecordID+1, app.StakingKeeper.GetLastTokenizeShareRecordID(ctx)) - - // ensure validator's total tokens is consistent - newValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - require.Equal(t, oldValidator.Tokens, newValidator.Tokens) - - // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased - totalLiquidTokensAfterTokenization := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) - validatorLiquidSharesAfterTokenization := newValidator.LiquidShares - if !tc.delegatorIsLSTP { - require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") - require.Equal(t, tc.tokenizeShareAmount.String(), validatorLiquidSharesAfterTokenization.TruncateInt().String(), "validator liquid shares after tokenization") - } else { - require.True(t, totalLiquidTokensAfterTokenization.IsZero(), "zero liquid tokens after tokenization") - require.True(t, validatorLiquidSharesAfterTokenization.IsZero(), "zero liquid validator shares after tokenization") - } - - if tc.vestingAmount.IsPositive() { - acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) - vestingAcc := acc.(vesting.VestingAccount) - require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) - } - - if tc.prevAccountDelegationExists { - _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - require.True(t, found, "delegation found after partial tokenize share") - } else { - _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - require.False(t, found, "delegation found after full tokenize share") - } - - shareToken := app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) - require.Equal(t, resp.Amount, shareToken) - _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found, true, "validator not found") - - records := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - require.Len(t, records, 1) - delegation, found := app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - require.True(t, found, "delegation not found from tokenize share module account after tokenize share") - - // slash before redeem - slashedTokens := sdk.ZeroInt() - redeemedShares := tc.redeemAmount - redeemedTokens := tc.redeemAmount - if tc.slashFactor.IsPositive() { - consAddr, err := val1.GetConsAddr() - require.NoError(t, err) - ctx = ctx.WithBlockHeight(100) - val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - power := app.StakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) - app.StakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor, 0) - slashedTokens = sdk.NewDecFromInt(val1.Tokens).Mul(tc.slashFactor).TruncateInt() - - val1, _ := app.StakingKeeper.GetValidator(ctx, addrVal1) - redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() - } - - // get deletagor balance and delegation - bondDenomAmountBefore := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) - val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - if !found { - delegation = types.Delegation{Shares: sdk.ZeroDec()} - } - delAmountBefore := val1.TokensFromShares(delegation.Shares) - oldValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - DelegatorAddress: delegatorAccount.String(), - Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), - }) - if tc.expRedeemErr { - require.Error(t, err) - return - } - require.NoError(t, err) - - // ensure validator's total tokens is consistent - newValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - require.Equal(t, oldValidator.Tokens, newValidator.Tokens) - - // if the delegator was not a liuqid staking provider, check that the total liquid staked - // and liquid shares decreased - totalLiquidTokensAfterRedemption := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) - validatorLiquidSharesAfterRedemption := newValidator.LiquidShares - expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) - expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) - if !tc.delegatorIsLSTP { - require.Equal(t, expectedLiquidTokens.String(), totalLiquidTokensAfterRedemption.String(), "total liquid tokens after redemption") - require.Equal(t, expectedLiquidShares.String(), validatorLiquidSharesAfterRedemption.String(), "validator liquid shares after tokenization") - } else { - require.True(t, totalLiquidTokensAfterRedemption.IsZero(), "zero liquid tokens after redemption") - require.True(t, validatorLiquidSharesAfterRedemption.IsZero(), "zero liquid validator shares after redemption") - } - - if tc.vestingAmount.IsPositive() { - acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) - vestingAcc := acc.(vesting.VestingAccount) - require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) - } - - expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) - delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - require.True(t, found, "delegation not found after redeem tokens") - require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) - require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) - require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") - - // check delegator balance is not changed - bondDenomAmountAfter := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) - require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) - - // get delegation amount is changed correctly - val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - if !found { - delegation = types.Delegation{Shares: sdk.ZeroDec()} - } - delAmountAfter := val1.TokensFromShares(delegation.Shares) - require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) - - shareToken = app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) - require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) - _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found, true, "validator not found") - - if tc.recordAccountDelegationExists { - _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") - - records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - require.Len(t, records, 1) - } else { - _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - require.False(t, found, "delegation found from tokenize share module account after redeem full amount") - - records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - require.Len(t, records, 0) - } - }) - } + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + // liquidStakingCapStrict := sdk.ZeroDec() + // liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") + // liquidStakingCapDisabled := sdk.OneDec() + + // validatorBondStrict := sdk.OneDec() + // validatorBondConservative := sdk.NewDec(10) + // validatorBondDisabled := sdk.NewDec(-1) + + // testCases := []struct { + // name string + // vestingAmount sdk.Int + // delegationAmount sdk.Int + // tokenizeShareAmount sdk.Int + // redeemAmount sdk.Int + // targetVestingDelAfterShare sdk.Int + // targetVestingDelAfterRedeem sdk.Int + // globalLiquidStakingCap sdk.Dec + // slashFactor sdk.Dec + // validatorLiquidStakingCap sdk.Dec + // validatorBondFactor sdk.Dec + // validatorBondDelegation bool + // validatorBondDelegatorIndex int + // delegatorIsLSTP bool + // expTokenizeErr bool + // expRedeemErr bool + // prevAccountDelegationExists bool + // recordAccountDelegationExists bool + // }{ + // { + // name: "full amount tokenize and redeem", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: false, + // recordAccountDelegationExists: false, + // }, + // { + // name: "full amount tokenize and partial redeem", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: false, + // recordAccountDelegationExists: true, + // }, + // { + // name: "partial amount tokenize and full redeem", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // recordAccountDelegationExists: false, + // }, + // { + // name: "tokenize and redeem with slash", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.MustNewDecFromStr("0.1"), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: false, + // recordAccountDelegationExists: true, + // }, + // { + // name: "over tokenize", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 30), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: true, + // expRedeemErr: false, + // }, + // { + // name: "over redeem", + // vestingAmount: sdk.NewInt(0), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 40), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: true, + // }, + // { + // name: "vesting account tokenize share failure", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: true, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "vesting account tokenize share success", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: false, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "try tokenize share for a validator-bond delegation", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondConservative, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 1, + // expTokenizeErr: true, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "strict validator-bond - tokenization fails", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondStrict, + // validatorBondDelegation: false, + // expTokenizeErr: true, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "conservative validator-bond - successful tokenization", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondConservative, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "strict global liquid staking cap - tokenization fails", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapStrict, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: true, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "conservative global liquid staking cap - successful tokenization", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapConservative, + // validatorLiquidStakingCap: liquidStakingCapDisabled, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "strict validator liquid staking cap - tokenization fails", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapStrict, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: true, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "conservative validator liquid staking cap - successful tokenization", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapDisabled, + // validatorLiquidStakingCap: liquidStakingCapConservative, + // validatorBondFactor: validatorBondDisabled, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "all caps set conservatively - successful tokenize share", + // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapConservative, + // validatorLiquidStakingCap: liquidStakingCapConservative, + // validatorBondFactor: validatorBondConservative, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // { + // name: "delegator is a liquid staking provider - accounting should not update", + // vestingAmount: sdk.ZeroInt(), + // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), + // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), + // slashFactor: sdk.ZeroDec(), + // globalLiquidStakingCap: liquidStakingCapConservative, + // validatorLiquidStakingCap: liquidStakingCapConservative, + // validatorBondFactor: validatorBondConservative, + // delegatorIsLSTP: true, + // validatorBondDelegation: true, + // validatorBondDelegatorIndex: 0, + // expTokenizeErr: false, + // expRedeemErr: false, + // prevAccountDelegationExists: true, + // }, + // } + + // for _, tc := range testCases { + // t.Run(tc.name, func(t *testing.T) { + // addrs := simtestutil.AddTestAddrs(app.BankKeeper, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + // addrAcc1, addrAcc2 := addrs[0], addrs[1] + // addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) + + // // Create ICA module account + // icaAccountAddress := createICAAccount(app, ctx) + + // // Fund module account + // delegationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.delegationAmount) + // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) + // require.NoError(t, err) + // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) + // require.NoError(t, err) + + // // set the delegator address depending on whether the delegator should be a liquid staking provider + // delegatorAccount := addrAcc2 + // if tc.delegatorIsLSTP { + // delegatorAccount = icaAccountAddress + // } + + // // set validator bond factor and global liquid staking cap + // params := app.StakingKeeper.GetParams(ctx) + // params.ValidatorBondFactor = tc.validatorBondFactor + // params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap + // params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap + // app.StakingKeeper.SetParams(ctx, params) + + // // set the total liquid staked tokens + // app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.ZeroInt()) + + // if !tc.vestingAmount.IsZero() { + // // create vesting account + // pubkey := secp256k1.GenPrivKey().PubKey() + // baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) + // initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) + // baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) + // delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) + // app.AccountKeeper.SetAccount(ctx, delayedVestingAccount) + // } + + // pubKeys := simtestutil.CreateTestPubKeys(2) + // pk1, pk2 := pubKeys[0], pubKeys[1] + + // // Create Validators and Delegation + // val1 := stakingtypes.NewValidator(addrVal1, pk1, stakingtypes.Description{}) + // val1.Status = sdkstaking.Bonded + // app.StakingKeeper.SetValidator(ctx, val1) + // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + // require.NoError(t, err) + + // val2 := stakingtypes.NewValidator(addrVal2, pk2, stakingtypes.Description{}) + // val2.Status = sdkstaking.Bonded + // app.StakingKeeper.SetValidator(ctx, val2) + // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) + // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) + // require.NoError(t, err) + + // // Delegate from both the main delegator as well as a random account so there is a + // // non-zero delegation after redemption + // err = delegateCoinsFromAccount(ctx, app, delegatorAccount, tc.delegationAmount, val1) + // require.NoError(t, err) + + // // apply TM updates + // applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // require.True(t, found, "delegation not found after delegate") + + // lastRecordID := app.StakingKeeper.GetLastTokenizeShareRecordID(ctx) + // oldValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + // if tc.validatorBondDelegation { + // err := delegateCoinsFromAccount(ctx, app, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) + // require.NoError(t, err) + // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + // DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), + // ValidatorAddress: addrVal1.String(), + // }) + // require.NoError(t, err) + // } + + // resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + // DelegatorAddress: delegatorAccount.String(), + // ValidatorAddress: addrVal1.String(), + // Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), + // TokenizedShareOwner: delegatorAccount.String(), + // }) + // if tc.expTokenizeErr { + // require.Error(t, err) + // return + // } + // require.NoError(t, err) + + // // check last record id increase + // require.Equal(t, lastRecordID+1, app.StakingKeeper.GetLastTokenizeShareRecordID(ctx)) + + // // ensure validator's total tokens is consistent + // newValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased + // totalLiquidTokensAfterTokenization := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) + // validatorLiquidSharesAfterTokenization := newValidator.LiquidShares + // if !tc.delegatorIsLSTP { + // require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") + // require.Equal(t, tc.tokenizeShareAmount.String(), validatorLiquidSharesAfterTokenization.TruncateInt().String(), "validator liquid shares after tokenization") + // } else { + // require.True(t, totalLiquidTokensAfterTokenization.IsZero(), "zero liquid tokens after tokenization") + // require.True(t, validatorLiquidSharesAfterTokenization.IsZero(), "zero liquid validator shares after tokenization") + // } + + // if tc.vestingAmount.IsPositive() { + // acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + // vestingAcc := acc.(vesting.VestingAccount) + // require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) + // } + + // if tc.prevAccountDelegationExists { + // _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // require.True(t, found, "delegation found after partial tokenize share") + // } else { + // _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // require.False(t, found, "delegation found after full tokenize share") + // } + + // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) + // require.Equal(t, resp.Amount, shareToken) + // _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found, true, "validator not found") + + // records := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + // require.Len(t, records, 1) + // delegation, found := app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + // require.True(t, found, "delegation not found from tokenize share module account after tokenize share") + + // // slash before redeem + // slashedTokens := sdk.ZeroInt() + // redeemedShares := tc.redeemAmount + // redeemedTokens := tc.redeemAmount + // if tc.slashFactor.IsPositive() { + // consAddr, err := val1.GetConsAddr() + // require.NoError(t, err) + // ctx = ctx.WithBlockHeight(100) + // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // power := app.StakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) + // app.StakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor, 0) + // slashedTokens = sdk.NewDecFromInt(val1.Tokens).Mul(tc.slashFactor).TruncateInt() + + // val1, _ := app.StakingKeeper.GetValidator(ctx, addrVal1) + // redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() + // } + + // // get deletagor balance and delegation + // bondDenomAmountBefore := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) + // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // if !found { + // delegation = types.Delegation{Shares: sdk.ZeroDec()} + // } + // delAmountBefore := val1.TokensFromShares(delegation.Shares) + // oldValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + + // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + // DelegatorAddress: delegatorAccount.String(), + // Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), + // }) + // if tc.expRedeemErr { + // require.Error(t, err) + // return + // } + // require.NoError(t, err) + + // // ensure validator's total tokens is consistent + // newValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // // if the delegator was not a liuqid staking provider, check that the total liquid staked + // // and liquid shares decreased + // totalLiquidTokensAfterRedemption := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) + // validatorLiquidSharesAfterRedemption := newValidator.LiquidShares + // expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) + // expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) + // if !tc.delegatorIsLSTP { + // require.Equal(t, expectedLiquidTokens.String(), totalLiquidTokensAfterRedemption.String(), "total liquid tokens after redemption") + // require.Equal(t, expectedLiquidShares.String(), validatorLiquidSharesAfterRedemption.String(), "validator liquid shares after tokenization") + // } else { + // require.True(t, totalLiquidTokensAfterRedemption.IsZero(), "zero liquid tokens after redemption") + // require.True(t, validatorLiquidSharesAfterRedemption.IsZero(), "zero liquid validator shares after redemption") + // } + + // if tc.vestingAmount.IsPositive() { + // acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) + // vestingAcc := acc.(vesting.VestingAccount) + // require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) + // } + + // expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) + // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // require.True(t, found, "delegation not found after redeem tokens") + // require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) + // require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) + // require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") + + // // check delegator balance is not changed + // bondDenomAmountAfter := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) + // require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) + + // // get delegation amount is changed correctly + // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) + // if !found { + // delegation = types.Delegation{Shares: sdk.ZeroDec()} + // } + // delAmountAfter := val1.TokensFromShares(delegation.Shares) + // require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) + + // shareToken = app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) + // require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) + // _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found, true, "validator not found") + + // if tc.recordAccountDelegationExists { + // _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + // require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") + + // records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + // require.Len(t, records, 1) + // } else { + // _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) + // require.False(t, found, "delegation found from tokenize share module account after redeem full amount") + + // records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) + // require.Len(t, records, 0) + // } + // }) + // } } +// TODO refactor LSM test +// // Helper function to setup a delegator and validator for the Tokenize/Redeem conversion tests func setupTestTokenizeAndRedeemConversion( t *testing.T, app *simapp.SimApp, ctx sdk.Context, ) (delAddress sdk.AccAddress, valAddress sdk.ValAddress) { - addresses := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1_000_000)) - pubKeys := simapp.CreateTestPubKeys(1) + // addresses := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1_000_000)) + // pubKeys := simapp.CreateTestPubKeys(1) - delegatorAddress := addresses[0] - validatorAddress := sdk.ValAddress(addresses[1]) + // delegatorAddress := addresses[0] + // validatorAddress := sdk.ValAddress(addresses[1]) - validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) - validator.DelegatorShares = sdk.NewDec(1_000_000) - validator.Tokens = sdk.NewInt(1_000_000) - validator.LiquidShares = sdk.NewDec(0) - validator.Status = types.Bonded + // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + // validator.DelegatorShares = sdk.NewDec(1_000_000) + // validator.Tokens = sdk.NewInt(1_000_000) + // validator.LiquidShares = sdk.NewDec(0) + // validator.Status = types.Bonded - app.StakingKeeper.SetValidator(ctx, validator) - app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) + // app.StakingKeeper.SetValidator(ctx, validator) + // app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - return delegatorAddress, validatorAddress + // return delegatorAddress, validatorAddress + return } +// TODO refactor LSM test +// // Simulate a slash by decrementing the validator's tokens // We'll do this in a way such that the exchange rate is not an even integer // and the shares associated with a delegation will have a long decimal func simulateSlashWithImprecision(t *testing.T, app *simapp.SimApp, ctx sdk.Context, valAddress sdk.ValAddress) { - validator, found := app.StakingKeeper.GetValidator(ctx, valAddress) - require.True(t, found) + // validator, found := app.StakingKeeper.GetValidator(ctx, valAddress) + // require.True(t, found) - slashMagnitude := sdk.MustNewDecFromStr("0.1111111111") - slashTokens := validator.Tokens.ToDec().Mul(slashMagnitude).TruncateInt() - validator.Tokens = validator.Tokens.Sub(slashTokens) + // slashMagnitude := sdk.MustNewDecFromStr("0.1111111111") + // slashTokens := validator.Tokens.ToDec().Mul(slashMagnitude).TruncateInt() + // validator.Tokens = validator.Tokens.Sub(slashTokens) - app.StakingKeeper.SetValidator(ctx, validator) + // app.StakingKeeper.SetValidator(ctx, validator) } +// TODO refactor LSM test // Tests the conversion from tokenization and redemption from the following scenario: // Slash -> Delegate -> Tokenize -> Redeem // Note, in this example, there 2 tokens are lost during the decimal to int conversion // during the unbonding step within tokenization and redemption func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // // slash the validator + // simulateSlashWithImprecision(t, app, ctx, validatorAddress) + // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found) + + // // Delegate and confirm the delegation record was created + // delegateAmount := sdk.NewInt(1000) + // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // }) + // require.NoError(t, err, "no error expected when delegating") + + // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found, "delegation should have been found") + + // // Tokenize the full delegation amount + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // TokenizedShareOwner: delegatorAddress.String(), + // }) + // require.NoError(t, err, "no error expected when tokenizing") + + // // Confirm the number of shareTokens equals the number of shares truncated + // // Note: 1 token is lost during unbonding due to rounding + // shareDenom := validatorAddress.String() + "/1" + // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + // expectedShareTokens := delegation.Shares.TruncateInt().Int64() - 1 // 1 token was lost during unbonding + // require.Equal(t, expectedShareTokens, shareToken.Amount.Int64(), "share token amount") - // slash the validator - simulateSlashWithImprecision(t, app, ctx, validatorAddress) - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found) - - // Delegate and confirm the delegation record was created - delegateAmount := sdk.NewInt(1000) - delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - }) - require.NoError(t, err, "no error expected when delegating") - - delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found, "delegation should have been found") - - // Tokenize the full delegation amount - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - TokenizedShareOwner: delegatorAddress.String(), - }) - require.NoError(t, err, "no error expected when tokenizing") - - // Confirm the number of shareTokens equals the number of shares truncated - // Note: 1 token is lost during unbonding due to rounding - shareDenom := validatorAddress.String() + "/1" - shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - expectedShareTokens := delegation.Shares.TruncateInt().Int64() - 1 // 1 token was lost during unbonding - require.Equal(t, expectedShareTokens, shareToken.Amount.Int64(), "share token amount") - - // Redeem the share tokens - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - DelegatorAddress: delegatorAddress.String(), - Amount: shareToken, - }) - require.NoError(t, err, "no error expected when redeeming") - - // Confirm (almost) the full delegation was recovered - minus the 2 tokens from the precision error - // (1 occurs during tokenization, and 1 occurs during redemption) - newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found) - - endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - expectedDelegationTokens := delegateAmount.Int64() - 2 - require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") + // // Redeem the share tokens + // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + // DelegatorAddress: delegatorAddress.String(), + // Amount: shareToken, + // }) + // require.NoError(t, err, "no error expected when redeeming") + + // // Confirm (almost) the full delegation was recovered - minus the 2 tokens from the precision error + // // (1 occurs during tokenization, and 1 occurs during redemption) + // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found) + + // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + // expectedDelegationTokens := delegateAmount.Int64() - 2 + // require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } +// TODO refactor LSM test +// // Tests the conversion from tokenization and redemption from the following scenario: // Delegate -> Slash -> Tokenize -> Redeem // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within tokenization func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) - - // Delegate and confirm the delegation record was created - delegateAmount := sdk.NewInt(1000) - delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - }) - require.NoError(t, err, "no error expected when delegating") - - _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found, "delegation should have been found") - - // slash the validator - simulateSlashWithImprecision(t, app, ctx, validatorAddress) - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found) - - // Tokenize the new amount after the slash - delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt() - tokenizationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmountAfterSlash) - - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: tokenizationCoin, - TokenizedShareOwner: delegatorAddress.String(), - }) - require.NoError(t, err, "no error expected when tokenizing") - - // The number of share tokens should line up with the **new** number of shares associated - // with the original delegated amount - // Note: 1 token is lost during unbonding due to rounding - shareDenom := validatorAddress.String() + "/1" - shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - expectedShareTokens, err := validator.SharesFromTokens(tokenizationCoin.Amount) - require.Equal(t, expectedShareTokens.TruncateInt().Int64()-1, shareToken.Amount.Int64(), "share token amount") - - // // Redeem the share tokens - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - DelegatorAddress: delegatorAddress.String(), - Amount: shareToken, - }) - require.NoError(t, err, "no error expected when redeeming") - - // Confirm the full tokenization amount was recovered - minus the 1 token from the precision error - newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found) - - endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - expectedDelegationTokens := delegationAmountAfterSlash.Int64() - 1 - require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // // Delegate and confirm the delegation record was created + // delegateAmount := sdk.NewInt(1000) + // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // }) + // require.NoError(t, err, "no error expected when delegating") + + // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found, "delegation should have been found") + + // // slash the validator + // simulateSlashWithImprecision(t, app, ctx, validatorAddress) + // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found) + + // // Tokenize the new amount after the slash + // delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt() + // tokenizationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmountAfterSlash) + + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: tokenizationCoin, + // TokenizedShareOwner: delegatorAddress.String(), + // }) + // require.NoError(t, err, "no error expected when tokenizing") + + // // The number of share tokens should line up with the **new** number of shares associated + // // with the original delegated amount + // // Note: 1 token is lost during unbonding due to rounding + // shareDenom := validatorAddress.String() + "/1" + // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + // expectedShareTokens, err := validator.SharesFromTokens(tokenizationCoin.Amount) + // require.Equal(t, expectedShareTokens.TruncateInt().Int64()-1, shareToken.Amount.Int64(), "share token amount") + + // // // Redeem the share tokens + // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + // DelegatorAddress: delegatorAddress.String(), + // Amount: shareToken, + // }) + // require.NoError(t, err, "no error expected when redeeming") + + // // Confirm the full tokenization amount was recovered - minus the 1 token from the precision error + // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found) + + // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + // expectedDelegationTokens := delegationAmountAfterSlash.Int64() - 1 + // require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } +// TODO refactor LSM test +// // Tests the conversion from tokenization and redemption from the following scenario: // Delegate -> Tokenize -> Slash -> Redeem // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within redemption func TestTokenizeAndRedeemConversion_SlashBeforeRedemptino(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) - - // Delegate and confirm the delegation record was created - delegateAmount := sdk.NewInt(1000) - delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - }) - require.NoError(t, err, "no error expected when delegating") - - _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found, "delegation should have been found") - - // Tokenize the full delegation amount - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - TokenizedShareOwner: delegatorAddress.String(), - }) - require.NoError(t, err, "no error expected when tokenizing") - - // The number of share tokens should line up 1:1 with the number of issued shares - // Since the validator has not been slashed, the shares also line up 1;1 - // with the original delegation amount - shareDenom := validatorAddress.String() + "/1" - shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - expectedShareTokens := delegateAmount - require.Equal(t, expectedShareTokens.Int64(), shareToken.Amount.Int64(), "share token amount") - - // slash the validator - simulateSlashWithImprecision(t, app, ctx, validatorAddress) - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found) - - // Redeem the share tokens - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - DelegatorAddress: delegatorAddress.String(), - Amount: shareToken, - }) - require.NoError(t, err, "no error expected when redeeming") - - // Confirm the original delegation, minus the slash, was recovered - // There's an additional 1 token lost from precision error during unbonding - delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt().Int64() - newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found) + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) + + // // Delegate and confirm the delegation record was created + // delegateAmount := sdk.NewInt(1000) + // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // }) + // require.NoError(t, err, "no error expected when delegating") + + // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found, "delegation should have been found") + + // // Tokenize the full delegation amount + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // TokenizedShareOwner: delegatorAddress.String(), + // }) + // require.NoError(t, err, "no error expected when tokenizing") + + // // The number of share tokens should line up 1:1 with the number of issued shares + // // Since the validator has not been slashed, the shares also line up 1;1 + // // with the original delegation amount + // shareDenom := validatorAddress.String() + "/1" + // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + // expectedShareTokens := delegateAmount + // require.Equal(t, expectedShareTokens.Int64(), shareToken.Amount.Int64(), "share token amount") + + // // slash the validator + // simulateSlashWithImprecision(t, app, ctx, validatorAddress) + // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found) - endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") + // // Redeem the share tokens + // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + // DelegatorAddress: delegatorAddress.String(), + // Amount: shareToken, + // }) + // require.NoError(t, err, "no error expected when redeeming") + + // // Confirm the original delegation, minus the slash, was recovered + // // There's an additional 1 token lost from precision error during unbonding + // delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt().Int64() + // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found) + + // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + // require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") } +// TODO refactor LSM test func TestTransferTokenizeShareRecord(t *testing.T) { - _, app, ctx := createTestInput() - - addrs := simapp.AddTestAddrs(app, ctx, 3, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] - addrVal := sdk.ValAddress(valAcc) - - pubKeys := simapp.CreateTestPubKeys(1) - pk := pubKeys[0] - - val := teststaking.NewValidator(t, addrVal, pk) - app.StakingKeeper.SetValidator(ctx, val) - app.StakingKeeper.SetValidatorByPowerIndex(ctx, val) - - // apply TM updates - applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) - - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - err := app.StakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ - Id: 1, - Owner: addrAcc1.String(), - ModuleAccount: "module_account", - Validator: val.String(), - }) - require.NoError(t, err) - - _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ - TokenizeShareRecordId: 1, - Sender: addrAcc1.String(), - NewOwner: addrAcc2.String(), - }) - require.NoError(t, err) - - record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) - require.NoError(t, err) - require.Equal(t, record.Owner, addrAcc2.String()) - - records := app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) - require.Len(t, records, 0) - records = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) - require.Len(t, records, 1) + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // addrs := simapp.AddTestAddrs(app, ctx, 3, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + // addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] + // addrVal := sdk.ValAddress(valAcc) + + // pubKeys := simapp.CreateTestPubKeys(1) + // pk := pubKeys[0] + + // val := stakingtypes.NewValidator(addrVal, pk, stakingtypes.Description{}) + // app.StakingKeeper.SetValidator(ctx, val) + // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val) + + // // apply TM updates + // applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) + + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // err := app.StakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ + // Id: 1, + // Owner: addrAcc1.String(), + // ModuleAccount: "module_account", + // Validator: val.String(), + // }) + // require.NoError(t, err) + + // _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ + // TokenizeShareRecordId: 1, + // Sender: addrAcc1.String(), + // NewOwner: addrAcc2.String(), + // }) + // require.NoError(t, err) + + // record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) + // require.NoError(t, err) + // require.Equal(t, record.Owner, addrAcc2.String()) + + // records := app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) + // require.Len(t, records, 0) + // records = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) + // require.Len(t, records, 1) } +// TODO refactor LSM test func TestValidatorBond(t *testing.T) { - _, app, ctx := createTestInput() - - testCases := []struct { - name string - createValidator bool - createDelegation bool - alreadyValidatorBond bool - delegatorIsLSTP bool - expectedErr error - }{ - { - name: "successful validator bond", - createValidator: true, - createDelegation: true, - alreadyValidatorBond: false, - delegatorIsLSTP: false, - }, - { - name: "successful with existing validator bond", - createValidator: true, - createDelegation: true, - alreadyValidatorBond: true, - delegatorIsLSTP: false, - }, - { - name: "validator does not not exist", - createValidator: false, - createDelegation: false, - alreadyValidatorBond: false, - delegatorIsLSTP: false, - expectedErr: sdkstaking.ErrNoValidatorFound, - }, - { - name: "delegation not exist case", - createValidator: true, - createDelegation: false, - alreadyValidatorBond: false, - delegatorIsLSTP: false, - expectedErr: sdkstaking.ErrNoDelegation, - }, - { - name: "delegator is a liquid staking provider", - createValidator: true, - createDelegation: true, - alreadyValidatorBond: false, - delegatorIsLSTP: true, - expectedErr: types.ErrValidatorBondNotAllowedFromModuleAccount, - }, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - _, app, ctx = createTestInput() - - pubKeys := simapp.CreateTestPubKeys(2) - validatorPubKey := pubKeys[0] - delegatorPubKey := pubKeys[1] - - delegatorAddress := sdk.AccAddress(delegatorPubKey.Address()) - validatorAddress := sdk.ValAddress(validatorPubKey.Address()) - icaAccountAddress := createICAAccount(app, ctx) - - // Set the delegator address to either be a user account or an ICA account depending on the test case - if tc.delegatorIsLSTP { - delegatorAddress = icaAccountAddress - } - - // Fund the delegator - delegationAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) - coins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmount)) - - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) - require.NoError(t, err, "no error expected when minting") - - err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) - require.NoError(t, err, "no error expected when funding account") - - // Create Validator and delegation - if tc.createValidator { - validator := teststaking.NewValidator(t, validatorAddress, validatorPubKey) - validator.Status = sdkstaking.Bonded - app.StakingKeeper.SetValidator(ctx, validator) - app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) - err = app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - require.NoError(t, err) - - // Optionally create the delegation, depending on the test case - if tc.createDelegation { - _, err = app.StakingKeeper.Delegate(ctx, delegatorAddress, delegationAmount, sdkstaking.Unbonded, validator, true) - require.NoError(t, err, "no error expected when delegating") - - // Optionally, convert the delegation into a validator bond - if tc.alreadyValidatorBond { - delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found, "delegation should have been found") - - delegation.ValidatorBond = true - app.StakingKeeper.SetDelegation(ctx, delegation) - } - } - } - - // Call ValidatorBond - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - }) - - if tc.expectedErr != nil { - require.ErrorContains(t, err, tc.expectedErr.Error()) - } else { - require.NoError(t, err, "no error expected from validator bond transaction") - - // check validator bond true - delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - require.True(t, found, "delegation should have been found after validator bond") - require.True(t, delegation.ValidatorBond, "delegation should be marked as a validator bond") - - // check validator bond shares - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found, "validator should have been found after validator bond") - - if tc.alreadyValidatorBond { - require.True(t, validator.ValidatorBondShares.IsZero(), "validator bond shares should still be zero") - } else { - require.Equal(t, delegation.Shares.String(), validator.ValidatorBondShares.String(), - "validator total shares should have increased") - } - } - }) - } + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + // testCases := []struct { + // name string + // createValidator bool + // createDelegation bool + // alreadyValidatorBond bool + // delegatorIsLSTP bool + // expectedErr error + // }{ + // { + // name: "successful validator bond", + // createValidator: true, + // createDelegation: true, + // alreadyValidatorBond: false, + // delegatorIsLSTP: false, + // }, + // { + // name: "successful with existing validator bond", + // createValidator: true, + // createDelegation: true, + // alreadyValidatorBond: true, + // delegatorIsLSTP: false, + // }, + // { + // name: "validator does not not exist", + // createValidator: false, + // createDelegation: false, + // alreadyValidatorBond: false, + // delegatorIsLSTP: false, + // expectedErr: sdkstaking.ErrNoValidatorFound, + // }, + // { + // name: "delegation not exist case", + // createValidator: true, + // createDelegation: false, + // alreadyValidatorBond: false, + // delegatorIsLSTP: false, + // expectedErr: sdkstaking.ErrNoDelegation, + // }, + // { + // name: "delegator is a liquid staking provider", + // createValidator: true, + // createDelegation: true, + // alreadyValidatorBond: false, + // delegatorIsLSTP: true, + // expectedErr: types.ErrValidatorBondNotAllowedFromModuleAccount, + // }, + // } + + // for _, tc := range testCases { + // t.Run(tc.name, func(t *testing.T) { + // _, app, ctx = createTestInput() + + // pubKeys := simapp.CreateTestPubKeys(2) + // validatorPubKey := pubKeys[0] + // delegatorPubKey := pubKeys[1] + + // delegatorAddress := sdk.AccAddress(delegatorPubKey.Address()) + // validatorAddress := sdk.ValAddress(validatorPubKey.Address()) + // icaAccountAddress := createICAAccount(app, ctx) + + // // Set the delegator address to either be a user account or an ICA account depending on the test case + // if tc.delegatorIsLSTP { + // delegatorAddress = icaAccountAddress + // } + + // // Fund the delegator + // delegationAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) + // coins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmount)) + + // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + // require.NoError(t, err, "no error expected when minting") + + // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) + // require.NoError(t, err, "no error expected when funding account") + + // // Create Validator and delegation + // if tc.createValidator { + // validator := stakingtypes.NewValidator(validatorAddress, validatorPubKey, stakingtypes.Description{}) + // validator.Status = sdkstaking.Bonded + // app.StakingKeeper.SetValidator(ctx, validator) + // app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) + // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) + // require.NoError(t, err) + + // // Optionally create the delegation, depending on the test case + // if tc.createDelegation { + // _, err = app.StakingKeeper.Delegate(ctx, delegatorAddress, delegationAmount, sdkstaking.Unbonded, validator, true) + // require.NoError(t, err, "no error expected when delegating") + + // // Optionally, convert the delegation into a validator bond + // if tc.alreadyValidatorBond { + // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found, "delegation should have been found") + + // delegation.ValidatorBond = true + // app.StakingKeeper.SetDelegation(ctx, delegation) + // } + // } + // } + + // // Call ValidatorBond + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // }) + + // if tc.expectedErr != nil { + // require.ErrorContains(t, err, tc.expectedErr.Error()) + // } else { + // require.NoError(t, err, "no error expected from validator bond transaction") + + // // check validator bond true + // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + // require.True(t, found, "delegation should have been found after validator bond") + // require.True(t, delegation.ValidatorBond, "delegation should be marked as a validator bond") + + // // check validator bond shares + // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found, "validator should have been found after validator bond") + + // if tc.alreadyValidatorBond { + // require.True(t, validator.ValidatorBondShares.IsZero(), "validator bond shares should still be zero") + // } else { + // require.Equal(t, delegation.Shares.String(), validator.ValidatorBondShares.String(), + // "validator total shares should have increased") + // } + // } + // }) + // } } +// TODO refactor LSM test func TestChangeValidatorBond(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { - validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found, "validator should have been found") - require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") - } - - // Create a delegator and 3 validators - addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1_000_000)) - pubKeys := simapp.CreateTestPubKeys(4) - - validatorAPubKey := pubKeys[1] - validatorBPubKey := pubKeys[2] - validatorCPubKey := pubKeys[3] - - delegatorAddress := addresses[0] - validatorAAddress := sdk.ValAddress(validatorAPubKey.Address()) - validatorBAddress := sdk.ValAddress(validatorBPubKey.Address()) - validatorCAddress := sdk.ValAddress(validatorCPubKey.Address()) - - validatorA := teststaking.NewValidator(t, validatorAAddress, validatorAPubKey) - validatorB := teststaking.NewValidator(t, validatorBAddress, validatorBPubKey) - validatorC := teststaking.NewValidator(t, validatorCAddress, validatorCPubKey) - - validatorA.Tokens = sdk.NewInt(1_000_000) - validatorB.Tokens = sdk.NewInt(1_000_000) - validatorC.Tokens = sdk.NewInt(1_000_000) - validatorA.DelegatorShares = sdk.NewDec(1_000_000) - validatorB.DelegatorShares = sdk.NewDec(1_000_000) - validatorC.DelegatorShares = sdk.NewDec(1_000_000) - - app.StakingKeeper.SetValidator(ctx, validatorA) - app.StakingKeeper.SetValidator(ctx, validatorB) - app.StakingKeeper.SetValidator(ctx, validatorC) - - // The test will go through Delegate/Redelegate/Undelegate messages with the following - delegation1Amount := sdk.NewInt(1000) - delegation2Amount := sdk.NewInt(1000) - redelegateAmount := sdk.NewInt(500) - undelegateAmount := sdk.NewInt(500) - - delegate1Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation1Amount) - delegate2Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation2Amount) - redelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), redelegateAmount) - undelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), undelegateAmount) - - // Delegate to validator's A and C - validator bond shares should not change - _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAAddress.String(), - Amount: delegate1Coin, - }) - require.NoError(t, err, "no error expected during first delegation") - - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorCAddress.String(), - Amount: delegate1Coin, - }) - require.NoError(t, err, "no error expected during first delegation") - - checkValidatorBondShares(validatorAAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, sdk.ZeroInt()) - - // Flag the the delegations to validator A and C validator bond's - // Their bond shares should increase - _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAAddress.String(), - }) - require.NoError(t, err, "no error expected during validator bond") - - _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorCAddress.String(), - }) - require.NoError(t, err, "no error expected during validator bond") - - checkValidatorBondShares(validatorAAddress, delegation1Amount) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // Delegate more to validator A - it should increase the validator bond shares - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAAddress.String(), - Amount: delegate2Coin, - }) - require.NoError(t, err, "no error expected during second delegation") - - checkValidatorBondShares(validatorAAddress, delegation1Amount.Add(delegation2Amount)) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // Redelegate partially from A to B (where A is a validator bond and B is not) - // It should remove the bond shares from A, and B's validator bond shares should not change - _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorSrcAddress: validatorAAddress.String(), - ValidatorDstAddress: validatorBAddress.String(), - Amount: redelegateCoin, - }) - require.NoError(t, err, "no error expected during redelegation") - - expectedBondSharesA := delegation1Amount.Add(delegation2Amount).Sub(redelegateAmount) - checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // Now redelegate from B to C (where B is not a validator bond, but C is) - // Validator B's bond shares should remain at zero, but C's bond shares should increase - _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorSrcAddress: validatorBAddress.String(), - ValidatorDstAddress: validatorCAddress.String(), - Amount: redelegateCoin, - }) - require.NoError(t, err, "no error expected during redelegation") - - checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, delegation1Amount.Add(redelegateAmount)) - - // Redelegate partially from A to C (where C is a validator bond delegation) - // It should remove the bond shares from A, and increase the bond shares on validator C - _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorSrcAddress: validatorAAddress.String(), - ValidatorDstAddress: validatorCAddress.String(), - Amount: redelegateCoin, - }) - require.NoError(t, err, "no error expected during redelegation") - - expectedBondSharesA = expectedBondSharesA.Sub(redelegateAmount) - expectedBondSharesC := delegation1Amount.Add(redelegateAmount).Add(redelegateAmount) - checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, expectedBondSharesC) - - // Undelegate from validator A - it should remove shares - _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAAddress.String(), - Amount: undelegateCoin, - }) - require.NoError(t, err, "no error expected during undelegation") - - expectedBondSharesA = expectedBondSharesA.Sub(undelegateAmount) - checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - checkValidatorBondShares(validatorCAddress, expectedBondSharesC) + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { + // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found, "validator should have been found") + // require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") + // } + + // // Create a delegator and 3 validators + // addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1_000_000)) + // pubKeys := simapp.CreateTestPubKeys(4) + + // validatorAPubKey := pubKeys[1] + // validatorBPubKey := pubKeys[2] + // validatorCPubKey := pubKeys[3] + + // delegatorAddress := addresses[0] + // validatorAAddress := sdk.ValAddress(validatorAPubKey.Address()) + // validatorBAddress := sdk.ValAddress(validatorBPubKey.Address()) + // validatorCAddress := sdk.ValAddress(validatorCPubKey.Address()) + + // validatorA := stakingtypes.NewValidator(validatorAAddress, validatorAPubKey, stakingtypes.Description{}) + // validatorB := stakingtypes.NewValidator(validatorBAddress, validatorBPubKey, stakingtypes.Description{}) + // validatorC := stakingtypes.NewValidator(validatorCAddress, validatorCPubKey, stakingtypes.Description{}) + + // validatorA.Tokens = sdk.NewInt(1_000_000) + // validatorB.Tokens = sdk.NewInt(1_000_000) + // validatorC.Tokens = sdk.NewInt(1_000_000) + // validatorA.DelegatorShares = sdk.NewDec(1_000_000) + // validatorB.DelegatorShares = sdk.NewDec(1_000_000) + // validatorC.DelegatorShares = sdk.NewDec(1_000_000) + + // app.StakingKeeper.SetValidator(ctx, validatorA) + // app.StakingKeeper.SetValidator(ctx, validatorB) + // app.StakingKeeper.SetValidator(ctx, validatorC) + + // // The test will go through Delegate/Redelegate/Undelegate messages with the following + // delegation1Amount := sdk.NewInt(1000) + // delegation2Amount := sdk.NewInt(1000) + // redelegateAmount := sdk.NewInt(500) + // undelegateAmount := sdk.NewInt(500) + + // delegate1Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation1Amount) + // delegate2Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation2Amount) + // redelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), redelegateAmount) + // undelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), undelegateAmount) + + // // Delegate to validator's A and C - validator bond shares should not change + // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAAddress.String(), + // Amount: delegate1Coin, + // }) + // require.NoError(t, err, "no error expected during first delegation") + + // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorCAddress.String(), + // Amount: delegate1Coin, + // }) + // require.NoError(t, err, "no error expected during first delegation") + + // checkValidatorBondShares(validatorAAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, sdk.ZeroInt()) + + // // Flag the the delegations to validator A and C validator bond's + // // Their bond shares should increase + // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAAddress.String(), + // }) + // require.NoError(t, err, "no error expected during validator bond") + + // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorCAddress.String(), + // }) + // require.NoError(t, err, "no error expected during validator bond") + + // checkValidatorBondShares(validatorAAddress, delegation1Amount) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // // Delegate more to validator A - it should increase the validator bond shares + // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAAddress.String(), + // Amount: delegate2Coin, + // }) + // require.NoError(t, err, "no error expected during second delegation") + + // checkValidatorBondShares(validatorAAddress, delegation1Amount.Add(delegation2Amount)) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // // Redelegate partially from A to B (where A is a validator bond and B is not) + // // It should remove the bond shares from A, and B's validator bond shares should not change + // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorSrcAddress: validatorAAddress.String(), + // ValidatorDstAddress: validatorBAddress.String(), + // Amount: redelegateCoin, + // }) + // require.NoError(t, err, "no error expected during redelegation") + + // expectedBondSharesA := delegation1Amount.Add(delegation2Amount).Sub(redelegateAmount) + // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // // Now redelegate from B to C (where B is not a validator bond, but C is) + // // Validator B's bond shares should remain at zero, but C's bond shares should increase + // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorSrcAddress: validatorBAddress.String(), + // ValidatorDstAddress: validatorCAddress.String(), + // Amount: redelegateCoin, + // }) + // require.NoError(t, err, "no error expected during redelegation") + + // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, delegation1Amount.Add(redelegateAmount)) + + // // Redelegate partially from A to C (where C is a validator bond delegation) + // // It should remove the bond shares from A, and increase the bond shares on validator C + // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorSrcAddress: validatorAAddress.String(), + // ValidatorDstAddress: validatorCAddress.String(), + // Amount: redelegateCoin, + // }) + // require.NoError(t, err, "no error expected during redelegation") + + // expectedBondSharesA = expectedBondSharesA.Sub(redelegateAmount) + // expectedBondSharesC := delegation1Amount.Add(redelegateAmount).Add(redelegateAmount) + // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, expectedBondSharesC) + + // // Undelegate from validator A - it should remove shares + // _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAAddress.String(), + // Amount: undelegateCoin, + // }) + // require.NoError(t, err, "no error expected during undelegation") + + // expectedBondSharesA = expectedBondSharesA.Sub(undelegateAmount) + // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + // checkValidatorBondShares(validatorCAddress, expectedBondSharesC) } +// TODO refactor LSM test func TestEnableDisableTokenizeShares(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // Create a delegator and validator - stakeAmount := sdk.NewInt(1000) - stakeToken := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), stakeAmount) - - addresses := simapp.AddTestAddrs(app, ctx, 2, stakeAmount) - delegatorAddress := addresses[0] - - pubKeys := simapp.CreateTestPubKeys(1) - validatorAddress := sdk.ValAddress(addresses[1]) - validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) - - validator.DelegatorShares = sdk.NewDec(1_000_000) - validator.Tokens = sdk.NewInt(1_000_000) - validator.Status = types.Bonded - app.StakingKeeper.SetValidator(ctx, validator) - - // Fix block time and set unbonding period to 1 day - blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - ctx = ctx.WithBlockTime(blockTime) - - unbondingPeriod := time.Hour * 24 - params := app.StakingKeeper.GetParams(ctx) - params.UnbondingTime = unbondingPeriod - app.StakingKeeper.SetParams(ctx, params) - unlockTime := blockTime.Add(unbondingPeriod) - - // Build test messages (some of which will be reused) - delegateMsg := types.MsgDelegate{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: stakeToken, - } - tokenizeMsg := types.MsgTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: stakeToken, - TokenizedShareOwner: delegatorAddress.String(), - } - redeemMsg := types.MsgRedeemTokensForShares{ - DelegatorAddress: delegatorAddress.String(), - } - disableMsg := types.MsgDisableTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - } - enableMsg := types.MsgEnableTokenizeShares{ - DelegatorAddress: delegatorAddress.String(), - } - - // Delegate normally - _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) - require.NoError(t, err, "no error expected when delegating") - - // Tokenize shares - it should succeed - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - require.NoError(t, err, "no error expected when tokenizing shares for the first time") - - liquidToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, validatorAddress.String()+"/1") - require.Equal(t, stakeAmount.Int64(), liquidToken.Amount.Int64(), "user received token after tokenizing share") - - // Redeem to remove all tokenized shares - redeemMsg.Amount = liquidToken - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &redeemMsg) - require.NoError(t, err, "no error expected when redeeming") - - // Attempt to enable tokenizing shares when there is no lock in place, it should error - _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyEnabledForAccount) - - // Attempt to disable when no lock is in place, it should succeed - _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - require.NoError(t, err, "no error expected when disabling tokenization") - - // Disabling again while the lock is already in place, should error - _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyDisabledForAccount) - - // Attempt to tokenize, it should fail since tokenization is disabled - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) - - // Now enable tokenization - _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - require.NoError(t, err, "no error expected when enabling tokenization") - - // Attempt to tokenize again, it should still fail since the unbonding period has - // not passed and the lock is still active - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) - require.ErrorContains(t, err, fmt.Sprintf("tokenization will be allowed at %s", - blockTime.Add(unbondingPeriod))) - - // Confirm the unlock is queued - authorizations := app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) - require.Equal(t, []string{delegatorAddress.String()}, authorizations.Addresses, - "pending tokenize share authorizations") - - // Disable tokenization again - it should remove the pending record from the queue - _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - require.NoError(t, err, "no error expected when re-enabling tokenization") - - authorizations = app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) - require.Empty(t, authorizations.Addresses, "there should be no pending authorizations in the queue") - - // Enable one more time - _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - require.NoError(t, err, "no error expected when enabling tokenization again") - - // Increment the block time by the unbonding period and remove the expired locks - ctx = ctx.WithBlockTime(unlockTime) - app.StakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) - - // Attempt to tokenize again, it should succeed this time since the lock has expired - _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - require.NoError(t, err, "no error expected when tokenizing after lock has expired") + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + // // Create a delegator and validator + // stakeAmount := sdk.NewInt(1000) + // stakeToken := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), stakeAmount) + + // addresses := simapp.AddTestAddrs(app, ctx, 2, stakeAmount) + // delegatorAddress := addresses[0] + + // pubKeys := simapp.CreateTestPubKeys(1) + // validatorAddress := sdk.ValAddress(addresses[1]) + // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + + // validator.DelegatorShares = sdk.NewDec(1_000_000) + // validator.Tokens = sdk.NewInt(1_000_000) + // validator.Status = types.Bonded + // app.StakingKeeper.SetValidator(ctx, validator) + + // // Fix block time and set unbonding period to 1 day + // blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + // ctx = ctx.WithBlockTime(blockTime) + + // unbondingPeriod := time.Hour * 24 + // params := app.StakingKeeper.GetParams(ctx) + // params.UnbondingTime = unbondingPeriod + // app.StakingKeeper.SetParams(ctx, params) + // unlockTime := blockTime.Add(unbondingPeriod) + + // // Build test messages (some of which will be reused) + // delegateMsg := types.MsgDelegate{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: stakeToken, + // } + // tokenizeMsg := types.MsgTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: stakeToken, + // TokenizedShareOwner: delegatorAddress.String(), + // } + // redeemMsg := types.MsgRedeemTokensForShares{ + // DelegatorAddress: delegatorAddress.String(), + // } + // disableMsg := types.MsgDisableTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // } + // enableMsg := types.MsgEnableTokenizeShares{ + // DelegatorAddress: delegatorAddress.String(), + // } + + // // Delegate normally + // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + // require.NoError(t, err, "no error expected when delegating") + + // // Tokenize shares - it should succeed + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + // require.NoError(t, err, "no error expected when tokenizing shares for the first time") + + // liquidToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, validatorAddress.String()+"/1") + // require.Equal(t, stakeAmount.Int64(), liquidToken.Amount.Int64(), "user received token after tokenizing share") + + // // Redeem to remove all tokenized shares + // redeemMsg.Amount = liquidToken + // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &redeemMsg) + // require.NoError(t, err, "no error expected when redeeming") + + // // Attempt to enable tokenizing shares when there is no lock in place, it should error + // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + // require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyEnabledForAccount) + + // // Attempt to disable when no lock is in place, it should succeed + // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + // require.NoError(t, err, "no error expected when disabling tokenization") + + // // Disabling again while the lock is already in place, should error + // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + // require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyDisabledForAccount) + + // // Attempt to tokenize, it should fail since tokenization is disabled + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + // require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + + // // Now enable tokenization + // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + // require.NoError(t, err, "no error expected when enabling tokenization") + + // // Attempt to tokenize again, it should still fail since the unbonding period has + // // not passed and the lock is still active + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + // require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + // require.ErrorContains(t, err, fmt.Sprintf("tokenization will be allowed at %s", + // blockTime.Add(unbondingPeriod))) + + // // Confirm the unlock is queued + // authorizations := app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + // require.Equal(t, []string{delegatorAddress.String()}, authorizations.Addresses, + // "pending tokenize share authorizations") + + // // Disable tokenization again - it should remove the pending record from the queue + // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + // require.NoError(t, err, "no error expected when re-enabling tokenization") + + // authorizations = app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + // require.Empty(t, authorizations.Addresses, "there should be no pending authorizations in the queue") + + // // Enable one more time + // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + // require.NoError(t, err, "no error expected when enabling tokenization again") + + // // Increment the block time by the unbonding period and remove the expired locks + // ctx = ctx.WithBlockTime(unlockTime) + // app.StakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) + + // // Attempt to tokenize again, it should succeed this time since the lock has expired + // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + // require.NoError(t, err, "no error expected when tokenizing after lock has expired") } +// TODO refactor LSM test func TestUnbondValidator(t *testing.T) { - _, app, ctx := createTestInput() - addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - addrAcc1 := addrs[0] - addrVal1 := sdk.ValAddress(addrAcc1) - - pubKeys := simapp.CreateTestPubKeys(1) - pk1 := pubKeys[0] - - // Create Validators and Delegation - val1 := teststaking.NewValidator(t, addrVal1, pk1) - val1.Status = sdkstaking.Bonded - app.StakingKeeper.SetValidator(ctx, val1) - app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) - err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) - require.NoError(t, err) - - // try unbonding not available validator - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ - ValidatorAddress: sdk.ValAddress(addrs[1]).String(), - }) - require.Error(t, err) - - // unbond validator - _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ - ValidatorAddress: addrVal1.String(), - }) - require.NoError(t, err) - - // check if validator is jailed - validator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - require.True(t, found) - require.True(t, validator.Jailed) + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + // addrAcc1 := addrs[0] + // addrVal1 := sdk.ValAddress(addrAcc1) + + // pubKeys := simapp.CreateTestPubKeys(1) + // pk1 := pubKeys[0] + + // // Create Validators and Delegation + // val1 := stakingtypes.NewValidator(addrVal1, pk1, stakingtypes.Description{}) + // val1.Status = sdkstaking.Bonded + // app.StakingKeeper.SetValidator(ctx, val1) + // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + // err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + // require.NoError(t, err) + + // // try unbonding not available validator + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + // _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + // ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + // }) + // require.Error(t, err) + + // // unbond validator + // _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + // ValidatorAddress: addrVal1.String(), + // }) + // require.NoError(t, err) + + // // check if validator is jailed + // validator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) + // require.True(t, found) + // require.True(t, validator.Jailed) } +// TODO refactor LSM test +// // TestICADelegateUndelegate tests that an ICA account can undelegate // sequentially right after delegating. func TestICADelegateUndelegate(t *testing.T) { - _, app, ctx := createTestInput() - msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // Create a delegator and validator (the delegator will be an ICA account) - delegateAmount := sdk.NewInt(1000) - delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - icaAccountAddress := createICAAccount(app, ctx) - - // Fund ICA account - err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) - require.NoError(t, err) - err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) - require.NoError(t, err) - - addresses := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(0)) - pubKeys := simapp.CreateTestPubKeys(1) - validatorAddress := sdk.ValAddress(addresses[0]) - validator := teststaking.NewValidator(t, validatorAddress, pubKeys[0]) - - validator.DelegatorShares = sdk.NewDec(1_000_000) - validator.Tokens = sdk.NewInt(1_000_000) - validator.LiquidShares = sdk.NewDec(0) - app.StakingKeeper.SetValidator(ctx, validator) - - delegateMsg := types.MsgDelegate{ - DelegatorAddress: icaAccountAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - } - - undelegateMsg := types.MsgUndelegate{ - DelegatorAddress: icaAccountAddress.String(), - ValidatorAddress: validatorAddress.String(), - Amount: delegateCoin, - } - - // Delegate normally - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) - require.NoError(t, err, "no error expected when delegating") - - // Confirm delegation record - _, found := app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) - require.True(t, found, "delegation should have been found") - - // Confirm liquid staking totals were incremented - expectedTotalLiquidStaked := delegateAmount.Int64() - actualTotalLiquidStaked := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() - require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked, "total liquid staked tokens after delegation") - - validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found, "validator should have been found") - require.Equal(t, delegateAmount.ToDec(), validator.LiquidShares, "validator liquid shares after delegation") - - // Try to undelegate - _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &undelegateMsg) - require.NoError(t, err, "no error expected when sequentially undelegating") - - // Confirm delegation record was removed - _, found = app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) - require.False(t, found, "delegation not have been found") - - // Confirm liquid staking totals were decremented - actualTotalLiquidStaked = app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() - require.Zero(t, actualTotalLiquidStaked, "total liquid staked tokens after undelegation") - - validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) - require.True(t, found, "validator should have been found") - require.Equal(t, sdk.ZeroDec(), validator.LiquidShares, "validator liquid shares after undelegation") + // app := simapp.Setup(t, false) + // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + // // Create a delegator and validator (the delegator will be an ICA account) + // delegateAmount := sdk.NewInt(1000) + // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) + // icaAccountAddress := createICAAccount(app, ctx) + + // // Fund ICA account + // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) + // require.NoError(t, err) + // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) + // require.NoError(t, err) + + // addresses := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(0)) + // pubKeys := simapp.CreateTestPubKeys(1) + // validatorAddress := sdk.ValAddress(addresses[0]) + // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + + // validator.DelegatorShares = sdk.NewDec(1_000_000) + // validator.Tokens = sdk.NewInt(1_000_000) + // validator.LiquidShares = sdk.NewDec(0) + // app.StakingKeeper.SetValidator(ctx, validator) + + // delegateMsg := types.MsgDelegate{ + // DelegatorAddress: icaAccountAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // } + + // undelegateMsg := types.MsgUndelegate{ + // DelegatorAddress: icaAccountAddress.String(), + // ValidatorAddress: validatorAddress.String(), + // Amount: delegateCoin, + // } + + // // Delegate normally + // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + // require.NoError(t, err, "no error expected when delegating") + + // // Confirm delegation record + // _, found := app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + // require.True(t, found, "delegation should have been found") + + // // Confirm liquid staking totals were incremented + // expectedTotalLiquidStaked := delegateAmount.Int64() + // actualTotalLiquidStaked := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + // require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked, "total liquid staked tokens after delegation") + + // validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found, "validator should have been found") + // require.Equal(t, delegateAmount.ToDec(), validator.LiquidShares, "validator liquid shares after delegation") + + // // Try to undelegate + // _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &undelegateMsg) + // require.NoError(t, err, "no error expected when sequentially undelegating") + + // // Confirm delegation record was removed + // _, found = app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + // require.False(t, found, "delegation not have been found") + + // // Confirm liquid staking totals were decremented + // actualTotalLiquidStaked = app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + // require.Zero(t, actualTotalLiquidStaked, "total liquid staked tokens after undelegation") + + // validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) + // require.True(t, found, "validator should have been found") + // require.Equal(t, sdk.ZeroDec(), validator.LiquidShares, "validator liquid shares after undelegation") } diff --git a/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail b/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail new file mode 100644 index 000000000000..8bc1d174a96a --- /dev/null +++ b/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail @@ -0,0 +1,32 @@ +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw bond-denom: "A--" +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw duration: 1701275790 +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw max-validators: 0x1 +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw max-entries: 0x1 +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw historical-entries: 0x1 +# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw commission: 0 +# +v0.4.8#11887775898083181920 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 +0x0 \ No newline at end of file diff --git a/x/distribution/testutil/expected_keepers_mocks.go b/x/distribution/testutil/expected_keepers_mocks.go index a060c1a3d133..b3de49ec23c6 100644 --- a/x/distribution/testutil/expected_keepers_mocks.go +++ b/x/distribution/testutil/expected_keepers_mocks.go @@ -197,20 +197,6 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderMod return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToModule), ctx, senderModule, recipientModule, amt) } -// SendCoins mocks base method. -func (m *MockBankKeeper) SendCoins(ctx types.Context, fromAddr types.AccAddress, toAddr types.AccAddress, amt types.Coins) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCoins", ctx, fromAddr, toAddr, amt) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendCoins indicates an expected call of SendCoins. -func (mr *MockBankKeeperMockRecorder) SendCoins(ctx, fromAddr, toAddr, amt interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoins", reflect.TypeOf((*MockBankKeeper)(nil).SendCoins), ctx, fromAddr, toAddr, amt) -} - // SpendableCoins mocks base method. func (m *MockBankKeeper) SpendableCoins(ctx types.Context, addr types.AccAddress) types.Coins { m.ctrl.T.Helper() @@ -399,49 +385,6 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } -// GetTokenizeShareRecordsByOwner mocks base method. -func (m *MockStakingKeeper) GetTokenizeShareRecordsByOwner(ctx types.Context, owner types.AccAddress) (tokenizeShareRecords []types1.TokenizeShareRecord) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenizeShareRecordsByOwner", ctx, owner) - ret0, _ := ret[0].([]types1.TokenizeShareRecord) - return ret0 -} - -// GetTokenizeShareRecordsByOwner indicates an expected call of GetTokenizeShareRecordsByOwner. -func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecordsByOwner(ctx, owner interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecordsByOwner", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecordsByOwner), ctx, owner) -} - -// GetTokenizeShareRecord mocks base method. -func (m *MockStakingKeeper) GetTokenizeShareRecord(ctx types.Context, id uint64) (tokenizeShareRecord types1.TokenizeShareRecord, err error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTokenizeShareRecord", ctx, id) - ret0, _ := ret[0].(types1.TokenizeShareRecord) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetTokenizeShareRecord indicates an expected call of GetTokenizeShareRecord. -func (mr *MockStakingKeeperMockRecorder) GetTokenizeShareRecord(ctx, id interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTokenizeShareRecord", reflect.TypeOf((*MockStakingKeeper)(nil).GetTokenizeShareRecord), ctx, id) -} - -// GetAllTokenizeShareRecords mocks base method. -func (m *MockStakingKeeper) GetAllTokenizeShareRecords(ctx types.Context) (tokenizeShareRecords []types1.TokenizeShareRecord) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAllTokenizeShareRecords", ctx) - ret0, _ := ret[0].([]types1.TokenizeShareRecord) - return ret0 -} - -// GetAllTokenizeShareRecords indicates an expected call of GetAllTokenizeShareRecords. -func (mr *MockStakingKeeperMockRecorder) GetAllTokenizeShareRecords(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllTokenizeShareRecords", reflect.TypeOf((*MockStakingKeeper)(nil).GetAllTokenizeShareRecords), ctx) -} - // MockStakingHooks is a mock of StakingHooks interface. type MockStakingHooks struct { ctrl *gomock.Controller From 552a1257c0f2be75cdd4260007ae48b24c18a2b3 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 29 Nov 2023 17:41:51 +0100 Subject: [PATCH 16/31] make protos --- .../cosmos-sdk/client/grpc/node/query.pb.go | 533 -- .../client/grpc/node/query.pb.gw.go | 153 - .../client/grpc/reflection/reflection.pb.go | 936 --- .../grpc/reflection/reflection.pb.gw.go | 254 - .../client/grpc/tmservice/query.pb.go | 5457 ---------------- .../client/grpc/tmservice/query.pb.gw.go | 669 -- .../client/grpc/tmservice/types.pb.go | 1371 ---- .../cosmos/cosmos-sdk/crypto/hd/hd.pb.go | 426 -- .../cosmos-sdk/crypto/keyring/record.pb.go | 1332 ---- .../cosmos-sdk/crypto/keys/ed25519/keys.pb.go | 505 -- .../crypto/keys/multisig/keys.pb.go | 362 -- .../crypto/keys/secp256k1/keys.pb.go | 503 -- .../crypto/keys/secp256r1/keys.pb.go | 503 -- .../cosmos-sdk/crypto/types/multisig.pb.go | 550 -- .../grpc/reflection/v2alpha1/reflection.pb.go | 5613 ----------------- .../reflection/v2alpha1/reflection.pb.gw.go | 478 -- .../cosmos-sdk/snapshots/types/snapshot.pb.go | 2595 -------- .../cosmos-sdk/store/types/commit_info.pb.go | 866 --- .../cosmos-sdk/store/types/listening.pb.go | 1212 ---- github.com/cosmos/cosmos-sdk/types/abci.pb.go | 3278 ---------- github.com/cosmos/cosmos-sdk/types/coin.pb.go | 983 --- .../cosmos/cosmos-sdk/types/kv/kv.pb.go | 557 -- .../cosmos-sdk/types/query/pagination.pb.go | 719 --- .../cosmos-sdk/types/tx/amino/amino.pb.go | 99 - .../cosmos/cosmos-sdk/x/auth/types/auth.pb.go | 1285 ---- .../cosmos-sdk/x/auth/types/genesis.pb.go | 391 -- .../cosmos-sdk/x/auth/types/query.pb.go | 4117 ------------ .../cosmos-sdk/x/auth/types/query.pb.gw.go | 990 --- .../cosmos/cosmos-sdk/x/auth/types/tx.pb.go | 606 -- .../cosmos/cosmos-sdk/x/authz/authz.pb.go | 1046 --- .../cosmos/cosmos-sdk/x/authz/event.pb.go | 703 --- .../cosmos/cosmos-sdk/x/authz/genesis.pb.go | 334 - .../cosmos/cosmos-sdk/x/authz/query.pb.go | 1873 ------ .../cosmos/cosmos-sdk/x/authz/query.pb.gw.go | 409 -- github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go | 1489 ----- .../cosmos-sdk/x/bank/types/authz.pb.go | 405 -- .../cosmos/cosmos-sdk/x/bank/types/bank.pb.go | 2122 ------- .../cosmos-sdk/x/bank/types/genesis.pb.go | 818 --- .../cosmos-sdk/x/bank/types/query.pb.go | 5508 ---------------- .../cosmos-sdk/x/bank/types/query.pb.gw.go | 1181 ---- .../cosmos/cosmos-sdk/x/bank/types/tx.pb.go | 1924 ------ .../x/capability/types/capability.pb.go | 702 --- .../x/capability/types/genesis.pb.go | 586 -- .../cosmos-sdk/x/consensus/types/query.pb.go | 544 -- .../x/consensus/types/query.pb.gw.go | 153 - .../cosmos-sdk/x/consensus/types/tx.pb.go | 732 --- .../cosmos-sdk/x/crisis/types/genesis.pb.go | 330 - .../cosmos/cosmos-sdk/x/crisis/types/tx.pb.go | 1028 --- .../x/distribution/types/distribution.pb.go | 3585 ----------- .../x/distribution/types/genesis.pb.go | 2477 -------- .../x/distribution/types/query.pb.go | 4882 -------------- .../x/distribution/types/query.pb.gw.go | 1167 ---- .../cosmos-sdk/x/distribution/types/tx.pb.go | 3615 ----------- .../x/evidence/types/evidence.pb.go | 434 -- .../cosmos-sdk/x/evidence/types/genesis.pb.go | 333 - .../cosmos-sdk/x/evidence/types/query.pb.go | 1134 ---- .../x/evidence/types/query.pb.gw.go | 290 - .../cosmos-sdk/x/evidence/types/tx.pb.go | 673 -- .../cosmos-sdk/x/feegrant/feegrant.pb.go | 1349 ---- .../cosmos-sdk/x/feegrant/genesis.pb.go | 334 - .../cosmos/cosmos-sdk/x/feegrant/query.pb.go | 1700 ----- .../cosmos-sdk/x/feegrant/query.pb.gw.go | 449 -- .../cosmos/cosmos-sdk/x/feegrant/tx.pb.go | 1043 --- .../cosmos-sdk/x/genutil/types/genesis.pb.go | 331 - .../cosmos-sdk/x/gov/types/v1/genesis.pb.go | 754 --- .../cosmos-sdk/x/gov/types/v1/gov.pb.go | 3618 ----------- .../cosmos-sdk/x/gov/types/v1/query.pb.go | 4036 ------------ .../cosmos-sdk/x/gov/types/v1/query.pb.gw.go | 958 --- .../cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go | 3054 --------- .../x/gov/types/v1beta1/genesis.pb.go | 669 -- .../cosmos-sdk/x/gov/types/v1beta1/gov.pb.go | 2852 --------- .../x/gov/types/v1beta1/query.pb.go | 3866 ------------ .../x/gov/types/v1beta1/query.pb.gw.go | 958 --- .../cosmos-sdk/x/gov/types/v1beta1/tx.pb.go | 1908 ------ .../cosmos/cosmos-sdk/x/group/events.pb.go | 1992 ------ .../cosmos/cosmos-sdk/x/group/genesis.pb.go | 702 --- 76 files changed, 108393 deletions(-) delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/store/types/listening.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/types/abci.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/types/coin.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/event.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/group/events.pb.go delete mode 100644 github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go deleted file mode 100644 index e0c097fd8ef6..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.go +++ /dev/null @@ -1,533 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/node/v1beta1/query.proto - -package node - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// ConfigRequest defines the request structure for the Config gRPC query. -type ConfigRequest struct { -} - -func (m *ConfigRequest) Reset() { *m = ConfigRequest{} } -func (m *ConfigRequest) String() string { return proto.CompactTextString(m) } -func (*ConfigRequest) ProtoMessage() {} -func (*ConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8324226a07064341, []int{0} -} -func (m *ConfigRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfigRequest.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 *ConfigRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigRequest.Merge(m, src) -} -func (m *ConfigRequest) XXX_Size() int { - return m.Size() -} -func (m *ConfigRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo - -// ConfigResponse defines the response structure for the Config gRPC query. -type ConfigResponse struct { - MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` -} - -func (m *ConfigResponse) Reset() { *m = ConfigResponse{} } -func (m *ConfigResponse) String() string { return proto.CompactTextString(m) } -func (*ConfigResponse) ProtoMessage() {} -func (*ConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8324226a07064341, []int{1} -} -func (m *ConfigResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfigResponse.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 *ConfigResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigResponse.Merge(m, src) -} -func (m *ConfigResponse) XXX_Size() int { - return m.Size() -} -func (m *ConfigResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigResponse proto.InternalMessageInfo - -func (m *ConfigResponse) GetMinimumGasPrice() string { - if m != nil { - return m.MinimumGasPrice - } - return "" -} - -func init() { - proto.RegisterType((*ConfigRequest)(nil), "cosmos.base.node.v1beta1.ConfigRequest") - proto.RegisterType((*ConfigResponse)(nil), "cosmos.base.node.v1beta1.ConfigResponse") -} - -func init() { - proto.RegisterFile("cosmos/base/node/v1beta1/query.proto", fileDescriptor_8324226a07064341) -} - -var fileDescriptor_8324226a07064341 = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0xb1, 0x4b, 0xc3, 0x40, - 0x18, 0xc5, 0x73, 0x0e, 0x15, 0x0f, 0xb4, 0x98, 0xa9, 0x14, 0x39, 0x4a, 0x10, 0x0c, 0x42, 0xef, - 0xa8, 0xae, 0x4e, 0x3a, 0x74, 0x95, 0xba, 0xb9, 0x94, 0xcb, 0xf5, 0xf3, 0x3c, 0x6c, 0xee, 0x4b, - 0x73, 0x97, 0x82, 0xab, 0xe0, 0xae, 0xf8, 0x4f, 0x39, 0x16, 0x5c, 0x1c, 0x25, 0xf1, 0x0f, 0x91, - 0x24, 0xed, 0xe0, 0x50, 0x3a, 0x1d, 0xbc, 0xfb, 0xbd, 0xf7, 0x3d, 0x1e, 0x3d, 0x55, 0xe8, 0x52, - 0x74, 0x22, 0x91, 0x0e, 0x84, 0xc5, 0x19, 0x88, 0xe5, 0x28, 0x01, 0x2f, 0x47, 0x62, 0x51, 0x40, - 0xfe, 0xcc, 0xb3, 0x1c, 0x3d, 0x86, 0xbd, 0x96, 0xe2, 0x35, 0xc5, 0x6b, 0x8a, 0xaf, 0xa9, 0xfe, - 0x89, 0x46, 0xd4, 0x73, 0x10, 0x32, 0x33, 0x42, 0x5a, 0x8b, 0x5e, 0x7a, 0x83, 0xd6, 0xb5, 0xbe, - 0xa8, 0x4b, 0x0f, 0x6f, 0xd0, 0x3e, 0x18, 0x3d, 0x81, 0x45, 0x01, 0xce, 0x47, 0x57, 0xf4, 0x68, - 0x23, 0xb8, 0x0c, 0xad, 0x83, 0xf0, 0x9c, 0x1e, 0xa7, 0xc6, 0x9a, 0xb4, 0x48, 0xa7, 0x5a, 0xba, - 0x69, 0x96, 0x1b, 0x05, 0x3d, 0x32, 0x20, 0xf1, 0xc1, 0xa4, 0xbb, 0xfe, 0x18, 0x4b, 0x77, 0x5b, - 0xcb, 0x17, 0xef, 0x84, 0xee, 0xdf, 0x41, 0xbe, 0x34, 0x0a, 0xc2, 0x57, 0x42, 0x3b, 0x6d, 0x54, - 0x78, 0xc6, 0xb7, 0xd5, 0xe3, 0xff, 0xae, 0xf7, 0xe3, 0xdd, 0x60, 0xdb, 0x2a, 0x8a, 0x5f, 0xbe, - 0x7e, 0x3f, 0xf6, 0xa2, 0x70, 0x20, 0xb6, 0xee, 0xa3, 0x1a, 0xc7, 0xf5, 0xf8, 0xb3, 0x64, 0x64, - 0x55, 0x32, 0xf2, 0x53, 0x32, 0xf2, 0x56, 0xb1, 0x60, 0x55, 0xb1, 0xe0, 0xbb, 0x62, 0xc1, 0xfd, - 0x50, 0x1b, 0xff, 0x58, 0x24, 0x5c, 0x61, 0xba, 0x49, 0x69, 0x9f, 0xa1, 0x9b, 0x3d, 0x09, 0x35, - 0x37, 0x60, 0xbd, 0xd0, 0x79, 0xa6, 0x9a, 0xdc, 0xa4, 0xd3, 0x4c, 0x76, 0xf9, 0x17, 0x00, 0x00, - 0xff, 0xff, 0x7d, 0x46, 0xb4, 0x93, 0x92, 0x01, 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 - -// ServiceClient is the client API for Service service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServiceClient interface { - // Config queries for the operator configuration. - Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) -} - -type serviceClient struct { - cc grpc1.ClientConn -} - -func NewServiceClient(cc grpc1.ClientConn) ServiceClient { - return &serviceClient{cc} -} - -func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) { - out := new(ConfigResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.node.v1beta1.Service/Config", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceServer is the server API for Service service. -type ServiceServer interface { - // Config queries for the operator configuration. - Config(context.Context, *ConfigRequest) (*ConfigResponse, error) -} - -// UnimplementedServiceServer can be embedded to have forward compatible implementations. -type UnimplementedServiceServer struct { -} - -func (*UnimplementedServiceServer) Config(ctx context.Context, req *ConfigRequest) (*ConfigResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") -} - -func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { - s.RegisterService(&_Service_serviceDesc, srv) -} - -func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).Config(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.node.v1beta1.Service/Config", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).Config(ctx, req.(*ConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Service_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.base.node.v1beta1.Service", - HandlerType: (*ServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Config", - Handler: _Service_Config_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/base/node/v1beta1/query.proto", -} - -func (m *ConfigRequest) 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 *ConfigRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ConfigResponse) 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 *ConfigResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MinimumGasPrice) > 0 { - i -= len(m.MinimumGasPrice) - copy(dAtA[i:], m.MinimumGasPrice) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MinimumGasPrice))) - 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 *ConfigRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ConfigResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MinimumGasPrice) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - 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 *ConfigRequest) 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: ConfigRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfigResponse) 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: ConfigResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", 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.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go deleted file mode 100644 index c579f6e54575..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/node/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/base/node/v1beta1/query.proto - -/* -Package node is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package node - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ConfigRequest - var metadata runtime.ServerMetadata - - msg, err := client.Config(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ConfigRequest - var metadata runtime.ServerMetadata - - msg, err := server.Config(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterServiceHandlerServer registers the http handlers for service Service to "mux". -// UnaryRPC :call ServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. -func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { - - mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_Config_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterServiceHandler(ctx, mux, conn) -} - -// RegisterServiceHandler registers the http handlers for service Service to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) -} - -// RegisterServiceHandlerClient registers the http handlers for service Service -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ServiceClient" to call the correct interceptors. -func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { - - mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_Config_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Service_Config_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v1beta1", "config"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Service_Config_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go deleted file mode 100644 index 3c207e94fefc..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.go +++ /dev/null @@ -1,936 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/reflection/v1beta1/reflection.proto - -package reflection - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. -type ListAllInterfacesRequest struct { -} - -func (m *ListAllInterfacesRequest) Reset() { *m = ListAllInterfacesRequest{} } -func (m *ListAllInterfacesRequest) String() string { return proto.CompactTextString(m) } -func (*ListAllInterfacesRequest) ProtoMessage() {} -func (*ListAllInterfacesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d48c054165687f5c, []int{0} -} -func (m *ListAllInterfacesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListAllInterfacesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListAllInterfacesRequest.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 *ListAllInterfacesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListAllInterfacesRequest.Merge(m, src) -} -func (m *ListAllInterfacesRequest) XXX_Size() int { - return m.Size() -} -func (m *ListAllInterfacesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListAllInterfacesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListAllInterfacesRequest proto.InternalMessageInfo - -// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. -type ListAllInterfacesResponse struct { - // interface_names is an array of all the registered interfaces. - InterfaceNames []string `protobuf:"bytes,1,rep,name=interface_names,json=interfaceNames,proto3" json:"interface_names,omitempty"` -} - -func (m *ListAllInterfacesResponse) Reset() { *m = ListAllInterfacesResponse{} } -func (m *ListAllInterfacesResponse) String() string { return proto.CompactTextString(m) } -func (*ListAllInterfacesResponse) ProtoMessage() {} -func (*ListAllInterfacesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d48c054165687f5c, []int{1} -} -func (m *ListAllInterfacesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListAllInterfacesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListAllInterfacesResponse.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 *ListAllInterfacesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListAllInterfacesResponse.Merge(m, src) -} -func (m *ListAllInterfacesResponse) XXX_Size() int { - return m.Size() -} -func (m *ListAllInterfacesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListAllInterfacesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListAllInterfacesResponse proto.InternalMessageInfo - -func (m *ListAllInterfacesResponse) GetInterfaceNames() []string { - if m != nil { - return m.InterfaceNames - } - return nil -} - -// ListImplementationsRequest is the request type of the ListImplementations -// RPC. -type ListImplementationsRequest struct { - // interface_name defines the interface to query the implementations for. - InterfaceName string `protobuf:"bytes,1,opt,name=interface_name,json=interfaceName,proto3" json:"interface_name,omitempty"` -} - -func (m *ListImplementationsRequest) Reset() { *m = ListImplementationsRequest{} } -func (m *ListImplementationsRequest) String() string { return proto.CompactTextString(m) } -func (*ListImplementationsRequest) ProtoMessage() {} -func (*ListImplementationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d48c054165687f5c, []int{2} -} -func (m *ListImplementationsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListImplementationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListImplementationsRequest.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 *ListImplementationsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListImplementationsRequest.Merge(m, src) -} -func (m *ListImplementationsRequest) XXX_Size() int { - return m.Size() -} -func (m *ListImplementationsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListImplementationsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ListImplementationsRequest proto.InternalMessageInfo - -func (m *ListImplementationsRequest) GetInterfaceName() string { - if m != nil { - return m.InterfaceName - } - return "" -} - -// ListImplementationsResponse is the response type of the ListImplementations -// RPC. -type ListImplementationsResponse struct { - ImplementationMessageNames []string `protobuf:"bytes,1,rep,name=implementation_message_names,json=implementationMessageNames,proto3" json:"implementation_message_names,omitempty"` -} - -func (m *ListImplementationsResponse) Reset() { *m = ListImplementationsResponse{} } -func (m *ListImplementationsResponse) String() string { return proto.CompactTextString(m) } -func (*ListImplementationsResponse) ProtoMessage() {} -func (*ListImplementationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d48c054165687f5c, []int{3} -} -func (m *ListImplementationsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ListImplementationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ListImplementationsResponse.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 *ListImplementationsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListImplementationsResponse.Merge(m, src) -} -func (m *ListImplementationsResponse) XXX_Size() int { - return m.Size() -} -func (m *ListImplementationsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListImplementationsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ListImplementationsResponse proto.InternalMessageInfo - -func (m *ListImplementationsResponse) GetImplementationMessageNames() []string { - if m != nil { - return m.ImplementationMessageNames - } - return nil -} - -func init() { - proto.RegisterType((*ListAllInterfacesRequest)(nil), "cosmos.base.reflection.v1beta1.ListAllInterfacesRequest") - proto.RegisterType((*ListAllInterfacesResponse)(nil), "cosmos.base.reflection.v1beta1.ListAllInterfacesResponse") - proto.RegisterType((*ListImplementationsRequest)(nil), "cosmos.base.reflection.v1beta1.ListImplementationsRequest") - proto.RegisterType((*ListImplementationsResponse)(nil), "cosmos.base.reflection.v1beta1.ListImplementationsResponse") -} - -func init() { - proto.RegisterFile("cosmos/base/reflection/v1beta1/reflection.proto", fileDescriptor_d48c054165687f5c) -} - -var fileDescriptor_d48c054165687f5c = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x4a, 0x4d, 0xcb, 0x49, 0x4d, 0x2e, 0xc9, - 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x12, 0xd2, 0x2b, 0x28, 0xca, - 0x2f, 0xc9, 0x17, 0x92, 0x83, 0x68, 0xd0, 0x03, 0x69, 0xd0, 0x43, 0x92, 0x85, 0x6a, 0x90, 0x92, - 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, - 0x49, 0x04, 0x49, 0x17, 0x43, 0x74, 0x2b, 0x49, 0x71, 0x49, 0xf8, 0x64, 0x16, 0x97, 0x38, 0xe6, - 0xe4, 0x78, 0xe6, 0x95, 0xa4, 0x16, 0xa5, 0x25, 0x26, 0xa7, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6, - 0x16, 0x97, 0x28, 0xb9, 0x70, 0x49, 0x62, 0x91, 0x2b, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x15, 0x52, - 0xe7, 0xe2, 0xcf, 0x84, 0x89, 0xc6, 0xe7, 0x25, 0xe6, 0xa6, 0x16, 0x4b, 0x30, 0x2a, 0x30, 0x6b, - 0x70, 0x06, 0xf1, 0xc1, 0x85, 0xfd, 0x40, 0xa2, 0x4a, 0xce, 0x5c, 0x52, 0x20, 0x53, 0x3c, 0x73, - 0x0b, 0x72, 0x52, 0x73, 0x53, 0xf3, 0xa0, 0xd6, 0x43, 0xed, 0x10, 0x52, 0xe5, 0xe2, 0x43, 0x35, - 0x46, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0x17, 0xc5, 0x14, 0xa5, 0x78, 0x2e, 0x69, 0xac, - 0x86, 0x40, 0x1d, 0xe3, 0xc0, 0x25, 0x93, 0x89, 0x22, 0x15, 0x9f, 0x9b, 0x5a, 0x5c, 0x9c, 0x98, - 0x8e, 0xea, 0x32, 0x29, 0x54, 0x35, 0xbe, 0x10, 0x25, 0x60, 0x57, 0x1a, 0xed, 0x60, 0xe6, 0x12, - 0x0c, 0x82, 0x07, 0x5e, 0x70, 0x6a, 0x51, 0x59, 0x66, 0x72, 0xaa, 0xd0, 0x1e, 0x46, 0x2e, 0x41, - 0x8c, 0x20, 0x10, 0xb2, 0xd0, 0xc3, 0x1f, 0xe4, 0x7a, 0xb8, 0x42, 0x54, 0xca, 0x92, 0x0c, 0x9d, - 0x10, 0x2f, 0x2a, 0x19, 0x35, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x47, 0x48, 0x8b, 0x50, 0x02, 0xc9, - 0x44, 0x38, 0xf4, 0x31, 0x23, 0x97, 0x30, 0x96, 0x60, 0x13, 0xb2, 0x22, 0xc6, 0x19, 0xd8, 0x23, - 0x4c, 0xca, 0x9a, 0x2c, 0xbd, 0x50, 0x4f, 0x04, 0x83, 0x3d, 0xe1, 0x2b, 0xe4, 0x4d, 0xbc, 0x27, - 0xf4, 0xab, 0x51, 0xd3, 0x47, 0xad, 0x3e, 0x6a, 0x2c, 0x16, 0x3b, 0xf9, 0x9e, 0x78, 0x24, 0xc7, - 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, - 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x71, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, - 0x7e, 0x2e, 0xcc, 0x42, 0x08, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x9f, 0x9c, 0x93, 0x99, 0x9a, 0x57, - 0xa2, 0x9f, 0x5e, 0x54, 0x90, 0x8c, 0xe4, 0x84, 0x24, 0x36, 0x70, 0xc6, 0x30, 0x06, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x32, 0x5b, 0x2b, 0x51, 0x89, 0x03, 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 - -// ReflectionServiceClient is the client API for ReflectionService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ReflectionServiceClient interface { - // ListAllInterfaces lists all the interfaces registered in the interface - // registry. - ListAllInterfaces(ctx context.Context, in *ListAllInterfacesRequest, opts ...grpc.CallOption) (*ListAllInterfacesResponse, error) - // ListImplementations list all the concrete types that implement a given - // interface. - ListImplementations(ctx context.Context, in *ListImplementationsRequest, opts ...grpc.CallOption) (*ListImplementationsResponse, error) -} - -type reflectionServiceClient struct { - cc grpc1.ClientConn -} - -func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { - return &reflectionServiceClient{cc} -} - -func (c *reflectionServiceClient) ListAllInterfaces(ctx context.Context, in *ListAllInterfacesRequest, opts ...grpc.CallOption) (*ListAllInterfacesResponse, error) { - out := new(ListAllInterfacesResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) ListImplementations(ctx context.Context, in *ListImplementationsRequest, opts ...grpc.CallOption) (*ListImplementationsResponse, error) { - out := new(ListImplementationsResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReflectionServiceServer is the server API for ReflectionService service. -type ReflectionServiceServer interface { - // ListAllInterfaces lists all the interfaces registered in the interface - // registry. - ListAllInterfaces(context.Context, *ListAllInterfacesRequest) (*ListAllInterfacesResponse, error) - // ListImplementations list all the concrete types that implement a given - // interface. - ListImplementations(context.Context, *ListImplementationsRequest) (*ListImplementationsResponse, error) -} - -// UnimplementedReflectionServiceServer can be embedded to have forward compatible implementations. -type UnimplementedReflectionServiceServer struct { -} - -func (*UnimplementedReflectionServiceServer) ListAllInterfaces(ctx context.Context, req *ListAllInterfacesRequest) (*ListAllInterfacesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListAllInterfaces not implemented") -} -func (*UnimplementedReflectionServiceServer) ListImplementations(ctx context.Context, req *ListImplementationsRequest) (*ListImplementationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListImplementations not implemented") -} - -func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { - s.RegisterService(&_ReflectionService_serviceDesc, srv) -} - -func _ReflectionService_ListAllInterfaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListAllInterfacesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).ListAllInterfaces(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).ListAllInterfaces(ctx, req.(*ListAllInterfacesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_ListImplementations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListImplementationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).ListImplementations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v1beta1.ReflectionService/ListImplementations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).ListImplementations(ctx, req.(*ListImplementationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ReflectionService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.base.reflection.v1beta1.ReflectionService", - HandlerType: (*ReflectionServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListAllInterfaces", - Handler: _ReflectionService_ListAllInterfaces_Handler, - }, - { - MethodName: "ListImplementations", - Handler: _ReflectionService_ListImplementations_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/base/reflection/v1beta1/reflection.proto", -} - -func (m *ListAllInterfacesRequest) 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 *ListAllInterfacesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListAllInterfacesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ListAllInterfacesResponse) 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 *ListAllInterfacesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListAllInterfacesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InterfaceNames) > 0 { - for iNdEx := len(m.InterfaceNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.InterfaceNames[iNdEx]) - copy(dAtA[i:], m.InterfaceNames[iNdEx]) - i = encodeVarintReflection(dAtA, i, uint64(len(m.InterfaceNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ListImplementationsRequest) 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 *ListImplementationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListImplementationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InterfaceName) > 0 { - i -= len(m.InterfaceName) - copy(dAtA[i:], m.InterfaceName) - i = encodeVarintReflection(dAtA, i, uint64(len(m.InterfaceName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ListImplementationsResponse) 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 *ListImplementationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ListImplementationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ImplementationMessageNames) > 0 { - for iNdEx := len(m.ImplementationMessageNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ImplementationMessageNames[iNdEx]) - copy(dAtA[i:], m.ImplementationMessageNames[iNdEx]) - i = encodeVarintReflection(dAtA, i, uint64(len(m.ImplementationMessageNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintReflection(dAtA []byte, offset int, v uint64) int { - offset -= sovReflection(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *ListAllInterfacesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ListAllInterfacesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.InterfaceNames) > 0 { - for _, s := range m.InterfaceNames { - l = len(s) - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *ListImplementationsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.InterfaceName) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *ListImplementationsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ImplementationMessageNames) > 0 { - for _, s := range m.ImplementationMessageNames { - l = len(s) - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func sovReflection(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozReflection(x uint64) (n int) { - return sovReflection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *ListAllInterfacesRequest) 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 ErrIntOverflowReflection - } - 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: ListAllInterfacesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListAllInterfacesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListAllInterfacesResponse) 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 ErrIntOverflowReflection - } - 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: ListAllInterfacesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListAllInterfacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InterfaceNames = append(m.InterfaceNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListImplementationsRequest) 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 ErrIntOverflowReflection - } - 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: ListImplementationsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListImplementationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InterfaceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ListImplementationsResponse) 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 ErrIntOverflowReflection - } - 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: ListImplementationsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ListImplementationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ImplementationMessageNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ImplementationMessageNames = append(m.ImplementationMessageNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipReflection(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, ErrIntOverflowReflection - } - 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, ErrIntOverflowReflection - } - 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, ErrIntOverflowReflection - } - 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, ErrInvalidLengthReflection - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupReflection - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthReflection - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthReflection = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowReflection = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupReflection = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go deleted file mode 100644 index 5f4cad169cf0..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/reflection/reflection.pb.gw.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/base/reflection/v1beta1/reflection.proto - -/* -Package reflection is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package reflection - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_ReflectionService_ListAllInterfaces_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAllInterfacesRequest - var metadata runtime.ServerMetadata - - msg, err := client.ListAllInterfaces(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_ListAllInterfaces_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListAllInterfacesRequest - var metadata runtime.ServerMetadata - - msg, err := server.ListAllInterfaces(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_ListImplementations_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListImplementationsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["interface_name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "interface_name") - } - - protoReq.InterfaceName, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "interface_name", err) - } - - msg, err := client.ListImplementations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_ListImplementations_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ListImplementationsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["interface_name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "interface_name") - } - - protoReq.InterfaceName, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "interface_name", err) - } - - msg, err := server.ListImplementations(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterReflectionServiceHandlerServer registers the http handlers for service ReflectionService to "mux". -// UnaryRPC :call ReflectionServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReflectionServiceHandlerFromEndpoint instead. -func RegisterReflectionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReflectionServiceServer) error { - - mux.Handle("GET", pattern_ReflectionService_ListAllInterfaces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_ListAllInterfaces_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_ListAllInterfaces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_ListImplementations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_ListImplementations_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_ListImplementations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterReflectionServiceHandlerFromEndpoint is same as RegisterReflectionServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterReflectionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterReflectionServiceHandler(ctx, mux, conn) -} - -// RegisterReflectionServiceHandler registers the http handlers for service ReflectionService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterReflectionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterReflectionServiceHandlerClient(ctx, mux, NewReflectionServiceClient(conn)) -} - -// RegisterReflectionServiceHandlerClient registers the http handlers for service ReflectionService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReflectionServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReflectionServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ReflectionServiceClient" to call the correct interceptors. -func RegisterReflectionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReflectionServiceClient) error { - - mux.Handle("GET", pattern_ReflectionService_ListAllInterfaces_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_ListAllInterfaces_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_ListAllInterfaces_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_ListImplementations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_ListImplementations_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_ListImplementations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ReflectionService_ListAllInterfaces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "reflection", "v1beta1", "interfaces"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_ListImplementations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"cosmos", "base", "reflection", "v1beta1", "interfaces", "interface_name", "implementations"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_ReflectionService_ListAllInterfaces_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_ListImplementations_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go deleted file mode 100644 index a94b274ac04a..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.go +++ /dev/null @@ -1,5457 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/tendermint/v1beta1/query.proto - -package tmservice - -import ( - context "context" - fmt "fmt" - p2p "github.com/cometbft/cometbft/proto/tendermint/p2p" - types1 "github.com/cometbft/cometbft/proto/tendermint/types" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -type GetValidatorSetByHeightRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *GetValidatorSetByHeightRequest) Reset() { *m = GetValidatorSetByHeightRequest{} } -func (m *GetValidatorSetByHeightRequest) String() string { return proto.CompactTextString(m) } -func (*GetValidatorSetByHeightRequest) ProtoMessage() {} -func (*GetValidatorSetByHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{0} -} -func (m *GetValidatorSetByHeightRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetValidatorSetByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetValidatorSetByHeightRequest.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 *GetValidatorSetByHeightRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetValidatorSetByHeightRequest.Merge(m, src) -} -func (m *GetValidatorSetByHeightRequest) XXX_Size() int { - return m.Size() -} -func (m *GetValidatorSetByHeightRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetValidatorSetByHeightRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetValidatorSetByHeightRequest proto.InternalMessageInfo - -func (m *GetValidatorSetByHeightRequest) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *GetValidatorSetByHeightRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -type GetValidatorSetByHeightResponse struct { - BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *GetValidatorSetByHeightResponse) Reset() { *m = GetValidatorSetByHeightResponse{} } -func (m *GetValidatorSetByHeightResponse) String() string { return proto.CompactTextString(m) } -func (*GetValidatorSetByHeightResponse) ProtoMessage() {} -func (*GetValidatorSetByHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{1} -} -func (m *GetValidatorSetByHeightResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetValidatorSetByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetValidatorSetByHeightResponse.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 *GetValidatorSetByHeightResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetValidatorSetByHeightResponse.Merge(m, src) -} -func (m *GetValidatorSetByHeightResponse) XXX_Size() int { - return m.Size() -} -func (m *GetValidatorSetByHeightResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetValidatorSetByHeightResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetValidatorSetByHeightResponse proto.InternalMessageInfo - -func (m *GetValidatorSetByHeightResponse) GetBlockHeight() int64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *GetValidatorSetByHeightResponse) GetValidators() []*Validator { - if m != nil { - return m.Validators - } - return nil -} - -func (m *GetValidatorSetByHeightResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -type GetLatestValidatorSetRequest struct { - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *GetLatestValidatorSetRequest) Reset() { *m = GetLatestValidatorSetRequest{} } -func (m *GetLatestValidatorSetRequest) String() string { return proto.CompactTextString(m) } -func (*GetLatestValidatorSetRequest) ProtoMessage() {} -func (*GetLatestValidatorSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{2} -} -func (m *GetLatestValidatorSetRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetLatestValidatorSetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetLatestValidatorSetRequest.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 *GetLatestValidatorSetRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLatestValidatorSetRequest.Merge(m, src) -} -func (m *GetLatestValidatorSetRequest) XXX_Size() int { - return m.Size() -} -func (m *GetLatestValidatorSetRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetLatestValidatorSetRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetLatestValidatorSetRequest proto.InternalMessageInfo - -func (m *GetLatestValidatorSetRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -type GetLatestValidatorSetResponse struct { - BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` - Validators []*Validator `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *GetLatestValidatorSetResponse) Reset() { *m = GetLatestValidatorSetResponse{} } -func (m *GetLatestValidatorSetResponse) String() string { return proto.CompactTextString(m) } -func (*GetLatestValidatorSetResponse) ProtoMessage() {} -func (*GetLatestValidatorSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{3} -} -func (m *GetLatestValidatorSetResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetLatestValidatorSetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetLatestValidatorSetResponse.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 *GetLatestValidatorSetResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLatestValidatorSetResponse.Merge(m, src) -} -func (m *GetLatestValidatorSetResponse) XXX_Size() int { - return m.Size() -} -func (m *GetLatestValidatorSetResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetLatestValidatorSetResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetLatestValidatorSetResponse proto.InternalMessageInfo - -func (m *GetLatestValidatorSetResponse) GetBlockHeight() int64 { - if m != nil { - return m.BlockHeight - } - return 0 -} - -func (m *GetLatestValidatorSetResponse) GetValidators() []*Validator { - if m != nil { - return m.Validators - } - return nil -} - -func (m *GetLatestValidatorSetResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// Validator is the type for the validator-set. -type Validator struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` - ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` -} - -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{4} -} -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.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 *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(m, src) -} -func (m *Validator) XXX_Size() int { - return m.Size() -} -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) -} - -var xxx_messageInfo_Validator proto.InternalMessageInfo - -func (m *Validator) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *Validator) GetPubKey() *types.Any { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *Validator) GetVotingPower() int64 { - if m != nil { - return m.VotingPower - } - return 0 -} - -func (m *Validator) GetProposerPriority() int64 { - if m != nil { - return m.ProposerPriority - } - return 0 -} - -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. -type GetBlockByHeightRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *GetBlockByHeightRequest) Reset() { *m = GetBlockByHeightRequest{} } -func (m *GetBlockByHeightRequest) String() string { return proto.CompactTextString(m) } -func (*GetBlockByHeightRequest) ProtoMessage() {} -func (*GetBlockByHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{5} -} -func (m *GetBlockByHeightRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetBlockByHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetBlockByHeightRequest.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 *GetBlockByHeightRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockByHeightRequest.Merge(m, src) -} -func (m *GetBlockByHeightRequest) XXX_Size() int { - return m.Size() -} -func (m *GetBlockByHeightRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockByHeightRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetBlockByHeightRequest proto.InternalMessageInfo - -func (m *GetBlockByHeightRequest) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. -type GetBlockByHeightResponse struct { - BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - // Deprecated: please use `sdk_block` instead - Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - // Since: cosmos-sdk 0.47 - SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` -} - -func (m *GetBlockByHeightResponse) Reset() { *m = GetBlockByHeightResponse{} } -func (m *GetBlockByHeightResponse) String() string { return proto.CompactTextString(m) } -func (*GetBlockByHeightResponse) ProtoMessage() {} -func (*GetBlockByHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{6} -} -func (m *GetBlockByHeightResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetBlockByHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetBlockByHeightResponse.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 *GetBlockByHeightResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetBlockByHeightResponse.Merge(m, src) -} -func (m *GetBlockByHeightResponse) XXX_Size() int { - return m.Size() -} -func (m *GetBlockByHeightResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetBlockByHeightResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetBlockByHeightResponse proto.InternalMessageInfo - -func (m *GetBlockByHeightResponse) GetBlockId() *types1.BlockID { - if m != nil { - return m.BlockId - } - return nil -} - -func (m *GetBlockByHeightResponse) GetBlock() *types1.Block { - if m != nil { - return m.Block - } - return nil -} - -func (m *GetBlockByHeightResponse) GetSdkBlock() *Block { - if m != nil { - return m.SdkBlock - } - return nil -} - -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. -type GetLatestBlockRequest struct { -} - -func (m *GetLatestBlockRequest) Reset() { *m = GetLatestBlockRequest{} } -func (m *GetLatestBlockRequest) String() string { return proto.CompactTextString(m) } -func (*GetLatestBlockRequest) ProtoMessage() {} -func (*GetLatestBlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{7} -} -func (m *GetLatestBlockRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetLatestBlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetLatestBlockRequest.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 *GetLatestBlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLatestBlockRequest.Merge(m, src) -} -func (m *GetLatestBlockRequest) XXX_Size() int { - return m.Size() -} -func (m *GetLatestBlockRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetLatestBlockRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetLatestBlockRequest proto.InternalMessageInfo - -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. -type GetLatestBlockResponse struct { - BlockId *types1.BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - // Deprecated: please use `sdk_block` instead - Block *types1.Block `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - // Since: cosmos-sdk 0.47 - SdkBlock *Block `protobuf:"bytes,3,opt,name=sdk_block,json=sdkBlock,proto3" json:"sdk_block,omitempty"` -} - -func (m *GetLatestBlockResponse) Reset() { *m = GetLatestBlockResponse{} } -func (m *GetLatestBlockResponse) String() string { return proto.CompactTextString(m) } -func (*GetLatestBlockResponse) ProtoMessage() {} -func (*GetLatestBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{8} -} -func (m *GetLatestBlockResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetLatestBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetLatestBlockResponse.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 *GetLatestBlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetLatestBlockResponse.Merge(m, src) -} -func (m *GetLatestBlockResponse) XXX_Size() int { - return m.Size() -} -func (m *GetLatestBlockResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetLatestBlockResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetLatestBlockResponse proto.InternalMessageInfo - -func (m *GetLatestBlockResponse) GetBlockId() *types1.BlockID { - if m != nil { - return m.BlockId - } - return nil -} - -func (m *GetLatestBlockResponse) GetBlock() *types1.Block { - if m != nil { - return m.Block - } - return nil -} - -func (m *GetLatestBlockResponse) GetSdkBlock() *Block { - if m != nil { - return m.SdkBlock - } - return nil -} - -// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. -type GetSyncingRequest struct { -} - -func (m *GetSyncingRequest) Reset() { *m = GetSyncingRequest{} } -func (m *GetSyncingRequest) String() string { return proto.CompactTextString(m) } -func (*GetSyncingRequest) ProtoMessage() {} -func (*GetSyncingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{9} -} -func (m *GetSyncingRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetSyncingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetSyncingRequest.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 *GetSyncingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSyncingRequest.Merge(m, src) -} -func (m *GetSyncingRequest) XXX_Size() int { - return m.Size() -} -func (m *GetSyncingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetSyncingRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSyncingRequest proto.InternalMessageInfo - -// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. -type GetSyncingResponse struct { - Syncing bool `protobuf:"varint,1,opt,name=syncing,proto3" json:"syncing,omitempty"` -} - -func (m *GetSyncingResponse) Reset() { *m = GetSyncingResponse{} } -func (m *GetSyncingResponse) String() string { return proto.CompactTextString(m) } -func (*GetSyncingResponse) ProtoMessage() {} -func (*GetSyncingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{10} -} -func (m *GetSyncingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetSyncingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetSyncingResponse.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 *GetSyncingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetSyncingResponse.Merge(m, src) -} -func (m *GetSyncingResponse) XXX_Size() int { - return m.Size() -} -func (m *GetSyncingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetSyncingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetSyncingResponse proto.InternalMessageInfo - -func (m *GetSyncingResponse) GetSyncing() bool { - if m != nil { - return m.Syncing - } - return false -} - -// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. -type GetNodeInfoRequest struct { -} - -func (m *GetNodeInfoRequest) Reset() { *m = GetNodeInfoRequest{} } -func (m *GetNodeInfoRequest) String() string { return proto.CompactTextString(m) } -func (*GetNodeInfoRequest) ProtoMessage() {} -func (*GetNodeInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{11} -} -func (m *GetNodeInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNodeInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNodeInfoRequest.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 *GetNodeInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeInfoRequest.Merge(m, src) -} -func (m *GetNodeInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *GetNodeInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetNodeInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNodeInfoRequest proto.InternalMessageInfo - -// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. -type GetNodeInfoResponse struct { - DefaultNodeInfo *p2p.DefaultNodeInfo `protobuf:"bytes,1,opt,name=default_node_info,json=defaultNodeInfo,proto3" json:"default_node_info,omitempty"` - ApplicationVersion *VersionInfo `protobuf:"bytes,2,opt,name=application_version,json=applicationVersion,proto3" json:"application_version,omitempty"` -} - -func (m *GetNodeInfoResponse) Reset() { *m = GetNodeInfoResponse{} } -func (m *GetNodeInfoResponse) String() string { return proto.CompactTextString(m) } -func (*GetNodeInfoResponse) ProtoMessage() {} -func (*GetNodeInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{12} -} -func (m *GetNodeInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetNodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetNodeInfoResponse.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 *GetNodeInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetNodeInfoResponse.Merge(m, src) -} -func (m *GetNodeInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *GetNodeInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetNodeInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetNodeInfoResponse proto.InternalMessageInfo - -func (m *GetNodeInfoResponse) GetDefaultNodeInfo() *p2p.DefaultNodeInfo { - if m != nil { - return m.DefaultNodeInfo - } - return nil -} - -func (m *GetNodeInfoResponse) GetApplicationVersion() *VersionInfo { - if m != nil { - return m.ApplicationVersion - } - return nil -} - -// VersionInfo is the type for the GetNodeInfoResponse message. -type VersionInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - GitCommit string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"` - BuildTags string `protobuf:"bytes,5,opt,name=build_tags,json=buildTags,proto3" json:"build_tags,omitempty"` - GoVersion string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` - BuildDeps []*Module `protobuf:"bytes,7,rep,name=build_deps,json=buildDeps,proto3" json:"build_deps,omitempty"` - // Since: cosmos-sdk 0.43 - CosmosSdkVersion string `protobuf:"bytes,8,opt,name=cosmos_sdk_version,json=cosmosSdkVersion,proto3" json:"cosmos_sdk_version,omitempty"` -} - -func (m *VersionInfo) Reset() { *m = VersionInfo{} } -func (m *VersionInfo) String() string { return proto.CompactTextString(m) } -func (*VersionInfo) ProtoMessage() {} -func (*VersionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{13} -} -func (m *VersionInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VersionInfo.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 *VersionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionInfo.Merge(m, src) -} -func (m *VersionInfo) XXX_Size() int { - return m.Size() -} -func (m *VersionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_VersionInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionInfo proto.InternalMessageInfo - -func (m *VersionInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *VersionInfo) GetAppName() string { - if m != nil { - return m.AppName - } - return "" -} - -func (m *VersionInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *VersionInfo) GetGitCommit() string { - if m != nil { - return m.GitCommit - } - return "" -} - -func (m *VersionInfo) GetBuildTags() string { - if m != nil { - return m.BuildTags - } - return "" -} - -func (m *VersionInfo) GetGoVersion() string { - if m != nil { - return m.GoVersion - } - return "" -} - -func (m *VersionInfo) GetBuildDeps() []*Module { - if m != nil { - return m.BuildDeps - } - return nil -} - -func (m *VersionInfo) GetCosmosSdkVersion() string { - if m != nil { - return m.CosmosSdkVersion - } - return "" -} - -// Module is the type for VersionInfo -type Module struct { - // module path - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // module version - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // checksum - Sum string `protobuf:"bytes,3,opt,name=sum,proto3" json:"sum,omitempty"` -} - -func (m *Module) Reset() { *m = Module{} } -func (m *Module) String() string { return proto.CompactTextString(m) } -func (*Module) ProtoMessage() {} -func (*Module) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{14} -} -func (m *Module) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Module) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Module.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 *Module) XXX_Merge(src proto.Message) { - xxx_messageInfo_Module.Merge(m, src) -} -func (m *Module) XXX_Size() int { - return m.Size() -} -func (m *Module) XXX_DiscardUnknown() { - xxx_messageInfo_Module.DiscardUnknown(m) -} - -var xxx_messageInfo_Module proto.InternalMessageInfo - -func (m *Module) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *Module) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *Module) GetSum() string { - if m != nil { - return m.Sum - } - return "" -} - -// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. -type ABCIQueryRequest struct { - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` -} - -func (m *ABCIQueryRequest) Reset() { *m = ABCIQueryRequest{} } -func (m *ABCIQueryRequest) String() string { return proto.CompactTextString(m) } -func (*ABCIQueryRequest) ProtoMessage() {} -func (*ABCIQueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{15} -} -func (m *ABCIQueryRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ABCIQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ABCIQueryRequest.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 *ABCIQueryRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ABCIQueryRequest.Merge(m, src) -} -func (m *ABCIQueryRequest) XXX_Size() int { - return m.Size() -} -func (m *ABCIQueryRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ABCIQueryRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ABCIQueryRequest proto.InternalMessageInfo - -func (m *ABCIQueryRequest) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *ABCIQueryRequest) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *ABCIQueryRequest) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ABCIQueryRequest) GetProve() bool { - if m != nil { - return m.Prove - } - return false -} - -// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. -// -// Note: This type is a duplicate of the ResponseQuery proto type defined in -// Tendermint. -type ABCIQueryResponse struct { - Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` - Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` - Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` - ProofOps *ProofOps `protobuf:"bytes,8,opt,name=proof_ops,json=proofOps,proto3" json:"proof_ops,omitempty"` - Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` - Codespace string `protobuf:"bytes,10,opt,name=codespace,proto3" json:"codespace,omitempty"` -} - -func (m *ABCIQueryResponse) Reset() { *m = ABCIQueryResponse{} } -func (m *ABCIQueryResponse) String() string { return proto.CompactTextString(m) } -func (*ABCIQueryResponse) ProtoMessage() {} -func (*ABCIQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{16} -} -func (m *ABCIQueryResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ABCIQueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ABCIQueryResponse.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 *ABCIQueryResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ABCIQueryResponse.Merge(m, src) -} -func (m *ABCIQueryResponse) XXX_Size() int { - return m.Size() -} -func (m *ABCIQueryResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ABCIQueryResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ABCIQueryResponse proto.InternalMessageInfo - -func (m *ABCIQueryResponse) GetCode() uint32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *ABCIQueryResponse) GetLog() string { - if m != nil { - return m.Log - } - return "" -} - -func (m *ABCIQueryResponse) GetInfo() string { - if m != nil { - return m.Info - } - return "" -} - -func (m *ABCIQueryResponse) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *ABCIQueryResponse) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ABCIQueryResponse) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *ABCIQueryResponse) GetProofOps() *ProofOps { - if m != nil { - return m.ProofOps - } - return nil -} - -func (m *ABCIQueryResponse) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ABCIQueryResponse) GetCodespace() string { - if m != nil { - return m.Codespace - } - return "" -} - -// ProofOp defines an operation used for calculating Merkle root. The data could -// be arbitrary format, providing necessary data for example neighbouring node -// hash. -// -// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. -type ProofOp struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *ProofOp) Reset() { *m = ProofOp{} } -func (m *ProofOp) String() string { return proto.CompactTextString(m) } -func (*ProofOp) ProtoMessage() {} -func (*ProofOp) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{17} -} -func (m *ProofOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOp.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 *ProofOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOp.Merge(m, src) -} -func (m *ProofOp) XXX_Size() int { - return m.Size() -} -func (m *ProofOp) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOp proto.InternalMessageInfo - -func (m *ProofOp) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ProofOp) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ProofOp) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// ProofOps is Merkle proof defined by the list of ProofOps. -// -// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. -type ProofOps struct { - Ops []ProofOp `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"` -} - -func (m *ProofOps) Reset() { *m = ProofOps{} } -func (m *ProofOps) String() string { return proto.CompactTextString(m) } -func (*ProofOps) ProtoMessage() {} -func (*ProofOps) Descriptor() ([]byte, []int) { - return fileDescriptor_40c93fb3ef485c5d, []int{18} -} -func (m *ProofOps) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ProofOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOps.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 *ProofOps) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOps.Merge(m, src) -} -func (m *ProofOps) XXX_Size() int { - return m.Size() -} -func (m *ProofOps) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOps.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOps proto.InternalMessageInfo - -func (m *ProofOps) GetOps() []ProofOp { - if m != nil { - return m.Ops - } - return nil -} - -func init() { - proto.RegisterType((*GetValidatorSetByHeightRequest)(nil), "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest") - proto.RegisterType((*GetValidatorSetByHeightResponse)(nil), "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse") - proto.RegisterType((*GetLatestValidatorSetRequest)(nil), "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest") - proto.RegisterType((*GetLatestValidatorSetResponse)(nil), "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse") - proto.RegisterType((*Validator)(nil), "cosmos.base.tendermint.v1beta1.Validator") - proto.RegisterType((*GetBlockByHeightRequest)(nil), "cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest") - proto.RegisterType((*GetBlockByHeightResponse)(nil), "cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse") - proto.RegisterType((*GetLatestBlockRequest)(nil), "cosmos.base.tendermint.v1beta1.GetLatestBlockRequest") - proto.RegisterType((*GetLatestBlockResponse)(nil), "cosmos.base.tendermint.v1beta1.GetLatestBlockResponse") - proto.RegisterType((*GetSyncingRequest)(nil), "cosmos.base.tendermint.v1beta1.GetSyncingRequest") - proto.RegisterType((*GetSyncingResponse)(nil), "cosmos.base.tendermint.v1beta1.GetSyncingResponse") - proto.RegisterType((*GetNodeInfoRequest)(nil), "cosmos.base.tendermint.v1beta1.GetNodeInfoRequest") - proto.RegisterType((*GetNodeInfoResponse)(nil), "cosmos.base.tendermint.v1beta1.GetNodeInfoResponse") - proto.RegisterType((*VersionInfo)(nil), "cosmos.base.tendermint.v1beta1.VersionInfo") - proto.RegisterType((*Module)(nil), "cosmos.base.tendermint.v1beta1.Module") - proto.RegisterType((*ABCIQueryRequest)(nil), "cosmos.base.tendermint.v1beta1.ABCIQueryRequest") - proto.RegisterType((*ABCIQueryResponse)(nil), "cosmos.base.tendermint.v1beta1.ABCIQueryResponse") - proto.RegisterType((*ProofOp)(nil), "cosmos.base.tendermint.v1beta1.ProofOp") - proto.RegisterType((*ProofOps)(nil), "cosmos.base.tendermint.v1beta1.ProofOps") -} - -func init() { - proto.RegisterFile("cosmos/base/tendermint/v1beta1/query.proto", fileDescriptor_40c93fb3ef485c5d) -} - -var fileDescriptor_40c93fb3ef485c5d = []byte{ - // 1398 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4d, 0x6f, 0x1b, 0xc5, - 0x1b, 0xcf, 0xda, 0x69, 0x6c, 0x3f, 0xee, 0xff, 0x4f, 0x32, 0x0d, 0xad, 0x63, 0xa5, 0x6e, 0x59, - 0x89, 0x36, 0x7d, 0xc9, 0x2e, 0x76, 0x5f, 0x0f, 0xa5, 0xa8, 0x6e, 0x4a, 0x1a, 0x5a, 0x4a, 0xd8, - 0x20, 0x0e, 0x08, 0x69, 0xb5, 0xf6, 0x4e, 0x36, 0xab, 0xd8, 0x3b, 0xd3, 0x9d, 0xb1, 0xc1, 0x42, - 0x48, 0x88, 0x0f, 0x80, 0x90, 0xf8, 0x0a, 0x3d, 0x94, 0x13, 0x1c, 0x10, 0xc7, 0x0a, 0xc4, 0xa5, - 0xc7, 0xaa, 0x48, 0xa8, 0xe2, 0x80, 0x50, 0x8b, 0xc4, 0xd7, 0x40, 0xf3, 0xb2, 0xf6, 0x6e, 0x9b, - 0xd4, 0x4e, 0x6e, 0xbd, 0x24, 0xb3, 0xcf, 0xeb, 0xef, 0xf7, 0x3c, 0x33, 0xcf, 0x8c, 0xe1, 0x74, - 0x9b, 0xb0, 0x2e, 0x61, 0x76, 0xcb, 0x63, 0xd8, 0xe6, 0x38, 0xf2, 0x71, 0xdc, 0x0d, 0x23, 0x6e, - 0xf7, 0xeb, 0x2d, 0xcc, 0xbd, 0xba, 0x7d, 0xb7, 0x87, 0xe3, 0x81, 0x45, 0x63, 0xc2, 0x09, 0xaa, - 0x29, 0x5b, 0x4b, 0xd8, 0x5a, 0x23, 0x5b, 0x4b, 0xdb, 0x56, 0xe7, 0x03, 0x12, 0x10, 0x69, 0x6a, - 0x8b, 0x95, 0xf2, 0xaa, 0x2e, 0x04, 0x84, 0x04, 0x1d, 0x6c, 0xcb, 0xaf, 0x56, 0x6f, 0xd3, 0xf6, - 0x22, 0x1d, 0xb0, 0xba, 0xa8, 0x55, 0x1e, 0x0d, 0x6d, 0x2f, 0x8a, 0x08, 0xf7, 0x78, 0x48, 0x22, - 0xa6, 0xb5, 0xd5, 0x14, 0x1c, 0xda, 0xa0, 0x36, 0x1f, 0x50, 0x9c, 0xe8, 0x16, 0x53, 0x3a, 0x29, - 0xcf, 0x68, 0x33, 0xa4, 0x24, 0x83, 0x21, 0x1f, 0xea, 0x05, 0x61, 0x24, 0xd3, 0xec, 0x64, 0xbb, - 0x43, 0x01, 0xd2, 0x71, 0x17, 0x94, 0xad, 0xab, 0x38, 0xea, 0x6a, 0xec, 0x06, 0xa8, 0xd5, 0x21, - 0xed, 0x6d, 0xad, 0x9d, 0xf3, 0xba, 0x61, 0x44, 0x6c, 0xf9, 0x57, 0x89, 0xcc, 0xaf, 0x0c, 0xa8, - 0xad, 0x62, 0xfe, 0xb1, 0xd7, 0x09, 0x7d, 0x8f, 0x93, 0x78, 0x03, 0xf3, 0xe6, 0xe0, 0x26, 0x0e, - 0x83, 0x2d, 0xee, 0xe0, 0xbb, 0x3d, 0xcc, 0x38, 0x3a, 0x0c, 0x33, 0x5b, 0x52, 0x50, 0x31, 0x8e, - 0x1b, 0x4b, 0x79, 0x47, 0x7f, 0xa1, 0x77, 0x01, 0x46, 0x34, 0x2a, 0xb9, 0xe3, 0xc6, 0x52, 0xb9, - 0x71, 0xc2, 0x4a, 0x37, 0x47, 0x75, 0x4d, 0x53, 0xb0, 0xd6, 0xbd, 0x00, 0xeb, 0x98, 0x4e, 0xca, - 0xd3, 0x7c, 0x62, 0xc0, 0xb1, 0x5d, 0x21, 0x30, 0x4a, 0x22, 0x86, 0xd1, 0x1b, 0x70, 0x50, 0x12, - 0x71, 0x33, 0x48, 0xca, 0x52, 0xa6, 0x4c, 0xd1, 0x1a, 0x40, 0x3f, 0x09, 0xc1, 0x2a, 0xb9, 0xe3, - 0xf9, 0xa5, 0x72, 0xe3, 0x94, 0xf5, 0xf2, 0xbd, 0x62, 0x0d, 0x93, 0x3a, 0x29, 0x67, 0xb4, 0x9a, - 0x61, 0x96, 0x97, 0xcc, 0x4e, 0x8e, 0x65, 0xa6, 0xa0, 0x66, 0xa8, 0x6d, 0xc2, 0xe2, 0x2a, 0xe6, - 0xb7, 0x3d, 0x8e, 0x59, 0x86, 0x5f, 0x52, 0xda, 0x6c, 0x09, 0x8d, 0x7d, 0x97, 0xf0, 0x0f, 0x03, - 0x8e, 0xee, 0x92, 0xe8, 0xd5, 0x2e, 0xe0, 0x03, 0x03, 0x4a, 0xc3, 0x14, 0xa8, 0x01, 0x05, 0xcf, - 0xf7, 0x63, 0xcc, 0x98, 0xc4, 0x5f, 0x6a, 0x56, 0x1e, 0xff, 0xb4, 0x3c, 0xaf, 0xc3, 0x5e, 0x53, - 0x9a, 0x0d, 0x1e, 0x87, 0x51, 0xe0, 0x24, 0x86, 0x68, 0x19, 0x0a, 0xb4, 0xd7, 0x72, 0xb7, 0xf1, - 0x40, 0x6f, 0xd1, 0x79, 0x4b, 0x1d, 0x77, 0x2b, 0x99, 0x04, 0xd6, 0xb5, 0x68, 0xe0, 0xcc, 0xd0, - 0x5e, 0xeb, 0x16, 0x1e, 0x88, 0x3a, 0xf5, 0x09, 0x0f, 0xa3, 0xc0, 0xa5, 0xe4, 0x33, 0x1c, 0x4b, - 0xec, 0x79, 0xa7, 0xac, 0x64, 0xeb, 0x42, 0x84, 0xce, 0xc0, 0x1c, 0x8d, 0x09, 0x25, 0x0c, 0xc7, - 0x2e, 0x8d, 0x43, 0x12, 0x87, 0x7c, 0x50, 0x99, 0x96, 0x76, 0xb3, 0x89, 0x62, 0x5d, 0xcb, 0xcd, - 0x3a, 0x1c, 0x59, 0xc5, 0xbc, 0x29, 0xca, 0x3c, 0xe1, 0xb9, 0x32, 0x7f, 0x33, 0xa0, 0xf2, 0xa2, - 0x8f, 0xee, 0xe3, 0x79, 0x28, 0xaa, 0x3e, 0x86, 0xbe, 0xde, 0x2f, 0x0b, 0xe9, 0xb6, 0xa8, 0x31, - 0x21, 0x5d, 0xd7, 0x56, 0x9c, 0x82, 0x34, 0x5d, 0xf3, 0xd1, 0x32, 0x1c, 0x90, 0x4b, 0x5d, 0x82, - 0x23, 0xbb, 0xb8, 0x38, 0xca, 0x0a, 0x35, 0xa1, 0xc4, 0xfc, 0x6d, 0x57, 0xb9, 0xa8, 0xee, 0xbd, - 0x39, 0x6e, 0x23, 0xa8, 0x00, 0x45, 0xe6, 0x6f, 0xcb, 0x95, 0x79, 0x04, 0x5e, 0x1f, 0xee, 0x48, - 0xa5, 0x53, 0xb4, 0xcd, 0x5f, 0x0d, 0x38, 0xfc, 0xbc, 0xe6, 0x55, 0x23, 0x77, 0x08, 0xe6, 0x56, - 0x31, 0xdf, 0x18, 0x44, 0x6d, 0xb1, 0xd7, 0x34, 0x31, 0x0b, 0x50, 0x5a, 0xa8, 0x39, 0x55, 0xa0, - 0xc0, 0x94, 0x48, 0x52, 0x2a, 0x3a, 0xc9, 0xa7, 0x39, 0x2f, 0xed, 0xef, 0x10, 0x1f, 0xaf, 0x45, - 0x9b, 0x24, 0x89, 0xf2, 0x8b, 0x01, 0x87, 0x32, 0x62, 0x1d, 0xe7, 0x16, 0xcc, 0xf9, 0x78, 0xd3, - 0xeb, 0x75, 0xb8, 0x1b, 0x11, 0x1f, 0xbb, 0x61, 0xb4, 0x49, 0x74, 0x91, 0x8e, 0xa5, 0x21, 0xd3, - 0x06, 0xb5, 0x56, 0x94, 0xe1, 0x30, 0xc6, 0x6b, 0x7e, 0x56, 0x80, 0x3e, 0x85, 0x43, 0x1e, 0xa5, - 0x9d, 0xb0, 0x2d, 0x4f, 0x99, 0xdb, 0xc7, 0x31, 0x1b, 0xcd, 0xf0, 0x33, 0x63, 0xcf, 0xbc, 0x32, - 0x97, 0xa1, 0x51, 0x2a, 0x8e, 0x96, 0x9b, 0xf7, 0x73, 0x50, 0x4e, 0xd9, 0x20, 0x04, 0xd3, 0x91, - 0xd7, 0xc5, 0xea, 0xcc, 0x3a, 0x72, 0x8d, 0x16, 0xa0, 0xe8, 0x51, 0xea, 0x4a, 0x79, 0x4e, 0xca, - 0x0b, 0x1e, 0xa5, 0x77, 0x84, 0xaa, 0x02, 0x85, 0x04, 0x50, 0x5e, 0x69, 0xf4, 0x27, 0x3a, 0x0a, - 0x10, 0x84, 0xdc, 0x6d, 0x93, 0x6e, 0x37, 0xe4, 0xf2, 0xc8, 0x95, 0x9c, 0x52, 0x10, 0xf2, 0xeb, - 0x52, 0x20, 0xd4, 0xad, 0x5e, 0xd8, 0xf1, 0x5d, 0xee, 0x05, 0xac, 0x72, 0x40, 0xa9, 0xa5, 0xe4, - 0x23, 0x2f, 0x60, 0xd2, 0x9b, 0x0c, 0xb9, 0xce, 0x68, 0x6f, 0xa2, 0x91, 0xa2, 0x1b, 0x89, 0xb7, - 0x8f, 0x29, 0xab, 0x14, 0xe4, 0xf8, 0x3b, 0x31, 0xae, 0x14, 0xef, 0x13, 0xbf, 0xd7, 0xc1, 0x3a, - 0xcb, 0x0a, 0xa6, 0x0c, 0x9d, 0x05, 0xa4, 0xaf, 0x67, 0xb1, 0xcb, 0x92, 0x6c, 0x45, 0x99, 0x6d, - 0x56, 0x69, 0x36, 0xfc, 0xed, 0xa4, 0x54, 0x37, 0x61, 0x46, 0x85, 0x10, 0x45, 0xa2, 0x1e, 0xdf, - 0x4a, 0x8a, 0x24, 0xd6, 0xe9, 0x4a, 0xe4, 0xb2, 0x95, 0x98, 0x85, 0x3c, 0xeb, 0x75, 0x75, 0x7d, - 0xc4, 0xd2, 0xdc, 0x82, 0xd9, 0x6b, 0xcd, 0xeb, 0x6b, 0x1f, 0x8a, 0xb9, 0x9a, 0x4c, 0x18, 0x04, - 0xd3, 0xbe, 0xc7, 0x3d, 0x19, 0xf3, 0xa0, 0x23, 0xd7, 0xc3, 0x3c, 0xb9, 0x54, 0x9e, 0xd1, 0x24, - 0xca, 0x67, 0x6e, 0xf8, 0x79, 0x38, 0x40, 0x63, 0xd2, 0xc7, 0xb2, 0xd4, 0x45, 0x47, 0x7d, 0x98, - 0xdf, 0xe4, 0x60, 0x2e, 0x95, 0x4a, 0xef, 0x4f, 0x04, 0xd3, 0x6d, 0xe2, 0xab, 0x26, 0xff, 0xcf, - 0x91, 0x6b, 0x81, 0xb2, 0x43, 0x82, 0x04, 0x65, 0x87, 0x04, 0xc2, 0x4a, 0x6e, 0x5c, 0xd5, 0x3b, - 0xb9, 0x16, 0x59, 0xc2, 0xc8, 0xc7, 0x9f, 0xcb, 0x8e, 0xe5, 0x1d, 0xf5, 0x21, 0x7c, 0xc5, 0xcc, - 0x9e, 0x91, 0xd0, 0xc5, 0x52, 0xd8, 0xf5, 0xbd, 0x4e, 0x0f, 0x57, 0x0a, 0x52, 0xa6, 0x3e, 0xd0, - 0x0d, 0x28, 0xd1, 0x98, 0x90, 0x4d, 0x97, 0x50, 0x26, 0xcb, 0x5c, 0x6e, 0x2c, 0x8d, 0xeb, 0xda, - 0xba, 0x70, 0xf8, 0x80, 0x32, 0xa7, 0x48, 0xf5, 0x2a, 0x55, 0x82, 0x52, 0xa6, 0x04, 0x8b, 0x50, - 0x12, 0x54, 0x18, 0xf5, 0xda, 0xb8, 0x02, 0x6a, 0xcf, 0x0c, 0x05, 0xef, 0x4d, 0x17, 0x73, 0xb3, - 0x79, 0xf3, 0x3a, 0x14, 0x74, 0x44, 0xc1, 0x4f, 0x8c, 0x9c, 0xa4, 0x8b, 0x62, 0x9d, 0x30, 0xc9, - 0x8d, 0x98, 0x24, 0x7d, 0xc9, 0x8f, 0xfa, 0x62, 0xae, 0x43, 0x31, 0x81, 0x85, 0x56, 0x20, 0x2f, - 0xd8, 0x18, 0x72, 0x0f, 0x9e, 0x9c, 0x90, 0x4d, 0xb3, 0xf4, 0xf0, 0xaf, 0x63, 0x53, 0xf7, 0xff, - 0xfd, 0xf1, 0xb4, 0xe1, 0x08, 0xf7, 0xc6, 0x0f, 0x00, 0x85, 0x0d, 0x1c, 0xf7, 0xc3, 0x36, 0x46, - 0xdf, 0x1b, 0x50, 0x4e, 0x4d, 0x15, 0xd4, 0x18, 0x17, 0xf4, 0xc5, 0xc9, 0x54, 0x3d, 0xb7, 0x27, - 0x1f, 0xb5, 0x2d, 0xcc, 0xfa, 0xd7, 0xbf, 0xff, 0xf3, 0x5d, 0xee, 0x0c, 0x3a, 0x65, 0x8f, 0x79, - 0xe0, 0x0e, 0x87, 0x1a, 0xba, 0x67, 0x00, 0x8c, 0x06, 0x29, 0xaa, 0x4f, 0x90, 0x36, 0x3b, 0x89, - 0xab, 0x8d, 0xbd, 0xb8, 0x68, 0xa0, 0xb6, 0x04, 0x7a, 0x0a, 0x9d, 0x1c, 0x07, 0x54, 0x8f, 0x6f, - 0xf4, 0xb3, 0x01, 0xff, 0xcf, 0xde, 0x63, 0xe8, 0xc2, 0x04, 0x79, 0x5f, 0xbc, 0x11, 0xab, 0x17, - 0xf7, 0xea, 0xa6, 0x21, 0x5f, 0x90, 0x90, 0x6d, 0xb4, 0x3c, 0x0e, 0xb2, 0xbc, 0xeb, 0x98, 0xdd, - 0x91, 0x31, 0xd0, 0x03, 0x03, 0x66, 0x9f, 0x7f, 0x5f, 0xa0, 0x4b, 0x13, 0x60, 0xd8, 0xe9, 0x15, - 0x53, 0xbd, 0xbc, 0x77, 0x47, 0x0d, 0xff, 0x92, 0x84, 0x5f, 0x47, 0xf6, 0x84, 0xf0, 0xbf, 0x50, - 0x47, 0xf2, 0x4b, 0xf4, 0xd8, 0x48, 0xbd, 0x2d, 0xd2, 0xaf, 0x5d, 0x74, 0x65, 0xe2, 0x4a, 0xee, - 0xf0, 0x1a, 0xaf, 0xbe, 0xbd, 0x4f, 0x6f, 0xcd, 0xe7, 0x8a, 0xe4, 0x73, 0x11, 0x9d, 0x1f, 0xc7, - 0x67, 0xf4, 0x50, 0xc6, 0x7c, 0xd8, 0x95, 0x3f, 0x0d, 0xf9, 0x52, 0xdc, 0xe9, 0x57, 0x10, 0xba, - 0x3a, 0x01, 0xb0, 0x97, 0xfc, 0x82, 0xab, 0xbe, 0xb3, 0x6f, 0x7f, 0x4d, 0xed, 0xaa, 0xa4, 0x76, - 0x19, 0x5d, 0xdc, 0x1b, 0xb5, 0x61, 0xc7, 0xee, 0x19, 0x50, 0x1a, 0x5e, 0x19, 0xe8, 0xad, 0x71, - 0x70, 0x9e, 0xbf, 0xc8, 0xaa, 0xf5, 0x3d, 0x78, 0x68, 0xc8, 0x0d, 0x09, 0xf9, 0x2c, 0x3a, 0x3d, - 0x0e, 0xb2, 0xd7, 0x6a, 0x87, 0xae, 0xfc, 0x39, 0xd2, 0xbc, 0xfd, 0xf0, 0x69, 0xcd, 0x78, 0xf4, - 0xb4, 0x66, 0xfc, 0xfd, 0xb4, 0x66, 0x7c, 0xfb, 0xac, 0x36, 0xf5, 0xe8, 0x59, 0x6d, 0xea, 0xc9, - 0xb3, 0xda, 0xd4, 0x27, 0x8d, 0x20, 0xe4, 0x5b, 0xbd, 0x96, 0xd5, 0x26, 0xdd, 0x24, 0x9e, 0xfa, - 0xb7, 0xcc, 0xfc, 0x6d, 0xbb, 0xdd, 0x09, 0x71, 0xc4, 0xed, 0x20, 0xa6, 0x6d, 0x9b, 0x77, 0x99, - 0x9a, 0xb9, 0xad, 0x19, 0xf9, 0x03, 0xe3, 0xdc, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xfd, - 0xd4, 0xde, 0xdc, 0x10, 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 - -// ServiceClient is the client API for Service service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ServiceClient interface { - // GetNodeInfo queries the current node info. - GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) - // GetSyncing queries node syncing. - GetSyncing(ctx context.Context, in *GetSyncingRequest, opts ...grpc.CallOption) (*GetSyncingResponse, error) - // GetLatestBlock returns the latest block. - GetLatestBlock(ctx context.Context, in *GetLatestBlockRequest, opts ...grpc.CallOption) (*GetLatestBlockResponse, error) - // GetBlockByHeight queries block for given height. - GetBlockByHeight(ctx context.Context, in *GetBlockByHeightRequest, opts ...grpc.CallOption) (*GetBlockByHeightResponse, error) - // GetLatestValidatorSet queries latest validator-set. - GetLatestValidatorSet(ctx context.Context, in *GetLatestValidatorSetRequest, opts ...grpc.CallOption) (*GetLatestValidatorSetResponse, error) - // GetValidatorSetByHeight queries validator-set at a given height. - GetValidatorSetByHeight(ctx context.Context, in *GetValidatorSetByHeightRequest, opts ...grpc.CallOption) (*GetValidatorSetByHeightResponse, error) - // ABCIQuery defines a query handler that supports ABCI queries directly to the - // application, bypassing Tendermint completely. The ABCI query must contain - // a valid and supported path, including app, custom, p2p, and store. - // - // Since: cosmos-sdk 0.46 - ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opts ...grpc.CallOption) (*ABCIQueryResponse, error) -} - -type serviceClient struct { - cc grpc1.ClientConn -} - -func NewServiceClient(cc grpc1.ClientConn) ServiceClient { - return &serviceClient{cc} -} - -func (c *serviceClient) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*GetNodeInfoResponse, error) { - out := new(GetNodeInfoResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) GetSyncing(ctx context.Context, in *GetSyncingRequest, opts ...grpc.CallOption) (*GetSyncingResponse, error) { - out := new(GetSyncingResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetSyncing", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) GetLatestBlock(ctx context.Context, in *GetLatestBlockRequest, opts ...grpc.CallOption) (*GetLatestBlockResponse, error) { - out := new(GetLatestBlockResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) GetBlockByHeight(ctx context.Context, in *GetBlockByHeightRequest, opts ...grpc.CallOption) (*GetBlockByHeightResponse, error) { - out := new(GetBlockByHeightResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) GetLatestValidatorSet(ctx context.Context, in *GetLatestValidatorSetRequest, opts ...grpc.CallOption) (*GetLatestValidatorSetResponse, error) { - out := new(GetLatestValidatorSetResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) GetValidatorSetByHeight(ctx context.Context, in *GetValidatorSetByHeightRequest, opts ...grpc.CallOption) (*GetValidatorSetByHeightResponse, error) { - out := new(GetValidatorSetByHeightResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *serviceClient) ABCIQuery(ctx context.Context, in *ABCIQueryRequest, opts ...grpc.CallOption) (*ABCIQueryResponse, error) { - out := new(ABCIQueryResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ServiceServer is the server API for Service service. -type ServiceServer interface { - // GetNodeInfo queries the current node info. - GetNodeInfo(context.Context, *GetNodeInfoRequest) (*GetNodeInfoResponse, error) - // GetSyncing queries node syncing. - GetSyncing(context.Context, *GetSyncingRequest) (*GetSyncingResponse, error) - // GetLatestBlock returns the latest block. - GetLatestBlock(context.Context, *GetLatestBlockRequest) (*GetLatestBlockResponse, error) - // GetBlockByHeight queries block for given height. - GetBlockByHeight(context.Context, *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) - // GetLatestValidatorSet queries latest validator-set. - GetLatestValidatorSet(context.Context, *GetLatestValidatorSetRequest) (*GetLatestValidatorSetResponse, error) - // GetValidatorSetByHeight queries validator-set at a given height. - GetValidatorSetByHeight(context.Context, *GetValidatorSetByHeightRequest) (*GetValidatorSetByHeightResponse, error) - // ABCIQuery defines a query handler that supports ABCI queries directly to the - // application, bypassing Tendermint completely. The ABCI query must contain - // a valid and supported path, including app, custom, p2p, and store. - // - // Since: cosmos-sdk 0.46 - ABCIQuery(context.Context, *ABCIQueryRequest) (*ABCIQueryResponse, error) -} - -// UnimplementedServiceServer can be embedded to have forward compatible implementations. -type UnimplementedServiceServer struct { -} - -func (*UnimplementedServiceServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNodeInfo not implemented") -} -func (*UnimplementedServiceServer) GetSyncing(ctx context.Context, req *GetSyncingRequest) (*GetSyncingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSyncing not implemented") -} -func (*UnimplementedServiceServer) GetLatestBlock(ctx context.Context, req *GetLatestBlockRequest) (*GetLatestBlockResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestBlock not implemented") -} -func (*UnimplementedServiceServer) GetBlockByHeight(ctx context.Context, req *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBlockByHeight not implemented") -} -func (*UnimplementedServiceServer) GetLatestValidatorSet(ctx context.Context, req *GetLatestValidatorSetRequest) (*GetLatestValidatorSetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestValidatorSet not implemented") -} -func (*UnimplementedServiceServer) GetValidatorSetByHeight(ctx context.Context, req *GetValidatorSetByHeightRequest) (*GetValidatorSetByHeightResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetValidatorSetByHeight not implemented") -} -func (*UnimplementedServiceServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABCIQueryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ABCIQuery not implemented") -} - -func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { - s.RegisterService(&_Service_serviceDesc, srv) -} - -func _Service_GetNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNodeInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetNodeInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetNodeInfo(ctx, req.(*GetNodeInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_GetSyncing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSyncingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetSyncing(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetSyncing", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetSyncing(ctx, req.(*GetSyncingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_GetLatestBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestBlockRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetLatestBlock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetLatestBlock", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetLatestBlock(ctx, req.(*GetLatestBlockRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_GetBlockByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBlockByHeightRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetBlockByHeight(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetBlockByHeight", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetBlockByHeight(ctx, req.(*GetBlockByHeightRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_GetLatestValidatorSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestValidatorSetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetLatestValidatorSet(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetLatestValidatorSet", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetLatestValidatorSet(ctx, req.(*GetLatestValidatorSetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_GetValidatorSetByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetValidatorSetByHeightRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).GetValidatorSetByHeight(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).GetValidatorSetByHeight(ctx, req.(*GetValidatorSetByHeightRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Service_ABCIQuery_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ABCIQueryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).ABCIQuery(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).ABCIQuery(ctx, req.(*ABCIQueryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Service_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.base.tendermint.v1beta1.Service", - HandlerType: (*ServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetNodeInfo", - Handler: _Service_GetNodeInfo_Handler, - }, - { - MethodName: "GetSyncing", - Handler: _Service_GetSyncing_Handler, - }, - { - MethodName: "GetLatestBlock", - Handler: _Service_GetLatestBlock_Handler, - }, - { - MethodName: "GetBlockByHeight", - Handler: _Service_GetBlockByHeight_Handler, - }, - { - MethodName: "GetLatestValidatorSet", - Handler: _Service_GetLatestValidatorSet_Handler, - }, - { - MethodName: "GetValidatorSetByHeight", - Handler: _Service_GetValidatorSetByHeight_Handler, - }, - { - MethodName: "ABCIQuery", - Handler: _Service_ABCIQuery_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/base/tendermint/v1beta1/query.proto", -} - -func (m *GetValidatorSetByHeightRequest) 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 *GetValidatorSetByHeightRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetValidatorSetByHeightRequest) 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 m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GetValidatorSetByHeightResponse) 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 *GetValidatorSetByHeightResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetValidatorSetByHeightResponse) 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] = 0x1a - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.BlockHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetResponse) 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 *GetLatestValidatorSetResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetLatestValidatorSetResponse) 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] = 0x1a - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.BlockHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Validator) 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 *Validator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposerPriority != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposerPriority)) - i-- - dAtA[i] = 0x20 - } - if m.VotingPower != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.VotingPower)) - i-- - dAtA[i] = 0x18 - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetBlockByHeightRequest) 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 *GetBlockByHeightRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetBlockByHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GetBlockByHeightResponse) 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 *GetBlockByHeightResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetBlockByHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SdkBlock != nil { - { - size, err := m.SdkBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.BlockId != nil { - { - size, err := m.BlockId.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 *GetLatestBlockRequest) 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 *GetLatestBlockRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetLatestBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetLatestBlockResponse) 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 *GetLatestBlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetLatestBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.SdkBlock != nil { - { - size, err := m.SdkBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.BlockId != nil { - { - size, err := m.BlockId.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 *GetSyncingRequest) 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 *GetSyncingRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetSyncingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetSyncingResponse) 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 *GetSyncingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetSyncingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Syncing { - i-- - if m.Syncing { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GetNodeInfoRequest) 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 *GetNodeInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNodeInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetNodeInfoResponse) 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 *GetNodeInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetNodeInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ApplicationVersion != nil { - { - size, err := m.ApplicationVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.DefaultNodeInfo != nil { - { - size, err := m.DefaultNodeInfo.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 *VersionInfo) 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 *VersionInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VersionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CosmosSdkVersion) > 0 { - i -= len(m.CosmosSdkVersion) - copy(dAtA[i:], m.CosmosSdkVersion) - i = encodeVarintQuery(dAtA, i, uint64(len(m.CosmosSdkVersion))) - i-- - dAtA[i] = 0x42 - } - if len(m.BuildDeps) > 0 { - for iNdEx := len(m.BuildDeps) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.BuildDeps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.GoVersion) > 0 { - i -= len(m.GoVersion) - copy(dAtA[i:], m.GoVersion) - i = encodeVarintQuery(dAtA, i, uint64(len(m.GoVersion))) - i-- - dAtA[i] = 0x32 - } - if len(m.BuildTags) > 0 { - i -= len(m.BuildTags) - copy(dAtA[i:], m.BuildTags) - i = encodeVarintQuery(dAtA, i, uint64(len(m.BuildTags))) - i-- - dAtA[i] = 0x2a - } - if len(m.GitCommit) > 0 { - i -= len(m.GitCommit) - copy(dAtA[i:], m.GitCommit) - i = encodeVarintQuery(dAtA, i, uint64(len(m.GitCommit))) - i-- - dAtA[i] = 0x22 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x1a - } - if len(m.AppName) > 0 { - i -= len(m.AppName) - copy(dAtA[i:], m.AppName) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AppName))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Module) 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 *Module) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Module) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Sum) > 0 { - i -= len(m.Sum) - copy(dAtA[i:], m.Sum) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Sum))) - i-- - dAtA[i] = 0x1a - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x12 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ABCIQueryRequest) 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 *ABCIQueryRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ABCIQueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Prove { - i-- - if m.Prove { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - if len(m.Path) > 0 { - i -= len(m.Path) - copy(dAtA[i:], m.Path) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Path))) - i-- - dAtA[i] = 0x12 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ABCIQueryResponse) 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 *ABCIQueryResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ABCIQueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x52 - } - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x48 - } - if m.ProofOps != nil { - { - size, err := m.ProofOps.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x3a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x32 - } - if m.Index != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x28 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x22 - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x1a - } - if m.Code != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ProofOp) 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 *ProofOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProofOps) 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 *ProofOps) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOps) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ops) > 0 { - for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ops[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 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 *GetValidatorSetByHeightRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *GetValidatorSetByHeightResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockHeight != 0 { - n += 1 + sovQuery(uint64(m.BlockHeight)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - 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 *GetLatestValidatorSetRequest) 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 *GetLatestValidatorSetResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockHeight != 0 { - n += 1 + sovQuery(uint64(m.BlockHeight)) - } - if len(m.Validators) > 0 { - for _, e := range m.Validators { - 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 *Validator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.VotingPower != 0 { - n += 1 + sovQuery(uint64(m.VotingPower)) - } - if m.ProposerPriority != 0 { - n += 1 + sovQuery(uint64(m.ProposerPriority)) - } - return n -} - -func (m *GetBlockByHeightRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - return n -} - -func (m *GetBlockByHeightResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockId != nil { - l = m.BlockId.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.SdkBlock != nil { - l = m.SdkBlock.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *GetLatestBlockRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetLatestBlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockId != nil { - l = m.BlockId.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.SdkBlock != nil { - l = m.SdkBlock.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *GetSyncingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetSyncingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Syncing { - n += 2 - } - return n -} - -func (m *GetNodeInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetNodeInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DefaultNodeInfo != nil { - l = m.DefaultNodeInfo.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.ApplicationVersion != nil { - l = m.ApplicationVersion.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *VersionInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AppName) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.GitCommit) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.BuildTags) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.GoVersion) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.BuildDeps) > 0 { - for _, e := range m.BuildDeps { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - l = len(m.CosmosSdkVersion) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *Module) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Sum) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *ABCIQueryRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Path) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - if m.Prove { - n += 2 - } - return n -} - -func (m *ABCIQueryResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovQuery(uint64(m.Code)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Index != 0 { - n += 1 + sovQuery(uint64(m.Index)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.ProofOps != nil { - l = m.ProofOps.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *ProofOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *ProofOps) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ops) > 0 { - for _, e := range m.Ops { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - 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 *GetValidatorSetByHeightRequest) 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: GetValidatorSetByHeightRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetValidatorSetByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetValidatorSetByHeightResponse) 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: GetValidatorSetByHeightResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetValidatorSetByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, &Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetLatestValidatorSetRequest) 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: GetLatestValidatorSetRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetLatestValidatorSetRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetLatestValidatorSetResponse) 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: GetLatestValidatorSetResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetLatestValidatorSetResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) - } - m.BlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, &Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Validator) 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: Validator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey == nil { - m.PubKey = &types.Any{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) - } - m.VotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType) - } - m.ProposerPriority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposerPriority |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetBlockByHeightRequest) 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: GetBlockByHeightRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetBlockByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetBlockByHeightResponse) 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: GetBlockByHeightResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetBlockByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockId", 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.BlockId == nil { - m.BlockId = &types1.BlockID{} - } - if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block == nil { - m.Block = &types1.Block{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SdkBlock", 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.SdkBlock == nil { - m.SdkBlock = &Block{} - } - if err := m.SdkBlock.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetLatestBlockRequest) 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: GetLatestBlockRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetLatestBlockRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetLatestBlockResponse) 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: GetLatestBlockResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetLatestBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockId", 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.BlockId == nil { - m.BlockId = &types1.BlockID{} - } - if err := m.BlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", 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.Block == nil { - m.Block = &types1.Block{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SdkBlock", 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.SdkBlock == nil { - m.SdkBlock = &Block{} - } - if err := m.SdkBlock.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetSyncingRequest) 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: GetSyncingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetSyncingRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetSyncingResponse) 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: GetSyncingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetSyncingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Syncing", 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.Syncing = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetNodeInfoRequest) 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: GetNodeInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNodeInfoRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetNodeInfoResponse) 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: GetNodeInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetNodeInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeInfo", 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.DefaultNodeInfo == nil { - m.DefaultNodeInfo = &p2p.DefaultNodeInfo{} - } - if err := m.DefaultNodeInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ApplicationVersion", 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.ApplicationVersion == nil { - m.ApplicationVersion = &VersionInfo{} - } - if err := m.ApplicationVersion.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VersionInfo) 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: VersionInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VersionInfo: 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 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.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppName", 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.AppName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GitCommit", 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.GitCommit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildTags", 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.BuildTags = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GoVersion", 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.GoVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildDeps", 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.BuildDeps = append(m.BuildDeps, &Module{}) - if err := m.BuildDeps[len(m.BuildDeps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CosmosSdkVersion", 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.CosmosSdkVersion = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Module) 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: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Module: 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 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.Path = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sum", 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.Sum = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ABCIQueryRequest) 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: ABCIQueryRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ABCIQueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - 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 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.Path = string(dAtA[iNdEx:postIndex]) - 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 ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Prove", 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.Prove = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ABCIQueryResponse) 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: ABCIQueryResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ABCIQueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", 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.Log = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - 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 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.Info = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofOps", 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.ProofOps == nil { - m.ProofOps = &ProofOps{} - } - if err := m.ProofOps.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - 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 ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", 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.Codespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProofOp) 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: ProofOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", 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.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ProofOps) 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: ProofOps: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOps: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ops", 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.Ops = append(m.Ops, ProofOp{}) - if err := m.Ops[len(m.Ops)-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) || (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/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go deleted file mode 100644 index 36727c4ca4e7..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/query.pb.gw.go +++ /dev/null @@ -1,669 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/base/tendermint/v1beta1/query.proto - -/* -Package tmservice is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package tmservice - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeInfoRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetNodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetNodeInfoRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetNodeInfo(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetSyncingRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetSyncing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetSyncing_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetSyncingRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetSyncing(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLatestBlockRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetLatestBlock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetLatestBlock_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLatestBlockRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetLatestBlock(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetBlockByHeightRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["height"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") - } - - protoReq.Height, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) - } - - msg, err := client.GetBlockByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetBlockByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetBlockByHeightRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["height"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") - } - - protoReq.Height, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) - } - - msg, err := server.GetBlockByHeight(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Service_GetLatestValidatorSet_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLatestValidatorSetRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetLatestValidatorSet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetLatestValidatorSet_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetLatestValidatorSetRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetLatestValidatorSet_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetLatestValidatorSet(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Service_GetValidatorSetByHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{"height": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorSetByHeightRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["height"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") - } - - protoReq.Height, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetValidatorSetByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_GetValidatorSetByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetValidatorSetByHeightRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["height"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "height") - } - - protoReq.Height, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "height", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_GetValidatorSetByHeight_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GetValidatorSetByHeight(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Service_ABCIQuery_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Service_ABCIQuery_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ABCIQueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ABCIQuery_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ABCIQuery(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_ABCIQuery_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq ABCIQueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Service_ABCIQuery_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ABCIQuery(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterServiceHandlerServer registers the http handlers for service Service to "mux". -// UnaryRPC :call ServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. -func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { - - mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetNodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetSyncing_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetLatestBlock_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_ABCIQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_ABCIQuery_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_ABCIQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterServiceHandler(ctx, mux, conn) -} - -// RegisterServiceHandler registers the http handlers for service Service to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) -} - -// RegisterServiceHandlerClient registers the http handlers for service Service -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ServiceClient" to call the correct interceptors. -func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { - - mux.Handle("GET", pattern_Service_GetNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetNodeInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetSyncing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetSyncing_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetSyncing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetLatestBlock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetLatestBlock_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetLatestBlock_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetBlockByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetBlockByHeight_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetBlockByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetLatestValidatorSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetLatestValidatorSet_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetLatestValidatorSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_GetValidatorSetByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_GetValidatorSetByHeight_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_GetValidatorSetByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Service_ABCIQuery_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_ABCIQuery_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_ABCIQuery_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Service_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "node_info"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_GetSyncing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "syncing"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_GetLatestBlock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "blocks", "latest"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_GetBlockByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "blocks", "height"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_GetLatestValidatorSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "latest"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_GetValidatorSetByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "height"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_ABCIQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "tendermint", "v1beta1", "abci_query"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Service_GetNodeInfo_0 = runtime.ForwardResponseMessage - - forward_Service_GetSyncing_0 = runtime.ForwardResponseMessage - - forward_Service_GetLatestBlock_0 = runtime.ForwardResponseMessage - - forward_Service_GetBlockByHeight_0 = runtime.ForwardResponseMessage - - forward_Service_GetLatestValidatorSet_0 = runtime.ForwardResponseMessage - - forward_Service_GetValidatorSetByHeight_0 = runtime.ForwardResponseMessage - - forward_Service_ABCIQuery_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go b/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go deleted file mode 100644 index 79e12e42b0b3..000000000000 --- a/github.com/cosmos/cosmos-sdk/client/grpc/tmservice/types.pb.go +++ /dev/null @@ -1,1371 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/tendermint/v1beta1/types.proto - -package tmservice - -import ( - fmt "fmt" - types "github.com/cometbft/cometbft/proto/tendermint/types" - version "github.com/cometbft/cometbft/proto/tendermint/version" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "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 - -// Block is tendermint type Block, with the Header proposer address -// field converted to bech32 string. -type Block struct { - Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` - Data types.Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` - Evidence types.EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` - LastCommit *types.Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` -} - -func (m *Block) Reset() { *m = Block{} } -func (m *Block) String() string { return proto.CompactTextString(m) } -func (*Block) ProtoMessage() {} -func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_bb9931519c08e0d6, []int{0} -} -func (m *Block) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Block.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 *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(m, src) -} -func (m *Block) XXX_Size() int { - return m.Size() -} -func (m *Block) XXX_DiscardUnknown() { - xxx_messageInfo_Block.DiscardUnknown(m) -} - -var xxx_messageInfo_Block proto.InternalMessageInfo - -func (m *Block) GetHeader() Header { - if m != nil { - return m.Header - } - return Header{} -} - -func (m *Block) GetData() types.Data { - if m != nil { - return m.Data - } - return types.Data{} -} - -func (m *Block) GetEvidence() types.EvidenceList { - if m != nil { - return m.Evidence - } - return types.EvidenceList{} -} - -func (m *Block) GetLastCommit() *types.Commit { - if m != nil { - return m.LastCommit - } - return nil -} - -// Header defines the structure of a Tendermint block header. -type Header struct { - // basic block info - Version version.Consensus `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` - ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` - // prev block info - LastBlockId types.BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` - // hashes of block data - LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` - DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` - // hashes from the app output from the prev block - ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - NextValidatorsHash []byte `protobuf:"bytes,9,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` - AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` - // consensus info - EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` - // proposer_address is the original block proposer address, formatted as a Bech32 string. - // In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string - // for better UX. - ProposerAddress string `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_bb9931519c08e0d6, []int{1} -} -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.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 *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return m.Size() -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -func (m *Header) GetVersion() version.Consensus { - if m != nil { - return m.Version - } - return version.Consensus{} -} - -func (m *Header) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func (m *Header) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Header) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *Header) GetLastBlockId() types.BlockID { - if m != nil { - return m.LastBlockId - } - return types.BlockID{} -} - -func (m *Header) GetLastCommitHash() []byte { - if m != nil { - return m.LastCommitHash - } - return nil -} - -func (m *Header) GetDataHash() []byte { - if m != nil { - return m.DataHash - } - return nil -} - -func (m *Header) GetValidatorsHash() []byte { - if m != nil { - return m.ValidatorsHash - } - return nil -} - -func (m *Header) GetNextValidatorsHash() []byte { - if m != nil { - return m.NextValidatorsHash - } - return nil -} - -func (m *Header) GetConsensusHash() []byte { - if m != nil { - return m.ConsensusHash - } - return nil -} - -func (m *Header) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - -func (m *Header) GetLastResultsHash() []byte { - if m != nil { - return m.LastResultsHash - } - return nil -} - -func (m *Header) GetEvidenceHash() []byte { - if m != nil { - return m.EvidenceHash - } - return nil -} - -func (m *Header) GetProposerAddress() string { - if m != nil { - return m.ProposerAddress - } - return "" -} - -func init() { - proto.RegisterType((*Block)(nil), "cosmos.base.tendermint.v1beta1.Block") - proto.RegisterType((*Header)(nil), "cosmos.base.tendermint.v1beta1.Header") -} - -func init() { - proto.RegisterFile("cosmos/base/tendermint/v1beta1/types.proto", fileDescriptor_bb9931519c08e0d6) -} - -var fileDescriptor_bb9931519c08e0d6 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xcd, 0x6e, 0xd3, 0x4e, - 0x14, 0xc5, 0xe3, 0x36, 0xcd, 0xc7, 0xa4, 0xe9, 0xc7, 0xa8, 0xaa, 0xdc, 0xfc, 0xff, 0x38, 0x55, - 0x11, 0xa5, 0x54, 0xc2, 0xa6, 0x45, 0x2c, 0x58, 0xb0, 0x20, 0x6d, 0xa5, 0x46, 0xea, 0xca, 0x42, - 0x2c, 0xd8, 0x44, 0x13, 0x7b, 0xb0, 0x47, 0xb5, 0x3d, 0x96, 0x67, 0x12, 0xc1, 0x33, 0xb0, 0xe9, - 0x63, 0xb0, 0xe4, 0x31, 0xba, 0xec, 0x92, 0x55, 0x41, 0xe9, 0x82, 0x27, 0x60, 0x8f, 0xe6, 0xce, - 0xb8, 0x75, 0x88, 0xc4, 0x26, 0xb1, 0xcf, 0xfd, 0xdd, 0x93, 0xb9, 0xe7, 0x8e, 0x82, 0x0e, 0x03, - 0x2e, 0x52, 0x2e, 0xbc, 0x31, 0x11, 0xd4, 0x93, 0x34, 0x0b, 0x69, 0x91, 0xb2, 0x4c, 0x7a, 0xd3, - 0xa3, 0x31, 0x95, 0xe4, 0xc8, 0x93, 0x9f, 0x73, 0x2a, 0xdc, 0xbc, 0xe0, 0x92, 0x63, 0x47, 0xb3, - 0xae, 0x62, 0xdd, 0x07, 0xd6, 0x35, 0x6c, 0x6f, 0x2b, 0xe2, 0x11, 0x07, 0xd4, 0x53, 0x4f, 0xba, - 0xab, 0xf7, 0x7f, 0xc5, 0x15, 0xdc, 0xaa, 0x9e, 0xbd, 0xfe, 0x42, 0x95, 0x4e, 0x59, 0x48, 0xb3, - 0x80, 0x1a, 0xc0, 0xa9, 0x1e, 0x8a, 0x16, 0x82, 0xf1, 0x6c, 0xde, 0x20, 0xe2, 0x3c, 0x4a, 0xa8, - 0x07, 0x6f, 0xe3, 0xc9, 0x47, 0x4f, 0xb2, 0x94, 0x0a, 0x49, 0xd2, 0xdc, 0x00, 0x9b, 0x24, 0x65, - 0x19, 0xf7, 0xe0, 0x53, 0x4b, 0x7b, 0x5f, 0x96, 0xd0, 0xca, 0x20, 0xe1, 0xc1, 0x25, 0x1e, 0xa2, - 0x46, 0x4c, 0x49, 0x48, 0x0b, 0xdb, 0xda, 0xb5, 0x0e, 0x3a, 0xc7, 0xfb, 0xee, 0xbf, 0x67, 0x74, - 0xcf, 0x81, 0x1e, 0xb4, 0xaf, 0x6f, 0xfb, 0xb5, 0xaf, 0xbf, 0xbe, 0x1d, 0x5a, 0xbe, 0x31, 0xc0, - 0xaf, 0x50, 0x3d, 0x24, 0x92, 0xd8, 0x4b, 0x60, 0xb4, 0x5d, 0x6d, 0xd6, 0xe7, 0x3d, 0x25, 0x92, - 0x54, 0x1b, 0x01, 0xc7, 0x67, 0xa8, 0x55, 0x4e, 0x6c, 0x2f, 0x43, 0xab, 0xb3, 0xd8, 0x7a, 0x66, - 0x88, 0x0b, 0x26, 0x64, 0xd5, 0xe2, 0xbe, 0x15, 0xbf, 0x46, 0x9d, 0x84, 0x08, 0x39, 0x0a, 0x78, - 0x9a, 0x32, 0x69, 0xd7, 0xc1, 0xc9, 0x5e, 0x74, 0x3a, 0x81, 0xba, 0x8f, 0x14, 0xac, 0x9f, 0xf7, - 0x7e, 0xd7, 0x51, 0x43, 0x8f, 0x85, 0x07, 0xa8, 0x69, 0x32, 0x36, 0x79, 0x3c, 0x9a, 0xcb, 0x40, - 0x97, 0xdc, 0x13, 0x9e, 0x09, 0x9a, 0x89, 0x89, 0xa8, 0x1e, 0xa5, 0x6c, 0xc4, 0xfb, 0xa8, 0x15, - 0xc4, 0x84, 0x65, 0x23, 0x16, 0x42, 0x16, 0xed, 0x41, 0x67, 0x76, 0xdb, 0x6f, 0x9e, 0x28, 0x6d, - 0x78, 0xea, 0x37, 0xa1, 0x38, 0x0c, 0xf1, 0xb6, 0x8a, 0x9e, 0x45, 0xb1, 0x84, 0xb1, 0x97, 0x7d, - 0xf3, 0x86, 0xdf, 0xa0, 0xba, 0x5a, 0xa1, 0x19, 0xa1, 0xe7, 0xea, 0xfd, 0xba, 0xe5, 0x7e, 0xdd, - 0x77, 0xe5, 0x7e, 0x07, 0x5d, 0xf5, 0xeb, 0x57, 0x3f, 0xfa, 0x96, 0xc9, 0x53, 0xb5, 0xe1, 0x73, - 0xd4, 0x85, 0x20, 0xc6, 0x6a, 0xbf, 0xea, 0x0c, 0x2b, 0xe0, 0xb3, 0xb3, 0x18, 0x05, 0xdc, 0x80, - 0xe1, 0x69, 0x75, 0x08, 0xc8, 0x50, 0xeb, 0x21, 0x3e, 0x40, 0x1b, 0x95, 0x48, 0x47, 0x31, 0x11, - 0xb1, 0xdd, 0xd8, 0xb5, 0x0e, 0x56, 0xfd, 0xb5, 0x87, 0xf4, 0xce, 0x89, 0x88, 0xf1, 0x7f, 0xa8, - 0xad, 0x76, 0xa9, 0x91, 0x26, 0x20, 0x2d, 0x25, 0x40, 0xf1, 0x29, 0x5a, 0x9f, 0x92, 0x84, 0x85, - 0x44, 0xf2, 0x42, 0x68, 0xa4, 0xa5, 0x5d, 0x1e, 0x64, 0x00, 0x5f, 0xa0, 0xad, 0x8c, 0x7e, 0x92, - 0xa3, 0xbf, 0xe9, 0x36, 0xd0, 0x58, 0xd5, 0xde, 0xcf, 0x77, 0x3c, 0x41, 0x6b, 0x41, 0xb9, 0x0b, - 0xcd, 0x22, 0x60, 0xbb, 0xf7, 0x2a, 0x60, 0x3b, 0xa8, 0x45, 0xf2, 0x5c, 0x03, 0x1d, 0x00, 0x9a, - 0x24, 0xcf, 0xa1, 0x74, 0x88, 0x36, 0x61, 0xc6, 0x82, 0x8a, 0x49, 0x22, 0x8d, 0xc9, 0x2a, 0x30, - 0xeb, 0xaa, 0xe0, 0x6b, 0x1d, 0xd8, 0xc7, 0xa8, 0x5b, 0x5e, 0x37, 0xcd, 0x75, 0x81, 0x5b, 0x2d, - 0x45, 0x80, 0x9e, 0xa1, 0x8d, 0xbc, 0xe0, 0x39, 0x17, 0xb4, 0x18, 0x91, 0x30, 0x2c, 0xa8, 0x10, - 0xf6, 0x9a, 0xba, 0x05, 0xfe, 0x7a, 0xa9, 0xbf, 0xd5, 0xf2, 0xe0, 0xe2, 0x7a, 0xe6, 0x58, 0x37, - 0x33, 0xc7, 0xfa, 0x39, 0x73, 0xac, 0xab, 0x3b, 0xa7, 0x76, 0x73, 0xe7, 0xd4, 0xbe, 0xdf, 0x39, - 0xb5, 0x0f, 0xc7, 0x11, 0x93, 0xf1, 0x64, 0xec, 0x06, 0x3c, 0xf5, 0xcc, 0xff, 0x93, 0xfe, 0x7a, - 0x2e, 0xc2, 0x4b, 0x2f, 0x48, 0x18, 0xcd, 0xa4, 0x17, 0x15, 0x79, 0xe0, 0xc9, 0x54, 0xd0, 0x62, - 0xca, 0x02, 0x3a, 0x6e, 0xc0, 0x05, 0x79, 0xf9, 0x27, 0x00, 0x00, 0xff, 0xff, 0x9b, 0x84, 0x6d, - 0xe8, 0xd1, 0x04, 0x00, 0x00, -} - -func (m *Block) 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 *Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastCommit != nil { - { - size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Header) 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 *Header) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x72 - } - if len(m.EvidenceHash) > 0 { - i -= len(m.EvidenceHash) - copy(dAtA[i:], m.EvidenceHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) - i-- - dAtA[i] = 0x6a - } - if len(m.LastResultsHash) > 0 { - i -= len(m.LastResultsHash) - copy(dAtA[i:], m.LastResultsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) - i-- - dAtA[i] = 0x62 - } - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x5a - } - if len(m.ConsensusHash) > 0 { - i -= len(m.ConsensusHash) - copy(dAtA[i:], m.ConsensusHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) - i-- - dAtA[i] = 0x52 - } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x4a - } - if len(m.ValidatorsHash) > 0 { - i -= len(m.ValidatorsHash) - copy(dAtA[i:], m.ValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) - i-- - dAtA[i] = 0x42 - } - if len(m.DataHash) > 0 { - i -= len(m.DataHash) - copy(dAtA[i:], m.DataHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.DataHash))) - i-- - dAtA[i] = 0x3a - } - if len(m.LastCommitHash) > 0 { - i -= len(m.LastCommitHash) - copy(dAtA[i:], m.LastCommitHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastCommitHash))) - i-- - dAtA[i] = 0x32 - } - { - size, err := m.LastBlockId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTypes(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x22 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Block) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.Data.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.Evidence.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.LastCommit != nil { - l = m.LastCommit.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Version.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = m.LastBlockId.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.LastCommitHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.DataHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ConsensusHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.LastResultsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.EvidenceHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func sovTypes(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTypes(x uint64) (n int) { - return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Block) 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 ErrIntOverflowTypes - } - 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: Block: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastCommit == nil { - m.LastCommit = &types.Commit{} - } - if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Header) 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 ErrIntOverflowTypes - } - 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: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - 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 ErrIntOverflowTypes - } - 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 Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastCommitHash == nil { - m.LastCommitHash = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) - if m.DataHash == nil { - m.DataHash = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorsHash == nil { - m.ValidatorsHash = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) - if m.ConsensusHash == nil { - m.ConsensusHash = []byte{} - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastResultsHash == nil { - m.LastResultsHash = []byte{} - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) - if m.EvidenceHash == nil { - m.EvidenceHash = []byte{} - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go b/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go deleted file mode 100644 index a5c466a354e4..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/hd/hd.pb.go +++ /dev/null @@ -1,426 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/hd/v1/hd.proto - -package hd - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// BIP44Params is used as path field in ledger item in Record. -type BIP44Params struct { - // purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation - Purpose uint32 `protobuf:"varint,1,opt,name=purpose,proto3" json:"purpose,omitempty"` - // coin_type is a constant that improves privacy - CoinType uint32 `protobuf:"varint,2,opt,name=coin_type,json=coinType,proto3" json:"coin_type,omitempty"` - // account splits the key space into independent user identities - Account uint32 `protobuf:"varint,3,opt,name=account,proto3" json:"account,omitempty"` - // change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - // chain. - Change bool `protobuf:"varint,4,opt,name=change,proto3" json:"change,omitempty"` - // address_index is used as child index in BIP32 derivation - AddressIndex uint32 `protobuf:"varint,5,opt,name=address_index,json=addressIndex,proto3" json:"address_index,omitempty"` -} - -func (m *BIP44Params) Reset() { *m = BIP44Params{} } -func (*BIP44Params) ProtoMessage() {} -func (*BIP44Params) Descriptor() ([]byte, []int) { - return fileDescriptor_cf10f1fb5e778a8d, []int{0} -} -func (m *BIP44Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BIP44Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BIP44Params.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 *BIP44Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_BIP44Params.Merge(m, src) -} -func (m *BIP44Params) XXX_Size() int { - return m.Size() -} -func (m *BIP44Params) XXX_DiscardUnknown() { - xxx_messageInfo_BIP44Params.DiscardUnknown(m) -} - -var xxx_messageInfo_BIP44Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*BIP44Params)(nil), "cosmos.crypto.hd.v1.BIP44Params") -} - -func init() { proto.RegisterFile("cosmos/crypto/hd/v1/hd.proto", fileDescriptor_cf10f1fb5e778a8d) } - -var fileDescriptor_cf10f1fb5e778a8d = []byte{ - // 294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x48, 0xd1, 0x2f, 0x33, 0xd4, - 0xcf, 0x48, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x41, 0x64, 0xf5, - 0x32, 0x52, 0xf4, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, - 0x9d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x0e, 0x30, - 0x72, 0x71, 0x3b, 0x79, 0x06, 0x98, 0x98, 0x04, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x0b, 0x49, 0x70, - 0xb1, 0x17, 0x94, 0x16, 0x15, 0xe4, 0x17, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x06, 0xc1, - 0xb8, 0x42, 0xd2, 0x5c, 0x9c, 0xc9, 0xf9, 0x99, 0x79, 0xf1, 0x25, 0x95, 0x05, 0xa9, 0x12, 0x4c, - 0x60, 0x39, 0x0e, 0x90, 0x40, 0x48, 0x65, 0x41, 0x2a, 0x48, 0x5b, 0x62, 0x72, 0x72, 0x7e, 0x69, - 0x5e, 0x89, 0x04, 0x33, 0x44, 0x1b, 0x94, 0x2b, 0x24, 0xc6, 0xc5, 0x96, 0x9c, 0x91, 0x98, 0x97, - 0x9e, 0x2a, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x11, 0x04, 0xe5, 0x09, 0x29, 0x73, 0xf1, 0x26, 0xa6, - 0xa4, 0x14, 0xa5, 0x16, 0x17, 0xc7, 0x67, 0xe6, 0xa5, 0xa4, 0x56, 0x48, 0xb0, 0x82, 0xf5, 0xf1, - 0x40, 0x05, 0x3d, 0x41, 0x62, 0x56, 0xca, 0x33, 0x16, 0xc8, 0x33, 0x74, 0x3d, 0xdf, 0xa0, 0x25, - 0x05, 0xf5, 0x7b, 0x76, 0x6a, 0x65, 0x31, 0x28, 0x00, 0x90, 0x9c, 0xec, 0xe4, 0x72, 0xe2, 0xa1, - 0x1c, 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, - 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa5, 0x67, 0x96, - 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xc2, 0x11, 0x4c, 0xe9, 0x16, 0xa7, 0x64, - 0x23, 0x82, 0x34, 0x89, 0x0d, 0x1c, 0x1e, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x0c, - 0x7a, 0x26, 0x6d, 0x01, 0x00, 0x00, -} - -func (m *BIP44Params) 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 *BIP44Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BIP44Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AddressIndex != 0 { - i = encodeVarintHd(dAtA, i, uint64(m.AddressIndex)) - i-- - dAtA[i] = 0x28 - } - if m.Change { - i-- - if m.Change { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Account != 0 { - i = encodeVarintHd(dAtA, i, uint64(m.Account)) - i-- - dAtA[i] = 0x18 - } - if m.CoinType != 0 { - i = encodeVarintHd(dAtA, i, uint64(m.CoinType)) - i-- - dAtA[i] = 0x10 - } - if m.Purpose != 0 { - i = encodeVarintHd(dAtA, i, uint64(m.Purpose)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintHd(dAtA []byte, offset int, v uint64) int { - offset -= sovHd(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BIP44Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Purpose != 0 { - n += 1 + sovHd(uint64(m.Purpose)) - } - if m.CoinType != 0 { - n += 1 + sovHd(uint64(m.CoinType)) - } - if m.Account != 0 { - n += 1 + sovHd(uint64(m.Account)) - } - if m.Change { - n += 2 - } - if m.AddressIndex != 0 { - n += 1 + sovHd(uint64(m.AddressIndex)) - } - return n -} - -func sovHd(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozHd(x uint64) (n int) { - return sovHd(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BIP44Params) 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 ErrIntOverflowHd - } - 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: BIP44Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BIP44Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Purpose", wireType) - } - m.Purpose = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Purpose |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) - } - m.CoinType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CoinType |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType) - } - m.Account = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Account |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Change", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Change = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressIndex", wireType) - } - m.AddressIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowHd - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AddressIndex |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipHd(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthHd - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipHd(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, ErrIntOverflowHd - } - 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, ErrIntOverflowHd - } - 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, ErrIntOverflowHd - } - 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, ErrInvalidLengthHd - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupHd - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthHd - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthHd = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowHd = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupHd = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go deleted file mode 100644 index 081b456bea20..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/keyring/record.pb.go +++ /dev/null @@ -1,1332 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/keyring/v1/record.proto - -package keyring - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - hd "github.com/cosmos/cosmos-sdk/crypto/hd" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package - -// Record is used for representing a key in the keyring. -type Record struct { - // name represents a name of Record - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // pub_key represents a public key in any format - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // Record contains one of the following items - // - // Types that are valid to be assigned to Item: - // *Record_Local_ - // *Record_Ledger_ - // *Record_Multi_ - // *Record_Offline_ - Item isRecord_Item `protobuf_oneof:"item"` -} - -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} -func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_36d640103edea005, []int{0} -} -func (m *Record) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record.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 *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return m.Size() -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) -} - -var xxx_messageInfo_Record proto.InternalMessageInfo - -type isRecord_Item interface { - isRecord_Item() - MarshalTo([]byte) (int, error) - Size() int -} - -type Record_Local_ struct { - Local *Record_Local `protobuf:"bytes,3,opt,name=local,proto3,oneof" json:"local,omitempty"` -} -type Record_Ledger_ struct { - Ledger *Record_Ledger `protobuf:"bytes,4,opt,name=ledger,proto3,oneof" json:"ledger,omitempty"` -} -type Record_Multi_ struct { - Multi *Record_Multi `protobuf:"bytes,5,opt,name=multi,proto3,oneof" json:"multi,omitempty"` -} -type Record_Offline_ struct { - Offline *Record_Offline `protobuf:"bytes,6,opt,name=offline,proto3,oneof" json:"offline,omitempty"` -} - -func (*Record_Local_) isRecord_Item() {} -func (*Record_Ledger_) isRecord_Item() {} -func (*Record_Multi_) isRecord_Item() {} -func (*Record_Offline_) isRecord_Item() {} - -func (m *Record) GetItem() isRecord_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *Record) GetLocal() *Record_Local { - if x, ok := m.GetItem().(*Record_Local_); ok { - return x.Local - } - return nil -} - -func (m *Record) GetLedger() *Record_Ledger { - if x, ok := m.GetItem().(*Record_Ledger_); ok { - return x.Ledger - } - return nil -} - -func (m *Record) GetMulti() *Record_Multi { - if x, ok := m.GetItem().(*Record_Multi_); ok { - return x.Multi - } - return nil -} - -func (m *Record) GetOffline() *Record_Offline { - if x, ok := m.GetItem().(*Record_Offline_); ok { - return x.Offline - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Record) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Record_Local_)(nil), - (*Record_Ledger_)(nil), - (*Record_Multi_)(nil), - (*Record_Offline_)(nil), - } -} - -// Item is a keyring item stored in a keyring backend. -// Local item -type Record_Local struct { - PrivKey *types.Any `protobuf:"bytes,1,opt,name=priv_key,json=privKey,proto3" json:"priv_key,omitempty"` -} - -func (m *Record_Local) Reset() { *m = Record_Local{} } -func (m *Record_Local) String() string { return proto.CompactTextString(m) } -func (*Record_Local) ProtoMessage() {} -func (*Record_Local) Descriptor() ([]byte, []int) { - return fileDescriptor_36d640103edea005, []int{0, 0} -} -func (m *Record_Local) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record_Local.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 *Record_Local) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record_Local.Merge(m, src) -} -func (m *Record_Local) XXX_Size() int { - return m.Size() -} -func (m *Record_Local) XXX_DiscardUnknown() { - xxx_messageInfo_Record_Local.DiscardUnknown(m) -} - -var xxx_messageInfo_Record_Local proto.InternalMessageInfo - -// Ledger item -type Record_Ledger struct { - Path *hd.BIP44Params `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` -} - -func (m *Record_Ledger) Reset() { *m = Record_Ledger{} } -func (m *Record_Ledger) String() string { return proto.CompactTextString(m) } -func (*Record_Ledger) ProtoMessage() {} -func (*Record_Ledger) Descriptor() ([]byte, []int) { - return fileDescriptor_36d640103edea005, []int{0, 1} -} -func (m *Record_Ledger) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record_Ledger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record_Ledger.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 *Record_Ledger) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record_Ledger.Merge(m, src) -} -func (m *Record_Ledger) XXX_Size() int { - return m.Size() -} -func (m *Record_Ledger) XXX_DiscardUnknown() { - xxx_messageInfo_Record_Ledger.DiscardUnknown(m) -} - -var xxx_messageInfo_Record_Ledger proto.InternalMessageInfo - -// Multi item -type Record_Multi struct { -} - -func (m *Record_Multi) Reset() { *m = Record_Multi{} } -func (m *Record_Multi) String() string { return proto.CompactTextString(m) } -func (*Record_Multi) ProtoMessage() {} -func (*Record_Multi) Descriptor() ([]byte, []int) { - return fileDescriptor_36d640103edea005, []int{0, 2} -} -func (m *Record_Multi) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record_Multi) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record_Multi.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 *Record_Multi) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record_Multi.Merge(m, src) -} -func (m *Record_Multi) XXX_Size() int { - return m.Size() -} -func (m *Record_Multi) XXX_DiscardUnknown() { - xxx_messageInfo_Record_Multi.DiscardUnknown(m) -} - -var xxx_messageInfo_Record_Multi proto.InternalMessageInfo - -// Offline item -type Record_Offline struct { -} - -func (m *Record_Offline) Reset() { *m = Record_Offline{} } -func (m *Record_Offline) String() string { return proto.CompactTextString(m) } -func (*Record_Offline) ProtoMessage() {} -func (*Record_Offline) Descriptor() ([]byte, []int) { - return fileDescriptor_36d640103edea005, []int{0, 3} -} -func (m *Record_Offline) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record_Offline) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record_Offline.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 *Record_Offline) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record_Offline.Merge(m, src) -} -func (m *Record_Offline) XXX_Size() int { - return m.Size() -} -func (m *Record_Offline) XXX_DiscardUnknown() { - xxx_messageInfo_Record_Offline.DiscardUnknown(m) -} - -var xxx_messageInfo_Record_Offline proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Record)(nil), "cosmos.crypto.keyring.v1.Record") - proto.RegisterType((*Record_Local)(nil), "cosmos.crypto.keyring.v1.Record.Local") - proto.RegisterType((*Record_Ledger)(nil), "cosmos.crypto.keyring.v1.Record.Ledger") - proto.RegisterType((*Record_Multi)(nil), "cosmos.crypto.keyring.v1.Record.Multi") - proto.RegisterType((*Record_Offline)(nil), "cosmos.crypto.keyring.v1.Record.Offline") -} - -func init() { - proto.RegisterFile("cosmos/crypto/keyring/v1/record.proto", fileDescriptor_36d640103edea005) -} - -var fileDescriptor_36d640103edea005 = []byte{ - // 411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xbd, 0xae, 0xd3, 0x30, - 0x1c, 0xc5, 0x1d, 0x6e, 0x3e, 0xb8, 0x66, 0xb3, 0xee, 0x10, 0x22, 0x64, 0x55, 0x48, 0x40, 0x25, - 0x54, 0x5b, 0x85, 0x0e, 0x4c, 0x95, 0x5a, 0x31, 0x14, 0x95, 0x8a, 0x2a, 0x23, 0x0b, 0xca, 0x87, - 0x9b, 0x44, 0x4d, 0xe2, 0xc8, 0x49, 0x2a, 0xe5, 0x2d, 0x18, 0x79, 0xa4, 0x8e, 0x1d, 0x19, 0xa1, - 0xd9, 0x78, 0x0a, 0x64, 0x3b, 0x1d, 0xa8, 0x04, 0x65, 0x8a, 0x23, 0xff, 0xce, 0xff, 0x9c, 0x63, - 0xfd, 0xe1, 0x8b, 0x88, 0xd7, 0x05, 0xaf, 0x69, 0x24, 0xba, 0xaa, 0xe1, 0x74, 0xcf, 0x3a, 0x91, - 0x95, 0x09, 0x3d, 0x4c, 0xa9, 0x60, 0x11, 0x17, 0x31, 0xa9, 0x04, 0x6f, 0x38, 0x72, 0x35, 0x46, - 0x34, 0x46, 0x06, 0x8c, 0x1c, 0xa6, 0xde, 0x43, 0xc2, 0x13, 0xae, 0x20, 0x2a, 0x4f, 0x9a, 0xf7, - 0x9e, 0x26, 0x9c, 0x27, 0x39, 0xa3, 0xea, 0x2f, 0x6c, 0x77, 0x34, 0x28, 0xbb, 0xe1, 0xea, 0xd9, - 0x9f, 0x8e, 0x69, 0x2c, 0xcd, 0xd2, 0xc1, 0xe8, 0xf9, 0xaf, 0x3b, 0x68, 0xfb, 0xca, 0x19, 0x21, - 0x68, 0x96, 0x41, 0xc1, 0x5c, 0x63, 0x64, 0x8c, 0xef, 0x7d, 0x75, 0x46, 0x13, 0xe8, 0x54, 0x6d, - 0xf8, 0x65, 0xcf, 0x3a, 0xf7, 0xd1, 0xc8, 0x18, 0x3f, 0x79, 0xf3, 0x40, 0xb4, 0x13, 0xb9, 0x38, - 0x91, 0x45, 0xd9, 0xf9, 0x76, 0xd5, 0x86, 0x6b, 0xd6, 0xa1, 0x39, 0xb4, 0x72, 0x1e, 0x05, 0xb9, - 0x7b, 0xa7, 0xe0, 0x97, 0xe4, 0x6f, 0x35, 0x88, 0xf6, 0x24, 0x1f, 0x25, 0xbd, 0x02, 0xbe, 0x96, - 0xa1, 0x05, 0xb4, 0x73, 0x16, 0x27, 0x4c, 0xb8, 0xa6, 0x1a, 0xf0, 0xea, 0xf6, 0x00, 0x85, 0xaf, - 0x80, 0x3f, 0x08, 0x65, 0x84, 0xa2, 0xcd, 0x9b, 0xcc, 0xb5, 0xfe, 0x33, 0xc2, 0x46, 0xd2, 0x32, - 0x82, 0x92, 0xa1, 0xf7, 0xd0, 0xe1, 0xbb, 0x5d, 0x9e, 0x95, 0xcc, 0xb5, 0xd5, 0x84, 0xf1, 0xcd, - 0x09, 0x9f, 0x34, 0xbf, 0x02, 0xfe, 0x45, 0xea, 0xbd, 0x83, 0x96, 0xaa, 0x86, 0x28, 0x7c, 0x5c, - 0x89, 0xec, 0xa0, 0x5e, 0xd0, 0xf8, 0xc7, 0x0b, 0x3a, 0x92, 0x5a, 0xb3, 0xce, 0x9b, 0x43, 0x5b, - 0x77, 0x42, 0x33, 0x68, 0x56, 0x41, 0x93, 0x0e, 0xb2, 0xd1, 0x55, 0x8c, 0x34, 0x96, 0x09, 0x96, - 0x1f, 0xb6, 0xb3, 0xd9, 0x36, 0x10, 0x41, 0x51, 0xfb, 0x8a, 0xf6, 0x1c, 0x68, 0xa9, 0x46, 0xde, - 0x3d, 0x74, 0x86, 0x60, 0x4b, 0x1b, 0x9a, 0x59, 0xc3, 0x8a, 0xe5, 0xe6, 0xf8, 0x13, 0x83, 0xe3, - 0x19, 0x1b, 0xa7, 0x33, 0x36, 0x7e, 0x9c, 0xb1, 0xf1, 0xb5, 0xc7, 0xe0, 0x5b, 0x8f, 0xc1, 0xa9, - 0xc7, 0xe0, 0x7b, 0x8f, 0xc1, 0xe7, 0xd7, 0x49, 0xd6, 0xa4, 0x6d, 0x48, 0x22, 0x5e, 0xd0, 0xcb, - 0xde, 0xa8, 0xcf, 0xa4, 0x8e, 0xf7, 0x57, 0x4b, 0x1b, 0xda, 0xaa, 0xc1, 0xdb, 0xdf, 0x01, 0x00, - 0x00, 0xff, 0xff, 0x47, 0x24, 0x2f, 0xa9, 0xd4, 0x02, 0x00, 0x00, -} - -func (m *Record) 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 *Record) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Item != nil { - { - size := m.Item.Size() - i -= size - if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintRecord(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Record_Local_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Local_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Local != nil { - { - size, err := m.Local.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *Record_Ledger_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Ledger_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Ledger != nil { - { - size, err := m.Ledger.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *Record_Multi_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Multi_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Multi != nil { - { - size, err := m.Multi.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *Record_Offline_) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Offline_) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Offline != nil { - { - size, err := m.Offline.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *Record_Local) 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 *Record_Local) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Local) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PrivKey != nil { - { - size, err := m.PrivKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Record_Ledger) 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 *Record_Ledger) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Ledger) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Path != nil { - { - size, err := m.Path.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintRecord(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Record_Multi) 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 *Record_Multi) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Multi) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *Record_Offline) 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 *Record_Offline) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record_Offline) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintRecord(dAtA []byte, offset int, v uint64) int { - offset -= sovRecord(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Record) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovRecord(uint64(l)) - } - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovRecord(uint64(l)) - } - if m.Item != nil { - n += m.Item.Size() - } - return n -} - -func (m *Record_Local_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Local != nil { - l = m.Local.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} -func (m *Record_Ledger_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Ledger != nil { - l = m.Ledger.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} -func (m *Record_Multi_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Multi != nil { - l = m.Multi.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} -func (m *Record_Offline_) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Offline != nil { - l = m.Offline.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} -func (m *Record_Local) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PrivKey != nil { - l = m.PrivKey.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} - -func (m *Record_Ledger) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Path != nil { - l = m.Path.Size() - n += 1 + l + sovRecord(uint64(l)) - } - return n -} - -func (m *Record_Multi) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *Record_Offline) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovRecord(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozRecord(x uint64) (n int) { - return sovRecord(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Record) 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 ErrIntOverflowRecord - } - 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: Record: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Record: 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 ErrIntOverflowRecord - } - 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 ErrInvalidLengthRecord - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - 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 PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &types.Any{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Record_Local{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Record_Local_{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ledger", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Record_Ledger{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Record_Ledger_{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Multi", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Record_Multi{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Record_Multi_{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Offline", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Record_Offline{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &Record_Offline_{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRecord(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRecord - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record_Local) 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 ErrIntOverflowRecord - } - 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: Local: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Local: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrivKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PrivKey == nil { - m.PrivKey = &types.Any{} - } - if err := m.PrivKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRecord(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRecord - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record_Ledger) 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 ErrIntOverflowRecord - } - 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: Ledger: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Ledger: 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 msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthRecord - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthRecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Path == nil { - m.Path = &hd.BIP44Params{} - } - if err := m.Path.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipRecord(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRecord - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record_Multi) 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 ErrIntOverflowRecord - } - 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: Multi: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Multi: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRecord(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRecord - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record_Offline) 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 ErrIntOverflowRecord - } - 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: Offline: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Offline: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipRecord(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthRecord - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipRecord(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, ErrIntOverflowRecord - } - 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, ErrIntOverflowRecord - } - 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, ErrIntOverflowRecord - } - 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, ErrInvalidLengthRecord - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRecord - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthRecord - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthRecord = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRecord = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRecord = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go deleted file mode 100644 index 1280647df3ec..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/keys/ed25519/keys.pb.go +++ /dev/null @@ -1,505 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/ed25519/keys.proto - -package ed25519 - -import ( - crypto_ed25519 "crypto/ed25519" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PubKey is an ed25519 public key for handling Tendermint keys in SDK. -// It's needed for Any serialization and SDK compatibility. -// It must not be used in a non Tendermint key context because it doesn't implement -// ADR-28. Nevertheless, you will like to use ed25519 in app user level -// then you must create a new proto message and follow ADR-28 for Address construction. -type PubKey struct { - Key crypto_ed25519.PublicKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PublicKey" json:"key,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_48fe3336771e732d, []int{0} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (m *PubKey) GetKey() crypto_ed25519.PublicKey { - if m != nil { - return m.Key - } - return nil -} - -// Deprecated: PrivKey defines a ed25519 private key. -// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. -type PrivKey struct { - Key crypto_ed25519.PrivateKey `protobuf:"bytes,1,opt,name=key,proto3,casttype=crypto/ed25519.PrivateKey" json:"key,omitempty"` -} - -func (m *PrivKey) Reset() { *m = PrivKey{} } -func (m *PrivKey) String() string { return proto.CompactTextString(m) } -func (*PrivKey) ProtoMessage() {} -func (*PrivKey) Descriptor() ([]byte, []int) { - return fileDescriptor_48fe3336771e732d, []int{1} -} -func (m *PrivKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKey.Merge(m, src) -} -func (m *PrivKey) XXX_Size() int { - return m.Size() -} -func (m *PrivKey) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivKey proto.InternalMessageInfo - -func (m *PrivKey) GetKey() crypto_ed25519.PrivateKey { - if m != nil { - return m.Key - } - return nil -} - -func init() { - proto.RegisterType((*PubKey)(nil), "cosmos.crypto.ed25519.PubKey") - proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.ed25519.PrivKey") -} - -func init() { proto.RegisterFile("cosmos/crypto/ed25519/keys.proto", fileDescriptor_48fe3336771e732d) } - -var fileDescriptor_48fe3336771e732d = []byte{ - // 279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x4f, 0x4d, 0x31, 0x32, 0x35, 0x35, - 0xb4, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xa8, - 0xd0, 0x83, 0xa8, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, - 0x10, 0x95, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0xca, - 0xe4, 0x62, 0x0b, 0x28, 0x4d, 0xf2, 0x4e, 0xad, 0x14, 0xd2, 0xe3, 0x62, 0xce, 0x4e, 0xad, 0x94, - 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x71, 0x92, 0xf9, 0x75, 0x4f, 0x5e, 0x02, 0xd5, 0x56, 0xbd, 0x80, - 0xd2, 0xa4, 0x9c, 0xcc, 0x64, 0xef, 0xd4, 0xca, 0x20, 0x90, 0x42, 0x2b, 0xfd, 0x19, 0x0b, 0xe4, - 0x19, 0xba, 0x9e, 0x6f, 0xd0, 0x92, 0x28, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, - 0xd1, 0x87, 0x98, 0xe5, 0x0a, 0xd1, 0x31, 0xe9, 0xf9, 0x06, 0x2d, 0xce, 0xec, 0xd4, 0xca, 0xf8, - 0xb4, 0xcc, 0xd4, 0x9c, 0x14, 0xa5, 0x0c, 0x2e, 0xf6, 0x80, 0xa2, 0xcc, 0x32, 0x90, 0x5d, 0xfa, - 0xc8, 0x76, 0xc9, 0xfe, 0xba, 0x27, 0x2f, 0x89, 0x6e, 0x57, 0x51, 0x66, 0x59, 0x62, 0x49, 0x2a, - 0xdc, 0x32, 0x1d, 0x90, 0x45, 0x92, 0xc8, 0x16, 0x41, 0x4c, 0xc2, 0x6a, 0x93, 0x93, 0xd7, 0x89, - 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, - 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, 0xa4, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xc2, 0x16, 0x4c, 0xe9, 0x16, 0xa7, 0x64, 0xc3, 0x82, 0x19, - 0x14, 0xbc, 0x30, 0x97, 0x24, 0xb1, 0x81, 0xc3, 0xc9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x8e, - 0xcd, 0xa4, 0x67, 0x8b, 0x01, 0x00, 0x00, -} - -func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func (m *PrivKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PubKey) 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 ErrIntOverflowKeys - } - 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrivKey) 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 ErrIntOverflowKeys - } - 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: PrivKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go deleted file mode 100644 index b181232634fd..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/keys/multisig/keys.pb.go +++ /dev/null @@ -1,362 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/multisig/keys.proto - -package multisig - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// LegacyAminoPubKey specifies a public key type -// which nests multiple public keys and a threshold, -// it uses legacy amino address rules. -type LegacyAminoPubKey struct { - Threshold uint32 `protobuf:"varint,1,opt,name=threshold,proto3" json:"threshold,omitempty"` - PubKeys []*types.Any `protobuf:"bytes,2,rep,name=public_keys,json=publicKeys,proto3" json:"public_keys,omitempty"` -} - -func (m *LegacyAminoPubKey) Reset() { *m = LegacyAminoPubKey{} } -func (m *LegacyAminoPubKey) String() string { return proto.CompactTextString(m) } -func (*LegacyAminoPubKey) ProtoMessage() {} -func (*LegacyAminoPubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_46b57537e097d47d, []int{0} -} -func (m *LegacyAminoPubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LegacyAminoPubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LegacyAminoPubKey.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 *LegacyAminoPubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_LegacyAminoPubKey.Merge(m, src) -} -func (m *LegacyAminoPubKey) XXX_Size() int { - return m.Size() -} -func (m *LegacyAminoPubKey) XXX_DiscardUnknown() { - xxx_messageInfo_LegacyAminoPubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_LegacyAminoPubKey proto.InternalMessageInfo - -func init() { - proto.RegisterType((*LegacyAminoPubKey)(nil), "cosmos.crypto.multisig.LegacyAminoPubKey") -} - -func init() { proto.RegisterFile("cosmos/crypto/multisig/keys.proto", fileDescriptor_46b57537e097d47d) } - -var fileDescriptor_46b57537e097d47d = []byte{ - // 317 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x2d, 0xcd, 0x29, 0xc9, 0x2c, - 0xce, 0x4c, 0xd7, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, - 0x28, 0xd1, 0x83, 0x28, 0xd1, 0x83, 0x29, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd1, - 0x07, 0xb1, 0x20, 0xaa, 0xa5, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, - 0xd2, 0x34, 0xfd, 0xc4, 0xbc, 0x4a, 0xa8, 0x94, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, - 0x84, 0x08, 0x29, 0x1d, 0x66, 0xe4, 0x12, 0xf4, 0x49, 0x4d, 0x4f, 0x4c, 0xae, 0x74, 0x04, 0x89, - 0x06, 0x94, 0x26, 0x79, 0xa7, 0x56, 0x0a, 0xc9, 0x70, 0x71, 0x96, 0x64, 0x14, 0xa5, 0x16, 0x67, - 0xe4, 0xe7, 0xa4, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x06, 0x21, 0x04, 0x84, 0xfc, 0xb8, 0xb8, - 0x0b, 0x4a, 0x93, 0x72, 0x32, 0x93, 0xe3, 0x41, 0x8e, 0x94, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, - 0x12, 0xd1, 0x83, 0xd8, 0xab, 0x07, 0xb3, 0x57, 0xcf, 0x31, 0xaf, 0xd2, 0x49, 0xfc, 0xd1, 0x3d, - 0x79, 0x76, 0x88, 0xa1, 0xc5, 0x8b, 0x9e, 0x6f, 0xd0, 0x62, 0x2f, 0x28, 0x4d, 0x02, 0x69, 0x0a, - 0xe2, 0x82, 0x98, 0x00, 0x12, 0xb7, 0x72, 0xe8, 0x58, 0x20, 0xcf, 0xd0, 0xf5, 0x7c, 0x83, 0x96, - 0x52, 0x49, 0x6a, 0x5e, 0x4a, 0x6a, 0x51, 0x6e, 0x66, 0x5e, 0x89, 0x3e, 0x44, 0x93, 0x2f, 0xd4, - 0xaf, 0x21, 0x30, 0xcb, 0x27, 0x3d, 0xdf, 0xa0, 0x25, 0x00, 0x77, 0x4a, 0x7c, 0x71, 0x49, 0x51, - 0x66, 0x5e, 0xba, 0x93, 0xf7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, - 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x19, - 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0x42, 0x1a, 0x4c, 0xe9, - 0x16, 0xa7, 0x64, 0xc3, 0x02, 0x1d, 0xe4, 0x22, 0x78, 0xc8, 0x27, 0xb1, 0x81, 0x7d, 0x60, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x78, 0xf0, 0xbc, 0x9a, 0x01, 0x00, 0x00, -} - -func (m *LegacyAminoPubKey) 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 *LegacyAminoPubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LegacyAminoPubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PubKeys) > 0 { - for iNdEx := len(m.PubKeys) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PubKeys[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintKeys(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Threshold != 0 { - i = encodeVarintKeys(dAtA, i, uint64(m.Threshold)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LegacyAminoPubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Threshold != 0 { - n += 1 + sovKeys(uint64(m.Threshold)) - } - if len(m.PubKeys) > 0 { - for _, e := range m.PubKeys { - l = e.Size() - n += 1 + l + sovKeys(uint64(l)) - } - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *LegacyAminoPubKey) 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 ErrIntOverflowKeys - } - 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: LegacyAminoPubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LegacyAminoPubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) - } - m.Threshold = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Threshold |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeys", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PubKeys = append(m.PubKeys, &types.Any{}) - if err := m.PubKeys[len(m.PubKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go deleted file mode 100644 index 24ab774e36d4..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1/keys.pb.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/secp256k1/keys.proto - -package secp256k1 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PubKey defines a secp256k1 public key -// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -type PubKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_e0835e68ebdcb224, []int{0} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (m *PubKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -// PrivKey defines a secp256k1 private key. -type PrivKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *PrivKey) Reset() { *m = PrivKey{} } -func (m *PrivKey) String() string { return proto.CompactTextString(m) } -func (*PrivKey) ProtoMessage() {} -func (*PrivKey) Descriptor() ([]byte, []int) { - return fileDescriptor_e0835e68ebdcb224, []int{1} -} -func (m *PrivKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKey.Merge(m, src) -} -func (m *PrivKey) XXX_Size() int { - return m.Size() -} -func (m *PrivKey) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivKey proto.InternalMessageInfo - -func (m *PrivKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func init() { - proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256k1.PubKey") - proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256k1.PrivKey") -} - -func init() { - proto.RegisterFile("cosmos/crypto/secp256k1/keys.proto", fileDescriptor_e0835e68ebdcb224) -} - -var fileDescriptor_e0835e68ebdcb224 = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32, - 0x35, 0xcb, 0x36, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, - 0x07, 0x93, 0x10, 0xb5, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, - 0x55, 0xf2, 0xe5, 0x62, 0x0b, 0x28, 0x4d, 0xf2, 0x4e, 0xad, 0x14, 0x12, 0xe0, 0x62, 0xce, 0x4e, - 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0x31, 0xad, 0x0c, 0x67, 0x2c, 0x90, 0x67, - 0xe8, 0x7a, 0xbe, 0x41, 0x4b, 0xaa, 0x24, 0x35, 0x2f, 0x25, 0xb5, 0x28, 0x37, 0x33, 0xaf, 0x44, - 0x1f, 0xa2, 0x3a, 0x18, 0x66, 0xd3, 0xa4, 0xe7, 0x1b, 0xb4, 0x38, 0xb3, 0x53, 0x2b, 0xe3, 0xd3, - 0x32, 0x53, 0x73, 0x52, 0x94, 0xbc, 0xb9, 0xd8, 0x03, 0x8a, 0x32, 0xcb, 0xb0, 0x9b, 0xa7, 0x07, - 0x32, 0x4b, 0x1a, 0xd9, 0x2c, 0x88, 0x52, 0x1c, 0x86, 0x39, 0xf9, 0x9c, 0x78, 0x24, 0xc7, 0x78, - 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, - 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x51, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, - 0xae, 0x3e, 0x2c, 0x98, 0xc0, 0x94, 0x6e, 0x71, 0x4a, 0x36, 0x2c, 0xc4, 0x40, 0xe1, 0x84, 0x08, - 0xb6, 0x24, 0x36, 0xb0, 0x87, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0x42, 0xbc, 0x00, - 0x58, 0x01, 0x00, 0x00, -} - -func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func (m *PrivKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PubKey) 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 ErrIntOverflowKeys - } - 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrivKey) 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 ErrIntOverflowKeys - } - 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: PrivKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go b/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go deleted file mode 100644 index 7bfb79ff77d4..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1/keys.pb.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/secp256r1/keys.proto - -package secp256r1 - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PubKey defines a secp256r1 ECDSA public key. -type PubKey struct { - // Point on secp256r1 curve in a compressed representation as specified in section - // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - Key *ecdsaPK `protobuf:"bytes,1,opt,name=key,proto3,customtype=ecdsaPK" json:"key,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_b90c18415095c0c3, []int{0} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.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 *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (*PubKey) XXX_MessageName() string { - return "cosmos.crypto.secp256r1.PubKey" -} - -// PrivKey defines a secp256r1 ECDSA private key. -type PrivKey struct { - // secret number serialized using big-endian encoding - Secret *ecdsaSK `protobuf:"bytes,1,opt,name=secret,proto3,customtype=ecdsaSK" json:"secret,omitempty"` -} - -func (m *PrivKey) Reset() { *m = PrivKey{} } -func (*PrivKey) ProtoMessage() {} -func (*PrivKey) Descriptor() ([]byte, []int) { - return fileDescriptor_b90c18415095c0c3, []int{1} -} -func (m *PrivKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrivKey.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 *PrivKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKey.Merge(m, src) -} -func (m *PrivKey) XXX_Size() int { - return m.Size() -} -func (m *PrivKey) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivKey proto.InternalMessageInfo - -func (*PrivKey) XXX_MessageName() string { - return "cosmos.crypto.secp256r1.PrivKey" -} -func init() { - proto.RegisterType((*PubKey)(nil), "cosmos.crypto.secp256r1.PubKey") - proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.secp256r1.PrivKey") -} - -func init() { - proto.RegisterFile("cosmos/crypto/secp256r1/keys.proto", fileDescriptor_b90c18415095c0c3) -} - -var fileDescriptor_b90c18415095c0c3 = []byte{ - // 221 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x2f, 0x4e, 0x4d, 0x2e, 0x30, 0x32, - 0x35, 0x2b, 0x32, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x87, 0xa8, 0xd1, 0x83, 0xa8, 0xd1, 0x83, 0xab, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, - 0xd1, 0x07, 0xb1, 0x20, 0xca, 0x95, 0xd4, 0xb9, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, - 0x64, 0xb9, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x9c, 0xb8, 0x6f, 0xdd, - 0x93, 0x67, 0x4f, 0x4d, 0x4e, 0x29, 0x4e, 0x0c, 0xf0, 0x0e, 0x02, 0x89, 0x2b, 0xe9, 0x71, 0xb1, - 0x07, 0x14, 0x65, 0x96, 0x81, 0x54, 0x2a, 0x73, 0xb1, 0x15, 0xa7, 0x26, 0x17, 0xa5, 0x96, 0x60, - 0x28, 0x0e, 0xf6, 0x0e, 0x82, 0x4a, 0x39, 0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, - 0xc3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, - 0x1c, 0xc3, 0x89, 0xc7, 0x72, 0x8c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, - 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0xf3, 0x1c, 0x98, 0xd2, - 0x2d, 0x4e, 0xc9, 0x86, 0xf9, 0x13, 0xe4, 0x3b, 0x84, 0x67, 0x93, 0xd8, 0xc0, 0x2e, 0x37, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x65, 0x08, 0x5c, 0x0e, 0x01, 0x00, 0x00, -} - -func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Key != nil { - { - size := m.Key.Size() - i -= size - if _, err := m.Key.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintKeys(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Secret != nil { - { - size := m.Secret.Size() - i -= size - if _, err := m.Secret.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintKeys(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Key != nil { - l = m.Key.Size() - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func (m *PrivKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secret != nil { - l = m.Secret.Size() - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PubKey) 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 ErrIntOverflowKeys - } - 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v ecdsaPK - m.Key = &v - if err := m.Key.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrivKey) 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 ErrIntOverflowKeys - } - 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: PrivKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secret", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var v ecdsaSK - m.Secret = &v - if err := m.Secret.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go b/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go deleted file mode 100644 index a5b750a17fbc..000000000000 --- a/github.com/cosmos/cosmos-sdk/crypto/types/multisig.pb.go +++ /dev/null @@ -1,550 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/multisig/v1beta1/multisig.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. -// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers -// signed and with which modes. -type MultiSignature struct { - Signatures [][]byte `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *MultiSignature) Reset() { *m = MultiSignature{} } -func (m *MultiSignature) String() string { return proto.CompactTextString(m) } -func (*MultiSignature) ProtoMessage() {} -func (*MultiSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_1177bdf7025769be, []int{0} -} -func (m *MultiSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MultiSignature.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 *MultiSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_MultiSignature.Merge(m, src) -} -func (m *MultiSignature) XXX_Size() int { - return m.Size() -} -func (m *MultiSignature) XXX_DiscardUnknown() { - xxx_messageInfo_MultiSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_MultiSignature proto.InternalMessageInfo - -func (m *MultiSignature) GetSignatures() [][]byte { - if m != nil { - return m.Signatures - } - return nil -} - -// CompactBitArray is an implementation of a space efficient bit array. -// This is used to ensure that the encoded data takes up a minimal amount of -// space after proto encoding. -// This is not thread safe, and is not intended for concurrent usage. -type CompactBitArray struct { - ExtraBitsStored uint32 `protobuf:"varint,1,opt,name=extra_bits_stored,json=extraBitsStored,proto3" json:"extra_bits_stored,omitempty"` - Elems []byte `protobuf:"bytes,2,opt,name=elems,proto3" json:"elems,omitempty"` -} - -func (m *CompactBitArray) Reset() { *m = CompactBitArray{} } -func (*CompactBitArray) ProtoMessage() {} -func (*CompactBitArray) Descriptor() ([]byte, []int) { - return fileDescriptor_1177bdf7025769be, []int{1} -} -func (m *CompactBitArray) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CompactBitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CompactBitArray.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 *CompactBitArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_CompactBitArray.Merge(m, src) -} -func (m *CompactBitArray) XXX_Size() int { - return m.Size() -} -func (m *CompactBitArray) XXX_DiscardUnknown() { - xxx_messageInfo_CompactBitArray.DiscardUnknown(m) -} - -var xxx_messageInfo_CompactBitArray proto.InternalMessageInfo - -func (m *CompactBitArray) GetExtraBitsStored() uint32 { - if m != nil { - return m.ExtraBitsStored - } - return 0 -} - -func (m *CompactBitArray) GetElems() []byte { - if m != nil { - return m.Elems - } - return nil -} - -func init() { - proto.RegisterType((*MultiSignature)(nil), "cosmos.crypto.multisig.v1beta1.MultiSignature") - proto.RegisterType((*CompactBitArray)(nil), "cosmos.crypto.multisig.v1beta1.CompactBitArray") -} - -func init() { - proto.RegisterFile("cosmos/crypto/multisig/v1beta1/multisig.proto", fileDescriptor_1177bdf7025769be) -} - -var fileDescriptor_1177bdf7025769be = []byte{ - // 269 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0x31, 0x4f, 0x83, 0x50, - 0x14, 0x85, 0x79, 0x5a, 0x1d, 0x5e, 0xaa, 0x8d, 0xa4, 0x03, 0x71, 0x78, 0x25, 0x9d, 0xd0, 0xa4, - 0x90, 0xc6, 0xc4, 0xa1, 0x9b, 0x74, 0x76, 0xa1, 0x93, 0x2e, 0x0d, 0xd0, 0x17, 0x7c, 0xb1, 0x78, - 0xc9, 0xbb, 0x17, 0x23, 0xff, 0xc2, 0xd1, 0x51, 0xff, 0x8d, 0x23, 0xa3, 0xa3, 0x81, 0x3f, 0x62, - 0xfa, 0x90, 0xa6, 0xd3, 0xbd, 0xe7, 0x9c, 0xef, 0x0e, 0xf7, 0xf0, 0x59, 0x0a, 0x98, 0x03, 0x06, - 0xa9, 0xae, 0x0a, 0x82, 0x20, 0x2f, 0xb7, 0xa4, 0x50, 0x65, 0xc1, 0xeb, 0x3c, 0x91, 0x14, 0xcf, - 0xf7, 0x86, 0x5f, 0x68, 0x20, 0xb0, 0x45, 0x87, 0xfb, 0x1d, 0xee, 0xef, 0xd3, 0x7f, 0xfc, 0x72, - 0x9c, 0x41, 0x06, 0x06, 0x0d, 0x76, 0x5b, 0x77, 0x35, 0xbd, 0xe5, 0xe7, 0xf7, 0x3b, 0x72, 0xa5, - 0xb2, 0x97, 0x98, 0x4a, 0x2d, 0x6d, 0xc1, 0x39, 0xf6, 0x02, 0x1d, 0xe6, 0x1e, 0x7b, 0xc3, 0xe8, - 0xc0, 0x59, 0x0c, 0xea, 0xaf, 0x09, 0x9b, 0x3e, 0xf0, 0xd1, 0x12, 0xf2, 0x22, 0x4e, 0x29, 0x54, - 0x74, 0xa7, 0x75, 0x5c, 0xd9, 0xd7, 0xfc, 0x42, 0xbe, 0x91, 0x8e, 0xd7, 0x89, 0x22, 0x5c, 0x23, - 0x81, 0x96, 0x1b, 0x87, 0xb9, 0xcc, 0x3b, 0x8b, 0x46, 0x26, 0x08, 0x15, 0xe1, 0xca, 0xd8, 0xf6, - 0x98, 0x9f, 0xc8, 0xad, 0xcc, 0xd1, 0x39, 0x72, 0x99, 0x37, 0x8c, 0x3a, 0xb1, 0x18, 0x7c, 0x7c, - 0x4e, 0xac, 0x70, 0xf9, 0xdd, 0x08, 0x56, 0x37, 0x82, 0xfd, 0x36, 0x82, 0xbd, 0xb7, 0xc2, 0xaa, - 0x5b, 0x61, 0xfd, 0xb4, 0xc2, 0x7a, 0xbc, 0xca, 0x14, 0x3d, 0x95, 0x89, 0x9f, 0x42, 0x1e, 0xf4, - 0xe5, 0x98, 0x31, 0xc3, 0xcd, 0x73, 0xdf, 0x13, 0x55, 0x85, 0xc4, 0xe4, 0xd4, 0xbc, 0x77, 0xf3, - 0x17, 0x00, 0x00, 0xff, 0xff, 0xba, 0x52, 0xb5, 0x1f, 0x45, 0x01, 0x00, 0x00, -} - -func (m *MultiSignature) 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 *MultiSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Signatures[iNdEx]) - copy(dAtA[i:], m.Signatures[iNdEx]) - i = encodeVarintMultisig(dAtA, i, uint64(len(m.Signatures[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *CompactBitArray) 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 *CompactBitArray) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CompactBitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Elems) > 0 { - i -= len(m.Elems) - copy(dAtA[i:], m.Elems) - i = encodeVarintMultisig(dAtA, i, uint64(len(m.Elems))) - i-- - dAtA[i] = 0x12 - } - if m.ExtraBitsStored != 0 { - i = encodeVarintMultisig(dAtA, i, uint64(m.ExtraBitsStored)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintMultisig(dAtA []byte, offset int, v uint64) int { - offset -= sovMultisig(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MultiSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Signatures) > 0 { - for _, b := range m.Signatures { - l = len(b) - n += 1 + l + sovMultisig(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *CompactBitArray) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExtraBitsStored != 0 { - n += 1 + sovMultisig(uint64(m.ExtraBitsStored)) - } - l = len(m.Elems) - if l > 0 { - n += 1 + l + sovMultisig(uint64(l)) - } - return n -} - -func sovMultisig(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMultisig(x uint64) (n int) { - return sovMultisig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MultiSignature) 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 ErrIntOverflowMultisig - } - 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: MultiSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMultisig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMultisig - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMultisig - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, make([]byte, postIndex-iNdEx)) - copy(m.Signatures[len(m.Signatures)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMultisig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMultisig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CompactBitArray) 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 ErrIntOverflowMultisig - } - 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: CompactBitArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CompactBitArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtraBitsStored", wireType) - } - m.ExtraBitsStored = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMultisig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExtraBitsStored |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMultisig - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMultisig - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMultisig - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Elems = append(m.Elems[:0], dAtA[iNdEx:postIndex]...) - if m.Elems == nil { - m.Elems = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMultisig(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMultisig - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMultisig(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, ErrIntOverflowMultisig - } - 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, ErrIntOverflowMultisig - } - 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, ErrIntOverflowMultisig - } - 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, ErrInvalidLengthMultisig - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMultisig - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMultisig - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMultisig = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMultisig = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMultisig = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go deleted file mode 100644 index 360e4440e8f6..000000000000 --- a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.go +++ /dev/null @@ -1,5613 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/reflection/v2alpha1/reflection.proto - -package v2alpha1 - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// AppDescriptor describes a cosmos-sdk based application -type AppDescriptor struct { - // AuthnDescriptor provides information on how to authenticate transactions on the application - // NOTE: experimental and subject to change in future releases. - Authn *AuthnDescriptor `protobuf:"bytes,1,opt,name=authn,proto3" json:"authn,omitempty"` - // chain provides the chain descriptor - Chain *ChainDescriptor `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` - // codec provides metadata information regarding codec related types - Codec *CodecDescriptor `protobuf:"bytes,3,opt,name=codec,proto3" json:"codec,omitempty"` - // configuration provides metadata information regarding the sdk.Config type - Configuration *ConfigurationDescriptor `protobuf:"bytes,4,opt,name=configuration,proto3" json:"configuration,omitempty"` - // query_services provides metadata information regarding the available queriable endpoints - QueryServices *QueryServicesDescriptor `protobuf:"bytes,5,opt,name=query_services,json=queryServices,proto3" json:"query_services,omitempty"` - // tx provides metadata information regarding how to send transactions to the given application - Tx *TxDescriptor `protobuf:"bytes,6,opt,name=tx,proto3" json:"tx,omitempty"` -} - -func (m *AppDescriptor) Reset() { *m = AppDescriptor{} } -func (m *AppDescriptor) String() string { return proto.CompactTextString(m) } -func (*AppDescriptor) ProtoMessage() {} -func (*AppDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{0} -} -func (m *AppDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AppDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AppDescriptor.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 *AppDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_AppDescriptor.Merge(m, src) -} -func (m *AppDescriptor) XXX_Size() int { - return m.Size() -} -func (m *AppDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_AppDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_AppDescriptor proto.InternalMessageInfo - -func (m *AppDescriptor) GetAuthn() *AuthnDescriptor { - if m != nil { - return m.Authn - } - return nil -} - -func (m *AppDescriptor) GetChain() *ChainDescriptor { - if m != nil { - return m.Chain - } - return nil -} - -func (m *AppDescriptor) GetCodec() *CodecDescriptor { - if m != nil { - return m.Codec - } - return nil -} - -func (m *AppDescriptor) GetConfiguration() *ConfigurationDescriptor { - if m != nil { - return m.Configuration - } - return nil -} - -func (m *AppDescriptor) GetQueryServices() *QueryServicesDescriptor { - if m != nil { - return m.QueryServices - } - return nil -} - -func (m *AppDescriptor) GetTx() *TxDescriptor { - if m != nil { - return m.Tx - } - return nil -} - -// TxDescriptor describes the accepted transaction type -type TxDescriptor struct { - // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - // it is not meant to support polymorphism of transaction types, it is supposed to be used by - // reflection clients to understand if they can handle a specific transaction type in an application. - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` - // msgs lists the accepted application messages (sdk.Msg) - Msgs []*MsgDescriptor `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` -} - -func (m *TxDescriptor) Reset() { *m = TxDescriptor{} } -func (m *TxDescriptor) String() string { return proto.CompactTextString(m) } -func (*TxDescriptor) ProtoMessage() {} -func (*TxDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{1} -} -func (m *TxDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxDescriptor.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 *TxDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxDescriptor.Merge(m, src) -} -func (m *TxDescriptor) XXX_Size() int { - return m.Size() -} -func (m *TxDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_TxDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_TxDescriptor proto.InternalMessageInfo - -func (m *TxDescriptor) GetFullname() string { - if m != nil { - return m.Fullname - } - return "" -} - -func (m *TxDescriptor) GetMsgs() []*MsgDescriptor { - if m != nil { - return m.Msgs - } - return nil -} - -// AuthnDescriptor provides information on how to sign transactions without relying -// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures -type AuthnDescriptor struct { - // sign_modes defines the supported signature algorithm - SignModes []*SigningModeDescriptor `protobuf:"bytes,1,rep,name=sign_modes,json=signModes,proto3" json:"sign_modes,omitempty"` -} - -func (m *AuthnDescriptor) Reset() { *m = AuthnDescriptor{} } -func (m *AuthnDescriptor) String() string { return proto.CompactTextString(m) } -func (*AuthnDescriptor) ProtoMessage() {} -func (*AuthnDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{2} -} -func (m *AuthnDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AuthnDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthnDescriptor.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 *AuthnDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthnDescriptor.Merge(m, src) -} -func (m *AuthnDescriptor) XXX_Size() int { - return m.Size() -} -func (m *AuthnDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_AuthnDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthnDescriptor proto.InternalMessageInfo - -func (m *AuthnDescriptor) GetSignModes() []*SigningModeDescriptor { - if m != nil { - return m.SignModes - } - return nil -} - -// SigningModeDescriptor provides information on a signing flow of the application -// NOTE(fdymylja): here we could go as far as providing an entire flow on how -// to sign a message given a SigningModeDescriptor, but it's better to think about -// this another time -type SigningModeDescriptor struct { - // name defines the unique name of the signing mode - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // number is the unique int32 identifier for the sign_mode enum - Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` - // authn_info_provider_method_fullname defines the fullname of the method to call to get - // the metadata required to authenticate using the provided sign_modes - AuthnInfoProviderMethodFullname string `protobuf:"bytes,3,opt,name=authn_info_provider_method_fullname,json=authnInfoProviderMethodFullname,proto3" json:"authn_info_provider_method_fullname,omitempty"` -} - -func (m *SigningModeDescriptor) Reset() { *m = SigningModeDescriptor{} } -func (m *SigningModeDescriptor) String() string { return proto.CompactTextString(m) } -func (*SigningModeDescriptor) ProtoMessage() {} -func (*SigningModeDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{3} -} -func (m *SigningModeDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SigningModeDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SigningModeDescriptor.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 *SigningModeDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_SigningModeDescriptor.Merge(m, src) -} -func (m *SigningModeDescriptor) XXX_Size() int { - return m.Size() -} -func (m *SigningModeDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_SigningModeDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_SigningModeDescriptor proto.InternalMessageInfo - -func (m *SigningModeDescriptor) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *SigningModeDescriptor) GetNumber() int32 { - if m != nil { - return m.Number - } - return 0 -} - -func (m *SigningModeDescriptor) GetAuthnInfoProviderMethodFullname() string { - if m != nil { - return m.AuthnInfoProviderMethodFullname - } - return "" -} - -// ChainDescriptor describes chain information of the application -type ChainDescriptor struct { - // id is the chain id - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *ChainDescriptor) Reset() { *m = ChainDescriptor{} } -func (m *ChainDescriptor) String() string { return proto.CompactTextString(m) } -func (*ChainDescriptor) ProtoMessage() {} -func (*ChainDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{4} -} -func (m *ChainDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ChainDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChainDescriptor.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 *ChainDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChainDescriptor.Merge(m, src) -} -func (m *ChainDescriptor) XXX_Size() int { - return m.Size() -} -func (m *ChainDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_ChainDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_ChainDescriptor proto.InternalMessageInfo - -func (m *ChainDescriptor) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -// CodecDescriptor describes the registered interfaces and provides metadata information on the types -type CodecDescriptor struct { - // interfaces is a list of the registerted interfaces descriptors - Interfaces []*InterfaceDescriptor `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` -} - -func (m *CodecDescriptor) Reset() { *m = CodecDescriptor{} } -func (m *CodecDescriptor) String() string { return proto.CompactTextString(m) } -func (*CodecDescriptor) ProtoMessage() {} -func (*CodecDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{5} -} -func (m *CodecDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CodecDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CodecDescriptor.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 *CodecDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_CodecDescriptor.Merge(m, src) -} -func (m *CodecDescriptor) XXX_Size() int { - return m.Size() -} -func (m *CodecDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_CodecDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_CodecDescriptor proto.InternalMessageInfo - -func (m *CodecDescriptor) GetInterfaces() []*InterfaceDescriptor { - if m != nil { - return m.Interfaces - } - return nil -} - -// InterfaceDescriptor describes the implementation of an interface -type InterfaceDescriptor struct { - // fullname is the name of the interface - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` - // interface_accepting_messages contains information regarding the proto messages which contain the interface as - // google.protobuf.Any field - InterfaceAcceptingMessages []*InterfaceAcceptingMessageDescriptor `protobuf:"bytes,2,rep,name=interface_accepting_messages,json=interfaceAcceptingMessages,proto3" json:"interface_accepting_messages,omitempty"` - // interface_implementers is a list of the descriptors of the interface implementers - InterfaceImplementers []*InterfaceImplementerDescriptor `protobuf:"bytes,3,rep,name=interface_implementers,json=interfaceImplementers,proto3" json:"interface_implementers,omitempty"` -} - -func (m *InterfaceDescriptor) Reset() { *m = InterfaceDescriptor{} } -func (m *InterfaceDescriptor) String() string { return proto.CompactTextString(m) } -func (*InterfaceDescriptor) ProtoMessage() {} -func (*InterfaceDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{6} -} -func (m *InterfaceDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InterfaceDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InterfaceDescriptor.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 *InterfaceDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceDescriptor.Merge(m, src) -} -func (m *InterfaceDescriptor) XXX_Size() int { - return m.Size() -} -func (m *InterfaceDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_InterfaceDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_InterfaceDescriptor proto.InternalMessageInfo - -func (m *InterfaceDescriptor) GetFullname() string { - if m != nil { - return m.Fullname - } - return "" -} - -func (m *InterfaceDescriptor) GetInterfaceAcceptingMessages() []*InterfaceAcceptingMessageDescriptor { - if m != nil { - return m.InterfaceAcceptingMessages - } - return nil -} - -func (m *InterfaceDescriptor) GetInterfaceImplementers() []*InterfaceImplementerDescriptor { - if m != nil { - return m.InterfaceImplementers - } - return nil -} - -// InterfaceImplementerDescriptor describes an interface implementer -type InterfaceImplementerDescriptor struct { - // fullname is the protobuf queryable name of the interface implementer - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` - // type_url defines the type URL used when marshalling the type as any - // this is required so we can provide type safe google.protobuf.Any marshalling and - // unmarshalling, making sure that we don't accept just 'any' type - // in our interface fields - TypeUrl string `protobuf:"bytes,2,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` -} - -func (m *InterfaceImplementerDescriptor) Reset() { *m = InterfaceImplementerDescriptor{} } -func (m *InterfaceImplementerDescriptor) String() string { return proto.CompactTextString(m) } -func (*InterfaceImplementerDescriptor) ProtoMessage() {} -func (*InterfaceImplementerDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{7} -} -func (m *InterfaceImplementerDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InterfaceImplementerDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InterfaceImplementerDescriptor.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 *InterfaceImplementerDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceImplementerDescriptor.Merge(m, src) -} -func (m *InterfaceImplementerDescriptor) XXX_Size() int { - return m.Size() -} -func (m *InterfaceImplementerDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_InterfaceImplementerDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_InterfaceImplementerDescriptor proto.InternalMessageInfo - -func (m *InterfaceImplementerDescriptor) GetFullname() string { - if m != nil { - return m.Fullname - } - return "" -} - -func (m *InterfaceImplementerDescriptor) GetTypeUrl() string { - if m != nil { - return m.TypeUrl - } - return "" -} - -// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains -// an interface represented as a google.protobuf.Any -type InterfaceAcceptingMessageDescriptor struct { - // fullname is the protobuf fullname of the type containing the interface - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` - // field_descriptor_names is a list of the protobuf name (not fullname) of the field - // which contains the interface as google.protobuf.Any (the interface is the same, but - // it can be in multiple fields of the same proto message) - FieldDescriptorNames []string `protobuf:"bytes,2,rep,name=field_descriptor_names,json=fieldDescriptorNames,proto3" json:"field_descriptor_names,omitempty"` -} - -func (m *InterfaceAcceptingMessageDescriptor) Reset() { *m = InterfaceAcceptingMessageDescriptor{} } -func (m *InterfaceAcceptingMessageDescriptor) String() string { return proto.CompactTextString(m) } -func (*InterfaceAcceptingMessageDescriptor) ProtoMessage() {} -func (*InterfaceAcceptingMessageDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{8} -} -func (m *InterfaceAcceptingMessageDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InterfaceAcceptingMessageDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InterfaceAcceptingMessageDescriptor.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 *InterfaceAcceptingMessageDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_InterfaceAcceptingMessageDescriptor.Merge(m, src) -} -func (m *InterfaceAcceptingMessageDescriptor) XXX_Size() int { - return m.Size() -} -func (m *InterfaceAcceptingMessageDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_InterfaceAcceptingMessageDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_InterfaceAcceptingMessageDescriptor proto.InternalMessageInfo - -func (m *InterfaceAcceptingMessageDescriptor) GetFullname() string { - if m != nil { - return m.Fullname - } - return "" -} - -func (m *InterfaceAcceptingMessageDescriptor) GetFieldDescriptorNames() []string { - if m != nil { - return m.FieldDescriptorNames - } - return nil -} - -// ConfigurationDescriptor contains metadata information on the sdk.Config -type ConfigurationDescriptor struct { - // bech32_account_address_prefix is the account address prefix - Bech32AccountAddressPrefix string `protobuf:"bytes,1,opt,name=bech32_account_address_prefix,json=bech32AccountAddressPrefix,proto3" json:"bech32_account_address_prefix,omitempty"` -} - -func (m *ConfigurationDescriptor) Reset() { *m = ConfigurationDescriptor{} } -func (m *ConfigurationDescriptor) String() string { return proto.CompactTextString(m) } -func (*ConfigurationDescriptor) ProtoMessage() {} -func (*ConfigurationDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{9} -} -func (m *ConfigurationDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ConfigurationDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConfigurationDescriptor.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 *ConfigurationDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConfigurationDescriptor.Merge(m, src) -} -func (m *ConfigurationDescriptor) XXX_Size() int { - return m.Size() -} -func (m *ConfigurationDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_ConfigurationDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_ConfigurationDescriptor proto.InternalMessageInfo - -func (m *ConfigurationDescriptor) GetBech32AccountAddressPrefix() string { - if m != nil { - return m.Bech32AccountAddressPrefix - } - return "" -} - -// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction -type MsgDescriptor struct { - // msg_type_url contains the TypeURL of a sdk.Msg. - MsgTypeUrl string `protobuf:"bytes,1,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` -} - -func (m *MsgDescriptor) Reset() { *m = MsgDescriptor{} } -func (m *MsgDescriptor) String() string { return proto.CompactTextString(m) } -func (*MsgDescriptor) ProtoMessage() {} -func (*MsgDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{10} -} -func (m *MsgDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDescriptor.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 *MsgDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDescriptor.Merge(m, src) -} -func (m *MsgDescriptor) XXX_Size() int { - return m.Size() -} -func (m *MsgDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDescriptor proto.InternalMessageInfo - -func (m *MsgDescriptor) GetMsgTypeUrl() string { - if m != nil { - return m.MsgTypeUrl - } - return "" -} - -// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC -type GetAuthnDescriptorRequest struct { -} - -func (m *GetAuthnDescriptorRequest) Reset() { *m = GetAuthnDescriptorRequest{} } -func (m *GetAuthnDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetAuthnDescriptorRequest) ProtoMessage() {} -func (*GetAuthnDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{11} -} -func (m *GetAuthnDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetAuthnDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetAuthnDescriptorRequest.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 *GetAuthnDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAuthnDescriptorRequest.Merge(m, src) -} -func (m *GetAuthnDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetAuthnDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetAuthnDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAuthnDescriptorRequest proto.InternalMessageInfo - -// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC -type GetAuthnDescriptorResponse struct { - // authn describes how to authenticate to the application when sending transactions - Authn *AuthnDescriptor `protobuf:"bytes,1,opt,name=authn,proto3" json:"authn,omitempty"` -} - -func (m *GetAuthnDescriptorResponse) Reset() { *m = GetAuthnDescriptorResponse{} } -func (m *GetAuthnDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetAuthnDescriptorResponse) ProtoMessage() {} -func (*GetAuthnDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{12} -} -func (m *GetAuthnDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetAuthnDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetAuthnDescriptorResponse.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 *GetAuthnDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetAuthnDescriptorResponse.Merge(m, src) -} -func (m *GetAuthnDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetAuthnDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetAuthnDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetAuthnDescriptorResponse proto.InternalMessageInfo - -func (m *GetAuthnDescriptorResponse) GetAuthn() *AuthnDescriptor { - if m != nil { - return m.Authn - } - return nil -} - -// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC -type GetChainDescriptorRequest struct { -} - -func (m *GetChainDescriptorRequest) Reset() { *m = GetChainDescriptorRequest{} } -func (m *GetChainDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetChainDescriptorRequest) ProtoMessage() {} -func (*GetChainDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{13} -} -func (m *GetChainDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetChainDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetChainDescriptorRequest.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 *GetChainDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetChainDescriptorRequest.Merge(m, src) -} -func (m *GetChainDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetChainDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetChainDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetChainDescriptorRequest proto.InternalMessageInfo - -// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC -type GetChainDescriptorResponse struct { - // chain describes application chain information - Chain *ChainDescriptor `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` -} - -func (m *GetChainDescriptorResponse) Reset() { *m = GetChainDescriptorResponse{} } -func (m *GetChainDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetChainDescriptorResponse) ProtoMessage() {} -func (*GetChainDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{14} -} -func (m *GetChainDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetChainDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetChainDescriptorResponse.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 *GetChainDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetChainDescriptorResponse.Merge(m, src) -} -func (m *GetChainDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetChainDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetChainDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetChainDescriptorResponse proto.InternalMessageInfo - -func (m *GetChainDescriptorResponse) GetChain() *ChainDescriptor { - if m != nil { - return m.Chain - } - return nil -} - -// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC -type GetCodecDescriptorRequest struct { -} - -func (m *GetCodecDescriptorRequest) Reset() { *m = GetCodecDescriptorRequest{} } -func (m *GetCodecDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetCodecDescriptorRequest) ProtoMessage() {} -func (*GetCodecDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{15} -} -func (m *GetCodecDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetCodecDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetCodecDescriptorRequest.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 *GetCodecDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCodecDescriptorRequest.Merge(m, src) -} -func (m *GetCodecDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetCodecDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetCodecDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCodecDescriptorRequest proto.InternalMessageInfo - -// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC -type GetCodecDescriptorResponse struct { - // codec describes the application codec such as registered interfaces and implementations - Codec *CodecDescriptor `protobuf:"bytes,1,opt,name=codec,proto3" json:"codec,omitempty"` -} - -func (m *GetCodecDescriptorResponse) Reset() { *m = GetCodecDescriptorResponse{} } -func (m *GetCodecDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetCodecDescriptorResponse) ProtoMessage() {} -func (*GetCodecDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{16} -} -func (m *GetCodecDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetCodecDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetCodecDescriptorResponse.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 *GetCodecDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetCodecDescriptorResponse.Merge(m, src) -} -func (m *GetCodecDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetCodecDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetCodecDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetCodecDescriptorResponse proto.InternalMessageInfo - -func (m *GetCodecDescriptorResponse) GetCodec() *CodecDescriptor { - if m != nil { - return m.Codec - } - return nil -} - -// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC -type GetConfigurationDescriptorRequest struct { -} - -func (m *GetConfigurationDescriptorRequest) Reset() { *m = GetConfigurationDescriptorRequest{} } -func (m *GetConfigurationDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetConfigurationDescriptorRequest) ProtoMessage() {} -func (*GetConfigurationDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{17} -} -func (m *GetConfigurationDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetConfigurationDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetConfigurationDescriptorRequest.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 *GetConfigurationDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetConfigurationDescriptorRequest.Merge(m, src) -} -func (m *GetConfigurationDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetConfigurationDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetConfigurationDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetConfigurationDescriptorRequest proto.InternalMessageInfo - -// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC -type GetConfigurationDescriptorResponse struct { - // config describes the application's sdk.Config - Config *ConfigurationDescriptor `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` -} - -func (m *GetConfigurationDescriptorResponse) Reset() { *m = GetConfigurationDescriptorResponse{} } -func (m *GetConfigurationDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetConfigurationDescriptorResponse) ProtoMessage() {} -func (*GetConfigurationDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{18} -} -func (m *GetConfigurationDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetConfigurationDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetConfigurationDescriptorResponse.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 *GetConfigurationDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetConfigurationDescriptorResponse.Merge(m, src) -} -func (m *GetConfigurationDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetConfigurationDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetConfigurationDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetConfigurationDescriptorResponse proto.InternalMessageInfo - -func (m *GetConfigurationDescriptorResponse) GetConfig() *ConfigurationDescriptor { - if m != nil { - return m.Config - } - return nil -} - -// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC -type GetQueryServicesDescriptorRequest struct { -} - -func (m *GetQueryServicesDescriptorRequest) Reset() { *m = GetQueryServicesDescriptorRequest{} } -func (m *GetQueryServicesDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetQueryServicesDescriptorRequest) ProtoMessage() {} -func (*GetQueryServicesDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{19} -} -func (m *GetQueryServicesDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetQueryServicesDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetQueryServicesDescriptorRequest.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 *GetQueryServicesDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetQueryServicesDescriptorRequest.Merge(m, src) -} -func (m *GetQueryServicesDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetQueryServicesDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetQueryServicesDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetQueryServicesDescriptorRequest proto.InternalMessageInfo - -// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC -type GetQueryServicesDescriptorResponse struct { - // queries provides information on the available queryable services - Queries *QueryServicesDescriptor `protobuf:"bytes,1,opt,name=queries,proto3" json:"queries,omitempty"` -} - -func (m *GetQueryServicesDescriptorResponse) Reset() { *m = GetQueryServicesDescriptorResponse{} } -func (m *GetQueryServicesDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetQueryServicesDescriptorResponse) ProtoMessage() {} -func (*GetQueryServicesDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{20} -} -func (m *GetQueryServicesDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetQueryServicesDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetQueryServicesDescriptorResponse.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 *GetQueryServicesDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetQueryServicesDescriptorResponse.Merge(m, src) -} -func (m *GetQueryServicesDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetQueryServicesDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetQueryServicesDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetQueryServicesDescriptorResponse proto.InternalMessageInfo - -func (m *GetQueryServicesDescriptorResponse) GetQueries() *QueryServicesDescriptor { - if m != nil { - return m.Queries - } - return nil -} - -// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC -type GetTxDescriptorRequest struct { -} - -func (m *GetTxDescriptorRequest) Reset() { *m = GetTxDescriptorRequest{} } -func (m *GetTxDescriptorRequest) String() string { return proto.CompactTextString(m) } -func (*GetTxDescriptorRequest) ProtoMessage() {} -func (*GetTxDescriptorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{21} -} -func (m *GetTxDescriptorRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetTxDescriptorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetTxDescriptorRequest.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 *GetTxDescriptorRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTxDescriptorRequest.Merge(m, src) -} -func (m *GetTxDescriptorRequest) XXX_Size() int { - return m.Size() -} -func (m *GetTxDescriptorRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTxDescriptorRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTxDescriptorRequest proto.InternalMessageInfo - -// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC -type GetTxDescriptorResponse struct { - // tx provides information on msgs that can be forwarded to the application - // alongside the accepted transaction protobuf type - Tx *TxDescriptor `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` -} - -func (m *GetTxDescriptorResponse) Reset() { *m = GetTxDescriptorResponse{} } -func (m *GetTxDescriptorResponse) String() string { return proto.CompactTextString(m) } -func (*GetTxDescriptorResponse) ProtoMessage() {} -func (*GetTxDescriptorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{22} -} -func (m *GetTxDescriptorResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetTxDescriptorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetTxDescriptorResponse.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 *GetTxDescriptorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTxDescriptorResponse.Merge(m, src) -} -func (m *GetTxDescriptorResponse) XXX_Size() int { - return m.Size() -} -func (m *GetTxDescriptorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTxDescriptorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_GetTxDescriptorResponse proto.InternalMessageInfo - -func (m *GetTxDescriptorResponse) GetTx() *TxDescriptor { - if m != nil { - return m.Tx - } - return nil -} - -// QueryServicesDescriptor contains the list of cosmos-sdk queriable services -type QueryServicesDescriptor struct { - // query_services is a list of cosmos-sdk QueryServiceDescriptor - QueryServices []*QueryServiceDescriptor `protobuf:"bytes,1,rep,name=query_services,json=queryServices,proto3" json:"query_services,omitempty"` -} - -func (m *QueryServicesDescriptor) Reset() { *m = QueryServicesDescriptor{} } -func (m *QueryServicesDescriptor) String() string { return proto.CompactTextString(m) } -func (*QueryServicesDescriptor) ProtoMessage() {} -func (*QueryServicesDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{23} -} -func (m *QueryServicesDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryServicesDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryServicesDescriptor.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 *QueryServicesDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryServicesDescriptor.Merge(m, src) -} -func (m *QueryServicesDescriptor) XXX_Size() int { - return m.Size() -} -func (m *QueryServicesDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_QueryServicesDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryServicesDescriptor proto.InternalMessageInfo - -func (m *QueryServicesDescriptor) GetQueryServices() []*QueryServiceDescriptor { - if m != nil { - return m.QueryServices - } - return nil -} - -// QueryServiceDescriptor describes a cosmos-sdk queryable service -type QueryServiceDescriptor struct { - // fullname is the protobuf fullname of the service descriptor - Fullname string `protobuf:"bytes,1,opt,name=fullname,proto3" json:"fullname,omitempty"` - // is_module describes if this service is actually exposed by an application's module - IsModule bool `protobuf:"varint,2,opt,name=is_module,json=isModule,proto3" json:"is_module,omitempty"` - // methods provides a list of query service methods - Methods []*QueryMethodDescriptor `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty"` -} - -func (m *QueryServiceDescriptor) Reset() { *m = QueryServiceDescriptor{} } -func (m *QueryServiceDescriptor) String() string { return proto.CompactTextString(m) } -func (*QueryServiceDescriptor) ProtoMessage() {} -func (*QueryServiceDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{24} -} -func (m *QueryServiceDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryServiceDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryServiceDescriptor.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 *QueryServiceDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryServiceDescriptor.Merge(m, src) -} -func (m *QueryServiceDescriptor) XXX_Size() int { - return m.Size() -} -func (m *QueryServiceDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_QueryServiceDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryServiceDescriptor proto.InternalMessageInfo - -func (m *QueryServiceDescriptor) GetFullname() string { - if m != nil { - return m.Fullname - } - return "" -} - -func (m *QueryServiceDescriptor) GetIsModule() bool { - if m != nil { - return m.IsModule - } - return false -} - -func (m *QueryServiceDescriptor) GetMethods() []*QueryMethodDescriptor { - if m != nil { - return m.Methods - } - return nil -} - -// QueryMethodDescriptor describes a queryable method of a query service -// no other info is provided beside method name and tendermint queryable path -// because it would be redundant with the grpc reflection service -type QueryMethodDescriptor struct { - // name is the protobuf name (not fullname) of the method - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // full_query_path is the path that can be used to query - // this method via tendermint abci.Query - FullQueryPath string `protobuf:"bytes,2,opt,name=full_query_path,json=fullQueryPath,proto3" json:"full_query_path,omitempty"` -} - -func (m *QueryMethodDescriptor) Reset() { *m = QueryMethodDescriptor{} } -func (m *QueryMethodDescriptor) String() string { return proto.CompactTextString(m) } -func (*QueryMethodDescriptor) ProtoMessage() {} -func (*QueryMethodDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_15c91f0b8d6bf3d0, []int{25} -} -func (m *QueryMethodDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryMethodDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryMethodDescriptor.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 *QueryMethodDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryMethodDescriptor.Merge(m, src) -} -func (m *QueryMethodDescriptor) XXX_Size() int { - return m.Size() -} -func (m *QueryMethodDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_QueryMethodDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryMethodDescriptor proto.InternalMessageInfo - -func (m *QueryMethodDescriptor) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QueryMethodDescriptor) GetFullQueryPath() string { - if m != nil { - return m.FullQueryPath - } - return "" -} - -func init() { - proto.RegisterType((*AppDescriptor)(nil), "cosmos.base.reflection.v2alpha1.AppDescriptor") - proto.RegisterType((*TxDescriptor)(nil), "cosmos.base.reflection.v2alpha1.TxDescriptor") - proto.RegisterType((*AuthnDescriptor)(nil), "cosmos.base.reflection.v2alpha1.AuthnDescriptor") - proto.RegisterType((*SigningModeDescriptor)(nil), "cosmos.base.reflection.v2alpha1.SigningModeDescriptor") - proto.RegisterType((*ChainDescriptor)(nil), "cosmos.base.reflection.v2alpha1.ChainDescriptor") - proto.RegisterType((*CodecDescriptor)(nil), "cosmos.base.reflection.v2alpha1.CodecDescriptor") - proto.RegisterType((*InterfaceDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceDescriptor") - proto.RegisterType((*InterfaceImplementerDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor") - proto.RegisterType((*InterfaceAcceptingMessageDescriptor)(nil), "cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor") - proto.RegisterType((*ConfigurationDescriptor)(nil), "cosmos.base.reflection.v2alpha1.ConfigurationDescriptor") - proto.RegisterType((*MsgDescriptor)(nil), "cosmos.base.reflection.v2alpha1.MsgDescriptor") - proto.RegisterType((*GetAuthnDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest") - proto.RegisterType((*GetAuthnDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse") - proto.RegisterType((*GetChainDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest") - proto.RegisterType((*GetChainDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse") - proto.RegisterType((*GetCodecDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest") - proto.RegisterType((*GetCodecDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse") - proto.RegisterType((*GetConfigurationDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest") - proto.RegisterType((*GetConfigurationDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse") - proto.RegisterType((*GetQueryServicesDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest") - proto.RegisterType((*GetQueryServicesDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse") - proto.RegisterType((*GetTxDescriptorRequest)(nil), "cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest") - proto.RegisterType((*GetTxDescriptorResponse)(nil), "cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse") - proto.RegisterType((*QueryServicesDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryServicesDescriptor") - proto.RegisterType((*QueryServiceDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryServiceDescriptor") - proto.RegisterType((*QueryMethodDescriptor)(nil), "cosmos.base.reflection.v2alpha1.QueryMethodDescriptor") -} - -func init() { - proto.RegisterFile("cosmos/base/reflection/v2alpha1/reflection.proto", fileDescriptor_15c91f0b8d6bf3d0) -} - -var fileDescriptor_15c91f0b8d6bf3d0 = []byte{ - // 1155 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x3a, 0xbf, 0x5f, 0x9b, 0x46, 0x0c, 0x24, 0x71, 0xdd, 0xe2, 0xa6, 0x1b, 0x09, 0xf5, - 0x52, 0xbb, 0x49, 0xa3, 0xb4, 0x82, 0x94, 0xca, 0x69, 0x68, 0x15, 0x89, 0xa0, 0xe0, 0xa4, 0x80, - 0x10, 0xea, 0x6a, 0xbd, 0x3b, 0x5e, 0x8f, 0xf0, 0xee, 0x6c, 0x76, 0xc6, 0xc1, 0xb9, 0x72, 0xe0, - 0x0c, 0xe2, 0x4f, 0xe0, 0xc0, 0x9d, 0xbf, 0x02, 0xc1, 0xa5, 0x12, 0x17, 0x8e, 0x28, 0x41, 0xe2, - 0x00, 0x7f, 0x04, 0x9a, 0x1f, 0x76, 0xc6, 0xce, 0xda, 0xde, 0x24, 0x3d, 0x25, 0xb3, 0xef, 0xbd, - 0x6f, 0xbe, 0xef, 0xed, 0xe8, 0x7d, 0xb3, 0x86, 0x07, 0x1e, 0x65, 0x21, 0x65, 0xe5, 0x9a, 0xcb, - 0x70, 0x39, 0xc1, 0xf5, 0x26, 0xf6, 0x38, 0xa1, 0x51, 0xf9, 0x68, 0xcd, 0x6d, 0xc6, 0x0d, 0x77, - 0xd5, 0x78, 0x56, 0x8a, 0x13, 0xca, 0x29, 0xba, 0xa3, 0x2a, 0x4a, 0xa2, 0xa2, 0x64, 0x44, 0x3b, - 0x15, 0x85, 0xdb, 0x01, 0xa5, 0x41, 0x13, 0x97, 0xdd, 0x98, 0x94, 0xdd, 0x28, 0xa2, 0xdc, 0x15, - 0x71, 0xa6, 0xca, 0xed, 0x7f, 0xc6, 0x61, 0xae, 0x12, 0xc7, 0xdb, 0x98, 0x79, 0x09, 0x89, 0x39, - 0x4d, 0xd0, 0x73, 0x98, 0x74, 0x5b, 0xbc, 0x11, 0xe5, 0xad, 0x65, 0xeb, 0xde, 0xb5, 0xb5, 0x07, - 0xa5, 0x11, 0x1b, 0x94, 0x2a, 0x22, 0xfb, 0x0c, 0xa0, 0xaa, 0xca, 0x05, 0x8e, 0xd7, 0x70, 0x49, - 0x94, 0xcf, 0x65, 0xc4, 0x79, 0x26, 0xb2, 0x4d, 0x1c, 0x59, 0x2e, 0x71, 0xa8, 0x8f, 0xbd, 0xfc, - 0x78, 0x56, 0x1c, 0x91, 0xdd, 0x83, 0x23, 0x1e, 0xa0, 0x57, 0x30, 0xe7, 0xd1, 0xa8, 0x4e, 0x82, - 0x56, 0x22, 0x3b, 0x90, 0x9f, 0x90, 0x78, 0x8f, 0x33, 0xe0, 0x19, 0x55, 0x06, 0x6e, 0x2f, 0x1c, - 0x72, 0xe0, 0xc6, 0x61, 0x0b, 0x27, 0xc7, 0x0e, 0xc3, 0xc9, 0x11, 0xf1, 0x30, 0xcb, 0x4f, 0x66, - 0xdc, 0xe0, 0x53, 0x51, 0xb6, 0xaf, 0xab, 0xcc, 0x0d, 0x0e, 0xcd, 0x00, 0x7a, 0x02, 0x39, 0xde, - 0xce, 0x4f, 0x49, 0xd0, 0xfb, 0x23, 0x41, 0x0f, 0xda, 0x06, 0x52, 0x8e, 0xb7, 0xed, 0x08, 0xae, - 0x9b, 0xcf, 0x50, 0x01, 0x66, 0xea, 0xad, 0x66, 0x33, 0x72, 0x43, 0x2c, 0x5f, 0xf5, 0x6c, 0xb5, - 0xbb, 0x46, 0x5b, 0x30, 0x11, 0xb2, 0x80, 0xe5, 0x73, 0xcb, 0xe3, 0xf7, 0xae, 0xad, 0x95, 0x46, - 0x6e, 0xb6, 0xcb, 0x02, 0x63, 0x37, 0x59, 0x6b, 0x37, 0x60, 0xbe, 0xef, 0x64, 0xa0, 0x97, 0x00, - 0x8c, 0x04, 0x91, 0x13, 0x52, 0x1f, 0xb3, 0xbc, 0x25, 0xc1, 0x37, 0x46, 0x82, 0xef, 0x93, 0x20, - 0x22, 0x51, 0xb0, 0x4b, 0x7d, 0x6c, 0x6c, 0x32, 0x2b, 0x90, 0xc4, 0x33, 0x66, 0xff, 0x60, 0xc1, - 0x42, 0x6a, 0x12, 0x42, 0x30, 0x61, 0xe8, 0x93, 0xff, 0xa3, 0x45, 0x98, 0x8a, 0x5a, 0x61, 0x0d, - 0x27, 0xf2, 0x60, 0x4e, 0x56, 0xf5, 0x0a, 0x7d, 0x0c, 0x2b, 0xf2, 0xe0, 0x3a, 0x24, 0xaa, 0x53, - 0x27, 0x4e, 0xe8, 0x11, 0xf1, 0x71, 0xe2, 0x84, 0x98, 0x37, 0xa8, 0xef, 0x74, 0x5b, 0x35, 0x2e, - 0xa1, 0xee, 0xc8, 0xd4, 0x9d, 0xa8, 0x4e, 0xf7, 0x74, 0xe2, 0xae, 0xcc, 0x7b, 0xae, 0xd3, 0xec, - 0xbb, 0x30, 0xdf, 0x77, 0x9e, 0xd1, 0x0d, 0xc8, 0x11, 0x5f, 0x53, 0xc9, 0x11, 0xdf, 0x0e, 0x60, - 0xbe, 0xef, 0xa8, 0xa2, 0x03, 0x00, 0x12, 0x71, 0x9c, 0xd4, 0x5d, 0xaf, 0xdb, 0xa0, 0xf5, 0x91, - 0x0d, 0xda, 0xe9, 0x94, 0x18, 0xed, 0x31, 0x70, 0xec, 0x5f, 0x72, 0xf0, 0x76, 0x4a, 0xce, 0xd0, - 0x13, 0xf0, 0x9d, 0x05, 0xb7, 0xbb, 0x10, 0x8e, 0xeb, 0x79, 0x38, 0xe6, 0x24, 0x0a, 0x9c, 0x10, - 0x33, 0xe6, 0x06, 0xb8, 0x73, 0x34, 0xb6, 0xb3, 0x93, 0xab, 0x74, 0x30, 0x76, 0x15, 0x84, 0x41, - 0xb6, 0x40, 0x06, 0x25, 0x31, 0x74, 0x04, 0x8b, 0x67, 0x3c, 0x48, 0x18, 0x37, 0x71, 0x88, 0xc5, - 0x9a, 0xe5, 0xc7, 0x25, 0x83, 0xa7, 0xd9, 0x19, 0xec, 0x9c, 0x55, 0x1b, 0x9b, 0x2f, 0x90, 0x94, - 0x38, 0xb3, 0x3f, 0x87, 0xe2, 0xf0, 0xc2, 0xa1, 0xed, 0xbb, 0x09, 0x33, 0xfc, 0x38, 0xc6, 0x4e, - 0x2b, 0x69, 0xca, 0x63, 0x36, 0x5b, 0x9d, 0x16, 0xeb, 0x97, 0x49, 0xd3, 0xfe, 0x06, 0x56, 0x32, - 0xf4, 0x64, 0x28, 0xfa, 0x3a, 0x2c, 0xd6, 0x09, 0x6e, 0xfa, 0x8e, 0xdf, 0xcd, 0x77, 0x44, 0x40, - 0xbd, 0x95, 0xd9, 0xea, 0x3b, 0x32, 0x7a, 0x06, 0xf6, 0x89, 0x88, 0xd9, 0x5f, 0xc1, 0xd2, 0x80, - 0x51, 0x86, 0x2a, 0xf0, 0x6e, 0x0d, 0x7b, 0x8d, 0x87, 0x6b, 0xe2, 0x4d, 0xd3, 0x56, 0xc4, 0x1d, - 0xd7, 0xf7, 0x13, 0xcc, 0x98, 0x13, 0x27, 0xb8, 0x4e, 0xda, 0x9a, 0x41, 0x41, 0x25, 0x55, 0x54, - 0x4e, 0x45, 0xa5, 0xec, 0xc9, 0x0c, 0x7b, 0x15, 0xe6, 0x7a, 0xa6, 0x00, 0x5a, 0x86, 0xeb, 0x21, - 0x0b, 0x9c, 0x6e, 0x1b, 0x14, 0x04, 0x84, 0x2c, 0x38, 0xd0, 0x9d, 0xb8, 0x05, 0x37, 0x5f, 0x60, - 0xde, 0x6f, 0x1f, 0xf8, 0xb0, 0x85, 0x19, 0xb7, 0x7d, 0x28, 0xa4, 0x05, 0x59, 0x4c, 0x23, 0x86, - 0xdf, 0x94, 0x49, 0x69, 0x0a, 0xfd, 0xce, 0xd3, 0x43, 0xe1, 0x5c, 0xf0, 0x8c, 0x82, 0xf2, 0x37, - 0xeb, 0x4a, 0xfe, 0xd6, 0xa1, 0xd0, 0x67, 0x5a, 0xbd, 0x14, 0xfa, 0x83, 0x06, 0x05, 0x69, 0x8d, - 0xd6, 0x95, 0xac, 0xd1, 0x5e, 0x81, 0xbb, 0x72, 0x97, 0x74, 0x9f, 0xd3, 0x54, 0x8e, 0xc0, 0x1e, - 0x96, 0xa4, 0x29, 0xed, 0xc1, 0x94, 0xb2, 0x45, 0xcd, 0xe9, 0xf2, 0xf6, 0xaa, 0x71, 0x34, 0xb9, - 0x41, 0x1e, 0xa9, 0xc9, 0xb5, 0x25, 0xb9, 0x81, 0x49, 0x9a, 0x5c, 0x15, 0xa6, 0x85, 0xa5, 0x12, - 0x39, 0x5b, 0xaf, 0xe6, 0xcd, 0x1d, 0x20, 0x3b, 0x0f, 0x8b, 0x2f, 0x30, 0xef, 0x71, 0x5b, 0xcd, - 0xe9, 0x0b, 0x58, 0x3a, 0x17, 0xd1, 0x44, 0x94, 0x95, 0x5b, 0x97, 0xb5, 0xf2, 0x63, 0x58, 0x1a, - 0xc0, 0x0b, 0xbd, 0x3a, 0x77, 0x0b, 0x51, 0x2e, 0xf2, 0xe8, 0x42, 0x4a, 0x07, 0x5e, 0x42, 0xec, - 0x9f, 0x2c, 0x58, 0x4c, 0xcf, 0x1c, 0x3a, 0xb1, 0x6e, 0xc1, 0x2c, 0x61, 0xc2, 0xf7, 0x5b, 0x4d, - 0x2c, 0x07, 0xe2, 0x4c, 0x75, 0x86, 0xb0, 0x5d, 0xb9, 0x46, 0x7b, 0x30, 0xad, 0x5c, 0xb6, 0x33, - 0xd3, 0x37, 0xb2, 0x91, 0x55, 0x96, 0x6b, 0xbe, 0x14, 0x0d, 0x63, 0xef, 0xc3, 0x42, 0x6a, 0x46, - 0xea, 0x85, 0xe0, 0x3d, 0x98, 0x17, 0x3c, 0x1d, 0xd5, 0xb7, 0xd8, 0xe5, 0x0d, 0x3d, 0xb2, 0xe7, - 0xc4, 0x63, 0x89, 0xb3, 0xe7, 0xf2, 0xc6, 0xda, 0xcf, 0x00, 0x6f, 0x55, 0xbb, 0x5c, 0xb4, 0x7e, - 0xf4, 0xbb, 0x05, 0xe8, 0xfc, 0xa0, 0x42, 0xef, 0x8f, 0x94, 0x30, 0x70, 0xf4, 0x15, 0x3e, 0xb8, - 0x54, 0xad, 0x3a, 0x5a, 0xf6, 0xe6, 0xb7, 0x7f, 0xfc, 0xfd, 0x63, 0x6e, 0x03, 0xad, 0x97, 0x07, - 0x7d, 0x4a, 0xac, 0xd6, 0x30, 0x77, 0x57, 0xcb, 0x6e, 0x1c, 0x1b, 0xfe, 0x51, 0x56, 0x97, 0x76, - 0xad, 0xa6, 0xff, 0xea, 0x92, 0x49, 0x4d, 0xfa, 0x14, 0xcd, 0xa6, 0x66, 0xc0, 0x90, 0xbd, 0xb4, - 0x1a, 0xf5, 0xe9, 0xd0, 0x51, 0xd3, 0x77, 0xcb, 0xca, 0xa6, 0x26, 0x75, 0x20, 0x67, 0x54, 0x93, - 0x3e, 0xaf, 0x2f, 0xaf, 0x46, 0x7e, 0xc0, 0xfc, 0x6b, 0x69, 0x33, 0x48, 0xf7, 0xf0, 0xad, 0x6c, - 0xcc, 0x86, 0xcd, 0xf8, 0xc2, 0xb3, 0x2b, 0x61, 0x68, 0x95, 0xdb, 0x52, 0xe5, 0x87, 0x68, 0xf3, - 0xc2, 0x2a, 0xcd, 0xcf, 0xa9, 0xff, 0x94, 0xda, 0x41, 0x73, 0x2e, 0x93, 0xda, 0xe1, 0xa6, 0x91, - 0x4d, 0xed, 0x08, 0x4f, 0xb1, 0x3f, 0x92, 0x6a, 0x9f, 0xa2, 0x27, 0x17, 0x54, 0xdb, 0x3b, 0xa5, - 0xd1, 0x6f, 0x16, 0xcc, 0xf7, 0xb9, 0x05, 0x7a, 0x94, 0x85, 0x5f, 0x8a, 0xf3, 0x14, 0x1e, 0x5f, - 0xbc, 0xf0, 0x8a, 0xef, 0x8e, 0xb7, 0x8d, 0xd5, 0xd6, 0x67, 0xbf, 0x9e, 0x14, 0xad, 0xd7, 0x27, - 0x45, 0xeb, 0xaf, 0x93, 0xa2, 0xf5, 0xfd, 0x69, 0x71, 0xec, 0xf5, 0x69, 0x71, 0xec, 0xcf, 0xd3, - 0xe2, 0xd8, 0x97, 0x9b, 0x01, 0xe1, 0x8d, 0x56, 0xad, 0xe4, 0xd1, 0xb0, 0xb3, 0x83, 0xfa, 0x73, - 0x9f, 0xf9, 0x5f, 0x97, 0x45, 0x37, 0x70, 0x52, 0x0e, 0x92, 0xd8, 0x4b, 0xfb, 0xf1, 0xa3, 0x36, - 0x25, 0x7f, 0xb3, 0x78, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0xdb, 0xec, 0xac, 0x26, - 0x11, 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 - -// ReflectionServiceClient is the client API for ReflectionService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ReflectionServiceClient interface { - // GetAuthnDescriptor returns information on how to authenticate transactions in the application - // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - // future releases of the cosmos-sdk. - GetAuthnDescriptor(ctx context.Context, in *GetAuthnDescriptorRequest, opts ...grpc.CallOption) (*GetAuthnDescriptorResponse, error) - // GetChainDescriptor returns the description of the chain - GetChainDescriptor(ctx context.Context, in *GetChainDescriptorRequest, opts ...grpc.CallOption) (*GetChainDescriptorResponse, error) - // GetCodecDescriptor returns the descriptor of the codec of the application - GetCodecDescriptor(ctx context.Context, in *GetCodecDescriptorRequest, opts ...grpc.CallOption) (*GetCodecDescriptorResponse, error) - // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - GetConfigurationDescriptor(ctx context.Context, in *GetConfigurationDescriptorRequest, opts ...grpc.CallOption) (*GetConfigurationDescriptorResponse, error) - // GetQueryServicesDescriptor returns the available gRPC queryable services of the application - GetQueryServicesDescriptor(ctx context.Context, in *GetQueryServicesDescriptorRequest, opts ...grpc.CallOption) (*GetQueryServicesDescriptorResponse, error) - // GetTxDescriptor returns information on the used transaction object and available msgs that can be used - GetTxDescriptor(ctx context.Context, in *GetTxDescriptorRequest, opts ...grpc.CallOption) (*GetTxDescriptorResponse, error) -} - -type reflectionServiceClient struct { - cc grpc1.ClientConn -} - -func NewReflectionServiceClient(cc grpc1.ClientConn) ReflectionServiceClient { - return &reflectionServiceClient{cc} -} - -func (c *reflectionServiceClient) GetAuthnDescriptor(ctx context.Context, in *GetAuthnDescriptorRequest, opts ...grpc.CallOption) (*GetAuthnDescriptorResponse, error) { - out := new(GetAuthnDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) GetChainDescriptor(ctx context.Context, in *GetChainDescriptorRequest, opts ...grpc.CallOption) (*GetChainDescriptorResponse, error) { - out := new(GetChainDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) GetCodecDescriptor(ctx context.Context, in *GetCodecDescriptorRequest, opts ...grpc.CallOption) (*GetCodecDescriptorResponse, error) { - out := new(GetCodecDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) GetConfigurationDescriptor(ctx context.Context, in *GetConfigurationDescriptorRequest, opts ...grpc.CallOption) (*GetConfigurationDescriptorResponse, error) { - out := new(GetConfigurationDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) GetQueryServicesDescriptor(ctx context.Context, in *GetQueryServicesDescriptorRequest, opts ...grpc.CallOption) (*GetQueryServicesDescriptorResponse, error) { - out := new(GetQueryServicesDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *reflectionServiceClient) GetTxDescriptor(ctx context.Context, in *GetTxDescriptorRequest, opts ...grpc.CallOption) (*GetTxDescriptorResponse, error) { - out := new(GetTxDescriptorResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ReflectionServiceServer is the server API for ReflectionService service. -type ReflectionServiceServer interface { - // GetAuthnDescriptor returns information on how to authenticate transactions in the application - // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - // future releases of the cosmos-sdk. - GetAuthnDescriptor(context.Context, *GetAuthnDescriptorRequest) (*GetAuthnDescriptorResponse, error) - // GetChainDescriptor returns the description of the chain - GetChainDescriptor(context.Context, *GetChainDescriptorRequest) (*GetChainDescriptorResponse, error) - // GetCodecDescriptor returns the descriptor of the codec of the application - GetCodecDescriptor(context.Context, *GetCodecDescriptorRequest) (*GetCodecDescriptorResponse, error) - // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - GetConfigurationDescriptor(context.Context, *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) - // GetQueryServicesDescriptor returns the available gRPC queryable services of the application - GetQueryServicesDescriptor(context.Context, *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) - // GetTxDescriptor returns information on the used transaction object and available msgs that can be used - GetTxDescriptor(context.Context, *GetTxDescriptorRequest) (*GetTxDescriptorResponse, error) -} - -// UnimplementedReflectionServiceServer can be embedded to have forward compatible implementations. -type UnimplementedReflectionServiceServer struct { -} - -func (*UnimplementedReflectionServiceServer) GetAuthnDescriptor(ctx context.Context, req *GetAuthnDescriptorRequest) (*GetAuthnDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAuthnDescriptor not implemented") -} -func (*UnimplementedReflectionServiceServer) GetChainDescriptor(ctx context.Context, req *GetChainDescriptorRequest) (*GetChainDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetChainDescriptor not implemented") -} -func (*UnimplementedReflectionServiceServer) GetCodecDescriptor(ctx context.Context, req *GetCodecDescriptorRequest) (*GetCodecDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetCodecDescriptor not implemented") -} -func (*UnimplementedReflectionServiceServer) GetConfigurationDescriptor(ctx context.Context, req *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfigurationDescriptor not implemented") -} -func (*UnimplementedReflectionServiceServer) GetQueryServicesDescriptor(ctx context.Context, req *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetQueryServicesDescriptor not implemented") -} -func (*UnimplementedReflectionServiceServer) GetTxDescriptor(ctx context.Context, req *GetTxDescriptorRequest) (*GetTxDescriptorResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTxDescriptor not implemented") -} - -func RegisterReflectionServiceServer(s grpc1.Server, srv ReflectionServiceServer) { - s.RegisterService(&_ReflectionService_serviceDesc, srv) -} - -func _ReflectionService_GetAuthnDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAuthnDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetAuthnDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetAuthnDescriptor(ctx, req.(*GetAuthnDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_GetChainDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetChainDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetChainDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetChainDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetChainDescriptor(ctx, req.(*GetChainDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_GetCodecDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCodecDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetCodecDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetCodecDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetCodecDescriptor(ctx, req.(*GetCodecDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_GetConfigurationDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigurationDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetConfigurationDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetConfigurationDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetConfigurationDescriptor(ctx, req.(*GetConfigurationDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_GetQueryServicesDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetQueryServicesDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetQueryServicesDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetQueryServicesDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetQueryServicesDescriptor(ctx, req.(*GetQueryServicesDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ReflectionService_GetTxDescriptor_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTxDescriptorRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ReflectionServiceServer).GetTxDescriptor(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.reflection.v2alpha1.ReflectionService/GetTxDescriptor", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ReflectionServiceServer).GetTxDescriptor(ctx, req.(*GetTxDescriptorRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ReflectionService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.base.reflection.v2alpha1.ReflectionService", - HandlerType: (*ReflectionServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetAuthnDescriptor", - Handler: _ReflectionService_GetAuthnDescriptor_Handler, - }, - { - MethodName: "GetChainDescriptor", - Handler: _ReflectionService_GetChainDescriptor_Handler, - }, - { - MethodName: "GetCodecDescriptor", - Handler: _ReflectionService_GetCodecDescriptor_Handler, - }, - { - MethodName: "GetConfigurationDescriptor", - Handler: _ReflectionService_GetConfigurationDescriptor_Handler, - }, - { - MethodName: "GetQueryServicesDescriptor", - Handler: _ReflectionService_GetQueryServicesDescriptor_Handler, - }, - { - MethodName: "GetTxDescriptor", - Handler: _ReflectionService_GetTxDescriptor_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/base/reflection/v2alpha1/reflection.proto", -} - -func (m *AppDescriptor) 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 *AppDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AppDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Tx != nil { - { - size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.QueryServices != nil { - { - size, err := m.QueryServices.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.Configuration != nil { - { - size, err := m.Configuration.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Codec != nil { - { - size, err := m.Codec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Chain != nil { - { - size, err := m.Chain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Authn != nil { - { - size, err := m.Authn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TxDescriptor) 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 *TxDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Fullname) > 0 { - i -= len(m.Fullname) - copy(dAtA[i:], m.Fullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AuthnDescriptor) 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 *AuthnDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthnDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SignModes) > 0 { - for iNdEx := len(m.SignModes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SignModes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SigningModeDescriptor) 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 *SigningModeDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SigningModeDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AuthnInfoProviderMethodFullname) > 0 { - i -= len(m.AuthnInfoProviderMethodFullname) - copy(dAtA[i:], m.AuthnInfoProviderMethodFullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.AuthnInfoProviderMethodFullname))) - i-- - dAtA[i] = 0x1a - } - if m.Number != 0 { - i = encodeVarintReflection(dAtA, i, uint64(m.Number)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ChainDescriptor) 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 *ChainDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChainDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CodecDescriptor) 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 *CodecDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CodecDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Interfaces) > 0 { - for iNdEx := len(m.Interfaces) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Interfaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *InterfaceDescriptor) 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 *InterfaceDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InterfaceDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InterfaceImplementers) > 0 { - for iNdEx := len(m.InterfaceImplementers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InterfaceImplementers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.InterfaceAcceptingMessages) > 0 { - for iNdEx := len(m.InterfaceAcceptingMessages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InterfaceAcceptingMessages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Fullname) > 0 { - i -= len(m.Fullname) - copy(dAtA[i:], m.Fullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InterfaceImplementerDescriptor) 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 *InterfaceImplementerDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InterfaceImplementerDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TypeUrl) > 0 { - i -= len(m.TypeUrl) - copy(dAtA[i:], m.TypeUrl) - i = encodeVarintReflection(dAtA, i, uint64(len(m.TypeUrl))) - i-- - dAtA[i] = 0x12 - } - if len(m.Fullname) > 0 { - i -= len(m.Fullname) - copy(dAtA[i:], m.Fullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InterfaceAcceptingMessageDescriptor) 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 *InterfaceAcceptingMessageDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InterfaceAcceptingMessageDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FieldDescriptorNames) > 0 { - for iNdEx := len(m.FieldDescriptorNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.FieldDescriptorNames[iNdEx]) - copy(dAtA[i:], m.FieldDescriptorNames[iNdEx]) - i = encodeVarintReflection(dAtA, i, uint64(len(m.FieldDescriptorNames[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Fullname) > 0 { - i -= len(m.Fullname) - copy(dAtA[i:], m.Fullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConfigurationDescriptor) 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 *ConfigurationDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConfigurationDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Bech32AccountAddressPrefix) > 0 { - i -= len(m.Bech32AccountAddressPrefix) - copy(dAtA[i:], m.Bech32AccountAddressPrefix) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Bech32AccountAddressPrefix))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgDescriptor) 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 *MsgDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MsgTypeUrl) > 0 { - i -= len(m.MsgTypeUrl) - copy(dAtA[i:], m.MsgTypeUrl) - i = encodeVarintReflection(dAtA, i, uint64(len(m.MsgTypeUrl))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetAuthnDescriptorRequest) 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 *GetAuthnDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetAuthnDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetAuthnDescriptorResponse) 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 *GetAuthnDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetAuthnDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Authn != nil { - { - size, err := m.Authn.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetChainDescriptorRequest) 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 *GetChainDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetChainDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetChainDescriptorResponse) 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 *GetChainDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetChainDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Chain != nil { - { - size, err := m.Chain.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetCodecDescriptorRequest) 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 *GetCodecDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetCodecDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetCodecDescriptorResponse) 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 *GetCodecDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetCodecDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Codec != nil { - { - size, err := m.Codec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetConfigurationDescriptorRequest) 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 *GetConfigurationDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetConfigurationDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetConfigurationDescriptorResponse) 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 *GetConfigurationDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetConfigurationDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Config != nil { - { - size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetQueryServicesDescriptorRequest) 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 *GetQueryServicesDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetQueryServicesDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetQueryServicesDescriptorResponse) 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 *GetQueryServicesDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetQueryServicesDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Queries != nil { - { - size, err := m.Queries.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetTxDescriptorRequest) 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 *GetTxDescriptorRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetTxDescriptorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *GetTxDescriptorResponse) 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 *GetTxDescriptorResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetTxDescriptorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Tx != nil { - { - size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryServicesDescriptor) 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 *QueryServicesDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryServicesDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.QueryServices) > 0 { - for iNdEx := len(m.QueryServices) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.QueryServices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryServiceDescriptor) 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 *QueryServiceDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryServiceDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Methods) > 0 { - for iNdEx := len(m.Methods) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Methods[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintReflection(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.IsModule { - i-- - if m.IsModule { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.Fullname) > 0 { - i -= len(m.Fullname) - copy(dAtA[i:], m.Fullname) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Fullname))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryMethodDescriptor) 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 *QueryMethodDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryMethodDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FullQueryPath) > 0 { - i -= len(m.FullQueryPath) - copy(dAtA[i:], m.FullQueryPath) - i = encodeVarintReflection(dAtA, i, uint64(len(m.FullQueryPath))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintReflection(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintReflection(dAtA []byte, offset int, v uint64) int { - offset -= sovReflection(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *AppDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Authn != nil { - l = m.Authn.Size() - n += 1 + l + sovReflection(uint64(l)) - } - if m.Chain != nil { - l = m.Chain.Size() - n += 1 + l + sovReflection(uint64(l)) - } - if m.Codec != nil { - l = m.Codec.Size() - n += 1 + l + sovReflection(uint64(l)) - } - if m.Configuration != nil { - l = m.Configuration.Size() - n += 1 + l + sovReflection(uint64(l)) - } - if m.QueryServices != nil { - l = m.QueryServices.Size() - n += 1 + l + sovReflection(uint64(l)) - } - if m.Tx != nil { - l = m.Tx.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *TxDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Fullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *AuthnDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SignModes) > 0 { - for _, e := range m.SignModes { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *SigningModeDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - if m.Number != 0 { - n += 1 + sovReflection(uint64(m.Number)) - } - l = len(m.AuthnInfoProviderMethodFullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *ChainDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *CodecDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Interfaces) > 0 { - for _, e := range m.Interfaces { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *InterfaceDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Fullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - if len(m.InterfaceAcceptingMessages) > 0 { - for _, e := range m.InterfaceAcceptingMessages { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - if len(m.InterfaceImplementers) > 0 { - for _, e := range m.InterfaceImplementers { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *InterfaceImplementerDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Fullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - l = len(m.TypeUrl) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *InterfaceAcceptingMessageDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Fullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - if len(m.FieldDescriptorNames) > 0 { - for _, s := range m.FieldDescriptorNames { - l = len(s) - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *ConfigurationDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bech32AccountAddressPrefix) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *MsgDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MsgTypeUrl) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetAuthnDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetAuthnDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Authn != nil { - l = m.Authn.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetChainDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetChainDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Chain != nil { - l = m.Chain.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetCodecDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetCodecDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Codec != nil { - l = m.Codec.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetConfigurationDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetConfigurationDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Config != nil { - l = m.Config.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetQueryServicesDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetQueryServicesDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Queries != nil { - l = m.Queries.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *GetTxDescriptorRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *GetTxDescriptorResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Tx != nil { - l = m.Tx.Size() - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func (m *QueryServicesDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.QueryServices) > 0 { - for _, e := range m.QueryServices { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *QueryServiceDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Fullname) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - if m.IsModule { - n += 2 - } - if len(m.Methods) > 0 { - for _, e := range m.Methods { - l = e.Size() - n += 1 + l + sovReflection(uint64(l)) - } - } - return n -} - -func (m *QueryMethodDescriptor) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - l = len(m.FullQueryPath) - if l > 0 { - n += 1 + l + sovReflection(uint64(l)) - } - return n -} - -func sovReflection(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozReflection(x uint64) (n int) { - return sovReflection(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *AppDescriptor) 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 ErrIntOverflowReflection - } - 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: AppDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AppDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authn == nil { - m.Authn = &AuthnDescriptor{} - } - if err := m.Authn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Chain == nil { - m.Chain = &ChainDescriptor{} - } - if err := m.Chain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Codec == nil { - m.Codec = &CodecDescriptor{} - } - if err := m.Codec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Configuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Configuration == nil { - m.Configuration = &ConfigurationDescriptor{} - } - if err := m.Configuration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryServices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.QueryServices == nil { - m.QueryServices = &QueryServicesDescriptor{} - } - if err := m.QueryServices.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tx == nil { - m.Tx = &TxDescriptor{} - } - if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TxDescriptor) 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 ErrIntOverflowReflection - } - 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: TxDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msgs = append(m.Msgs, &MsgDescriptor{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AuthnDescriptor) 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 ErrIntOverflowReflection - } - 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: AuthnDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthnDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignModes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SignModes = append(m.SignModes, &SigningModeDescriptor{}) - if err := m.SignModes[len(m.SignModes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SigningModeDescriptor) 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 ErrIntOverflowReflection - } - 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: SigningModeDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SigningModeDescriptor: 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 ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - 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 Number", wireType) - } - m.Number = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Number |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AuthnInfoProviderMethodFullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AuthnInfoProviderMethodFullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChainDescriptor) 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 ErrIntOverflowReflection - } - 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: ChainDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChainDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CodecDescriptor) 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 ErrIntOverflowReflection - } - 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: CodecDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CodecDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Interfaces", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Interfaces = append(m.Interfaces, &InterfaceDescriptor{}) - if err := m.Interfaces[len(m.Interfaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InterfaceDescriptor) 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 ErrIntOverflowReflection - } - 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: InterfaceDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InterfaceDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceAcceptingMessages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InterfaceAcceptingMessages = append(m.InterfaceAcceptingMessages, &InterfaceAcceptingMessageDescriptor{}) - if err := m.InterfaceAcceptingMessages[len(m.InterfaceAcceptingMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterfaceImplementers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InterfaceImplementers = append(m.InterfaceImplementers, &InterfaceImplementerDescriptor{}) - if err := m.InterfaceImplementers[len(m.InterfaceImplementers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InterfaceImplementerDescriptor) 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 ErrIntOverflowReflection - } - 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: InterfaceImplementerDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InterfaceImplementerDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *InterfaceAcceptingMessageDescriptor) 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 ErrIntOverflowReflection - } - 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: InterfaceAcceptingMessageDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InterfaceAcceptingMessageDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FieldDescriptorNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FieldDescriptorNames = append(m.FieldDescriptorNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConfigurationDescriptor) 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 ErrIntOverflowReflection - } - 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: ConfigurationDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConfigurationDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bech32AccountAddressPrefix", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bech32AccountAddressPrefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgDescriptor) 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 ErrIntOverflowReflection - } - 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: MsgDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetAuthnDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetAuthnDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetAuthnDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetAuthnDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetAuthnDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetAuthnDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authn", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authn == nil { - m.Authn = &AuthnDescriptor{} - } - if err := m.Authn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetChainDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetChainDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetChainDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetChainDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetChainDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetChainDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Chain == nil { - m.Chain = &ChainDescriptor{} - } - if err := m.Chain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCodecDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetCodecDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCodecDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCodecDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetCodecDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCodecDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Codec == nil { - m.Codec = &CodecDescriptor{} - } - if err := m.Codec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetConfigurationDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetConfigurationDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetConfigurationDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetConfigurationDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetConfigurationDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetConfigurationDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Config == nil { - m.Config = &ConfigurationDescriptor{} - } - if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetQueryServicesDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetQueryServicesDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetQueryServicesDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetQueryServicesDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetQueryServicesDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetQueryServicesDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Queries", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Queries == nil { - m.Queries = &QueryServicesDescriptor{} - } - if err := m.Queries.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTxDescriptorRequest) 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 ErrIntOverflowReflection - } - 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: GetTxDescriptorRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTxDescriptorRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTxDescriptorResponse) 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 ErrIntOverflowReflection - } - 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: GetTxDescriptorResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTxDescriptorResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tx == nil { - m.Tx = &TxDescriptor{} - } - if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryServicesDescriptor) 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 ErrIntOverflowReflection - } - 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: QueryServicesDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryServicesDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field QueryServices", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.QueryServices = append(m.QueryServices, &QueryServiceDescriptor{}) - if err := m.QueryServices[len(m.QueryServices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryServiceDescriptor) 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 ErrIntOverflowReflection - } - 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: QueryServiceDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryServiceDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fullname", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fullname = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsModule", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsModule = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Methods", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthReflection - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Methods = append(m.Methods, &QueryMethodDescriptor{}) - if err := m.Methods[len(m.Methods)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryMethodDescriptor) 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 ErrIntOverflowReflection - } - 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: QueryMethodDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMethodDescriptor: 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 ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - 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 FullQueryPath", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowReflection - } - 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 ErrInvalidLengthReflection - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthReflection - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FullQueryPath = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipReflection(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthReflection - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipReflection(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, ErrIntOverflowReflection - } - 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, ErrIntOverflowReflection - } - 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, ErrIntOverflowReflection - } - 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, ErrInvalidLengthReflection - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupReflection - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthReflection - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthReflection = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowReflection = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupReflection = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go b/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go deleted file mode 100644 index d53b4fdaeb8c..000000000000 --- a/github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1/reflection.pb.gw.go +++ /dev/null @@ -1,478 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/base/reflection/v2alpha1/reflection.proto - -/* -Package v2alpha1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package v2alpha1 - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_ReflectionService_GetAuthnDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAuthnDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetAuthnDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetAuthnDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetAuthnDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetAuthnDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_GetChainDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetChainDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetChainDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetChainDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetChainDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetChainDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_GetCodecDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetCodecDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetCodecDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetCodecDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetCodecDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetCodecDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_GetConfigurationDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetConfigurationDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetConfigurationDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetConfigurationDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetConfigurationDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetConfigurationDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_GetQueryServicesDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetQueryServicesDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetQueryServicesDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetQueryServicesDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetQueryServicesDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetQueryServicesDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -func request_ReflectionService_GetTxDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, client ReflectionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTxDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := client.GetTxDescriptor(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_ReflectionService_GetTxDescriptor_0(ctx context.Context, marshaler runtime.Marshaler, server ReflectionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTxDescriptorRequest - var metadata runtime.ServerMetadata - - msg, err := server.GetTxDescriptor(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterReflectionServiceHandlerServer registers the http handlers for service ReflectionService to "mux". -// UnaryRPC :call ReflectionServiceServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterReflectionServiceHandlerFromEndpoint instead. -func RegisterReflectionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ReflectionServiceServer) error { - - mux.Handle("GET", pattern_ReflectionService_GetAuthnDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetAuthnDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetAuthnDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetChainDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetChainDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetChainDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetCodecDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetCodecDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetCodecDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetConfigurationDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetConfigurationDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetConfigurationDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetQueryServicesDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetQueryServicesDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetQueryServicesDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetTxDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_ReflectionService_GetTxDescriptor_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetTxDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterReflectionServiceHandlerFromEndpoint is same as RegisterReflectionServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterReflectionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterReflectionServiceHandler(ctx, mux, conn) -} - -// RegisterReflectionServiceHandler registers the http handlers for service ReflectionService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterReflectionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterReflectionServiceHandlerClient(ctx, mux, NewReflectionServiceClient(conn)) -} - -// RegisterReflectionServiceHandlerClient registers the http handlers for service ReflectionService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ReflectionServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ReflectionServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "ReflectionServiceClient" to call the correct interceptors. -func RegisterReflectionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ReflectionServiceClient) error { - - mux.Handle("GET", pattern_ReflectionService_GetAuthnDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetAuthnDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetAuthnDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetChainDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetChainDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetChainDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetCodecDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetCodecDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetCodecDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetConfigurationDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetConfigurationDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetConfigurationDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetQueryServicesDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetQueryServicesDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetQueryServicesDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_ReflectionService_GetTxDescriptor_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_ReflectionService_GetTxDescriptor_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_ReflectionService_GetTxDescriptor_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_ReflectionService_GetAuthnDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "authn"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_GetChainDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "chain"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_GetCodecDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "codec"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_GetConfigurationDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "configuration"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_GetQueryServicesDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "query_services"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_ReflectionService_GetTxDescriptor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "reflection", "v1beta1", "app_descriptor", "tx_descriptor"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_ReflectionService_GetAuthnDescriptor_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_GetChainDescriptor_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_GetCodecDescriptor_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_GetConfigurationDescriptor_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_GetQueryServicesDescriptor_0 = runtime.ForwardResponseMessage - - forward_ReflectionService_GetTxDescriptor_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go b/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go deleted file mode 100644 index 5821c916143b..000000000000 --- a/github.com/cosmos/cosmos-sdk/snapshots/types/snapshot.pb.go +++ /dev/null @@ -1,2595 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/snapshots/v1beta1/snapshot.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Snapshot contains Tendermint state sync snapshot info. -type Snapshot struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` -} - -func (m *Snapshot) Reset() { *m = Snapshot{} } -func (m *Snapshot) String() string { return proto.CompactTextString(m) } -func (*Snapshot) ProtoMessage() {} -func (*Snapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{0} -} -func (m *Snapshot) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Snapshot.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 *Snapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_Snapshot.Merge(m, src) -} -func (m *Snapshot) XXX_Size() int { - return m.Size() -} -func (m *Snapshot) XXX_DiscardUnknown() { - xxx_messageInfo_Snapshot.DiscardUnknown(m) -} - -var xxx_messageInfo_Snapshot proto.InternalMessageInfo - -func (m *Snapshot) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Snapshot) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *Snapshot) GetChunks() uint32 { - if m != nil { - return m.Chunks - } - return 0 -} - -func (m *Snapshot) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *Snapshot) GetMetadata() Metadata { - if m != nil { - return m.Metadata - } - return Metadata{} -} - -// Metadata contains SDK-specific snapshot metadata. -type Metadata struct { - ChunkHashes [][]byte `protobuf:"bytes,1,rep,name=chunk_hashes,json=chunkHashes,proto3" json:"chunk_hashes,omitempty"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{1} -} -func (m *Metadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Metadata.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 *Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metadata.Merge(m, src) -} -func (m *Metadata) XXX_Size() int { - return m.Size() -} -func (m *Metadata) XXX_DiscardUnknown() { - xxx_messageInfo_Metadata.DiscardUnknown(m) -} - -var xxx_messageInfo_Metadata proto.InternalMessageInfo - -func (m *Metadata) GetChunkHashes() [][]byte { - if m != nil { - return m.ChunkHashes - } - return nil -} - -// SnapshotItem is an item contained in a rootmulti.Store snapshot. -// -// Since: cosmos-sdk 0.46 -type SnapshotItem struct { - // item is the specific type of snapshot item. - // - // Types that are valid to be assigned to Item: - // - // *SnapshotItem_Store - // *SnapshotItem_IAVL - // *SnapshotItem_Extension - // *SnapshotItem_ExtensionPayload - // *SnapshotItem_KV - // *SnapshotItem_Schema - Item isSnapshotItem_Item `protobuf_oneof:"item"` -} - -func (m *SnapshotItem) Reset() { *m = SnapshotItem{} } -func (m *SnapshotItem) String() string { return proto.CompactTextString(m) } -func (*SnapshotItem) ProtoMessage() {} -func (*SnapshotItem) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{2} -} -func (m *SnapshotItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotItem.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 *SnapshotItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotItem.Merge(m, src) -} -func (m *SnapshotItem) XXX_Size() int { - return m.Size() -} -func (m *SnapshotItem) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotItem proto.InternalMessageInfo - -type isSnapshotItem_Item interface { - isSnapshotItem_Item() - MarshalTo([]byte) (int, error) - Size() int -} - -type SnapshotItem_Store struct { - Store *SnapshotStoreItem `protobuf:"bytes,1,opt,name=store,proto3,oneof" json:"store,omitempty"` -} -type SnapshotItem_IAVL struct { - IAVL *SnapshotIAVLItem `protobuf:"bytes,2,opt,name=iavl,proto3,oneof" json:"iavl,omitempty"` -} -type SnapshotItem_Extension struct { - Extension *SnapshotExtensionMeta `protobuf:"bytes,3,opt,name=extension,proto3,oneof" json:"extension,omitempty"` -} -type SnapshotItem_ExtensionPayload struct { - ExtensionPayload *SnapshotExtensionPayload `protobuf:"bytes,4,opt,name=extension_payload,json=extensionPayload,proto3,oneof" json:"extension_payload,omitempty"` -} -type SnapshotItem_KV struct { - KV *SnapshotKVItem `protobuf:"bytes,5,opt,name=kv,proto3,oneof" json:"kv,omitempty"` -} -type SnapshotItem_Schema struct { - Schema *SnapshotSchema `protobuf:"bytes,6,opt,name=schema,proto3,oneof" json:"schema,omitempty"` -} - -func (*SnapshotItem_Store) isSnapshotItem_Item() {} -func (*SnapshotItem_IAVL) isSnapshotItem_Item() {} -func (*SnapshotItem_Extension) isSnapshotItem_Item() {} -func (*SnapshotItem_ExtensionPayload) isSnapshotItem_Item() {} -func (*SnapshotItem_KV) isSnapshotItem_Item() {} -func (*SnapshotItem_Schema) isSnapshotItem_Item() {} - -func (m *SnapshotItem) GetItem() isSnapshotItem_Item { - if m != nil { - return m.Item - } - return nil -} - -func (m *SnapshotItem) GetStore() *SnapshotStoreItem { - if x, ok := m.GetItem().(*SnapshotItem_Store); ok { - return x.Store - } - return nil -} - -func (m *SnapshotItem) GetIAVL() *SnapshotIAVLItem { - if x, ok := m.GetItem().(*SnapshotItem_IAVL); ok { - return x.IAVL - } - return nil -} - -func (m *SnapshotItem) GetExtension() *SnapshotExtensionMeta { - if x, ok := m.GetItem().(*SnapshotItem_Extension); ok { - return x.Extension - } - return nil -} - -func (m *SnapshotItem) GetExtensionPayload() *SnapshotExtensionPayload { - if x, ok := m.GetItem().(*SnapshotItem_ExtensionPayload); ok { - return x.ExtensionPayload - } - return nil -} - -// Deprecated: Do not use. -func (m *SnapshotItem) GetKV() *SnapshotKVItem { - if x, ok := m.GetItem().(*SnapshotItem_KV); ok { - return x.KV - } - return nil -} - -// Deprecated: Do not use. -func (m *SnapshotItem) GetSchema() *SnapshotSchema { - if x, ok := m.GetItem().(*SnapshotItem_Schema); ok { - return x.Schema - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SnapshotItem) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SnapshotItem_Store)(nil), - (*SnapshotItem_IAVL)(nil), - (*SnapshotItem_Extension)(nil), - (*SnapshotItem_ExtensionPayload)(nil), - (*SnapshotItem_KV)(nil), - (*SnapshotItem_Schema)(nil), - } -} - -// SnapshotStoreItem contains metadata about a snapshotted store. -// -// Since: cosmos-sdk 0.46 -type SnapshotStoreItem struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *SnapshotStoreItem) Reset() { *m = SnapshotStoreItem{} } -func (m *SnapshotStoreItem) String() string { return proto.CompactTextString(m) } -func (*SnapshotStoreItem) ProtoMessage() {} -func (*SnapshotStoreItem) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{3} -} -func (m *SnapshotStoreItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotStoreItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotStoreItem.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 *SnapshotStoreItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotStoreItem.Merge(m, src) -} -func (m *SnapshotStoreItem) XXX_Size() int { - return m.Size() -} -func (m *SnapshotStoreItem) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotStoreItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotStoreItem proto.InternalMessageInfo - -func (m *SnapshotStoreItem) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// SnapshotIAVLItem is an exported IAVL node. -// -// Since: cosmos-sdk 0.46 -type SnapshotIAVLItem struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // version is block height - Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` - // height is depth of the tree. - Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *SnapshotIAVLItem) Reset() { *m = SnapshotIAVLItem{} } -func (m *SnapshotIAVLItem) String() string { return proto.CompactTextString(m) } -func (*SnapshotIAVLItem) ProtoMessage() {} -func (*SnapshotIAVLItem) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{4} -} -func (m *SnapshotIAVLItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotIAVLItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotIAVLItem.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 *SnapshotIAVLItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotIAVLItem.Merge(m, src) -} -func (m *SnapshotIAVLItem) XXX_Size() int { - return m.Size() -} -func (m *SnapshotIAVLItem) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotIAVLItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotIAVLItem proto.InternalMessageInfo - -func (m *SnapshotIAVLItem) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *SnapshotIAVLItem) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *SnapshotIAVLItem) GetVersion() int64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *SnapshotIAVLItem) GetHeight() int32 { - if m != nil { - return m.Height - } - return 0 -} - -// SnapshotExtensionMeta contains metadata about an external snapshotter. -// -// Since: cosmos-sdk 0.46 -type SnapshotExtensionMeta struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` -} - -func (m *SnapshotExtensionMeta) Reset() { *m = SnapshotExtensionMeta{} } -func (m *SnapshotExtensionMeta) String() string { return proto.CompactTextString(m) } -func (*SnapshotExtensionMeta) ProtoMessage() {} -func (*SnapshotExtensionMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{5} -} -func (m *SnapshotExtensionMeta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotExtensionMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotExtensionMeta.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 *SnapshotExtensionMeta) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotExtensionMeta.Merge(m, src) -} -func (m *SnapshotExtensionMeta) XXX_Size() int { - return m.Size() -} -func (m *SnapshotExtensionMeta) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotExtensionMeta.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotExtensionMeta proto.InternalMessageInfo - -func (m *SnapshotExtensionMeta) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *SnapshotExtensionMeta) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -// SnapshotExtensionPayload contains payloads of an external snapshotter. -// -// Since: cosmos-sdk 0.46 -type SnapshotExtensionPayload struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (m *SnapshotExtensionPayload) Reset() { *m = SnapshotExtensionPayload{} } -func (m *SnapshotExtensionPayload) String() string { return proto.CompactTextString(m) } -func (*SnapshotExtensionPayload) ProtoMessage() {} -func (*SnapshotExtensionPayload) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{6} -} -func (m *SnapshotExtensionPayload) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotExtensionPayload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotExtensionPayload.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 *SnapshotExtensionPayload) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotExtensionPayload.Merge(m, src) -} -func (m *SnapshotExtensionPayload) XXX_Size() int { - return m.Size() -} -func (m *SnapshotExtensionPayload) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotExtensionPayload.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotExtensionPayload proto.InternalMessageInfo - -func (m *SnapshotExtensionPayload) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -// SnapshotKVItem is an exported Key/Value Pair -// -// Since: cosmos-sdk 0.46 -// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -// -// Deprecated: Do not use. -type SnapshotKVItem struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *SnapshotKVItem) Reset() { *m = SnapshotKVItem{} } -func (m *SnapshotKVItem) String() string { return proto.CompactTextString(m) } -func (*SnapshotKVItem) ProtoMessage() {} -func (*SnapshotKVItem) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{7} -} -func (m *SnapshotKVItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotKVItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotKVItem.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 *SnapshotKVItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotKVItem.Merge(m, src) -} -func (m *SnapshotKVItem) XXX_Size() int { - return m.Size() -} -func (m *SnapshotKVItem) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotKVItem.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotKVItem proto.InternalMessageInfo - -func (m *SnapshotKVItem) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *SnapshotKVItem) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// SnapshotSchema is an exported schema of smt store -// -// Since: cosmos-sdk 0.46 -// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -// -// Deprecated: Do not use. -type SnapshotSchema struct { - Keys [][]byte `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"` -} - -func (m *SnapshotSchema) Reset() { *m = SnapshotSchema{} } -func (m *SnapshotSchema) String() string { return proto.CompactTextString(m) } -func (*SnapshotSchema) ProtoMessage() {} -func (*SnapshotSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_dd7a3c9b0a19e1ee, []int{8} -} -func (m *SnapshotSchema) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SnapshotSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotSchema.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 *SnapshotSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotSchema.Merge(m, src) -} -func (m *SnapshotSchema) XXX_Size() int { - return m.Size() -} -func (m *SnapshotSchema) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotSchema.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotSchema proto.InternalMessageInfo - -func (m *SnapshotSchema) GetKeys() [][]byte { - if m != nil { - return m.Keys - } - return nil -} - -func init() { - proto.RegisterType((*Snapshot)(nil), "cosmos.base.snapshots.v1beta1.Snapshot") - proto.RegisterType((*Metadata)(nil), "cosmos.base.snapshots.v1beta1.Metadata") - proto.RegisterType((*SnapshotItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotItem") - proto.RegisterType((*SnapshotStoreItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotStoreItem") - proto.RegisterType((*SnapshotIAVLItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") - proto.RegisterType((*SnapshotExtensionMeta)(nil), "cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") - proto.RegisterType((*SnapshotExtensionPayload)(nil), "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") - proto.RegisterType((*SnapshotKVItem)(nil), "cosmos.base.snapshots.v1beta1.SnapshotKVItem") - proto.RegisterType((*SnapshotSchema)(nil), "cosmos.base.snapshots.v1beta1.SnapshotSchema") -} - -func init() { - proto.RegisterFile("cosmos/base/snapshots/v1beta1/snapshot.proto", fileDescriptor_dd7a3c9b0a19e1ee) -} - -var fileDescriptor_dd7a3c9b0a19e1ee = []byte{ - // 586 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xf6, 0x3a, 0x4e, 0x48, 0xd7, 0x06, 0xb5, 0xab, 0x82, 0x2c, 0x24, 0xdc, 0xe0, 0x4b, 0x7d, - 0x68, 0x6d, 0x1a, 0x2a, 0x21, 0x21, 0x2e, 0x04, 0x81, 0x1c, 0x05, 0x04, 0xda, 0xa0, 0x1c, 0xb8, - 0x54, 0x9b, 0x64, 0x1b, 0x47, 0x8e, 0xb3, 0x51, 0x76, 0x63, 0x91, 0x27, 0xe0, 0xca, 0xab, 0xf0, - 0x16, 0x3d, 0xf6, 0xc8, 0xa9, 0x42, 0xc9, 0x8b, 0xa0, 0x5d, 0xff, 0xb4, 0x94, 0x16, 0xd2, 0x53, - 0x66, 0x26, 0xdf, 0xf7, 0x79, 0x76, 0xbe, 0x9d, 0x85, 0x07, 0x03, 0xc6, 0x13, 0xc6, 0x83, 0x3e, - 0xe1, 0x34, 0xe0, 0x53, 0x32, 0xe3, 0x11, 0x13, 0x3c, 0x48, 0x8f, 0xfa, 0x54, 0x90, 0xa3, 0xb2, - 0xe2, 0xcf, 0xe6, 0x4c, 0x30, 0xf4, 0x24, 0x43, 0xfb, 0x12, 0xed, 0x97, 0x68, 0x3f, 0x47, 0x3f, - 0xde, 0x1d, 0xb1, 0x11, 0x53, 0xc8, 0x40, 0x46, 0x19, 0xc9, 0xfd, 0x01, 0x60, 0xbd, 0x9b, 0x63, - 0xd1, 0x23, 0x58, 0x8b, 0xe8, 0x78, 0x14, 0x09, 0x1b, 0x34, 0x80, 0x67, 0xe0, 0x3c, 0x93, 0xf5, - 0x53, 0x36, 0x4f, 0x88, 0xb0, 0xf5, 0x06, 0xf0, 0xee, 0xe3, 0x3c, 0x93, 0xf5, 0x41, 0xb4, 0x98, - 0xc6, 0xdc, 0xae, 0x64, 0xf5, 0x2c, 0x43, 0x08, 0x1a, 0x11, 0xe1, 0x91, 0x6d, 0x34, 0x80, 0x67, - 0x61, 0x15, 0xa3, 0x36, 0xac, 0x27, 0x54, 0x90, 0x21, 0x11, 0xc4, 0xae, 0x36, 0x80, 0x67, 0x36, - 0xf7, 0xfd, 0x7f, 0x36, 0xec, 0x7f, 0xc8, 0xe1, 0x2d, 0xe3, 0xec, 0x62, 0x4f, 0xc3, 0x25, 0xdd, - 0x3d, 0x84, 0xf5, 0xe2, 0x3f, 0xf4, 0x14, 0x5a, 0xea, 0xa3, 0x27, 0xf2, 0x23, 0x94, 0xdb, 0xa0, - 0x51, 0xf1, 0x2c, 0x6c, 0xaa, 0x5a, 0xa8, 0x4a, 0xee, 0x37, 0x03, 0x5a, 0xc5, 0x11, 0xdb, 0x82, - 0x26, 0x28, 0x84, 0x55, 0x2e, 0xd8, 0x9c, 0xaa, 0x53, 0x9a, 0xcd, 0x67, 0xff, 0xe9, 0xa3, 0xe0, - 0x76, 0x25, 0x47, 0x0a, 0x84, 0x1a, 0xce, 0x04, 0xd0, 0x47, 0x68, 0x8c, 0x49, 0x3a, 0x51, 0x63, - 0x31, 0x9b, 0xc1, 0x86, 0x42, 0xed, 0xd7, 0xbd, 0xf7, 0x52, 0xa7, 0x55, 0x5f, 0x5d, 0xec, 0x19, - 0x32, 0x0b, 0x35, 0xac, 0x84, 0xd0, 0x67, 0xb8, 0x45, 0xbf, 0x0a, 0x3a, 0xe5, 0x63, 0x36, 0x55, - 0x43, 0x35, 0x9b, 0xc7, 0x1b, 0xaa, 0xbe, 0x2d, 0x78, 0x72, 0x36, 0xa1, 0x86, 0x2f, 0x85, 0xd0, - 0x29, 0xdc, 0x29, 0x93, 0x93, 0x19, 0x59, 0x4e, 0x18, 0x19, 0x2a, 0x73, 0xcc, 0xe6, 0x8b, 0xbb, - 0xaa, 0x7f, 0xca, 0xe8, 0xa1, 0x86, 0xb7, 0xe9, 0xb5, 0x1a, 0x6a, 0x43, 0x3d, 0x4e, 0x73, 0x77, - 0x0f, 0x37, 0x14, 0xee, 0xf4, 0xca, 0x51, 0xe8, 0x9d, 0x9e, 0x0d, 0x42, 0x0d, 0xeb, 0x71, 0x8a, - 0x3a, 0xb0, 0xc6, 0x07, 0x11, 0x4d, 0x88, 0x5d, 0xbb, 0x93, 0x5c, 0x57, 0x91, 0x5a, 0xba, 0x12, - 0xca, 0x25, 0x5a, 0x35, 0x68, 0x8c, 0x05, 0x4d, 0xdc, 0x7d, 0xb8, 0xf3, 0x97, 0x99, 0xf2, 0xb2, - 0x4e, 0x49, 0x92, 0x5d, 0x86, 0x2d, 0xac, 0x62, 0x77, 0x02, 0xb7, 0xaf, 0x9b, 0x85, 0xb6, 0x61, - 0x25, 0xa6, 0x4b, 0x05, 0xb3, 0xb0, 0x0c, 0xd1, 0x2e, 0xac, 0xa6, 0x64, 0xb2, 0xa0, 0xca, 0x7e, - 0x0b, 0x67, 0x09, 0xb2, 0xe1, 0xbd, 0x94, 0xce, 0x4b, 0x03, 0x2b, 0xb8, 0x48, 0xaf, 0xac, 0x97, - 0x9c, 0x7d, 0xb5, 0x58, 0x2f, 0xf7, 0x0d, 0x7c, 0x78, 0xa3, 0x89, 0x37, 0xb5, 0x76, 0xdb, 0x2e, - 0xba, 0xc7, 0xd0, 0xbe, 0xcd, 0x2b, 0xd9, 0x52, 0xe1, 0x7a, 0xd6, 0x7e, 0x91, 0xba, 0xaf, 0xe0, - 0x83, 0x3f, 0x8d, 0xd8, 0xf4, 0x98, 0x2f, 0x75, 0x1b, 0xb8, 0xde, 0x25, 0x3b, 0x9b, 0xbb, 0xec, - 0x38, 0xa6, 0xcb, 0x62, 0x0d, 0x55, 0x2c, 0x91, 0xad, 0x77, 0x67, 0x2b, 0x07, 0x9c, 0xaf, 0x1c, - 0xf0, 0x6b, 0xe5, 0x80, 0xef, 0x6b, 0x47, 0x3b, 0x5f, 0x3b, 0xda, 0xcf, 0xb5, 0xa3, 0x7d, 0x39, - 0x18, 0x8d, 0x45, 0xb4, 0xe8, 0xfb, 0x03, 0x96, 0x04, 0xf9, 0x73, 0x97, 0xfd, 0x1c, 0xf2, 0x61, - 0x7c, 0xe5, 0xd1, 0x13, 0xcb, 0x19, 0xe5, 0xfd, 0x9a, 0x7a, 0xb5, 0x9e, 0xff, 0x0e, 0x00, 0x00, - 0xff, 0xff, 0xe5, 0xb5, 0xd9, 0x60, 0x1a, 0x05, 0x00, 0x00, -} - -func (m *Snapshot) 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 *Snapshot) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if m.Chunks != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Metadata) 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 *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChunkHashes) > 0 { - for iNdEx := len(m.ChunkHashes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.ChunkHashes[iNdEx]) - copy(dAtA[i:], m.ChunkHashes[iNdEx]) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.ChunkHashes[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SnapshotItem) 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 *SnapshotItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Item != nil { - { - size := m.Item.Size() - i -= size - if _, err := m.Item.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *SnapshotItem_Store) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_Store) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Store != nil { - { - size, err := m.Store.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *SnapshotItem_IAVL) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_IAVL) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.IAVL != nil { - { - size, err := m.IAVL.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *SnapshotItem_Extension) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_Extension) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Extension != nil { - { - size, err := m.Extension.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *SnapshotItem_ExtensionPayload) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_ExtensionPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExtensionPayload != nil { - { - size, err := m.ExtensionPayload.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *SnapshotItem_KV) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_KV) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.KV != nil { - { - size, err := m.KV.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *SnapshotItem_Schema) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotItem_Schema) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Schema != nil { - { - size, err := m.Schema.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSnapshot(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *SnapshotStoreItem) 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 *SnapshotStoreItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotStoreItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotIAVLItem) 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 *SnapshotIAVLItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotIAVLItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x20 - } - if m.Version != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x18 - } - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotExtensionMeta) 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 *SnapshotExtensionMeta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotExtensionMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Format != 0 { - i = encodeVarintSnapshot(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotExtensionPayload) 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 *SnapshotExtensionPayload) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotExtensionPayload) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotKVItem) 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 *SnapshotKVItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotKVItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SnapshotSchema) 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 *SnapshotSchema) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotSchema) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Keys) > 0 { - for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Keys[iNdEx]) - copy(dAtA[i:], m.Keys[iNdEx]) - i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Keys[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { - offset -= sovSnapshot(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Snapshot) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovSnapshot(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovSnapshot(uint64(m.Format)) - } - if m.Chunks != 0 { - n += 1 + sovSnapshot(uint64(m.Chunks)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - l = m.Metadata.Size() - n += 1 + l + sovSnapshot(uint64(l)) - return n -} - -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ChunkHashes) > 0 { - for _, b := range m.ChunkHashes { - l = len(b) - n += 1 + l + sovSnapshot(uint64(l)) - } - } - return n -} - -func (m *SnapshotItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Item != nil { - n += m.Item.Size() - } - return n -} - -func (m *SnapshotItem_Store) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Store != nil { - l = m.Store.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotItem_IAVL) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.IAVL != nil { - l = m.IAVL.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotItem_Extension) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Extension != nil { - l = m.Extension.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotItem_ExtensionPayload) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ExtensionPayload != nil { - l = m.ExtensionPayload.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotItem_KV) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.KV != nil { - l = m.KV.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotItem_Schema) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Schema != nil { - l = m.Schema.Size() - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} -func (m *SnapshotStoreItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} - -func (m *SnapshotIAVLItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - if m.Version != 0 { - n += 1 + sovSnapshot(uint64(m.Version)) - } - if m.Height != 0 { - n += 1 + sovSnapshot(uint64(m.Height)) - } - return n -} - -func (m *SnapshotExtensionMeta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - if m.Format != 0 { - n += 1 + sovSnapshot(uint64(m.Format)) - } - return n -} - -func (m *SnapshotExtensionPayload) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Payload) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} - -func (m *SnapshotKVItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovSnapshot(uint64(l)) - } - return n -} - -func (m *SnapshotSchema) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Keys) > 0 { - for _, b := range m.Keys { - l = len(b) - n += 1 + l + sovSnapshot(uint64(l)) - } - } - return n -} - -func sovSnapshot(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSnapshot(x uint64) (n int) { - return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Snapshot) 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 ErrIntOverflowSnapshot - } - 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: Snapshot: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - m.Chunks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Metadata) 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 ErrIntOverflowSnapshot - } - 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: Metadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkHashes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChunkHashes = append(m.ChunkHashes, make([]byte, postIndex-iNdEx)) - copy(m.ChunkHashes[len(m.ChunkHashes)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotItem) 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 ErrIntOverflowSnapshot - } - 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: SnapshotItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Store", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotStoreItem{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_Store{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IAVL", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotIAVLItem{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_IAVL{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Extension", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotExtensionMeta{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_Extension{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExtensionPayload", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotExtensionPayload{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_ExtensionPayload{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KV", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotKVItem{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_KV{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotSchema{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Item = &SnapshotItem_Schema{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotStoreItem) 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 ErrIntOverflowSnapshot - } - 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: SnapshotStoreItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotStoreItem: 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 ErrIntOverflowSnapshot - } - 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 ErrInvalidLengthSnapshot - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotIAVLItem) 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 ErrIntOverflowSnapshot - } - 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: SnapshotIAVLItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotIAVLItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - case 3: - 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 ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotExtensionMeta) 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 ErrIntOverflowSnapshot - } - 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: SnapshotExtensionMeta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotExtensionMeta: 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 ErrIntOverflowSnapshot - } - 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 ErrInvalidLengthSnapshot - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - 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 Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotExtensionPayload) 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 ErrIntOverflowSnapshot - } - 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: SnapshotExtensionPayload: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotExtensionPayload: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotKVItem) 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 ErrIntOverflowSnapshot - } - 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: SnapshotKVItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotKVItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SnapshotSchema) 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 ErrIntOverflowSnapshot - } - 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: SnapshotSchema: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotSchema: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSnapshot - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSnapshot - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSnapshot - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSnapshot(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSnapshot - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSnapshot(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, ErrIntOverflowSnapshot - } - 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, ErrIntOverflowSnapshot - } - 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, ErrIntOverflowSnapshot - } - 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, ErrInvalidLengthSnapshot - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSnapshot - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSnapshot - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go b/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go deleted file mode 100644 index 58111754b431..000000000000 --- a/github.com/cosmos/cosmos-sdk/store/types/commit_info.pb.go +++ /dev/null @@ -1,866 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/store/v1beta1/commit_info.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "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 - -// CommitInfo defines commit information used by the multi-store when committing -// a version/height. -type CommitInfo struct { - Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - StoreInfos []StoreInfo `protobuf:"bytes,2,rep,name=store_infos,json=storeInfos,proto3" json:"store_infos"` - Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` -} - -func (m *CommitInfo) Reset() { *m = CommitInfo{} } -func (m *CommitInfo) String() string { return proto.CompactTextString(m) } -func (*CommitInfo) ProtoMessage() {} -func (*CommitInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_83f4097f6265b52f, []int{0} -} -func (m *CommitInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CommitInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CommitInfo.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 *CommitInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitInfo.Merge(m, src) -} -func (m *CommitInfo) XXX_Size() int { - return m.Size() -} -func (m *CommitInfo) XXX_DiscardUnknown() { - xxx_messageInfo_CommitInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitInfo proto.InternalMessageInfo - -func (m *CommitInfo) GetVersion() int64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *CommitInfo) GetStoreInfos() []StoreInfo { - if m != nil { - return m.StoreInfos - } - return nil -} - -func (m *CommitInfo) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -// StoreInfo defines store-specific commit information. It contains a reference -// between a store name and the commit ID. -type StoreInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - CommitId CommitID `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id"` -} - -func (m *StoreInfo) Reset() { *m = StoreInfo{} } -func (m *StoreInfo) String() string { return proto.CompactTextString(m) } -func (*StoreInfo) ProtoMessage() {} -func (*StoreInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_83f4097f6265b52f, []int{1} -} -func (m *StoreInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreInfo.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 *StoreInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreInfo.Merge(m, src) -} -func (m *StoreInfo) XXX_Size() int { - return m.Size() -} -func (m *StoreInfo) XXX_DiscardUnknown() { - xxx_messageInfo_StoreInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreInfo proto.InternalMessageInfo - -func (m *StoreInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *StoreInfo) GetCommitId() CommitID { - if m != nil { - return m.CommitId - } - return CommitID{} -} - -// CommitID defines the commitment information when a specific store is -// committed. -type CommitID struct { - Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *CommitID) Reset() { *m = CommitID{} } -func (*CommitID) ProtoMessage() {} -func (*CommitID) Descriptor() ([]byte, []int) { - return fileDescriptor_83f4097f6265b52f, []int{2} -} -func (m *CommitID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CommitID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CommitID.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 *CommitID) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitID.Merge(m, src) -} -func (m *CommitID) XXX_Size() int { - return m.Size() -} -func (m *CommitID) XXX_DiscardUnknown() { - xxx_messageInfo_CommitID.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitID proto.InternalMessageInfo - -func (m *CommitID) GetVersion() int64 { - if m != nil { - return m.Version - } - return 0 -} - -func (m *CommitID) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func init() { - proto.RegisterType((*CommitInfo)(nil), "cosmos.base.store.v1beta1.CommitInfo") - proto.RegisterType((*StoreInfo)(nil), "cosmos.base.store.v1beta1.StoreInfo") - proto.RegisterType((*CommitID)(nil), "cosmos.base.store.v1beta1.CommitID") -} - -func init() { - proto.RegisterFile("cosmos/base/store/v1beta1/commit_info.proto", fileDescriptor_83f4097f6265b52f) -} - -var fileDescriptor_83f4097f6265b52f = []byte{ - // 354 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xb1, 0x4e, 0xfb, 0x30, - 0x10, 0xc6, 0xe3, 0x36, 0xfa, 0xff, 0x1b, 0x97, 0xc9, 0x62, 0x08, 0x1d, 0x92, 0xaa, 0x30, 0x44, - 0x42, 0xd8, 0x6a, 0xd9, 0x18, 0x18, 0x02, 0x42, 0xaa, 0xd8, 0x02, 0x13, 0x0b, 0x4a, 0x5a, 0x37, - 0x8d, 0xc0, 0xb9, 0xaa, 0x76, 0x2b, 0xf1, 0x16, 0x1d, 0x19, 0x79, 0x0b, 0x5e, 0xa1, 0x63, 0x47, - 0x26, 0x40, 0xcd, 0x8b, 0xa0, 0x38, 0x71, 0x99, 0xe8, 0x94, 0xbb, 0xf8, 0xbb, 0xfb, 0x7e, 0xfa, - 0x74, 0xf8, 0x74, 0x04, 0x52, 0x80, 0x64, 0x49, 0x2c, 0x39, 0x93, 0x0a, 0xe6, 0x9c, 0x2d, 0xfb, - 0x09, 0x57, 0x71, 0x9f, 0x8d, 0x40, 0x88, 0x4c, 0x3d, 0x66, 0xf9, 0x04, 0xe8, 0x6c, 0x0e, 0x0a, - 0xc8, 0x51, 0x25, 0xa6, 0xa5, 0x98, 0x6a, 0x31, 0xad, 0xc5, 0x9d, 0xc3, 0x14, 0x52, 0xd0, 0x2a, - 0x56, 0x56, 0xd5, 0x40, 0xc7, 0x4f, 0x01, 0xd2, 0x67, 0xce, 0x74, 0x97, 0x2c, 0x26, 0x4c, 0x65, - 0x82, 0x4b, 0x15, 0x8b, 0x59, 0x25, 0xe8, 0xbd, 0x23, 0x8c, 0xaf, 0xb4, 0xcf, 0x30, 0x9f, 0x00, - 0x71, 0xf1, 0xff, 0x25, 0x9f, 0xcb, 0x0c, 0x72, 0x17, 0x75, 0x51, 0xd0, 0x8c, 0x4c, 0x4b, 0x6e, - 0x71, 0x5b, 0x1b, 0x6a, 0x1c, 0xe9, 0x36, 0xba, 0xcd, 0xa0, 0x3d, 0x38, 0xa1, 0x7f, 0x02, 0xd1, - 0xbb, 0xb2, 0x2b, 0x97, 0x86, 0xf6, 0xfa, 0xd3, 0xb7, 0x22, 0x2c, 0xcd, 0x0f, 0x49, 0x42, 0xec, - 0xec, 0x40, 0xdc, 0x66, 0x17, 0x05, 0xed, 0x41, 0x87, 0x56, 0xa8, 0xd4, 0xa0, 0xd2, 0x7b, 0xa3, - 0x08, 0x5b, 0xe5, 0x82, 0xd5, 0x97, 0x8f, 0xa2, 0xdf, 0xb1, 0x5e, 0x8a, 0x9d, 0x9d, 0x05, 0x21, - 0xd8, 0xce, 0x63, 0xc1, 0x35, 0xb4, 0x13, 0xe9, 0x9a, 0xdc, 0x60, 0xc7, 0x24, 0x38, 0x76, 0x1b, - 0xda, 0xe4, 0x78, 0x0f, 0x6f, 0x9d, 0xc2, 0x75, 0x8d, 0xdb, 0xaa, 0x66, 0x87, 0xe3, 0xde, 0x25, - 0x6e, 0x99, 0xb7, 0x3d, 0xf9, 0x10, 0x6c, 0x4f, 0x63, 0x39, 0xd5, 0x46, 0x07, 0x91, 0xae, 0x2f, - 0xec, 0xd7, 0x37, 0xdf, 0x0a, 0xc3, 0xf5, 0xd6, 0x43, 0x9b, 0xad, 0x87, 0xbe, 0xb7, 0x1e, 0x5a, - 0x15, 0x9e, 0xb5, 0x29, 0x3c, 0xeb, 0xa3, 0xf0, 0xac, 0x87, 0x20, 0xcd, 0xd4, 0x74, 0x91, 0xd0, - 0x11, 0x08, 0x56, 0x9f, 0x41, 0xf5, 0x39, 0x93, 0xe3, 0xa7, 0xfa, 0x18, 0xd4, 0xcb, 0x8c, 0xcb, - 0xe4, 0x9f, 0x4e, 0xe5, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x46, 0x0e, 0x24, 0xd4, 0x2e, 0x02, - 0x00, 0x00, -} - -func (m *CommitInfo) 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 *CommitInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommitInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintCommitInfo(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1a - if len(m.StoreInfos) > 0 { - for iNdEx := len(m.StoreInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.StoreInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommitInfo(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Version != 0 { - i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StoreInfo) 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 *StoreInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.CommitId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCommitInfo(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CommitID) 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 *CommitID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommitID) 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 = encodeVarintCommitInfo(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if m.Version != 0 { - i = encodeVarintCommitInfo(dAtA, i, uint64(m.Version)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintCommitInfo(dAtA []byte, offset int, v uint64) int { - offset -= sovCommitInfo(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *CommitInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Version != 0 { - n += 1 + sovCommitInfo(uint64(m.Version)) - } - if len(m.StoreInfos) > 0 { - for _, e := range m.StoreInfos { - l = e.Size() - n += 1 + l + sovCommitInfo(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovCommitInfo(uint64(l)) - return n -} - -func (m *StoreInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCommitInfo(uint64(l)) - } - l = m.CommitId.Size() - n += 1 + l + sovCommitInfo(uint64(l)) - return n -} - -func (m *CommitID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Version != 0 { - n += 1 + sovCommitInfo(uint64(m.Version)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovCommitInfo(uint64(l)) - } - return n -} - -func sovCommitInfo(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCommitInfo(x uint64) (n int) { - return sovCommitInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *CommitInfo) 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 ErrIntOverflowCommitInfo - } - 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: CommitInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommitInfo - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommitInfo - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoreInfos = append(m.StoreInfos, StoreInfo{}) - if err := m.StoreInfos[len(m.StoreInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommitInfo - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommitInfo - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommitInfo(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommitInfo - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StoreInfo) 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 ErrIntOverflowCommitInfo - } - 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: StoreInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreInfo: 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 ErrIntOverflowCommitInfo - } - 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 ErrInvalidLengthCommitInfo - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommitInfo - } - 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 CommitId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCommitInfo - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCommitInfo - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CommitId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommitInfo(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommitInfo - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommitID) 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 ErrIntOverflowCommitInfo - } - 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: CommitID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommitID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Version |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitInfo - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCommitInfo - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCommitInfo - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommitInfo(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommitInfo - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCommitInfo(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, ErrIntOverflowCommitInfo - } - 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, ErrIntOverflowCommitInfo - } - 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, ErrIntOverflowCommitInfo - } - 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, ErrInvalidLengthCommitInfo - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCommitInfo - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCommitInfo - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCommitInfo = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCommitInfo = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCommitInfo = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go b/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go deleted file mode 100644 index fafc6fad93da..000000000000 --- a/github.com/cosmos/cosmos-sdk/store/types/listening.pb.go +++ /dev/null @@ -1,1212 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/store/v1beta1/listening.proto - -package types - -import ( - fmt "fmt" - types "github.com/cometbft/cometbft/abci/types" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -// Deletes -// -// Since: cosmos-sdk 0.43 -type StoreKVPair struct { - StoreKey string `protobuf:"bytes,1,opt,name=store_key,json=storeKey,proto3" json:"store_key,omitempty"` - Delete bool `protobuf:"varint,2,opt,name=delete,proto3" json:"delete,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *StoreKVPair) Reset() { *m = StoreKVPair{} } -func (m *StoreKVPair) String() string { return proto.CompactTextString(m) } -func (*StoreKVPair) ProtoMessage() {} -func (*StoreKVPair) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d350879fe4fecd, []int{0} -} -func (m *StoreKVPair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StoreKVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StoreKVPair.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 *StoreKVPair) XXX_Merge(src proto.Message) { - xxx_messageInfo_StoreKVPair.Merge(m, src) -} -func (m *StoreKVPair) XXX_Size() int { - return m.Size() -} -func (m *StoreKVPair) XXX_DiscardUnknown() { - xxx_messageInfo_StoreKVPair.DiscardUnknown(m) -} - -var xxx_messageInfo_StoreKVPair proto.InternalMessageInfo - -func (m *StoreKVPair) GetStoreKey() string { - if m != nil { - return m.StoreKey - } - return "" -} - -func (m *StoreKVPair) GetDelete() bool { - if m != nil { - return m.Delete - } - return false -} - -func (m *StoreKVPair) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *StoreKVPair) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -// BlockMetadata contains all the abci event data of a block -// the file streamer dump them into files together with the state changes. -type BlockMetadata struct { - RequestBeginBlock *types.RequestBeginBlock `protobuf:"bytes,1,opt,name=request_begin_block,json=requestBeginBlock,proto3" json:"request_begin_block,omitempty"` - ResponseBeginBlock *types.ResponseBeginBlock `protobuf:"bytes,2,opt,name=response_begin_block,json=responseBeginBlock,proto3" json:"response_begin_block,omitempty"` - DeliverTxs []*BlockMetadata_DeliverTx `protobuf:"bytes,3,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"` - RequestEndBlock *types.RequestEndBlock `protobuf:"bytes,4,opt,name=request_end_block,json=requestEndBlock,proto3" json:"request_end_block,omitempty"` - ResponseEndBlock *types.ResponseEndBlock `protobuf:"bytes,5,opt,name=response_end_block,json=responseEndBlock,proto3" json:"response_end_block,omitempty"` - ResponseCommit *types.ResponseCommit `protobuf:"bytes,6,opt,name=response_commit,json=responseCommit,proto3" json:"response_commit,omitempty"` -} - -func (m *BlockMetadata) Reset() { *m = BlockMetadata{} } -func (m *BlockMetadata) String() string { return proto.CompactTextString(m) } -func (*BlockMetadata) ProtoMessage() {} -func (*BlockMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d350879fe4fecd, []int{1} -} -func (m *BlockMetadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockMetadata.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 *BlockMetadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadata.Merge(m, src) -} -func (m *BlockMetadata) XXX_Size() int { - return m.Size() -} -func (m *BlockMetadata) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadata.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockMetadata proto.InternalMessageInfo - -func (m *BlockMetadata) GetRequestBeginBlock() *types.RequestBeginBlock { - if m != nil { - return m.RequestBeginBlock - } - return nil -} - -func (m *BlockMetadata) GetResponseBeginBlock() *types.ResponseBeginBlock { - if m != nil { - return m.ResponseBeginBlock - } - return nil -} - -func (m *BlockMetadata) GetDeliverTxs() []*BlockMetadata_DeliverTx { - if m != nil { - return m.DeliverTxs - } - return nil -} - -func (m *BlockMetadata) GetRequestEndBlock() *types.RequestEndBlock { - if m != nil { - return m.RequestEndBlock - } - return nil -} - -func (m *BlockMetadata) GetResponseEndBlock() *types.ResponseEndBlock { - if m != nil { - return m.ResponseEndBlock - } - return nil -} - -func (m *BlockMetadata) GetResponseCommit() *types.ResponseCommit { - if m != nil { - return m.ResponseCommit - } - return nil -} - -// DeliverTx encapulate deliver tx request and response. -type BlockMetadata_DeliverTx struct { - Request *types.RequestDeliverTx `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Response *types.ResponseDeliverTx `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` -} - -func (m *BlockMetadata_DeliverTx) Reset() { *m = BlockMetadata_DeliverTx{} } -func (m *BlockMetadata_DeliverTx) String() string { return proto.CompactTextString(m) } -func (*BlockMetadata_DeliverTx) ProtoMessage() {} -func (*BlockMetadata_DeliverTx) Descriptor() ([]byte, []int) { - return fileDescriptor_a5d350879fe4fecd, []int{1, 0} -} -func (m *BlockMetadata_DeliverTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BlockMetadata_DeliverTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockMetadata_DeliverTx.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 *BlockMetadata_DeliverTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMetadata_DeliverTx.Merge(m, src) -} -func (m *BlockMetadata_DeliverTx) XXX_Size() int { - return m.Size() -} -func (m *BlockMetadata_DeliverTx) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMetadata_DeliverTx.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockMetadata_DeliverTx proto.InternalMessageInfo - -func (m *BlockMetadata_DeliverTx) GetRequest() *types.RequestDeliverTx { - if m != nil { - return m.Request - } - return nil -} - -func (m *BlockMetadata_DeliverTx) GetResponse() *types.ResponseDeliverTx { - if m != nil { - return m.Response - } - return nil -} - -func init() { - proto.RegisterType((*StoreKVPair)(nil), "cosmos.base.store.v1beta1.StoreKVPair") - proto.RegisterType((*BlockMetadata)(nil), "cosmos.base.store.v1beta1.BlockMetadata") - proto.RegisterType((*BlockMetadata_DeliverTx)(nil), "cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") -} - -func init() { - proto.RegisterFile("cosmos/base/store/v1beta1/listening.proto", fileDescriptor_a5d350879fe4fecd) -} - -var fileDescriptor_a5d350879fe4fecd = []byte{ - // 473 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x93, 0x4f, 0x6f, 0xd3, 0x40, - 0x10, 0xc5, 0xe3, 0xa6, 0x09, 0xc9, 0x04, 0x68, 0x59, 0x2a, 0x64, 0x5a, 0xc9, 0xb8, 0xe1, 0x62, - 0x0e, 0xac, 0xd5, 0x70, 0x44, 0xe2, 0x10, 0x40, 0x42, 0x2a, 0x08, 0xe4, 0x02, 0x07, 0x2e, 0x96, - 0xff, 0x8c, 0xc2, 0x12, 0xdb, 0x1b, 0x76, 0x37, 0x51, 0x73, 0xe6, 0xc2, 0x91, 0x8f, 0xc5, 0xb1, - 0x47, 0x8e, 0x28, 0xf9, 0x22, 0xc8, 0x6b, 0xc7, 0xa9, 0x43, 0x7d, 0xca, 0xee, 0xe4, 0xbd, 0x9f, - 0xdf, 0xcc, 0x6a, 0xe0, 0x49, 0xc4, 0x65, 0xca, 0xa5, 0x1b, 0x06, 0x12, 0x5d, 0xa9, 0xb8, 0x40, - 0x77, 0x71, 0x16, 0xa2, 0x0a, 0xce, 0xdc, 0x84, 0x49, 0x85, 0x19, 0xcb, 0x26, 0x74, 0x26, 0xb8, - 0xe2, 0xe4, 0x61, 0x21, 0xa5, 0xb9, 0x94, 0x6a, 0x29, 0x2d, 0xa5, 0xc7, 0x27, 0x0a, 0xb3, 0x18, - 0x45, 0xca, 0x32, 0xe5, 0x06, 0x61, 0xc4, 0x5c, 0xb5, 0x9c, 0xa1, 0x2c, 0x7c, 0xc3, 0x6f, 0x30, - 0xb8, 0xc8, 0xd5, 0xe7, 0x9f, 0x3f, 0x04, 0x4c, 0x90, 0x13, 0xe8, 0x6b, 0xb3, 0x3f, 0xc5, 0xa5, - 0x69, 0xd8, 0x86, 0xd3, 0xf7, 0x7a, 0xba, 0x70, 0x8e, 0x4b, 0xf2, 0x00, 0xba, 0x31, 0x26, 0xa8, - 0xd0, 0xdc, 0xb3, 0x0d, 0xa7, 0xe7, 0x95, 0x37, 0x72, 0x08, 0xed, 0x5c, 0xde, 0xb6, 0x0d, 0xe7, - 0xb6, 0x97, 0x1f, 0xc9, 0x11, 0x74, 0x16, 0x41, 0x32, 0x47, 0x73, 0x5f, 0xd7, 0x8a, 0xcb, 0xf0, - 0x47, 0x07, 0xee, 0x8c, 0x13, 0x1e, 0x4d, 0xdf, 0xa1, 0x0a, 0xe2, 0x40, 0x05, 0xc4, 0x83, 0xfb, - 0x02, 0xbf, 0xcf, 0x51, 0x2a, 0x3f, 0xc4, 0x09, 0xcb, 0xfc, 0x30, 0xff, 0x5b, 0x7f, 0x78, 0x30, - 0x1a, 0xd2, 0x6d, 0x70, 0x9a, 0x07, 0xa7, 0x5e, 0xa1, 0x1d, 0xe7, 0x52, 0x0d, 0xf2, 0xee, 0x89, - 0xdd, 0x12, 0xf9, 0x04, 0x47, 0x02, 0xe5, 0x8c, 0x67, 0x12, 0x6b, 0xd0, 0x3d, 0x0d, 0x7d, 0x7c, - 0x03, 0xb4, 0x10, 0x5f, 0xa3, 0x12, 0xf1, 0x5f, 0x8d, 0x5c, 0xc0, 0x20, 0xc6, 0x84, 0x2d, 0x50, - 0xf8, 0xea, 0x52, 0x9a, 0x6d, 0xbb, 0xed, 0x0c, 0x46, 0x23, 0xda, 0x38, 0x76, 0x5a, 0xeb, 0x94, - 0xbe, 0x2a, 0xbc, 0x1f, 0x2f, 0x3d, 0x88, 0x37, 0x47, 0x49, 0xde, 0xc2, 0xa6, 0x01, 0x1f, 0xb3, - 0xb8, 0x0c, 0xba, 0xaf, 0x83, 0xda, 0x4d, 0xdd, 0xbf, 0xce, 0xe2, 0x22, 0xe5, 0x81, 0xa8, 0x17, - 0xc8, 0x7b, 0xa8, 0x82, 0x5f, 0xc3, 0x75, 0x34, 0xee, 0xb4, 0xb1, 0xef, 0x8a, 0x77, 0x28, 0x76, - 0x2a, 0xe4, 0x0d, 0x1c, 0x54, 0xc0, 0x88, 0xa7, 0x29, 0x53, 0x66, 0x57, 0xd3, 0x1e, 0x35, 0xd2, - 0x5e, 0x6a, 0x99, 0x77, 0x57, 0xd4, 0xee, 0xc7, 0x3f, 0x0d, 0xe8, 0x57, 0x23, 0x20, 0xcf, 0xe1, - 0x56, 0x99, 0xbd, 0x7c, 0xea, 0xd3, 0xa6, 0x66, 0xb7, 0x63, 0xdb, 0x38, 0xc8, 0x0b, 0xe8, 0x6d, - 0xe0, 0xe5, 0x9b, 0x0e, 0x1b, 0xd3, 0x6c, 0xed, 0x95, 0x67, 0x3c, 0xfe, 0xbd, 0xb2, 0x8c, 0xab, - 0x95, 0x65, 0xfc, 0x5d, 0x59, 0xc6, 0xaf, 0xb5, 0xd5, 0xba, 0x5a, 0x5b, 0xad, 0x3f, 0x6b, 0xab, - 0xf5, 0xc5, 0x99, 0x30, 0xf5, 0x75, 0x1e, 0xd2, 0x88, 0xa7, 0x6e, 0xb9, 0x79, 0xc5, 0xcf, 0x53, - 0x19, 0x4f, 0xcb, 0xfd, 0xd3, 0xbb, 0x13, 0x76, 0xf5, 0xf2, 0x3c, 0xfb, 0x17, 0x00, 0x00, 0xff, - 0xff, 0x69, 0x5c, 0x8f, 0x23, 0xa1, 0x03, 0x00, 0x00, -} - -func (m *StoreKVPair) 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 *StoreKVPair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StoreKVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintListening(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x22 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintListening(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x1a - } - if m.Delete { - i-- - if m.Delete { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.StoreKey) > 0 { - i -= len(m.StoreKey) - copy(dAtA[i:], m.StoreKey) - i = encodeVarintListening(dAtA, i, uint64(len(m.StoreKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BlockMetadata) 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 *BlockMetadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ResponseCommit != nil { - { - size, err := m.ResponseCommit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.ResponseEndBlock != nil { - { - size, err := m.ResponseEndBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.RequestEndBlock != nil { - { - size, err := m.RequestEndBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if len(m.DeliverTxs) > 0 { - for iNdEx := len(m.DeliverTxs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DeliverTxs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.ResponseBeginBlock != nil { - { - size, err := m.ResponseBeginBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.RequestBeginBlock != nil { - { - size, err := m.RequestBeginBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BlockMetadata_DeliverTx) 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 *BlockMetadata_DeliverTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockMetadata_DeliverTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Response != nil { - { - size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Request != nil { - { - size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintListening(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintListening(dAtA []byte, offset int, v uint64) int { - offset -= sovListening(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *StoreKVPair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.StoreKey) - if l > 0 { - n += 1 + l + sovListening(uint64(l)) - } - if m.Delete { - n += 2 - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovListening(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovListening(uint64(l)) - } - return n -} - -func (m *BlockMetadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestBeginBlock != nil { - l = m.RequestBeginBlock.Size() - n += 1 + l + sovListening(uint64(l)) - } - if m.ResponseBeginBlock != nil { - l = m.ResponseBeginBlock.Size() - n += 1 + l + sovListening(uint64(l)) - } - if len(m.DeliverTxs) > 0 { - for _, e := range m.DeliverTxs { - l = e.Size() - n += 1 + l + sovListening(uint64(l)) - } - } - if m.RequestEndBlock != nil { - l = m.RequestEndBlock.Size() - n += 1 + l + sovListening(uint64(l)) - } - if m.ResponseEndBlock != nil { - l = m.ResponseEndBlock.Size() - n += 1 + l + sovListening(uint64(l)) - } - if m.ResponseCommit != nil { - l = m.ResponseCommit.Size() - n += 1 + l + sovListening(uint64(l)) - } - return n -} - -func (m *BlockMetadata_DeliverTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Request != nil { - l = m.Request.Size() - n += 1 + l + sovListening(uint64(l)) - } - if m.Response != nil { - l = m.Response.Size() - n += 1 + l + sovListening(uint64(l)) - } - return n -} - -func sovListening(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozListening(x uint64) (n int) { - return sovListening(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *StoreKVPair) 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 ErrIntOverflowListening - } - 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: StoreKVPair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StoreKVPair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StoreKey", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - 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 ErrInvalidLengthListening - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StoreKey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Delete", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Delete = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipListening(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthListening - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockMetadata) 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 ErrIntOverflowListening - } - 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: BlockMetadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockMetadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestBeginBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RequestBeginBlock == nil { - m.RequestBeginBlock = &types.RequestBeginBlock{} - } - if err := m.RequestBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseBeginBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResponseBeginBlock == nil { - m.ResponseBeginBlock = &types.ResponseBeginBlock{} - } - if err := m.ResponseBeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTxs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DeliverTxs = append(m.DeliverTxs, &BlockMetadata_DeliverTx{}) - if err := m.DeliverTxs[len(m.DeliverTxs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestEndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RequestEndBlock == nil { - m.RequestEndBlock = &types.RequestEndBlock{} - } - if err := m.RequestEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseEndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResponseEndBlock == nil { - m.ResponseEndBlock = &types.ResponseEndBlock{} - } - if err := m.ResponseEndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ResponseCommit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ResponseCommit == nil { - m.ResponseCommit = &types.ResponseCommit{} - } - if err := m.ResponseCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipListening(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthListening - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *BlockMetadata_DeliverTx) 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 ErrIntOverflowListening - } - 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: DeliverTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DeliverTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Request == nil { - m.Request = &types.RequestDeliverTx{} - } - if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowListening - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthListening - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthListening - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Response == nil { - m.Response = &types.ResponseDeliverTx{} - } - if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipListening(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthListening - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipListening(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, ErrIntOverflowListening - } - 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, ErrIntOverflowListening - } - 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, ErrIntOverflowListening - } - 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, ErrInvalidLengthListening - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupListening - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthListening - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthListening = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowListening = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupListening = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/types/abci.pb.go b/github.com/cosmos/cosmos-sdk/types/abci.pb.go deleted file mode 100644 index 4cc102bc1ac5..000000000000 --- a/github.com/cosmos/cosmos-sdk/types/abci.pb.go +++ /dev/null @@ -1,3278 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/abci/v1beta1/abci.proto - -package types - -import ( - fmt "fmt" - types1 "github.com/cometbft/cometbft/abci/types" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// 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 - -// TxResponse defines a structure containing relevant tx data and metadata. The -// tags are stringified and the log is JSON decoded. -type TxResponse struct { - // The block height - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - // The transaction hash. - TxHash string `protobuf:"bytes,2,opt,name=txhash,proto3" json:"txhash,omitempty"` - // Namespace for the Code - Codespace string `protobuf:"bytes,3,opt,name=codespace,proto3" json:"codespace,omitempty"` - // Response code. - Code uint32 `protobuf:"varint,4,opt,name=code,proto3" json:"code,omitempty"` - // Result bytes, if any. - Data string `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` - // The output of the application's logger (raw string). May be - // non-deterministic. - RawLog string `protobuf:"bytes,6,opt,name=raw_log,json=rawLog,proto3" json:"raw_log,omitempty"` - // The output of the application's logger (typed). May be non-deterministic. - Logs ABCIMessageLogs `protobuf:"bytes,7,rep,name=logs,proto3,castrepeated=ABCIMessageLogs" json:"logs"` - // Additional information. May be non-deterministic. - Info string `protobuf:"bytes,8,opt,name=info,proto3" json:"info,omitempty"` - // Amount of gas requested for transaction. - GasWanted int64 `protobuf:"varint,9,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - // Amount of gas consumed by transaction. - GasUsed int64 `protobuf:"varint,10,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - // The request transaction bytes. - Tx *types.Any `protobuf:"bytes,11,opt,name=tx,proto3" json:"tx,omitempty"` - // Time of the previous block. For heights > 1, it's the weighted median of - // the timestamps of the valid votes in the block.LastCommit. For height == 1, - // it's genesis time. - Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Events defines all the events emitted by processing a transaction. Note, - // these events include those emitted by processing all the messages and those - // emitted from the ante. Whereas Logs contains the events, with - // additional metadata, emitted only by processing the messages. - // - // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` -} - -func (m *TxResponse) Reset() { *m = TxResponse{} } -func (*TxResponse) ProtoMessage() {} -func (*TxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{0} -} -func (m *TxResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxResponse.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 *TxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxResponse.Merge(m, src) -} -func (m *TxResponse) XXX_Size() int { - return m.Size() -} -func (m *TxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TxResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TxResponse proto.InternalMessageInfo - -// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. -type ABCIMessageLog struct { - MsgIndex uint32 `protobuf:"varint,1,opt,name=msg_index,json=msgIndex,proto3" json:"msg_index"` - Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` - // Events contains a slice of Event objects that were emitted during some - // execution. - Events StringEvents `protobuf:"bytes,3,rep,name=events,proto3,castrepeated=StringEvents" json:"events"` -} - -func (m *ABCIMessageLog) Reset() { *m = ABCIMessageLog{} } -func (*ABCIMessageLog) ProtoMessage() {} -func (*ABCIMessageLog) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{1} -} -func (m *ABCIMessageLog) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ABCIMessageLog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ABCIMessageLog.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 *ABCIMessageLog) XXX_Merge(src proto.Message) { - xxx_messageInfo_ABCIMessageLog.Merge(m, src) -} -func (m *ABCIMessageLog) XXX_Size() int { - return m.Size() -} -func (m *ABCIMessageLog) XXX_DiscardUnknown() { - xxx_messageInfo_ABCIMessageLog.DiscardUnknown(m) -} - -var xxx_messageInfo_ABCIMessageLog proto.InternalMessageInfo - -func (m *ABCIMessageLog) GetMsgIndex() uint32 { - if m != nil { - return m.MsgIndex - } - return 0 -} - -func (m *ABCIMessageLog) GetLog() string { - if m != nil { - return m.Log - } - return "" -} - -func (m *ABCIMessageLog) GetEvents() StringEvents { - if m != nil { - return m.Events - } - return nil -} - -// StringEvent defines en Event object wrapper where all the attributes -// contain key/value pairs that are strings instead of raw bytes. -type StringEvent struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Attributes []Attribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes"` -} - -func (m *StringEvent) Reset() { *m = StringEvent{} } -func (*StringEvent) ProtoMessage() {} -func (*StringEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{2} -} -func (m *StringEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StringEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StringEvent.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 *StringEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringEvent.Merge(m, src) -} -func (m *StringEvent) XXX_Size() int { - return m.Size() -} -func (m *StringEvent) XXX_DiscardUnknown() { - xxx_messageInfo_StringEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_StringEvent proto.InternalMessageInfo - -func (m *StringEvent) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *StringEvent) GetAttributes() []Attribute { - if m != nil { - return m.Attributes - } - return nil -} - -// Attribute defines an attribute wrapper where the key and value are -// strings instead of raw bytes. -type Attribute struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Attribute) Reset() { *m = Attribute{} } -func (*Attribute) ProtoMessage() {} -func (*Attribute) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{3} -} -func (m *Attribute) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Attribute.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 *Attribute) XXX_Merge(src proto.Message) { - xxx_messageInfo_Attribute.Merge(m, src) -} -func (m *Attribute) XXX_Size() int { - return m.Size() -} -func (m *Attribute) XXX_DiscardUnknown() { - xxx_messageInfo_Attribute.DiscardUnknown(m) -} - -var xxx_messageInfo_Attribute proto.InternalMessageInfo - -func (m *Attribute) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *Attribute) GetValue() string { - if m != nil { - return m.Value - } - return "" -} - -// GasInfo defines tx execution gas context. -type GasInfo struct { - // GasWanted is the maximum units of work we allow this tx to perform. - GasWanted uint64 `protobuf:"varint,1,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` - // GasUsed is the amount of gas actually consumed. - GasUsed uint64 `protobuf:"varint,2,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` -} - -func (m *GasInfo) Reset() { *m = GasInfo{} } -func (*GasInfo) ProtoMessage() {} -func (*GasInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{4} -} -func (m *GasInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GasInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GasInfo.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 *GasInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_GasInfo.Merge(m, src) -} -func (m *GasInfo) XXX_Size() int { - return m.Size() -} -func (m *GasInfo) XXX_DiscardUnknown() { - xxx_messageInfo_GasInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_GasInfo proto.InternalMessageInfo - -func (m *GasInfo) GetGasWanted() uint64 { - if m != nil { - return m.GasWanted - } - return 0 -} - -func (m *GasInfo) GetGasUsed() uint64 { - if m != nil { - return m.GasUsed - } - return 0 -} - -// Result is the union of ResponseFormat and ResponseCheckTx. -type Result struct { - // Data is any data returned from message or handler execution. It MUST be - // length prefixed in order to separate data from multiple message executions. - // Deprecated. This field is still populated, but prefer msg_response instead - // because it also contains the Msg response typeURL. - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // Deprecated: Do not use. - // Log contains the log information from message or handler execution. - Log string `protobuf:"bytes,2,opt,name=log,proto3" json:"log,omitempty"` - // Events contains a slice of Event objects that were emitted during message - // or handler execution. - Events []types1.Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events"` - // msg_responses contains the Msg handler responses type packed in Anys. - // - // Since: cosmos-sdk 0.46 - MsgResponses []*types.Any `protobuf:"bytes,4,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` -} - -func (m *Result) Reset() { *m = Result{} } -func (*Result) ProtoMessage() {} -func (*Result) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{5} -} -func (m *Result) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Result.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 *Result) XXX_Merge(src proto.Message) { - xxx_messageInfo_Result.Merge(m, src) -} -func (m *Result) XXX_Size() int { - return m.Size() -} -func (m *Result) XXX_DiscardUnknown() { - xxx_messageInfo_Result.DiscardUnknown(m) -} - -var xxx_messageInfo_Result proto.InternalMessageInfo - -// SimulationResponse defines the response generated when a transaction is -// successfully simulated. -type SimulationResponse struct { - GasInfo `protobuf:"bytes,1,opt,name=gas_info,json=gasInfo,proto3,embedded=gas_info" json:"gas_info"` - Result *Result `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` -} - -func (m *SimulationResponse) Reset() { *m = SimulationResponse{} } -func (*SimulationResponse) ProtoMessage() {} -func (*SimulationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{6} -} -func (m *SimulationResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SimulationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SimulationResponse.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 *SimulationResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimulationResponse.Merge(m, src) -} -func (m *SimulationResponse) XXX_Size() int { - return m.Size() -} -func (m *SimulationResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SimulationResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SimulationResponse proto.InternalMessageInfo - -func (m *SimulationResponse) GetResult() *Result { - if m != nil { - return m.Result - } - return nil -} - -// MsgData defines the data returned in a Result object during message -// execution. -// -// Deprecated: Do not use. -type MsgData struct { - MsgType string `protobuf:"bytes,1,opt,name=msg_type,json=msgType,proto3" json:"msg_type,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *MsgData) Reset() { *m = MsgData{} } -func (*MsgData) ProtoMessage() {} -func (*MsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{7} -} -func (m *MsgData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgData.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 *MsgData) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgData.Merge(m, src) -} -func (m *MsgData) XXX_Size() int { - return m.Size() -} -func (m *MsgData) XXX_DiscardUnknown() { - xxx_messageInfo_MsgData.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgData proto.InternalMessageInfo - -func (m *MsgData) GetMsgType() string { - if m != nil { - return m.MsgType - } - return "" -} - -func (m *MsgData) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// TxMsgData defines a list of MsgData. A transaction will have a MsgData object -// for each message. -type TxMsgData struct { - // data field is deprecated and not populated. - Data []*MsgData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // Deprecated: Do not use. - // msg_responses contains the Msg handler responses packed into Anys. - // - // Since: cosmos-sdk 0.46 - MsgResponses []*types.Any `protobuf:"bytes,2,rep,name=msg_responses,json=msgResponses,proto3" json:"msg_responses,omitempty"` -} - -func (m *TxMsgData) Reset() { *m = TxMsgData{} } -func (*TxMsgData) ProtoMessage() {} -func (*TxMsgData) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{8} -} -func (m *TxMsgData) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxMsgData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxMsgData.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 *TxMsgData) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxMsgData.Merge(m, src) -} -func (m *TxMsgData) XXX_Size() int { - return m.Size() -} -func (m *TxMsgData) XXX_DiscardUnknown() { - xxx_messageInfo_TxMsgData.DiscardUnknown(m) -} - -var xxx_messageInfo_TxMsgData proto.InternalMessageInfo - -// Deprecated: Do not use. -func (m *TxMsgData) GetData() []*MsgData { - if m != nil { - return m.Data - } - return nil -} - -func (m *TxMsgData) GetMsgResponses() []*types.Any { - if m != nil { - return m.MsgResponses - } - return nil -} - -// SearchTxsResult defines a structure for querying txs pageable -type SearchTxsResult struct { - // Count of all txs - TotalCount uint64 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` - // Count of txs in current page - Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - // Index of current page, start from 1 - PageNumber uint64 `protobuf:"varint,3,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` - // Count of total pages - PageTotal uint64 `protobuf:"varint,4,opt,name=page_total,json=pageTotal,proto3" json:"page_total,omitempty"` - // Max count txs per page - Limit uint64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` - // List of txs in current page - Txs []*TxResponse `protobuf:"bytes,6,rep,name=txs,proto3" json:"txs,omitempty"` -} - -func (m *SearchTxsResult) Reset() { *m = SearchTxsResult{} } -func (*SearchTxsResult) ProtoMessage() {} -func (*SearchTxsResult) Descriptor() ([]byte, []int) { - return fileDescriptor_4e37629bc7eb0df8, []int{9} -} -func (m *SearchTxsResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SearchTxsResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SearchTxsResult.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 *SearchTxsResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_SearchTxsResult.Merge(m, src) -} -func (m *SearchTxsResult) XXX_Size() int { - return m.Size() -} -func (m *SearchTxsResult) XXX_DiscardUnknown() { - xxx_messageInfo_SearchTxsResult.DiscardUnknown(m) -} - -var xxx_messageInfo_SearchTxsResult proto.InternalMessageInfo - -func (m *SearchTxsResult) GetTotalCount() uint64 { - if m != nil { - return m.TotalCount - } - return 0 -} - -func (m *SearchTxsResult) GetCount() uint64 { - if m != nil { - return m.Count - } - return 0 -} - -func (m *SearchTxsResult) GetPageNumber() uint64 { - if m != nil { - return m.PageNumber - } - return 0 -} - -func (m *SearchTxsResult) GetPageTotal() uint64 { - if m != nil { - return m.PageTotal - } - return 0 -} - -func (m *SearchTxsResult) GetLimit() uint64 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *SearchTxsResult) GetTxs() []*TxResponse { - if m != nil { - return m.Txs - } - return nil -} - -func init() { - proto.RegisterType((*TxResponse)(nil), "cosmos.base.abci.v1beta1.TxResponse") - proto.RegisterType((*ABCIMessageLog)(nil), "cosmos.base.abci.v1beta1.ABCIMessageLog") - proto.RegisterType((*StringEvent)(nil), "cosmos.base.abci.v1beta1.StringEvent") - proto.RegisterType((*Attribute)(nil), "cosmos.base.abci.v1beta1.Attribute") - proto.RegisterType((*GasInfo)(nil), "cosmos.base.abci.v1beta1.GasInfo") - proto.RegisterType((*Result)(nil), "cosmos.base.abci.v1beta1.Result") - proto.RegisterType((*SimulationResponse)(nil), "cosmos.base.abci.v1beta1.SimulationResponse") - proto.RegisterType((*MsgData)(nil), "cosmos.base.abci.v1beta1.MsgData") - proto.RegisterType((*TxMsgData)(nil), "cosmos.base.abci.v1beta1.TxMsgData") - proto.RegisterType((*SearchTxsResult)(nil), "cosmos.base.abci.v1beta1.SearchTxsResult") -} - -func init() { - proto.RegisterFile("cosmos/base/abci/v1beta1/abci.proto", fileDescriptor_4e37629bc7eb0df8) -} - -var fileDescriptor_4e37629bc7eb0df8 = []byte{ - // 909 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xda, 0xdb, 0x75, 0x3c, 0x8e, 0x29, 0x1a, 0x45, 0xe9, 0xa4, 0x80, 0x6d, 0xdc, 0x22, - 0x59, 0x48, 0xac, 0xd5, 0xb4, 0x42, 0xb4, 0xa7, 0xd6, 0xe1, 0x2b, 0x52, 0xcb, 0x61, 0xe3, 0x0a, - 0x89, 0x8b, 0x35, 0xb6, 0xa7, 0xe3, 0x55, 0xbd, 0x3b, 0xd6, 0xce, 0x6c, 0xb2, 0xb9, 0x71, 0x83, - 0x23, 0x27, 0xce, 0x5c, 0xe1, 0x2f, 0xe9, 0x81, 0x43, 0x8e, 0x3d, 0x54, 0x01, 0x92, 0x1b, 0x7f, - 0x05, 0x7a, 0x6f, 0xc6, 0x1f, 0x25, 0x75, 0xd5, 0x93, 0xdf, 0xfc, 0xde, 0x87, 0xdf, 0xfb, 0xbd, - 0xdf, 0xce, 0x90, 0x5b, 0x63, 0xa5, 0x13, 0xa5, 0x7b, 0x23, 0xae, 0x45, 0x8f, 0x8f, 0xc6, 0x71, - 0xef, 0xf8, 0xce, 0x48, 0x18, 0x7e, 0x07, 0x0f, 0xe1, 0x3c, 0x53, 0x46, 0x51, 0x66, 0x83, 0x42, - 0x08, 0x0a, 0x11, 0x77, 0x41, 0x37, 0x77, 0xa4, 0x92, 0x0a, 0x83, 0x7a, 0x60, 0xd9, 0xf8, 0x9b, - 0x1f, 0x18, 0x91, 0x4e, 0x44, 0x96, 0xc4, 0xa9, 0xb1, 0x35, 0xcd, 0xe9, 0x5c, 0x68, 0xe7, 0xdc, - 0x93, 0x4a, 0xc9, 0x99, 0xe8, 0xe1, 0x69, 0x94, 0x3f, 0xeb, 0xf1, 0xf4, 0xd4, 0xba, 0x3a, 0x7f, - 0x56, 0x08, 0x19, 0x14, 0x91, 0xd0, 0x73, 0x95, 0x6a, 0x41, 0x77, 0x49, 0x30, 0x15, 0xb1, 0x9c, - 0x1a, 0xe6, 0xb5, 0xbd, 0x6e, 0x25, 0x72, 0x27, 0xda, 0x21, 0x81, 0x29, 0xa6, 0x5c, 0x4f, 0x59, - 0xb9, 0xed, 0x75, 0x6b, 0x7d, 0x72, 0x71, 0xde, 0x0a, 0x06, 0xc5, 0xb7, 0x5c, 0x4f, 0x23, 0xe7, - 0xa1, 0x1f, 0x92, 0xda, 0x58, 0x4d, 0x84, 0x9e, 0xf3, 0xb1, 0x60, 0x15, 0x08, 0x8b, 0x56, 0x00, - 0xa5, 0xc4, 0x87, 0x03, 0xf3, 0xdb, 0x5e, 0xb7, 0x11, 0xa1, 0x0d, 0xd8, 0x84, 0x1b, 0xce, 0xae, - 0x61, 0x30, 0xda, 0xf4, 0x06, 0xa9, 0x66, 0xfc, 0x64, 0x38, 0x53, 0x92, 0x05, 0x08, 0x07, 0x19, - 0x3f, 0x79, 0xac, 0x24, 0x7d, 0x4a, 0xfc, 0x99, 0x92, 0x9a, 0x55, 0xdb, 0x95, 0x6e, 0x7d, 0xbf, - 0x1b, 0x6e, 0x22, 0x28, 0x7c, 0xd4, 0x3f, 0x38, 0x7c, 0x22, 0xb4, 0xe6, 0x52, 0x3c, 0x56, 0xb2, - 0x7f, 0xe3, 0xc5, 0x79, 0xab, 0xf4, 0xc7, 0x5f, 0xad, 0xeb, 0xaf, 0xe3, 0x3a, 0xc2, 0x72, 0xd0, - 0x43, 0x9c, 0x3e, 0x53, 0x6c, 0xcb, 0xf6, 0x00, 0x36, 0xfd, 0x88, 0x10, 0xc9, 0xf5, 0xf0, 0x84, - 0xa7, 0x46, 0x4c, 0x58, 0x0d, 0x99, 0xa8, 0x49, 0xae, 0xbf, 0x47, 0x80, 0xee, 0x91, 0x2d, 0x70, - 0xe7, 0x5a, 0x4c, 0x18, 0x41, 0x67, 0x55, 0x72, 0xfd, 0x54, 0x8b, 0x09, 0xbd, 0x4d, 0xca, 0xa6, - 0x60, 0xf5, 0xb6, 0xd7, 0xad, 0xef, 0xef, 0x84, 0x96, 0xf6, 0x70, 0x41, 0x7b, 0xf8, 0x28, 0x3d, - 0x8d, 0xca, 0xa6, 0x00, 0xa6, 0x4c, 0x9c, 0x08, 0x6d, 0x78, 0x32, 0x67, 0xdb, 0x96, 0xa9, 0x25, - 0x40, 0xef, 0x91, 0x40, 0x1c, 0x8b, 0xd4, 0x68, 0xd6, 0xc0, 0x51, 0x77, 0xc3, 0xd5, 0x6e, 0xed, - 0xa4, 0x5f, 0x81, 0xbb, 0xef, 0xc3, 0x60, 0x91, 0x8b, 0x7d, 0xe0, 0xff, 0xfc, 0x5b, 0xab, 0xd4, - 0xf9, 0xdd, 0x23, 0xef, 0xbd, 0x3e, 0x27, 0xfd, 0x94, 0xd4, 0x12, 0x2d, 0x87, 0x71, 0x3a, 0x11, - 0x05, 0x6e, 0xb5, 0xd1, 0x6f, 0xfc, 0x7b, 0xde, 0x5a, 0x81, 0xd1, 0x56, 0xa2, 0xe5, 0x21, 0x58, - 0xf4, 0x7d, 0x52, 0x01, 0xe2, 0x71, 0xc7, 0x11, 0x98, 0xf4, 0x68, 0xd9, 0x4c, 0x05, 0x9b, 0xf9, - 0x64, 0x33, 0xef, 0x47, 0x26, 0x8b, 0x53, 0x69, 0x7b, 0xdb, 0x71, 0xa4, 0x6f, 0xaf, 0x81, 0x7a, - 0xd5, 0xeb, 0x8f, 0xaf, 0xda, 0x5e, 0x27, 0x23, 0xf5, 0x35, 0x2f, 0x2c, 0x02, 0x34, 0x8b, 0x2d, - 0xd6, 0x22, 0xb4, 0xe9, 0x21, 0x21, 0xdc, 0x98, 0x2c, 0x1e, 0xe5, 0x46, 0x68, 0x56, 0xc6, 0x0e, - 0x6e, 0xbd, 0x65, 0xf3, 0x8b, 0x58, 0xc7, 0xcd, 0x5a, 0xb2, 0xfb, 0xcf, 0xbb, 0xa4, 0xb6, 0x0c, - 0x82, 0x69, 0x9f, 0x8b, 0x53, 0xf7, 0x87, 0x60, 0xd2, 0x1d, 0x72, 0xed, 0x98, 0xcf, 0x72, 0xe1, - 0x18, 0xb0, 0x87, 0xce, 0x01, 0xa9, 0x7e, 0xc3, 0xf5, 0xe1, 0x55, 0x65, 0x40, 0xa6, 0xbf, 0x49, - 0x19, 0x65, 0x74, 0x2e, 0x94, 0x01, 0x9b, 0x09, 0x22, 0xa1, 0xf3, 0x99, 0xa1, 0xbb, 0x4e, 0xf6, - 0x90, 0xbe, 0xdd, 0x2f, 0x33, 0xcf, 0x49, 0xff, 0x2a, 0xfb, 0xf7, 0xfe, 0xc7, 0xfe, 0x3b, 0x49, - 0x81, 0xde, 0x27, 0x0d, 0x58, 0x6e, 0xe6, 0x3e, 0x6a, 0xcd, 0x7c, 0x4c, 0x7e, 0xb3, 0x1e, 0xb7, - 0x13, 0x2d, 0x17, 0x9f, 0xff, 0x42, 0x45, 0xbf, 0x7a, 0x84, 0x1e, 0xc5, 0x49, 0x3e, 0xe3, 0x26, - 0x56, 0xe9, 0xf2, 0x72, 0xf8, 0xda, 0x4e, 0x87, 0x9f, 0x8b, 0x87, 0x12, 0xff, 0x78, 0xf3, 0x2e, - 0x1c, 0x63, 0xfd, 0x2d, 0x68, 0xed, 0xec, 0xbc, 0xe5, 0x21, 0x15, 0x48, 0xe2, 0x17, 0x24, 0xc8, - 0x90, 0x09, 0x1c, 0xb5, 0xbe, 0xdf, 0xde, 0x5c, 0xc5, 0x32, 0x16, 0xb9, 0xf8, 0xce, 0x43, 0x52, - 0x7d, 0xa2, 0xe5, 0x97, 0x40, 0xd6, 0x1e, 0x01, 0xd9, 0x0e, 0xd7, 0x24, 0x53, 0x4d, 0xb4, 0x1c, - 0x80, 0x6a, 0x16, 0xd7, 0x0a, 0x54, 0xdf, 0xb6, 0xdc, 0x3e, 0x08, 0x60, 0xfd, 0xcc, 0xeb, 0xfc, - 0xe4, 0x91, 0xda, 0xa0, 0x58, 0x14, 0xb9, 0xbf, 0xdc, 0x44, 0xe5, 0xed, 0xd3, 0xb8, 0x84, 0xb5, - 0x65, 0x5d, 0x21, 0xb9, 0xfc, 0xee, 0x24, 0xa3, 0x14, 0x5f, 0x79, 0xe4, 0xfa, 0x91, 0xe0, 0xd9, - 0x78, 0x3a, 0x28, 0xb4, 0x53, 0x46, 0x8b, 0xd4, 0x8d, 0x32, 0x7c, 0x36, 0x1c, 0xab, 0x3c, 0x35, - 0x4e, 0x5f, 0x04, 0xa1, 0x03, 0x40, 0x40, 0xa0, 0xd6, 0x65, 0xd5, 0x65, 0x0f, 0x90, 0x36, 0xe7, - 0x52, 0x0c, 0xd3, 0x3c, 0x19, 0x89, 0x0c, 0xef, 0x5e, 0x3f, 0x22, 0x00, 0x7d, 0x87, 0x08, 0xc8, - 0x16, 0x03, 0xb0, 0x12, 0x5e, 0xc1, 0x7e, 0x54, 0x03, 0x64, 0x00, 0x00, 0x54, 0x9d, 0xc5, 0x49, - 0x6c, 0xf0, 0x22, 0xf6, 0x23, 0x7b, 0xa0, 0x9f, 0x93, 0x8a, 0x29, 0x34, 0x0b, 0x70, 0xae, 0xdb, - 0x9b, 0xb9, 0x59, 0x3d, 0x1f, 0x11, 0x24, 0xd8, 0xf1, 0xfa, 0x0f, 0x5f, 0xfe, 0xd3, 0x2c, 0xbd, - 0xb8, 0x68, 0x7a, 0x67, 0x17, 0x4d, 0xef, 0xef, 0x8b, 0xa6, 0xf7, 0xcb, 0x65, 0xb3, 0x74, 0x76, - 0xd9, 0x2c, 0xbd, 0xbc, 0x6c, 0x96, 0x7e, 0xe8, 0xc8, 0xd8, 0x4c, 0xf3, 0x51, 0x38, 0x56, 0x49, - 0xcf, 0x3d, 0x87, 0xf6, 0xe7, 0x33, 0x3d, 0x79, 0x6e, 0xdf, 0xae, 0x51, 0x80, 0x14, 0xde, 0xfd, - 0x2f, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xf1, 0x8e, 0x98, 0x30, 0x07, 0x00, 0x00, -} - -func (m *TxResponse) 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 *TxResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x6a - } - } - if len(m.Timestamp) > 0 { - i -= len(m.Timestamp) - copy(dAtA[i:], m.Timestamp) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Timestamp))) - i-- - dAtA[i] = 0x62 - } - if m.Tx != nil { - { - size, err := m.Tx.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - if m.GasUsed != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.GasUsed)) - i-- - dAtA[i] = 0x50 - } - if m.GasWanted != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.GasWanted)) - i-- - dAtA[i] = 0x48 - } - if len(m.Info) > 0 { - i -= len(m.Info) - copy(dAtA[i:], m.Info) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Info))) - i-- - dAtA[i] = 0x42 - } - if len(m.Logs) > 0 { - for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.RawLog) > 0 { - i -= len(m.RawLog) - copy(dAtA[i:], m.RawLog) - i = encodeVarintAbci(dAtA, i, uint64(len(m.RawLog))) - i-- - dAtA[i] = 0x32 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x2a - } - if m.Code != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x20 - } - if len(m.Codespace) > 0 { - i -= len(m.Codespace) - copy(dAtA[i:], m.Codespace) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Codespace))) - i-- - dAtA[i] = 0x1a - } - if len(m.TxHash) > 0 { - i -= len(m.TxHash) - copy(dAtA[i:], m.TxHash) - i = encodeVarintAbci(dAtA, i, uint64(len(m.TxHash))) - i-- - dAtA[i] = 0x12 - } - if m.Height != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ABCIMessageLog) 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 *ABCIMessageLog) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ABCIMessageLog) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x12 - } - if m.MsgIndex != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.MsgIndex)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *StringEvent) 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 *StringEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StringEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Attributes) > 0 { - for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Attribute) 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 *Attribute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Attribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GasInfo) 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 *GasInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GasInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.GasUsed != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.GasUsed)) - i-- - dAtA[i] = 0x10 - } - if m.GasWanted != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.GasWanted)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Result) 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 *Result) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MsgResponses) > 0 { - for iNdEx := len(m.MsgResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MsgResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Log) > 0 { - i -= len(m.Log) - copy(dAtA[i:], m.Log) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Log))) - i-- - dAtA[i] = 0x12 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SimulationResponse) 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 *SimulationResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SimulationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.GasInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgData) 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 *MsgData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintAbci(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if len(m.MsgType) > 0 { - i -= len(m.MsgType) - copy(dAtA[i:], m.MsgType) - i = encodeVarintAbci(dAtA, i, uint64(len(m.MsgType))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TxMsgData) 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 *TxMsgData) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxMsgData) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MsgResponses) > 0 { - for iNdEx := len(m.MsgResponses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MsgResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Data) > 0 { - for iNdEx := len(m.Data) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Data[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SearchTxsResult) 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 *SearchTxsResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SearchTxsResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Txs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAbci(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if m.Limit != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x28 - } - if m.PageTotal != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.PageTotal)) - i-- - dAtA[i] = 0x20 - } - if m.PageNumber != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.PageNumber)) - i-- - dAtA[i] = 0x18 - } - if m.Count != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x10 - } - if m.TotalCount != 0 { - i = encodeVarintAbci(dAtA, i, uint64(m.TotalCount)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintAbci(dAtA []byte, offset int, v uint64) int { - offset -= sovAbci(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *TxResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovAbci(uint64(m.Height)) - } - l = len(m.TxHash) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.Codespace) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if m.Code != 0 { - n += 1 + sovAbci(uint64(m.Code)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.RawLog) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if len(m.Logs) > 0 { - for _, e := range m.Logs { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - l = len(m.Info) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if m.GasWanted != 0 { - n += 1 + sovAbci(uint64(m.GasWanted)) - } - if m.GasUsed != 0 { - n += 1 + sovAbci(uint64(m.GasUsed)) - } - if m.Tx != nil { - l = m.Tx.Size() - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.Timestamp) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func (m *ABCIMessageLog) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgIndex != 0 { - n += 1 + sovAbci(uint64(m.MsgIndex)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func (m *StringEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func (m *Attribute) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - return n -} - -func (m *GasInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GasWanted != 0 { - n += 1 + sovAbci(uint64(m.GasWanted)) - } - if m.GasUsed != 0 { - n += 1 + sovAbci(uint64(m.GasUsed)) - } - return n -} - -func (m *Result) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.Log) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - if len(m.MsgResponses) > 0 { - for _, e := range m.MsgResponses { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func (m *SimulationResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.GasInfo.Size() - n += 1 + l + sovAbci(uint64(l)) - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovAbci(uint64(l)) - } - return n -} - -func (m *MsgData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MsgType) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAbci(uint64(l)) - } - return n -} - -func (m *TxMsgData) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Data) > 0 { - for _, e := range m.Data { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - if len(m.MsgResponses) > 0 { - for _, e := range m.MsgResponses { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func (m *SearchTxsResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TotalCount != 0 { - n += 1 + sovAbci(uint64(m.TotalCount)) - } - if m.Count != 0 { - n += 1 + sovAbci(uint64(m.Count)) - } - if m.PageNumber != 0 { - n += 1 + sovAbci(uint64(m.PageNumber)) - } - if m.PageTotal != 0 { - n += 1 + sovAbci(uint64(m.PageTotal)) - } - if m.Limit != 0 { - n += 1 + sovAbci(uint64(m.Limit)) - } - if len(m.Txs) > 0 { - for _, e := range m.Txs { - l = e.Size() - n += 1 + l + sovAbci(uint64(l)) - } - } - return n -} - -func sovAbci(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAbci(x uint64) (n int) { - return sovAbci(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (this *ABCIMessageLog) String() string { - if this == nil { - return "nil" - } - repeatedStringForEvents := "[]StringEvent{" - for _, f := range this.Events { - repeatedStringForEvents += strings.Replace(strings.Replace(f.String(), "StringEvent", "StringEvent", 1), `&`, ``, 1) + "," - } - repeatedStringForEvents += "}" - s := strings.Join([]string{`&ABCIMessageLog{`, - `MsgIndex:` + fmt.Sprintf("%v", this.MsgIndex) + `,`, - `Log:` + fmt.Sprintf("%v", this.Log) + `,`, - `Events:` + repeatedStringForEvents + `,`, - `}`, - }, "") - return s -} -func (this *StringEvent) String() string { - if this == nil { - return "nil" - } - repeatedStringForAttributes := "[]Attribute{" - for _, f := range this.Attributes { - repeatedStringForAttributes += fmt.Sprintf("%v", f) + "," - } - repeatedStringForAttributes += "}" - s := strings.Join([]string{`&StringEvent{`, - `Type:` + fmt.Sprintf("%v", this.Type) + `,`, - `Attributes:` + repeatedStringForAttributes + `,`, - `}`, - }, "") - return s -} -func (this *MsgData) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&MsgData{`, - `MsgType:` + fmt.Sprintf("%v", this.MsgType) + `,`, - `Data:` + fmt.Sprintf("%v", this.Data) + `,`, - `}`, - }, "") - return s -} -func (this *TxMsgData) String() string { - if this == nil { - return "nil" - } - repeatedStringForData := "[]*MsgData{" - for _, f := range this.Data { - repeatedStringForData += strings.Replace(f.String(), "MsgData", "MsgData", 1) + "," - } - repeatedStringForData += "}" - repeatedStringForMsgResponses := "[]*Any{" - for _, f := range this.MsgResponses { - repeatedStringForMsgResponses += strings.Replace(fmt.Sprintf("%v", f), "Any", "types.Any", 1) + "," - } - repeatedStringForMsgResponses += "}" - s := strings.Join([]string{`&TxMsgData{`, - `Data:` + repeatedStringForData + `,`, - `MsgResponses:` + repeatedStringForMsgResponses + `,`, - `}`, - }, "") - return s -} -func (this *SearchTxsResult) String() string { - if this == nil { - return "nil" - } - repeatedStringForTxs := "[]*TxResponse{" - for _, f := range this.Txs { - repeatedStringForTxs += strings.Replace(fmt.Sprintf("%v", f), "TxResponse", "TxResponse", 1) + "," - } - repeatedStringForTxs += "}" - s := strings.Join([]string{`&SearchTxsResult{`, - `TotalCount:` + fmt.Sprintf("%v", this.TotalCount) + `,`, - `Count:` + fmt.Sprintf("%v", this.Count) + `,`, - `PageNumber:` + fmt.Sprintf("%v", this.PageNumber) + `,`, - `PageTotal:` + fmt.Sprintf("%v", this.PageTotal) + `,`, - `Limit:` + fmt.Sprintf("%v", this.Limit) + `,`, - `Txs:` + repeatedStringForTxs + `,`, - `}`, - }, "") - return s -} -func valueToStringAbci(v interface{}) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} -func (m *TxResponse) 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 ErrIntOverflowAbci - } - 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: TxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Codespace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Codespace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawLog", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RawLog = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Logs = append(m.Logs, ABCIMessageLog{}) - if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - 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 ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Info = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) - } - m.GasWanted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasWanted |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) - } - m.GasUsed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasUsed |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tx", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tx == nil { - m.Tx = &types.Any{} - } - if err := m.Tx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Timestamp = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, types1.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ABCIMessageLog) 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 ErrIntOverflowAbci - } - 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: ABCIMessageLog: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ABCIMessageLog: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgIndex", wireType) - } - m.MsgIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MsgIndex |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Log = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, StringEvent{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StringEvent) 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 ErrIntOverflowAbci - } - 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: StringEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StringEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attributes = append(m.Attributes, Attribute{}) - if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Attribute) 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 ErrIntOverflowAbci - } - 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: Attribute: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Attribute: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GasInfo) 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 ErrIntOverflowAbci - } - 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: GasInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GasInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasWanted", wireType) - } - m.GasWanted = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasWanted |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasUsed", wireType) - } - m.GasUsed = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasUsed |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Result) 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 ErrIntOverflowAbci - } - 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: Result: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Result: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Log", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Log = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, types1.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgResponses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgResponses = append(m.MsgResponses, &types.Any{}) - if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SimulationResponse) 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 ErrIntOverflowAbci - } - 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: SimulationResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SimulationResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GasInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GasInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Result == nil { - m.Result = &Result{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgData) 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 ErrIntOverflowAbci - } - 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: MsgData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - 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 ErrInvalidLengthAbci - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TxMsgData) 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 ErrIntOverflowAbci - } - 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: TxMsgData: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxMsgData: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data, &MsgData{}) - if err := m.Data[len(m.Data)-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 MsgResponses", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgResponses = append(m.MsgResponses, &types.Any{}) - if err := m.MsgResponses[len(m.MsgResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SearchTxsResult) 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 ErrIntOverflowAbci - } - 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: SearchTxsResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SearchTxsResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalCount", wireType) - } - m.TotalCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PageNumber", wireType) - } - m.PageNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PageNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PageTotal", wireType) - } - m.PageTotal = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PageTotal |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAbci - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAbci - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAbci - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, &TxResponse{}) - if err := m.Txs[len(m.Txs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAbci(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAbci - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAbci(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, ErrIntOverflowAbci - } - 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, ErrIntOverflowAbci - } - 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, ErrIntOverflowAbci - } - 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, ErrInvalidLengthAbci - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAbci - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAbci - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAbci = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAbci = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAbci = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/types/coin.pb.go b/github.com/cosmos/cosmos-sdk/types/coin.pb.go deleted file mode 100644 index 28b017a81459..000000000000 --- a/github.com/cosmos/cosmos-sdk/types/coin.pb.go +++ /dev/null @@ -1,983 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/v1beta1/coin.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Coin defines a token with a denomination and an amount. -// -// NOTE: The amount field is an Int which implements the custom method -// signatures required by gogoproto. -type Coin struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Int" json:"amount"` -} - -func (m *Coin) Reset() { *m = Coin{} } -func (*Coin) ProtoMessage() {} -func (*Coin) Descriptor() ([]byte, []int) { - return fileDescriptor_189a96714eafc2df, []int{0} -} -func (m *Coin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Coin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Coin.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 *Coin) XXX_Merge(src proto.Message) { - xxx_messageInfo_Coin.Merge(m, src) -} -func (m *Coin) XXX_Size() int { - return m.Size() -} -func (m *Coin) XXX_DiscardUnknown() { - xxx_messageInfo_Coin.DiscardUnknown(m) -} - -var xxx_messageInfo_Coin proto.InternalMessageInfo - -func (m *Coin) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -// DecCoin defines a token with a denomination and a decimal amount. -// -// NOTE: The amount field is an Dec which implements the custom method -// signatures required by gogoproto. -type DecCoin struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Amount Dec `protobuf:"bytes,2,opt,name=amount,proto3,customtype=Dec" json:"amount"` -} - -func (m *DecCoin) Reset() { *m = DecCoin{} } -func (*DecCoin) ProtoMessage() {} -func (*DecCoin) Descriptor() ([]byte, []int) { - return fileDescriptor_189a96714eafc2df, []int{1} -} -func (m *DecCoin) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DecCoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DecCoin.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 *DecCoin) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecCoin.Merge(m, src) -} -func (m *DecCoin) XXX_Size() int { - return m.Size() -} -func (m *DecCoin) XXX_DiscardUnknown() { - xxx_messageInfo_DecCoin.DiscardUnknown(m) -} - -var xxx_messageInfo_DecCoin proto.InternalMessageInfo - -func (m *DecCoin) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -// IntProto defines a Protobuf wrapper around an Int object. -type IntProto struct { - Int Int `protobuf:"bytes,1,opt,name=int,proto3,customtype=Int" json:"int"` -} - -func (m *IntProto) Reset() { *m = IntProto{} } -func (*IntProto) ProtoMessage() {} -func (*IntProto) Descriptor() ([]byte, []int) { - return fileDescriptor_189a96714eafc2df, []int{2} -} -func (m *IntProto) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IntProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IntProto.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 *IntProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_IntProto.Merge(m, src) -} -func (m *IntProto) XXX_Size() int { - return m.Size() -} -func (m *IntProto) XXX_DiscardUnknown() { - xxx_messageInfo_IntProto.DiscardUnknown(m) -} - -var xxx_messageInfo_IntProto proto.InternalMessageInfo - -// DecProto defines a Protobuf wrapper around a Dec object. -type DecProto struct { - Dec Dec `protobuf:"bytes,1,opt,name=dec,proto3,customtype=Dec" json:"dec"` -} - -func (m *DecProto) Reset() { *m = DecProto{} } -func (*DecProto) ProtoMessage() {} -func (*DecProto) Descriptor() ([]byte, []int) { - return fileDescriptor_189a96714eafc2df, []int{3} -} -func (m *DecProto) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DecProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DecProto.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 *DecProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_DecProto.Merge(m, src) -} -func (m *DecProto) XXX_Size() int { - return m.Size() -} -func (m *DecProto) XXX_DiscardUnknown() { - xxx_messageInfo_DecProto.DiscardUnknown(m) -} - -var xxx_messageInfo_DecProto proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Coin)(nil), "cosmos.base.v1beta1.Coin") - proto.RegisterType((*DecCoin)(nil), "cosmos.base.v1beta1.DecCoin") - proto.RegisterType((*IntProto)(nil), "cosmos.base.v1beta1.IntProto") - proto.RegisterType((*DecProto)(nil), "cosmos.base.v1beta1.DecProto") -} - -func init() { proto.RegisterFile("cosmos/base/v1beta1/coin.proto", fileDescriptor_189a96714eafc2df) } - -var fileDescriptor_189a96714eafc2df = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x4f, 0xce, 0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xeb, 0x81, - 0xe4, 0xf5, 0xa0, 0xf2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, - 0x54, 0x4a, 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, - 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x21, 0xa5, 0x28, 0x2e, 0x16, 0xe7, 0xfc, 0xcc, 0x3c, 0x21, 0x11, - 0x2e, 0xd6, 0x94, 0xd4, 0xbc, 0xfc, 0x5c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x08, 0x47, - 0xc8, 0x8c, 0x8b, 0x2d, 0x31, 0x37, 0xbf, 0x34, 0xaf, 0x44, 0x82, 0x09, 0x24, 0xec, 0x24, 0x77, - 0xe2, 0x9e, 0x3c, 0xc3, 0xad, 0x7b, 0xf2, 0xcc, 0x9e, 0x79, 0x25, 0x97, 0xb6, 0xe8, 0x72, 0x41, - 0x4d, 0xf7, 0xcc, 0x2b, 0x59, 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0xb5, 0x15, 0xcb, 0x8b, - 0x05, 0xf2, 0x8c, 0x4a, 0x11, 0x5c, 0xec, 0x2e, 0xa9, 0xc9, 0x78, 0x8c, 0x37, 0x44, 0x33, 0x5e, - 0x12, 0x66, 0xbc, 0x4b, 0x6a, 0x32, 0x92, 0xf1, 0x2e, 0xa9, 0xc9, 0x68, 0x26, 0x9b, 0x73, 0x71, - 0x78, 0xe6, 0x95, 0x04, 0x80, 0x83, 0x46, 0x9b, 0x8b, 0x39, 0x33, 0xaf, 0x04, 0x62, 0x30, 0xc2, - 0x04, 0x0c, 0x07, 0x06, 0x81, 0x54, 0x81, 0x34, 0xba, 0xa4, 0x26, 0xc3, 0x35, 0xa6, 0xa4, 0x26, - 0xa3, 0x6b, 0xc4, 0xb4, 0x1a, 0xa4, 0xca, 0xc9, 0xe5, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, - 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, - 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x94, 0x9e, 0x59, 0x92, - 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x0d, 0x75, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x74, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x33, 0xcc, 0xd5, 0x87, 0xef, 0x01, 0x00, 0x00, -} - -func (this *Coin) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Coin) - if !ok { - that2, ok := that.(Coin) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Denom != that1.Denom { - return false - } - if !this.Amount.Equal(that1.Amount) { - return false - } - return true -} -func (this *DecCoin) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DecCoin) - if !ok { - that2, ok := that.(DecCoin) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Denom != that1.Denom { - return false - } - if !this.Amount.Equal(that1.Amount) { - return false - } - return true -} -func (m *Coin) 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 *Coin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Coin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCoin(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DecCoin) 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 *DecCoin) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DecCoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Amount.Size() - i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCoin(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintCoin(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IntProto) 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 *IntProto) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IntProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Int.Size() - i -= size - if _, err := m.Int.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCoin(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *DecProto) 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 *DecProto) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DecProto) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Dec.Size() - i -= size - if _, err := m.Dec.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintCoin(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintCoin(dAtA []byte, offset int, v uint64) int { - offset -= sovCoin(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Coin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovCoin(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovCoin(uint64(l)) - return n -} - -func (m *DecCoin) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovCoin(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovCoin(uint64(l)) - return n -} - -func (m *IntProto) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Int.Size() - n += 1 + l + sovCoin(uint64(l)) - return n -} - -func (m *DecProto) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Dec.Size() - n += 1 + l + sovCoin(uint64(l)) - return n -} - -func sovCoin(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCoin(x uint64) (n int) { - return sovCoin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Coin) 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 ErrIntOverflowCoin - } - 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: Coin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Coin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCoin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCoin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DecCoin) 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 ErrIntOverflowCoin - } - 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: DecCoin: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DecCoin: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCoin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCoin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IntProto) 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 ErrIntOverflowCoin - } - 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: IntProto: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IntProto: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Int.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCoin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCoin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DecProto) 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 ErrIntOverflowCoin - } - 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: DecProto: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DecProto: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dec", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCoin - } - 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 ErrInvalidLengthCoin - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCoin - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Dec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCoin(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCoin - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCoin(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, ErrIntOverflowCoin - } - 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, ErrIntOverflowCoin - } - 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, ErrIntOverflowCoin - } - 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, ErrInvalidLengthCoin - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCoin - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCoin - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCoin = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCoin = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCoin = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go b/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go deleted file mode 100644 index f03111ef6f9f..000000000000 --- a/github.com/cosmos/cosmos-sdk/types/kv/kv.pb.go +++ /dev/null @@ -1,557 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/kv/v1beta1/kv.proto - -package kv - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Pairs defines a repeated slice of Pair objects. -type Pairs struct { - Pairs []Pair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"` -} - -func (m *Pairs) Reset() { *m = Pairs{} } -func (m *Pairs) String() string { return proto.CompactTextString(m) } -func (*Pairs) ProtoMessage() {} -func (*Pairs) Descriptor() ([]byte, []int) { - return fileDescriptor_a44e87fe7182bb73, []int{0} -} -func (m *Pairs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pairs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pairs.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 *Pairs) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pairs.Merge(m, src) -} -func (m *Pairs) XXX_Size() int { - return m.Size() -} -func (m *Pairs) XXX_DiscardUnknown() { - xxx_messageInfo_Pairs.DiscardUnknown(m) -} - -var xxx_messageInfo_Pairs proto.InternalMessageInfo - -func (m *Pairs) GetPairs() []Pair { - if m != nil { - return m.Pairs - } - return nil -} - -// Pair defines a key/value bytes tuple. -type Pair struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (m *Pair) Reset() { *m = Pair{} } -func (m *Pair) String() string { return proto.CompactTextString(m) } -func (*Pair) ProtoMessage() {} -func (*Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_a44e87fe7182bb73, []int{1} -} -func (m *Pair) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Pair.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 *Pair) XXX_Merge(src proto.Message) { - xxx_messageInfo_Pair.Merge(m, src) -} -func (m *Pair) XXX_Size() int { - return m.Size() -} -func (m *Pair) XXX_DiscardUnknown() { - xxx_messageInfo_Pair.DiscardUnknown(m) -} - -var xxx_messageInfo_Pair proto.InternalMessageInfo - -func (m *Pair) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *Pair) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterType((*Pairs)(nil), "cosmos.base.kv.v1beta1.Pairs") - proto.RegisterType((*Pair)(nil), "cosmos.base.kv.v1beta1.Pair") -} - -func init() { proto.RegisterFile("cosmos/base/kv/v1beta1/kv.proto", fileDescriptor_a44e87fe7182bb73) } - -var fileDescriptor_a44e87fe7182bb73 = []byte{ - // 221 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0x2c, 0x4e, 0xd5, 0xcf, 0x2e, 0xd3, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, - 0x49, 0x34, 0xd4, 0xcf, 0x2e, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, 0x28, 0xd0, - 0x03, 0x29, 0xd0, 0xcb, 0x2e, 0xd3, 0x83, 0x2a, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, - 0xd1, 0x07, 0xb1, 0x20, 0xaa, 0x95, 0x1c, 0xb9, 0x58, 0x03, 0x12, 0x33, 0x8b, 0x8a, 0x85, 0x2c, - 0xb8, 0x58, 0x0b, 0x40, 0x0c, 0x09, 0x46, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x19, 0x3d, 0xec, 0xc6, - 0xe8, 0x81, 0x54, 0x3b, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, 0x04, 0xd1, 0xa0, 0xa4, 0xc7, 0xc5, - 0x02, 0x12, 0x14, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, - 0x02, 0x31, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, - 0x8e, 0x93, 0xfd, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, - 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xa9, 0xa6, 0x67, - 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x43, 0xbd, 0x09, 0xa1, 0x74, 0x8b, 0x53, - 0xb2, 0xf5, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0xf5, 0xb3, 0xcb, 0x92, 0xd8, 0xc0, 0x4e, 0x37, 0x06, - 0x04, 0x00, 0x00, 0xff, 0xff, 0x15, 0x18, 0x16, 0xcf, 0x0b, 0x01, 0x00, 0x00, -} - -func (m *Pairs) 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 *Pairs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pairs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pairs) > 0 { - for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintKv(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Pair) 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 *Pair) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintKv(dAtA []byte, offset int, v uint64) int { - offset -= sovKv(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Pairs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pairs) > 0 { - for _, e := range m.Pairs { - l = e.Size() - n += 1 + l + sovKv(uint64(l)) - } - } - return n -} - -func (m *Pair) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovKv(uint64(l)) - } - return n -} - -func sovKv(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKv(x uint64) (n int) { - return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Pairs) 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 ErrIntOverflowKv - } - 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: Pairs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pairs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Pairs = append(m.Pairs, Pair{}) - if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Pair) 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 ErrIntOverflowKv - } - 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: Pair: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKv - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKv - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKv - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKv(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKv - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKv(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, ErrIntOverflowKv - } - 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, ErrIntOverflowKv - } - 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, ErrIntOverflowKv - } - 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, ErrInvalidLengthKv - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKv - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKv - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go b/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go deleted file mode 100644 index cc37a2517295..000000000000 --- a/github.com/cosmos/cosmos-sdk/types/query/pagination.pb.go +++ /dev/null @@ -1,719 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/base/query/v1beta1/pagination.proto - -package query - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PageRequest is to be embedded in gRPC request messages for efficient -// pagination. Ex: -// -// 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 - // should be set. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // offset is a numeric offset that can be used when key is unavailable. - // It is less efficient than using key. Only one of offset or key should - // be set. - Offset uint64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - Limit uint64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` - // count_total is set to true to indicate that the result set should include - // a count of the total number of items available for pagination in UIs. - // count_total is only respected when offset is used. It is ignored when key - // is set. - CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"` - // reverse is set to true if results are to be returned in the descending order. - // - // Since: cosmos-sdk 0.43 - Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (m *PageRequest) Reset() { *m = PageRequest{} } -func (m *PageRequest) String() string { return proto.CompactTextString(m) } -func (*PageRequest) ProtoMessage() {} -func (*PageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_53d6d609fe6828af, []int{0} -} -func (m *PageRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PageRequest.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 *PageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PageRequest.Merge(m, src) -} -func (m *PageRequest) XXX_Size() int { - return m.Size() -} -func (m *PageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PageRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PageRequest proto.InternalMessageInfo - -func (m *PageRequest) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *PageRequest) GetOffset() uint64 { - if m != nil { - return m.Offset - } - return 0 -} - -func (m *PageRequest) GetLimit() uint64 { - if m != nil { - return m.Limit - } - return 0 -} - -func (m *PageRequest) GetCountTotal() bool { - if m != nil { - return m.CountTotal - } - return false -} - -func (m *PageRequest) GetReverse() bool { - if m != nil { - return m.Reverse - } - return false -} - -// 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; -// } -type PageResponse struct { - // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently. It will be empty if - // there are no more results. - NextKey []byte `protobuf:"bytes,1,opt,name=next_key,json=nextKey,proto3" json:"next_key,omitempty"` - // total is total number of results available if PageRequest.count_total - // was set, its value is undefined otherwise - Total uint64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` -} - -func (m *PageResponse) Reset() { *m = PageResponse{} } -func (m *PageResponse) String() string { return proto.CompactTextString(m) } -func (*PageResponse) ProtoMessage() {} -func (*PageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_53d6d609fe6828af, []int{1} -} -func (m *PageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PageResponse.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 *PageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PageResponse.Merge(m, src) -} -func (m *PageResponse) XXX_Size() int { - return m.Size() -} -func (m *PageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PageResponse proto.InternalMessageInfo - -func (m *PageResponse) GetNextKey() []byte { - if m != nil { - return m.NextKey - } - return nil -} - -func (m *PageResponse) GetTotal() uint64 { - if m != nil { - return m.Total - } - return 0 -} - -func init() { - proto.RegisterType((*PageRequest)(nil), "cosmos.base.query.v1beta1.PageRequest") - proto.RegisterType((*PageResponse)(nil), "cosmos.base.query.v1beta1.PageResponse") -} - -func init() { - proto.RegisterFile("cosmos/base/query/v1beta1/pagination.proto", fileDescriptor_53d6d609fe6828af) -} - -var fileDescriptor_53d6d609fe6828af = []byte{ - // 282 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x44, 0x90, 0xbd, 0x4e, 0xc3, 0x30, - 0x14, 0x85, 0x6b, 0xfa, 0x2b, 0xb7, 0x03, 0xb2, 0x10, 0x72, 0x17, 0x13, 0x75, 0x8a, 0x90, 0x88, - 0x55, 0xf1, 0x00, 0x48, 0x5d, 0x59, 0x50, 0xc4, 0xc4, 0x52, 0x39, 0xe1, 0x36, 0x44, 0x6d, 0xe2, - 0x34, 0xbe, 0xa9, 0xc8, 0x1b, 0x30, 0xf2, 0x58, 0x8c, 0x1d, 0x19, 0x51, 0xf2, 0x22, 0x28, 0x76, - 0x10, 0x93, 0xfd, 0x9d, 0x7b, 0x74, 0xef, 0xd1, 0xa1, 0xb7, 0xb1, 0x36, 0x99, 0x36, 0x32, 0x52, - 0x06, 0xe4, 0xb1, 0x82, 0xb2, 0x96, 0xa7, 0x75, 0x04, 0xa8, 0xd6, 0xb2, 0x50, 0x49, 0x9a, 0x2b, - 0x4c, 0x75, 0x1e, 0x14, 0xa5, 0x46, 0xcd, 0x96, 0xce, 0x1b, 0x74, 0xde, 0xc0, 0x7a, 0x83, 0xde, - 0xbb, 0xfa, 0x20, 0x74, 0xfe, 0xa4, 0x12, 0x08, 0xe1, 0x58, 0x81, 0x41, 0x76, 0x49, 0x87, 0x7b, - 0xa8, 0x39, 0xf1, 0x88, 0xbf, 0x08, 0xbb, 0x2f, 0xbb, 0xa6, 0x13, 0xbd, 0xdb, 0x19, 0x40, 0x7e, - 0xe1, 0x11, 0x7f, 0x14, 0xf6, 0xc4, 0xae, 0xe8, 0xf8, 0x90, 0x66, 0x29, 0xf2, 0xa1, 0x95, 0x1d, - 0xb0, 0x1b, 0x3a, 0x8f, 0x75, 0x95, 0xe3, 0x16, 0x35, 0xaa, 0x03, 0x1f, 0x79, 0xc4, 0x9f, 0x85, - 0xd4, 0x4a, 0xcf, 0x9d, 0xc2, 0x38, 0x9d, 0x96, 0x70, 0x82, 0xd2, 0x00, 0x1f, 0xdb, 0xe1, 0x1f, - 0xae, 0x1e, 0xe8, 0xc2, 0x25, 0x31, 0x85, 0xce, 0x0d, 0xb0, 0x25, 0x9d, 0xe5, 0xf0, 0x8e, 0xdb, - 0xff, 0x3c, 0xd3, 0x8e, 0x1f, 0xa1, 0xee, 0x6e, 0xbb, 0xfd, 0x2e, 0x92, 0x83, 0xcd, 0xe6, 0xab, - 0x11, 0xe4, 0xdc, 0x08, 0xf2, 0xd3, 0x08, 0xf2, 0xd9, 0x8a, 0xc1, 0xb9, 0x15, 0x83, 0xef, 0x56, - 0x0c, 0x5e, 0xfc, 0x24, 0xc5, 0xb7, 0x2a, 0x0a, 0x62, 0x9d, 0xc9, 0xbe, 0x37, 0xf7, 0xdc, 0x99, - 0xd7, 0xbd, 0xc4, 0xba, 0x00, 0xe3, 0x3a, 0x8c, 0x26, 0xb6, 0xb1, 0xfb, 0xdf, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x3d, 0x43, 0x85, 0xf7, 0x5f, 0x01, 0x00, 0x00, -} - -func (m *PageRequest) 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 *PageRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Reverse { - i-- - if m.Reverse { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.CountTotal { - i-- - if m.CountTotal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if m.Limit != 0 { - i = encodeVarintPagination(dAtA, i, uint64(m.Limit)) - i-- - dAtA[i] = 0x18 - } - if m.Offset != 0 { - i = encodeVarintPagination(dAtA, i, uint64(m.Offset)) - i-- - dAtA[i] = 0x10 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintPagination(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PageResponse) 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 *PageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Total != 0 { - i = encodeVarintPagination(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x10 - } - if len(m.NextKey) > 0 { - i -= len(m.NextKey) - copy(dAtA[i:], m.NextKey) - i = encodeVarintPagination(dAtA, i, uint64(len(m.NextKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintPagination(dAtA []byte, offset int, v uint64) int { - offset -= sovPagination(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PageRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovPagination(uint64(l)) - } - if m.Offset != 0 { - n += 1 + sovPagination(uint64(m.Offset)) - } - if m.Limit != 0 { - n += 1 + sovPagination(uint64(m.Limit)) - } - if m.CountTotal { - n += 2 - } - if m.Reverse { - n += 2 - } - return n -} - -func (m *PageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.NextKey) - if l > 0 { - n += 1 + l + sovPagination(uint64(l)) - } - if m.Total != 0 { - n += 1 + sovPagination(uint64(m.Total)) - } - return n -} - -func sovPagination(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPagination(x uint64) (n int) { - return sovPagination(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PageRequest) 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 ErrIntOverflowPagination - } - 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: PageRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PageRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthPagination - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthPagination - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) - } - m.Offset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Offset |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) - } - m.Limit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Limit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CountTotal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.CountTotal = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Reverse", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Reverse = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipPagination(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPagination - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PageResponse) 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 ErrIntOverflowPagination - } - 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: PageResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PageResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthPagination - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthPagination - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextKey = append(m.NextKey[:0], dAtA[iNdEx:postIndex]...) - if m.NextKey == nil { - m.NextKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPagination - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipPagination(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPagination - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPagination(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, ErrIntOverflowPagination - } - 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, ErrIntOverflowPagination - } - 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, ErrIntOverflowPagination - } - 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, ErrInvalidLengthPagination - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPagination - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPagination - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPagination = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPagination = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPagination = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go b/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go deleted file mode 100644 index 1d784a86e5fb..000000000000 --- a/github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: amino/amino.proto - -package amino - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - math "math" -) - -// 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 - -var E_Name = &proto.ExtensionDesc{ - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*string)(nil), - Field: 11110001, - Name: "amino.name", - Tag: "bytes,11110001,opt,name=name", - Filename: "amino/amino.proto", -} - -var E_MessageEncoding = &proto.ExtensionDesc{ - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*string)(nil), - Field: 11110002, - Name: "amino.message_encoding", - Tag: "bytes,11110002,opt,name=message_encoding", - Filename: "amino/amino.proto", -} - -var E_Encoding = &proto.ExtensionDesc{ - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 11110003, - Name: "amino.encoding", - Tag: "bytes,11110003,opt,name=encoding", - Filename: "amino/amino.proto", -} - -var E_FieldName = &proto.ExtensionDesc{ - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 11110004, - Name: "amino.field_name", - Tag: "bytes,11110004,opt,name=field_name", - Filename: "amino/amino.proto", -} - -var E_DontOmitempty = &proto.ExtensionDesc{ - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 11110005, - Name: "amino.dont_omitempty", - Tag: "varint,11110005,opt,name=dont_omitempty", - Filename: "amino/amino.proto", -} - -func init() { - proto.RegisterExtension(E_Name) - proto.RegisterExtension(E_MessageEncoding) - proto.RegisterExtension(E_Encoding) - proto.RegisterExtension(E_FieldName) - proto.RegisterExtension(E_DontOmitempty) -} - -func init() { proto.RegisterFile("amino/amino.proto", fileDescriptor_115c1f70afec6bc5) } - -var fileDescriptor_115c1f70afec6bc5 = []byte{ - // 284 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, - 0xcb, 0xd7, 0x07, 0x93, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xac, 0x60, 0x8e, 0x94, 0x42, - 0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x58, 0x30, 0xa9, 0x34, 0x4d, 0x3f, 0x25, 0xb5, 0x38, - 0xb9, 0x28, 0xb3, 0xa0, 0x24, 0xbf, 0x08, 0xa2, 0xd0, 0xca, 0x8c, 0x8b, 0x25, 0x2f, 0x31, 0x37, - 0x55, 0x48, 0x5e, 0x0f, 0xa2, 0x54, 0x0f, 0xa6, 0x54, 0xcf, 0x37, 0xb5, 0xb8, 0x38, 0x31, 0x3d, - 0xd5, 0xbf, 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0xe2, 0x63, 0xcf, 0x32, 0x56, 0x05, 0x46, 0x0d, - 0xce, 0x20, 0xb0, 0x7a, 0x2b, 0x5f, 0x2e, 0x81, 0x5c, 0x88, 0x82, 0xf8, 0xd4, 0xbc, 0xe4, 0xfc, - 0x94, 0xcc, 0xbc, 0x74, 0xc2, 0x66, 0x7c, 0x82, 0x99, 0xc1, 0x0f, 0xd5, 0xeb, 0x0a, 0xd5, 0x6a, - 0x65, 0xc3, 0xc5, 0x01, 0x37, 0x46, 0x16, 0xc3, 0x18, 0xb7, 0xcc, 0xd4, 0x9c, 0x14, 0x98, 0x21, - 0x9f, 0x61, 0x86, 0xc0, 0x75, 0x58, 0xd9, 0x73, 0x71, 0xa5, 0x81, 0x94, 0xc4, 0x83, 0xbd, 0x42, - 0x40, 0xff, 0x17, 0x98, 0x7e, 0x4e, 0xb0, 0x1e, 0x3f, 0x90, 0x6f, 0xdc, 0xb9, 0xf8, 0x52, 0xf2, - 0xf3, 0x4a, 0xe2, 0xf3, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, 0x09, 0x19, 0xf2, 0x15, - 0x62, 0x08, 0x47, 0x10, 0x2f, 0x48, 0x9f, 0x3f, 0x4c, 0x9b, 0x93, 0xeb, 0x89, 0x47, 0x72, 0x8c, - 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, - 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, - 0xe7, 0xea, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0x43, 0x29, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x92, - 0xca, 0x82, 0xd4, 0x62, 0xfd, 0x92, 0x0a, 0x48, 0x24, 0x26, 0xb1, 0x81, 0x6d, 0x35, 0x06, 0x04, - 0x00, 0x00, 0xff, 0xff, 0xa9, 0xa0, 0x4d, 0x6f, 0xda, 0x01, 0x00, 0x00, -} diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go deleted file mode 100644 index 7c4bbe2cf1d7..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go +++ /dev/null @@ -1,1285 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/auth/v1beta1/auth.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// BaseAccount defines a base account type. It contains all the necessary fields -// for basic account functionality. Any custom account type should extend this -// type for additional functionality (e.g. vesting). -type BaseAccount struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty"` - AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` -} - -func (m *BaseAccount) Reset() { *m = BaseAccount{} } -func (m *BaseAccount) String() string { return proto.CompactTextString(m) } -func (*BaseAccount) ProtoMessage() {} -func (*BaseAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_7e1f7e915d020d2d, []int{0} -} -func (m *BaseAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BaseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BaseAccount.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 *BaseAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_BaseAccount.Merge(m, src) -} -func (m *BaseAccount) XXX_Size() int { - return m.Size() -} -func (m *BaseAccount) XXX_DiscardUnknown() { - xxx_messageInfo_BaseAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_BaseAccount proto.InternalMessageInfo - -// ModuleAccount defines an account for modules that holds coins on a pool. -type ModuleAccount struct { - *BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Permissions []string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` -} - -func (m *ModuleAccount) Reset() { *m = ModuleAccount{} } -func (m *ModuleAccount) String() string { return proto.CompactTextString(m) } -func (*ModuleAccount) ProtoMessage() {} -func (*ModuleAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_7e1f7e915d020d2d, []int{1} -} -func (m *ModuleAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ModuleAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ModuleAccount.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 *ModuleAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModuleAccount.Merge(m, src) -} -func (m *ModuleAccount) XXX_Size() int { - return m.Size() -} -func (m *ModuleAccount) XXX_DiscardUnknown() { - xxx_messageInfo_ModuleAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_ModuleAccount proto.InternalMessageInfo - -// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. -// -// Since: cosmos-sdk 0.47 -type ModuleCredential struct { - // module_name is the name of the module used for address derivation (passed into address.Module). - ModuleName string `protobuf:"bytes,1,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"` - // derivation_keys is for deriving a module account address (passed into address.Module) - // adding more keys creates sub-account addresses (passed into address.Derive) - DerivationKeys [][]byte `protobuf:"bytes,2,rep,name=derivation_keys,json=derivationKeys,proto3" json:"derivation_keys,omitempty"` -} - -func (m *ModuleCredential) Reset() { *m = ModuleCredential{} } -func (m *ModuleCredential) String() string { return proto.CompactTextString(m) } -func (*ModuleCredential) ProtoMessage() {} -func (*ModuleCredential) Descriptor() ([]byte, []int) { - return fileDescriptor_7e1f7e915d020d2d, []int{2} -} -func (m *ModuleCredential) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ModuleCredential) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ModuleCredential.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 *ModuleCredential) XXX_Merge(src proto.Message) { - xxx_messageInfo_ModuleCredential.Merge(m, src) -} -func (m *ModuleCredential) XXX_Size() int { - return m.Size() -} -func (m *ModuleCredential) XXX_DiscardUnknown() { - xxx_messageInfo_ModuleCredential.DiscardUnknown(m) -} - -var xxx_messageInfo_ModuleCredential proto.InternalMessageInfo - -func (m *ModuleCredential) GetModuleName() string { - if m != nil { - return m.ModuleName - } - return "" -} - -func (m *ModuleCredential) GetDerivationKeys() [][]byte { - if m != nil { - return m.DerivationKeys - } - return nil -} - -// Params defines the parameters for the auth module. -type Params struct { - MaxMemoCharacters uint64 `protobuf:"varint,1,opt,name=max_memo_characters,json=maxMemoCharacters,proto3" json:"max_memo_characters,omitempty"` - TxSigLimit uint64 `protobuf:"varint,2,opt,name=tx_sig_limit,json=txSigLimit,proto3" json:"tx_sig_limit,omitempty"` - TxSizeCostPerByte uint64 `protobuf:"varint,3,opt,name=tx_size_cost_per_byte,json=txSizeCostPerByte,proto3" json:"tx_size_cost_per_byte,omitempty"` - SigVerifyCostED25519 uint64 `protobuf:"varint,4,opt,name=sig_verify_cost_ed25519,json=sigVerifyCostEd25519,proto3" json:"sig_verify_cost_ed25519,omitempty"` - SigVerifyCostSecp256k1 uint64 `protobuf:"varint,5,opt,name=sig_verify_cost_secp256k1,json=sigVerifyCostSecp256k1,proto3" json:"sig_verify_cost_secp256k1,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_7e1f7e915d020d2d, []int{3} -} -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) GetMaxMemoCharacters() uint64 { - if m != nil { - return m.MaxMemoCharacters - } - return 0 -} - -func (m *Params) GetTxSigLimit() uint64 { - if m != nil { - return m.TxSigLimit - } - return 0 -} - -func (m *Params) GetTxSizeCostPerByte() uint64 { - if m != nil { - return m.TxSizeCostPerByte - } - return 0 -} - -func (m *Params) GetSigVerifyCostED25519() uint64 { - if m != nil { - return m.SigVerifyCostED25519 - } - return 0 -} - -func (m *Params) GetSigVerifyCostSecp256k1() uint64 { - if m != nil { - return m.SigVerifyCostSecp256k1 - } - return 0 -} - -func init() { - proto.RegisterType((*BaseAccount)(nil), "cosmos.auth.v1beta1.BaseAccount") - proto.RegisterType((*ModuleAccount)(nil), "cosmos.auth.v1beta1.ModuleAccount") - proto.RegisterType((*ModuleCredential)(nil), "cosmos.auth.v1beta1.ModuleCredential") - proto.RegisterType((*Params)(nil), "cosmos.auth.v1beta1.Params") -} - -func init() { proto.RegisterFile("cosmos/auth/v1beta1/auth.proto", fileDescriptor_7e1f7e915d020d2d) } - -var fileDescriptor_7e1f7e915d020d2d = []byte{ - // 707 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x54, 0xcf, 0x4e, 0xe3, 0x46, - 0x1c, 0x8e, 0x93, 0x14, 0xca, 0x04, 0x68, 0x31, 0x29, 0x35, 0x51, 0x15, 0xbb, 0x91, 0x2a, 0x52, - 0x54, 0xec, 0x26, 0x15, 0x95, 0xca, 0x8d, 0xa4, 0x55, 0x85, 0x28, 0x14, 0x39, 0x5a, 0x0e, 0xab, - 0x95, 0xac, 0xb1, 0x33, 0x98, 0x11, 0x19, 0x8f, 0xd7, 0x33, 0x46, 0x31, 0x4f, 0x80, 0xf6, 0xb4, - 0x8f, 0xc0, 0xee, 0x13, 0x70, 0xe0, 0x21, 0x56, 0x7b, 0x42, 0x7b, 0xd9, 0xdd, 0x4b, 0xb4, 0x0a, - 0x07, 0xd0, 0x3e, 0xc5, 0xca, 0x33, 0x0e, 0x24, 0x6c, 0x2e, 0x91, 0x7f, 0xdf, 0xf7, 0xfd, 0xfe, - 0x7d, 0xfe, 0xc5, 0xa0, 0xea, 0x51, 0x46, 0x28, 0xb3, 0x60, 0xcc, 0x8f, 0xad, 0xd3, 0x86, 0x8b, - 0x38, 0x6c, 0x88, 0xc0, 0x0c, 0x23, 0xca, 0xa9, 0xba, 0x2c, 0x79, 0x53, 0x40, 0x19, 0x5f, 0x59, - 0x82, 0x04, 0x07, 0xd4, 0x12, 0xbf, 0x52, 0x57, 0x59, 0x95, 0x3a, 0x47, 0x44, 0x56, 0x96, 0x24, - 0xa9, 0xb2, 0x4f, 0x7d, 0x2a, 0xf1, 0xf4, 0x69, 0x94, 0xe0, 0x53, 0xea, 0xf7, 0x90, 0x25, 0x22, - 0x37, 0x3e, 0xb2, 0x60, 0x90, 0x48, 0xaa, 0xf6, 0x2a, 0x0f, 0x4a, 0x2d, 0xc8, 0xd0, 0xb6, 0xe7, - 0xd1, 0x38, 0xe0, 0x6a, 0x13, 0xcc, 0xc2, 0x6e, 0x37, 0x42, 0x8c, 0x69, 0x8a, 0xa1, 0xd4, 0xe7, - 0x5a, 0xda, 0xbb, 0xab, 0x8d, 0x72, 0xd6, 0x63, 0x5b, 0x32, 0x1d, 0x1e, 0xe1, 0xc0, 0xb7, 0x47, - 0x42, 0xf5, 0x10, 0xcc, 0x86, 0xb1, 0xeb, 0x9c, 0xa0, 0x44, 0xcb, 0x1b, 0x4a, 0xbd, 0xd4, 0x2c, - 0x9b, 0xb2, 0xa1, 0x39, 0x6a, 0x68, 0x6e, 0x07, 0x49, 0x6b, 0xed, 0xf3, 0x40, 0x2f, 0x87, 0xb1, - 0xdb, 0xc3, 0x5e, 0xaa, 0xfd, 0x8d, 0x12, 0xcc, 0x11, 0x09, 0x79, 0xf2, 0xfa, 0xf6, 0x72, 0x1d, - 0x3c, 0x10, 0xf6, 0x4c, 0x18, 0xbb, 0xbb, 0x28, 0x51, 0x7f, 0x01, 0x8b, 0x50, 0x8e, 0xe5, 0x04, - 0x31, 0x71, 0x51, 0xa4, 0x15, 0x0c, 0xa5, 0x5e, 0xb4, 0x17, 0x32, 0x74, 0x5f, 0x80, 0x6a, 0x05, - 0x7c, 0xcb, 0xd0, 0xf3, 0x18, 0x05, 0x1e, 0xd2, 0x8a, 0x42, 0x70, 0x1f, 0x6f, 0xb5, 0xcf, 0x2f, - 0xf4, 0xdc, 0xdd, 0x85, 0x9e, 0x7b, 0x7b, 0xb5, 0xf1, 0xd3, 0x14, 0x7b, 0xcd, 0x6c, 0xef, 0x9d, - 0x17, 0xb7, 0x97, 0xeb, 0x2b, 0x52, 0xb0, 0xc1, 0xba, 0x27, 0xd6, 0x98, 0x27, 0xb5, 0x8f, 0x0a, - 0x58, 0xd8, 0xa3, 0xdd, 0xb8, 0x77, 0xef, 0xd2, 0x0e, 0x98, 0x77, 0x21, 0x43, 0x4e, 0x36, 0x88, - 0xb0, 0xaa, 0xd4, 0x34, 0xcc, 0x69, 0x1d, 0xc6, 0x2a, 0xb5, 0x8a, 0xd7, 0x03, 0x5d, 0xb1, 0x4b, - 0xee, 0x98, 0xe1, 0x2a, 0x28, 0x06, 0x90, 0x20, 0xe1, 0xdc, 0x9c, 0x2d, 0x9e, 0x55, 0x03, 0x94, - 0x42, 0x14, 0x11, 0xcc, 0x18, 0xa6, 0x01, 0xd3, 0x0a, 0x46, 0xa1, 0x3e, 0x67, 0x8f, 0x43, 0x5b, - 0xff, 0x9e, 0xcb, 0x9d, 0x6a, 0xd3, 0x3a, 0x4e, 0xcc, 0x2a, 0x36, 0xd3, 0xc6, 0x36, 0x9b, 0x60, - 0x6b, 0xcf, 0xc0, 0xf7, 0x12, 0x68, 0x47, 0xa8, 0x8b, 0x02, 0x8e, 0x61, 0x4f, 0xd5, 0x41, 0x89, - 0x08, 0xcc, 0x11, 0x93, 0x89, 0x3b, 0xb0, 0x81, 0x84, 0xf6, 0xd3, 0xf9, 0xd6, 0xc0, 0x77, 0x5d, - 0x14, 0xe1, 0x53, 0xc8, 0x31, 0x0d, 0xd2, 0x57, 0xc6, 0xb4, 0xbc, 0x51, 0xa8, 0xcf, 0xdb, 0x8b, - 0x0f, 0xf0, 0x2e, 0x4a, 0x58, 0xed, 0x7d, 0x1e, 0xcc, 0x1c, 0xc0, 0x08, 0x12, 0xa6, 0x9a, 0x60, - 0x99, 0xc0, 0xbe, 0x43, 0x10, 0xa1, 0x8e, 0x77, 0x0c, 0x23, 0xe8, 0x71, 0x14, 0xc9, 0x23, 0x2b, - 0xda, 0x4b, 0x04, 0xf6, 0xf7, 0x10, 0xa1, 0xed, 0x7b, 0x42, 0x35, 0xc0, 0x3c, 0xef, 0x3b, 0x0c, - 0xfb, 0x4e, 0x0f, 0x13, 0xcc, 0x85, 0x3f, 0x45, 0x1b, 0xf0, 0x7e, 0x07, 0xfb, 0xff, 0xa5, 0x88, - 0xfa, 0x3b, 0xf8, 0x41, 0x28, 0xce, 0x90, 0xe3, 0x51, 0xc6, 0x9d, 0x10, 0x45, 0x8e, 0x9b, 0x70, - 0x94, 0x5d, 0xc9, 0x52, 0x2a, 0x3d, 0x43, 0x6d, 0xca, 0xf8, 0x01, 0x8a, 0x5a, 0x09, 0x47, 0xea, - 0xff, 0xe0, 0xc7, 0xb4, 0xe0, 0x29, 0x8a, 0xf0, 0x51, 0x22, 0x93, 0x50, 0xb7, 0xb9, 0xb9, 0xd9, - 0xf8, 0x4b, 0x1e, 0x4e, 0x4b, 0x1b, 0x0e, 0xf4, 0x72, 0x07, 0xfb, 0x87, 0x42, 0x91, 0xa6, 0xfe, - 0xf3, 0xb7, 0xe0, 0xed, 0x32, 0x9b, 0x40, 0x65, 0x96, 0xfa, 0x04, 0xac, 0x3e, 0x2e, 0xc8, 0x90, - 0x17, 0x36, 0x37, 0xff, 0x3c, 0x69, 0x68, 0xdf, 0x88, 0x92, 0x95, 0xe1, 0x40, 0x5f, 0x99, 0x28, - 0xd9, 0x19, 0x29, 0xec, 0x15, 0x36, 0x15, 0xdf, 0xfa, 0xf9, 0xee, 0x42, 0x57, 0x1e, 0xbf, 0xb7, - 0xbe, 0xfc, 0x6e, 0x48, 0x3b, 0x5b, 0xed, 0x37, 0xc3, 0xaa, 0x72, 0x3d, 0xac, 0x2a, 0x9f, 0x86, - 0x55, 0xe5, 0xe5, 0x4d, 0x35, 0x77, 0x7d, 0x53, 0xcd, 0x7d, 0xb8, 0xa9, 0xe6, 0x9e, 0xfe, 0xea, - 0x63, 0x7e, 0x1c, 0xbb, 0xa6, 0x47, 0x49, 0xf6, 0x6d, 0xb0, 0xbe, 0xae, 0xc2, 0x93, 0x10, 0x31, - 0x77, 0x46, 0xfc, 0x3f, 0xff, 0xf8, 0x12, 0x00, 0x00, 0xff, 0xff, 0x94, 0x45, 0xcd, 0x40, 0x99, - 0x04, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxMemoCharacters != that1.MaxMemoCharacters { - return false - } - if this.TxSigLimit != that1.TxSigLimit { - return false - } - if this.TxSizeCostPerByte != that1.TxSizeCostPerByte { - return false - } - if this.SigVerifyCostED25519 != that1.SigVerifyCostED25519 { - return false - } - if this.SigVerifyCostSecp256k1 != that1.SigVerifyCostSecp256k1 { - return false - } - return true -} -func (m *BaseAccount) 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 *BaseAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sequence != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.Sequence)) - i-- - dAtA[i] = 0x20 - } - if m.AccountNumber != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.AccountNumber)) - i-- - dAtA[i] = 0x18 - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuth(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ModuleAccount) 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 *ModuleAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Permissions) > 0 { - for iNdEx := len(m.Permissions) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Permissions[iNdEx]) - copy(dAtA[i:], m.Permissions[iNdEx]) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Permissions[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.BaseAccount != nil { - { - size, err := m.BaseAccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuth(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ModuleCredential) 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 *ModuleCredential) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ModuleCredential) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DerivationKeys) > 0 { - for iNdEx := len(m.DerivationKeys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.DerivationKeys[iNdEx]) - copy(dAtA[i:], m.DerivationKeys[iNdEx]) - i = encodeVarintAuth(dAtA, i, uint64(len(m.DerivationKeys[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.ModuleName) > 0 { - i -= len(m.ModuleName) - copy(dAtA[i:], m.ModuleName) - i = encodeVarintAuth(dAtA, i, uint64(len(m.ModuleName))) - 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.SigVerifyCostSecp256k1 != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostSecp256k1)) - i-- - dAtA[i] = 0x28 - } - if m.SigVerifyCostED25519 != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostED25519)) - i-- - dAtA[i] = 0x20 - } - if m.TxSizeCostPerByte != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.TxSizeCostPerByte)) - i-- - dAtA[i] = 0x18 - } - if m.TxSigLimit != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.TxSigLimit)) - i-- - dAtA[i] = 0x10 - } - if m.MaxMemoCharacters != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.MaxMemoCharacters)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { - offset -= sovAuth(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BaseAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovAuth(uint64(l)) - } - if m.AccountNumber != 0 { - n += 1 + sovAuth(uint64(m.AccountNumber)) - } - if m.Sequence != 0 { - n += 1 + sovAuth(uint64(m.Sequence)) - } - return n -} - -func (m *ModuleAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseAccount != nil { - l = m.BaseAccount.Size() - n += 1 + l + sovAuth(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.Permissions) > 0 { - for _, s := range m.Permissions { - l = len(s) - n += 1 + l + sovAuth(uint64(l)) - } - } - return n -} - -func (m *ModuleCredential) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ModuleName) - if l > 0 { - n += 1 + l + sovAuth(uint64(l)) - } - if len(m.DerivationKeys) > 0 { - for _, b := range m.DerivationKeys { - l = len(b) - n += 1 + l + sovAuth(uint64(l)) - } - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxMemoCharacters != 0 { - n += 1 + sovAuth(uint64(m.MaxMemoCharacters)) - } - if m.TxSigLimit != 0 { - n += 1 + sovAuth(uint64(m.TxSigLimit)) - } - if m.TxSizeCostPerByte != 0 { - n += 1 + sovAuth(uint64(m.TxSizeCostPerByte)) - } - if m.SigVerifyCostED25519 != 0 { - n += 1 + sovAuth(uint64(m.SigVerifyCostED25519)) - } - if m.SigVerifyCostSecp256k1 != 0 { - n += 1 + sovAuth(uint64(m.SigVerifyCostSecp256k1)) - } - return n -} - -func sovAuth(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAuth(x uint64) (n int) { - return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BaseAccount) 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 ErrIntOverflowAuth - } - 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: BaseAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BaseAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - 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 ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &types.Any{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountNumber", wireType) - } - m.AccountNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AccountNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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 ErrIntOverflowAuth - } - 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 := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ModuleAccount) 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 ErrIntOverflowAuth - } - 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: ModuleAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ModuleAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseAccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BaseAccount == nil { - m.BaseAccount = &BaseAccount{} - } - if err := m.BaseAccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - 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 ErrIntOverflowAuth - } - 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 ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - 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 ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Permissions = append(m.Permissions, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ModuleCredential) 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 ErrIntOverflowAuth - } - 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: ModuleCredential: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ModuleCredential: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - 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 ErrInvalidLengthAuth - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ModuleName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DerivationKeys", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAuth - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAuth - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DerivationKeys = append(m.DerivationKeys, make([]byte, postIndex-iNdEx)) - copy(m.DerivationKeys[len(m.DerivationKeys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - 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 ErrIntOverflowAuth - } - 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 MaxMemoCharacters", wireType) - } - m.MaxMemoCharacters = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxMemoCharacters |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxSigLimit", wireType) - } - m.TxSigLimit = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxSigLimit |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TxSizeCostPerByte", wireType) - } - m.TxSizeCostPerByte = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TxSizeCostPerByte |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SigVerifyCostED25519", wireType) - } - m.SigVerifyCostED25519 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SigVerifyCostED25519 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SigVerifyCostSecp256k1", wireType) - } - m.SigVerifyCostSecp256k1 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SigVerifyCostSecp256k1 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAuth(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuth - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuth(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, ErrIntOverflowAuth - } - 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, ErrIntOverflowAuth - } - 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, ErrIntOverflowAuth - } - 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, ErrInvalidLengthAuth - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAuth - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAuth - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go deleted file mode 100644 index 6ebdec98146f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/auth/types/genesis.pb.go +++ /dev/null @@ -1,391 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/auth/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// GenesisState defines the auth module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // accounts are the accounts present at genesis. - Accounts []*types.Any `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_d897ccbce9822332, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetAccounts() []*types.Any { - if m != nil { - return m.Accounts - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.auth.v1beta1.GenesisState") -} - -func init() { proto.RegisterFile("cosmos/auth/v1beta1/genesis.proto", fileDescriptor_d897ccbce9822332) } - -var fileDescriptor_d897ccbce9822332 = []byte{ - // 269 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, - 0x28, 0xd1, 0x03, 0x29, 0xd1, 0x83, 0x2a, 0x91, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, - 0x07, 0x2b, 0x49, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xa8, 0x97, 0x12, 0x49, 0xcf, 0x4f, - 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0xa8, 0xa8, 0x1c, 0x36, 0x8b, 0xc0, 0x46, 0x42, 0xe4, 0x05, - 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x48, 0xa9, 0x81, 0x91, 0x8b, 0xc7, 0x1d, - 0xe2, 0x94, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x3b, 0x2e, 0xb6, 0x82, 0xc4, 0xa2, 0xc4, 0xdc, - 0x62, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x69, 0x3d, 0x2c, 0x4e, 0xd3, 0x0b, 0x00, 0x2b, - 0x71, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x42, - 0x06, 0x5c, 0x1c, 0x89, 0xc9, 0xc9, 0xf9, 0xa5, 0x79, 0x25, 0xc5, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, - 0xdc, 0x46, 0x22, 0x7a, 0x10, 0x7f, 0xe8, 0xc1, 0xfc, 0xa1, 0xe7, 0x98, 0x57, 0x19, 0x04, 0x57, - 0xe5, 0xe4, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, - 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0xe9, 0x99, - 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, 0xaf, 0x41, 0x28, 0xdd, 0xe2, 0x94, - 0x6c, 0xfd, 0x0a, 0x88, 0x3f, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x86, 0x1b, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x70, 0x8d, 0xea, 0x6c, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Accounts = append(m.Accounts, &types.Any{}) - if err := m.Accounts[len(m.Accounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go deleted file mode 100644 index 72910ef780ac..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.go +++ /dev/null @@ -1,4117 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/auth/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -type QueryAccountsRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAccountsRequest) Reset() { *m = QueryAccountsRequest{} } -func (m *QueryAccountsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountsRequest) ProtoMessage() {} -func (*QueryAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{0} -} -func (m *QueryAccountsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountsRequest.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 *QueryAccountsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountsRequest.Merge(m, src) -} -func (m *QueryAccountsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountsRequest proto.InternalMessageInfo - -func (m *QueryAccountsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -type QueryAccountsResponse struct { - // accounts are the existing accounts - Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAccountsResponse) Reset() { *m = QueryAccountsResponse{} } -func (m *QueryAccountsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountsResponse) ProtoMessage() {} -func (*QueryAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{1} -} -func (m *QueryAccountsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountsResponse.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 *QueryAccountsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountsResponse.Merge(m, src) -} -func (m *QueryAccountsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountsResponse proto.InternalMessageInfo - -func (m *QueryAccountsResponse) GetAccounts() []*types.Any { - if m != nil { - return m.Accounts - } - return nil -} - -func (m *QueryAccountsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAccountRequest is the request type for the Query/Account RPC method. -type QueryAccountRequest struct { - // address defines the address to query for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryAccountRequest) Reset() { *m = QueryAccountRequest{} } -func (m *QueryAccountRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountRequest) ProtoMessage() {} -func (*QueryAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{2} -} -func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountRequest.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 *QueryAccountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountRequest.Merge(m, src) -} -func (m *QueryAccountRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountRequest proto.InternalMessageInfo - -// QueryAccountResponse is the response type for the Query/Account RPC method. -type QueryAccountResponse struct { - // account defines the account of the corresponding address. - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` -} - -func (m *QueryAccountResponse) Reset() { *m = QueryAccountResponse{} } -func (m *QueryAccountResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountResponse) ProtoMessage() {} -func (*QueryAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{3} -} -func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountResponse.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 *QueryAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountResponse.Merge(m, src) -} -func (m *QueryAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountResponse proto.InternalMessageInfo - -func (m *QueryAccountResponse) GetAccount() *types.Any { - if m != nil { - return m.Account - } - return nil -} - -// QueryParamsRequest is the 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_c451370b3929a27c, []int{4} -} -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 the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params defines the parameters of the 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_c451370b3929a27c, []int{5} -} -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{} -} - -// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. -// -// Since: cosmos-sdk 0.46 -type QueryModuleAccountsRequest struct { -} - -func (m *QueryModuleAccountsRequest) Reset() { *m = QueryModuleAccountsRequest{} } -func (m *QueryModuleAccountsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryModuleAccountsRequest) ProtoMessage() {} -func (*QueryModuleAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{6} -} -func (m *QueryModuleAccountsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryModuleAccountsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryModuleAccountsRequest.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 *QueryModuleAccountsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryModuleAccountsRequest.Merge(m, src) -} -func (m *QueryModuleAccountsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryModuleAccountsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryModuleAccountsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryModuleAccountsRequest proto.InternalMessageInfo - -// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. -// -// Since: cosmos-sdk 0.46 -type QueryModuleAccountsResponse struct { - Accounts []*types.Any `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` -} - -func (m *QueryModuleAccountsResponse) Reset() { *m = QueryModuleAccountsResponse{} } -func (m *QueryModuleAccountsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryModuleAccountsResponse) ProtoMessage() {} -func (*QueryModuleAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{7} -} -func (m *QueryModuleAccountsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryModuleAccountsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryModuleAccountsResponse.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 *QueryModuleAccountsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryModuleAccountsResponse.Merge(m, src) -} -func (m *QueryModuleAccountsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryModuleAccountsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryModuleAccountsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryModuleAccountsResponse proto.InternalMessageInfo - -func (m *QueryModuleAccountsResponse) GetAccounts() []*types.Any { - if m != nil { - return m.Accounts - } - return nil -} - -// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. -type QueryModuleAccountByNameRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *QueryModuleAccountByNameRequest) Reset() { *m = QueryModuleAccountByNameRequest{} } -func (m *QueryModuleAccountByNameRequest) String() string { return proto.CompactTextString(m) } -func (*QueryModuleAccountByNameRequest) ProtoMessage() {} -func (*QueryModuleAccountByNameRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{8} -} -func (m *QueryModuleAccountByNameRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryModuleAccountByNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryModuleAccountByNameRequest.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 *QueryModuleAccountByNameRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryModuleAccountByNameRequest.Merge(m, src) -} -func (m *QueryModuleAccountByNameRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryModuleAccountByNameRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryModuleAccountByNameRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryModuleAccountByNameRequest proto.InternalMessageInfo - -func (m *QueryModuleAccountByNameRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. -type QueryModuleAccountByNameResponse struct { - Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` -} - -func (m *QueryModuleAccountByNameResponse) Reset() { *m = QueryModuleAccountByNameResponse{} } -func (m *QueryModuleAccountByNameResponse) String() string { return proto.CompactTextString(m) } -func (*QueryModuleAccountByNameResponse) ProtoMessage() {} -func (*QueryModuleAccountByNameResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{9} -} -func (m *QueryModuleAccountByNameResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryModuleAccountByNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryModuleAccountByNameResponse.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 *QueryModuleAccountByNameResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryModuleAccountByNameResponse.Merge(m, src) -} -func (m *QueryModuleAccountByNameResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryModuleAccountByNameResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryModuleAccountByNameResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryModuleAccountByNameResponse proto.InternalMessageInfo - -func (m *QueryModuleAccountByNameResponse) GetAccount() *types.Any { - if m != nil { - return m.Account - } - return nil -} - -// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. -// -// Since: cosmos-sdk 0.46 -type Bech32PrefixRequest struct { -} - -func (m *Bech32PrefixRequest) Reset() { *m = Bech32PrefixRequest{} } -func (m *Bech32PrefixRequest) String() string { return proto.CompactTextString(m) } -func (*Bech32PrefixRequest) ProtoMessage() {} -func (*Bech32PrefixRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{10} -} -func (m *Bech32PrefixRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Bech32PrefixRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Bech32PrefixRequest.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 *Bech32PrefixRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_Bech32PrefixRequest.Merge(m, src) -} -func (m *Bech32PrefixRequest) XXX_Size() int { - return m.Size() -} -func (m *Bech32PrefixRequest) XXX_DiscardUnknown() { - xxx_messageInfo_Bech32PrefixRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_Bech32PrefixRequest proto.InternalMessageInfo - -// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. -// -// Since: cosmos-sdk 0.46 -type Bech32PrefixResponse struct { - Bech32Prefix string `protobuf:"bytes,1,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` -} - -func (m *Bech32PrefixResponse) Reset() { *m = Bech32PrefixResponse{} } -func (m *Bech32PrefixResponse) String() string { return proto.CompactTextString(m) } -func (*Bech32PrefixResponse) ProtoMessage() {} -func (*Bech32PrefixResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{11} -} -func (m *Bech32PrefixResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Bech32PrefixResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Bech32PrefixResponse.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 *Bech32PrefixResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_Bech32PrefixResponse.Merge(m, src) -} -func (m *Bech32PrefixResponse) XXX_Size() int { - return m.Size() -} -func (m *Bech32PrefixResponse) XXX_DiscardUnknown() { - xxx_messageInfo_Bech32PrefixResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_Bech32PrefixResponse proto.InternalMessageInfo - -func (m *Bech32PrefixResponse) GetBech32Prefix() string { - if m != nil { - return m.Bech32Prefix - } - return "" -} - -// AddressBytesToStringRequest is the request type for AddressString rpc method. -// -// Since: cosmos-sdk 0.46 -type AddressBytesToStringRequest struct { - AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` -} - -func (m *AddressBytesToStringRequest) Reset() { *m = AddressBytesToStringRequest{} } -func (m *AddressBytesToStringRequest) String() string { return proto.CompactTextString(m) } -func (*AddressBytesToStringRequest) ProtoMessage() {} -func (*AddressBytesToStringRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{12} -} -func (m *AddressBytesToStringRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddressBytesToStringRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddressBytesToStringRequest.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 *AddressBytesToStringRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressBytesToStringRequest.Merge(m, src) -} -func (m *AddressBytesToStringRequest) XXX_Size() int { - return m.Size() -} -func (m *AddressBytesToStringRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddressBytesToStringRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddressBytesToStringRequest proto.InternalMessageInfo - -func (m *AddressBytesToStringRequest) GetAddressBytes() []byte { - if m != nil { - return m.AddressBytes - } - return nil -} - -// AddressBytesToStringResponse is the response type for AddressString rpc method. -// -// Since: cosmos-sdk 0.46 -type AddressBytesToStringResponse struct { - AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` -} - -func (m *AddressBytesToStringResponse) Reset() { *m = AddressBytesToStringResponse{} } -func (m *AddressBytesToStringResponse) String() string { return proto.CompactTextString(m) } -func (*AddressBytesToStringResponse) ProtoMessage() {} -func (*AddressBytesToStringResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{13} -} -func (m *AddressBytesToStringResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddressBytesToStringResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddressBytesToStringResponse.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 *AddressBytesToStringResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressBytesToStringResponse.Merge(m, src) -} -func (m *AddressBytesToStringResponse) XXX_Size() int { - return m.Size() -} -func (m *AddressBytesToStringResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddressBytesToStringResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AddressBytesToStringResponse proto.InternalMessageInfo - -func (m *AddressBytesToStringResponse) GetAddressString() string { - if m != nil { - return m.AddressString - } - return "" -} - -// AddressStringToBytesRequest is the request type for AccountBytes rpc method. -// -// Since: cosmos-sdk 0.46 -type AddressStringToBytesRequest struct { - AddressString string `protobuf:"bytes,1,opt,name=address_string,json=addressString,proto3" json:"address_string,omitempty"` -} - -func (m *AddressStringToBytesRequest) Reset() { *m = AddressStringToBytesRequest{} } -func (m *AddressStringToBytesRequest) String() string { return proto.CompactTextString(m) } -func (*AddressStringToBytesRequest) ProtoMessage() {} -func (*AddressStringToBytesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{14} -} -func (m *AddressStringToBytesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddressStringToBytesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddressStringToBytesRequest.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 *AddressStringToBytesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressStringToBytesRequest.Merge(m, src) -} -func (m *AddressStringToBytesRequest) XXX_Size() int { - return m.Size() -} -func (m *AddressStringToBytesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddressStringToBytesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_AddressStringToBytesRequest proto.InternalMessageInfo - -func (m *AddressStringToBytesRequest) GetAddressString() string { - if m != nil { - return m.AddressString - } - return "" -} - -// AddressStringToBytesResponse is the response type for AddressBytes rpc method. -// -// Since: cosmos-sdk 0.46 -type AddressStringToBytesResponse struct { - AddressBytes []byte `protobuf:"bytes,1,opt,name=address_bytes,json=addressBytes,proto3" json:"address_bytes,omitempty"` -} - -func (m *AddressStringToBytesResponse) Reset() { *m = AddressStringToBytesResponse{} } -func (m *AddressStringToBytesResponse) String() string { return proto.CompactTextString(m) } -func (*AddressStringToBytesResponse) ProtoMessage() {} -func (*AddressStringToBytesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{15} -} -func (m *AddressStringToBytesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AddressStringToBytesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AddressStringToBytesResponse.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 *AddressStringToBytesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressStringToBytesResponse.Merge(m, src) -} -func (m *AddressStringToBytesResponse) XXX_Size() int { - return m.Size() -} -func (m *AddressStringToBytesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddressStringToBytesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_AddressStringToBytesResponse proto.InternalMessageInfo - -func (m *AddressStringToBytesResponse) GetAddressBytes() []byte { - if m != nil { - return m.AddressBytes - } - return nil -} - -// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method -// -// Since: cosmos-sdk 0.46.2 -type QueryAccountAddressByIDRequest struct { - // Deprecated, use account_id instead - // - // id is the account number of the address to be queried. This field - // should have been an uint64 (like all account numbers), and will be - // updated to uint64 in a future version of the auth query. - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Deprecated: Do not use. - // account_id is the account number of the address to be queried. - // - // Since: cosmos-sdk 0.47 - AccountId uint64 `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` -} - -func (m *QueryAccountAddressByIDRequest) Reset() { *m = QueryAccountAddressByIDRequest{} } -func (m *QueryAccountAddressByIDRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountAddressByIDRequest) ProtoMessage() {} -func (*QueryAccountAddressByIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{16} -} -func (m *QueryAccountAddressByIDRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountAddressByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountAddressByIDRequest.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 *QueryAccountAddressByIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountAddressByIDRequest.Merge(m, src) -} -func (m *QueryAccountAddressByIDRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountAddressByIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountAddressByIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountAddressByIDRequest proto.InternalMessageInfo - -// Deprecated: Do not use. -func (m *QueryAccountAddressByIDRequest) GetId() int64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *QueryAccountAddressByIDRequest) GetAccountId() uint64 { - if m != nil { - return m.AccountId - } - return 0 -} - -// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method -// -// Since: cosmos-sdk 0.46.2 -type QueryAccountAddressByIDResponse struct { - AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` -} - -func (m *QueryAccountAddressByIDResponse) Reset() { *m = QueryAccountAddressByIDResponse{} } -func (m *QueryAccountAddressByIDResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountAddressByIDResponse) ProtoMessage() {} -func (*QueryAccountAddressByIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{17} -} -func (m *QueryAccountAddressByIDResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountAddressByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountAddressByIDResponse.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 *QueryAccountAddressByIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountAddressByIDResponse.Merge(m, src) -} -func (m *QueryAccountAddressByIDResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountAddressByIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountAddressByIDResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountAddressByIDResponse proto.InternalMessageInfo - -func (m *QueryAccountAddressByIDResponse) GetAccountAddress() string { - if m != nil { - return m.AccountAddress - } - return "" -} - -// QueryAccountInfoRequest is the Query/AccountInfo request type. -// -// Since: cosmos-sdk 0.47 -type QueryAccountInfoRequest struct { - // address is the account address string. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *QueryAccountInfoRequest) Reset() { *m = QueryAccountInfoRequest{} } -func (m *QueryAccountInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAccountInfoRequest) ProtoMessage() {} -func (*QueryAccountInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{18} -} -func (m *QueryAccountInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountInfoRequest.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 *QueryAccountInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountInfoRequest.Merge(m, src) -} -func (m *QueryAccountInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountInfoRequest proto.InternalMessageInfo - -func (m *QueryAccountInfoRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// QueryAccountInfoResponse is the Query/AccountInfo response type. -// -// Since: cosmos-sdk 0.47 -type QueryAccountInfoResponse struct { - // info is the account info which is represented by BaseAccount. - Info *BaseAccount `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` -} - -func (m *QueryAccountInfoResponse) Reset() { *m = QueryAccountInfoResponse{} } -func (m *QueryAccountInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAccountInfoResponse) ProtoMessage() {} -func (*QueryAccountInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c451370b3929a27c, []int{19} -} -func (m *QueryAccountInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAccountInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAccountInfoResponse.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 *QueryAccountInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAccountInfoResponse.Merge(m, src) -} -func (m *QueryAccountInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAccountInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAccountInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAccountInfoResponse proto.InternalMessageInfo - -func (m *QueryAccountInfoResponse) GetInfo() *BaseAccount { - if m != nil { - return m.Info - } - return nil -} - -func init() { - proto.RegisterType((*QueryAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryAccountsRequest") - proto.RegisterType((*QueryAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryAccountsResponse") - proto.RegisterType((*QueryAccountRequest)(nil), "cosmos.auth.v1beta1.QueryAccountRequest") - proto.RegisterType((*QueryAccountResponse)(nil), "cosmos.auth.v1beta1.QueryAccountResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.auth.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.auth.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryModuleAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryModuleAccountsRequest") - proto.RegisterType((*QueryModuleAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryModuleAccountsResponse") - proto.RegisterType((*QueryModuleAccountByNameRequest)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameRequest") - proto.RegisterType((*QueryModuleAccountByNameResponse)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameResponse") - proto.RegisterType((*Bech32PrefixRequest)(nil), "cosmos.auth.v1beta1.Bech32PrefixRequest") - proto.RegisterType((*Bech32PrefixResponse)(nil), "cosmos.auth.v1beta1.Bech32PrefixResponse") - proto.RegisterType((*AddressBytesToStringRequest)(nil), "cosmos.auth.v1beta1.AddressBytesToStringRequest") - proto.RegisterType((*AddressBytesToStringResponse)(nil), "cosmos.auth.v1beta1.AddressBytesToStringResponse") - proto.RegisterType((*AddressStringToBytesRequest)(nil), "cosmos.auth.v1beta1.AddressStringToBytesRequest") - proto.RegisterType((*AddressStringToBytesResponse)(nil), "cosmos.auth.v1beta1.AddressStringToBytesResponse") - proto.RegisterType((*QueryAccountAddressByIDRequest)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") - proto.RegisterType((*QueryAccountAddressByIDResponse)(nil), "cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") - proto.RegisterType((*QueryAccountInfoRequest)(nil), "cosmos.auth.v1beta1.QueryAccountInfoRequest") - proto.RegisterType((*QueryAccountInfoResponse)(nil), "cosmos.auth.v1beta1.QueryAccountInfoResponse") -} - -func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) } - -var fileDescriptor_c451370b3929a27c = []byte{ - // 1065 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0xe3, 0x6e, 0x69, 0xbb, 0xaf, 0xd9, 0x22, 0x4d, 0xb3, 0x22, 0x38, 0x6d, 0x12, 0xb9, - 0xd0, 0xa6, 0x65, 0x63, 0xd3, 0x34, 0x2b, 0xf1, 0xe3, 0x54, 0xef, 0x02, 0xea, 0x61, 0x51, 0x70, - 0x57, 0x08, 0x71, 0x20, 0x72, 0x62, 0x27, 0xb5, 0xd8, 0x78, 0xb2, 0xb1, 0x03, 0x1b, 0xaa, 0x5c, - 0x90, 0x90, 0x7a, 0x41, 0x42, 0x82, 0x3f, 0x60, 0x0f, 0x88, 0xf3, 0x22, 0x95, 0x1b, 0x7f, 0xc0, - 0x6a, 0x4f, 0x2b, 0xb8, 0x70, 0x42, 0xa8, 0x45, 0x82, 0x1b, 0xff, 0x02, 0xca, 0xcc, 0xb3, 0x63, - 0xb7, 0x93, 0xc4, 0x85, 0x53, 0x9d, 0x99, 0xf7, 0xbe, 0xef, 0x33, 0x6f, 0x9e, 0xfd, 0x2d, 0x14, - 0x9a, 0xd4, 0xeb, 0x50, 0x4f, 0x33, 0xfb, 0xfe, 0x91, 0xf6, 0xd9, 0x6e, 0xc3, 0xf6, 0xcd, 0x5d, - 0xed, 0x61, 0xdf, 0xee, 0x0d, 0xd4, 0x6e, 0x8f, 0xfa, 0x94, 0xac, 0xf2, 0x00, 0x75, 0x14, 0xa0, - 0x62, 0x80, 0xbc, 0x83, 0x59, 0x0d, 0xd3, 0xb3, 0x79, 0x74, 0x98, 0xdb, 0x35, 0xdb, 0x8e, 0x6b, - 0xfa, 0x0e, 0x75, 0xb9, 0x80, 0x9c, 0x69, 0xd3, 0x36, 0x65, 0x8f, 0xda, 0xe8, 0x09, 0x57, 0x5f, - 0x6e, 0x53, 0xda, 0x7e, 0x60, 0x6b, 0xec, 0x57, 0xa3, 0xdf, 0xd2, 0x4c, 0x17, 0x2b, 0xca, 0x6b, - 0xb8, 0x65, 0x76, 0x1d, 0xcd, 0x74, 0x5d, 0xea, 0x33, 0x35, 0x0f, 0x77, 0xf3, 0x22, 0x60, 0x06, - 0x87, 0xc2, 0x7c, 0xbf, 0xce, 0x2b, 0x22, 0x3c, 0xdf, 0xca, 0x61, 0x6a, 0x00, 0x1c, 0x3d, 0xa7, - 0xf2, 0x09, 0x64, 0x3e, 0x18, 0xfd, 0xdc, 0x6f, 0x36, 0x69, 0xdf, 0xf5, 0x3d, 0xc3, 0x7e, 0xd8, - 0xb7, 0x3d, 0x9f, 0xbc, 0x0b, 0x30, 0x3e, 0x52, 0x56, 0x2a, 0x4a, 0xa5, 0xe5, 0xca, 0xa6, 0x8a, - 0xba, 0xa3, 0xf3, 0xab, 0x5c, 0x05, 0x51, 0xd4, 0x9a, 0xd9, 0xb6, 0x31, 0xd7, 0x88, 0x64, 0x2a, - 0xa7, 0x12, 0xdc, 0xbc, 0x50, 0xc0, 0xeb, 0x52, 0xd7, 0xb3, 0x89, 0x01, 0x4b, 0x26, 0xae, 0x65, - 0xa5, 0xe2, 0xb5, 0xd2, 0x72, 0x25, 0xa3, 0xf2, 0x16, 0xa8, 0x41, 0x77, 0xd4, 0x7d, 0x77, 0xa0, - 0x17, 0x9f, 0x9d, 0x96, 0xd7, 0x04, 0xb7, 0xa1, 0xa2, 0xe2, 0x81, 0x11, 0xea, 0x90, 0xf7, 0x62, - 0xd4, 0x73, 0x8c, 0x7a, 0x6b, 0x26, 0x35, 0x07, 0x8a, 0x61, 0x1f, 0xc2, 0x6a, 0x94, 0x3a, 0xe8, - 0x4a, 0x05, 0x16, 0x4d, 0xcb, 0xea, 0xd9, 0x9e, 0xc7, 0x5a, 0x72, 0x5d, 0xcf, 0xfe, 0x72, 0x5a, - 0xce, 0xa0, 0xfe, 0x3e, 0xdf, 0x39, 0xf4, 0x7b, 0x8e, 0xdb, 0x36, 0x82, 0xc0, 0xb7, 0x96, 0x4e, - 0x1e, 0x17, 0x52, 0x7f, 0x3f, 0x2e, 0xa4, 0x94, 0xa3, 0x78, 0xaf, 0xc3, 0x4e, 0xd4, 0x60, 0x11, - 0x4f, 0x80, 0x8d, 0xfe, 0xaf, 0x8d, 0x08, 0x64, 0x94, 0x0c, 0x10, 0x56, 0xa9, 0x66, 0xf6, 0xcc, - 0x4e, 0x70, 0xa7, 0x4a, 0x0d, 0x0f, 0x15, 0xac, 0x62, 0xf9, 0x37, 0x61, 0xa1, 0xcb, 0x56, 0xb0, - 0x7a, 0x4e, 0x15, 0x15, 0xe1, 0x49, 0xfa, 0xfc, 0xd3, 0xdf, 0x0b, 0x29, 0x03, 0x13, 0x94, 0x35, - 0x90, 0x99, 0xe2, 0x3d, 0x6a, 0xf5, 0x1f, 0xd8, 0x17, 0x66, 0x48, 0xf9, 0x1c, 0x72, 0xc2, 0x5d, - 0xac, 0xfb, 0x51, 0xc2, 0x01, 0xd8, 0x7c, 0x76, 0x5a, 0x56, 0x44, 0x48, 0x31, 0xdd, 0xc8, 0x18, - 0x28, 0xb7, 0xa1, 0x70, 0xb9, 0xb0, 0x3e, 0x78, 0xdf, 0xec, 0x04, 0x33, 0x4a, 0x08, 0xcc, 0xbb, - 0x66, 0xc7, 0xe6, 0xd7, 0x68, 0xb0, 0x67, 0xe5, 0x0b, 0x28, 0x4e, 0x4e, 0x43, 0xe8, 0x0f, 0x93, - 0xdd, 0x55, 0x52, 0xe6, 0xf0, 0xc6, 0x6e, 0xc2, 0xaa, 0x6e, 0x37, 0x8f, 0xf6, 0x2a, 0xb5, 0x9e, - 0xdd, 0x72, 0x1e, 0x05, 0x2d, 0x7c, 0x1b, 0x32, 0xf1, 0x65, 0xc4, 0xd8, 0x80, 0x1b, 0x0d, 0xb6, - 0x5e, 0xef, 0xb2, 0x0d, 0x3c, 0x47, 0xba, 0x11, 0x09, 0x56, 0x74, 0xc8, 0xe1, 0x4c, 0xea, 0x03, - 0xdf, 0xf6, 0xee, 0x53, 0x1c, 0x4d, 0x6c, 0xc1, 0x06, 0xdc, 0xc0, 0x19, 0xad, 0x37, 0x46, 0xfb, - 0x4c, 0x23, 0x6d, 0xa4, 0xcd, 0x48, 0x8e, 0xf2, 0x0e, 0xac, 0x89, 0x35, 0x10, 0xe4, 0x55, 0x58, - 0x09, 0x44, 0x3c, 0xb6, 0x83, 0x24, 0x81, 0x34, 0x0f, 0x57, 0xee, 0x86, 0x28, 0x7c, 0xe1, 0x3e, - 0x65, 0x72, 0x01, 0x4a, 0x42, 0x95, 0x3b, 0x21, 0xcc, 0x05, 0x95, 0x71, 0x57, 0x66, 0x9f, 0xe8, - 0x10, 0xf2, 0xd1, 0xb7, 0x30, 0x3c, 0xdd, 0xc1, 0xdd, 0xf1, 0x6c, 0xcc, 0x39, 0x16, 0xcb, 0xbd, - 0xa6, 0xcf, 0x65, 0x25, 0x63, 0xce, 0xb1, 0xc8, 0x3a, 0x00, 0x5e, 0x55, 0xdd, 0xb1, 0xd8, 0x97, - 0x65, 0xde, 0xb8, 0x8e, 0x2b, 0x07, 0x96, 0x62, 0xe1, 0xc4, 0x89, 0x44, 0x11, 0x6e, 0x1f, 0x5e, - 0x0c, 0x14, 0x92, 0x7e, 0x43, 0x56, 0xcc, 0x98, 0x9c, 0x72, 0x0f, 0x5e, 0x8a, 0x56, 0x39, 0x70, - 0x5b, 0xf4, 0x7f, 0x7c, 0x99, 0x94, 0x1a, 0x64, 0x2f, 0xcb, 0x21, 0x6d, 0x15, 0xe6, 0x1d, 0xb7, - 0x45, 0x71, 0xc8, 0x8b, 0xc2, 0x4f, 0x82, 0x6e, 0x7a, 0xc1, 0x24, 0x1b, 0x2c, 0xba, 0xf2, 0x4f, - 0x1a, 0x5e, 0x60, 0x92, 0xe4, 0x6b, 0x09, 0x96, 0x82, 0x37, 0x9e, 0x6c, 0x0b, 0xd3, 0x45, 0xbe, - 0x23, 0xef, 0x24, 0x09, 0xe5, 0x8c, 0xca, 0xce, 0xc9, 0x5f, 0x4f, 0x76, 0xa4, 0x2f, 0x7f, 0xfd, - 0xf3, 0xdb, 0xb9, 0x02, 0x59, 0xd7, 0x84, 0x0e, 0x19, 0x20, 0x7c, 0x27, 0xc1, 0x22, 0x0a, 0x90, - 0xd2, 0xcc, 0x1a, 0x01, 0xcd, 0x76, 0x82, 0x48, 0x84, 0xa9, 0x8e, 0x61, 0xb6, 0xc9, 0xd6, 0x54, - 0x18, 0xed, 0x18, 0x6f, 0x60, 0x48, 0x7e, 0x92, 0x80, 0x5c, 0x9e, 0x19, 0xb2, 0x37, 0xb3, 0xee, - 0xe5, 0xb1, 0x95, 0xab, 0x57, 0x4b, 0xba, 0x02, 0x77, 0xf8, 0x4e, 0xd5, 0x1d, 0x4b, 0x3b, 0x76, - 0xac, 0x21, 0xf9, 0x4a, 0x82, 0x05, 0xee, 0x08, 0x64, 0x6b, 0x72, 0xd9, 0x98, 0xfd, 0xc8, 0xa5, - 0xd9, 0x81, 0xc8, 0x54, 0x1a, 0x33, 0xad, 0x93, 0x9c, 0x90, 0x89, 0x1b, 0x10, 0xf9, 0x41, 0x82, - 0x95, 0xb8, 0xbd, 0x10, 0x6d, 0x72, 0x19, 0xa1, 0x4d, 0xc9, 0xaf, 0x27, 0x4f, 0x40, 0xbe, 0xdd, - 0x31, 0xdf, 0x26, 0x79, 0x45, 0xc8, 0xd7, 0x61, 0x99, 0xf5, 0x70, 0xfe, 0x7e, 0x96, 0x60, 0x55, - 0xe0, 0x2b, 0xa4, 0x9a, 0xb0, 0x78, 0xcc, 0xbd, 0xe4, 0xdb, 0x57, 0xcc, 0x42, 0xee, 0x37, 0xc6, - 0xdc, 0x65, 0xf2, 0x5a, 0x12, 0x6e, 0xed, 0x78, 0xe4, 0x8c, 0x43, 0x72, 0x22, 0x41, 0x3a, 0x6a, - 0x44, 0x13, 0xde, 0x21, 0x81, 0x85, 0x4d, 0x78, 0x87, 0x44, 0xae, 0xa6, 0x6c, 0x4c, 0xbd, 0x72, - 0xee, 0x6d, 0xe4, 0x89, 0x04, 0x19, 0x91, 0x25, 0x11, 0xf1, 0x3d, 0x4e, 0x71, 0x40, 0x79, 0xf7, - 0x0a, 0x19, 0x88, 0xb8, 0x37, 0xb5, 0x7b, 0x1c, 0x31, 0x7c, 0xbf, 0xb9, 0x0b, 0x0d, 0xc9, 0x8f, - 0x63, 0xe4, 0x98, 0x71, 0x4d, 0x47, 0x16, 0x39, 0xe5, 0x74, 0x64, 0xa1, 0x2b, 0x2a, 0x55, 0x86, - 0xac, 0x92, 0x5b, 0x89, 0x90, 0xb9, 0xff, 0x0e, 0xc9, 0xf7, 0x12, 0x2c, 0x47, 0x8c, 0x81, 0xdc, - 0x9a, 0xf9, 0x75, 0x89, 0xd8, 0x91, 0x5c, 0x4e, 0x18, 0x9d, 0x7c, 0x30, 0x43, 0xf7, 0x75, 0x5b, - 0x74, 0xfc, 0x01, 0xd5, 0xef, 0x3c, 0x3d, 0xcb, 0x4b, 0xcf, 0xcf, 0xf2, 0xd2, 0x1f, 0x67, 0x79, - 0xe9, 0x9b, 0xf3, 0x7c, 0xea, 0xf9, 0x79, 0x3e, 0xf5, 0xdb, 0x79, 0x3e, 0xf5, 0xf1, 0x76, 0xdb, - 0xf1, 0x8f, 0xfa, 0x0d, 0xb5, 0x49, 0x3b, 0x81, 0x20, 0xff, 0x53, 0xf6, 0xac, 0x4f, 0xb5, 0x47, - 0x5c, 0xdd, 0x1f, 0x74, 0x6d, 0xaf, 0xb1, 0xc0, 0xfe, 0x77, 0xdb, 0xfb, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x1f, 0xa2, 0x5f, 0xef, 0x16, 0x0e, 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 { - // Accounts returns all the existing accounts. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.43 - Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) - // Account returns account details based on address. - Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // AccountAddressByID returns account address based on account number. - // - // Since: cosmos-sdk 0.46.2 - AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) - // Params queries all parameters. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // ModuleAccounts returns all the existing module accounts. - // - // Since: cosmos-sdk 0.46 - ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) - // ModuleAccountByName returns the module account info by module name - ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) - // Bech32Prefix queries bech32Prefix - // - // Since: cosmos-sdk 0.46 - Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) - // AddressBytesToString converts Account Address bytes to string - // - // Since: cosmos-sdk 0.46 - AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) - // AddressStringToBytes converts Address string to bytes - // - // Since: cosmos-sdk 0.46 - AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) - // AccountInfo queries account info which is common to all account types. - // - // Since: cosmos-sdk 0.47 - AccountInfo(ctx context.Context, in *QueryAccountInfoRequest, opts ...grpc.CallOption) (*QueryAccountInfoResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) { - out := new(QueryAccountsResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Accounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) { - out := new(QueryAccountResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Account", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AccountAddressByID(ctx context.Context, in *QueryAccountAddressByIDRequest, opts ...grpc.CallOption) (*QueryAccountAddressByIDResponse, error) { - out := new(QueryAccountAddressByIDResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountAddressByID", 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, "/cosmos.auth.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ModuleAccounts(ctx context.Context, in *QueryModuleAccountsRequest, opts ...grpc.CallOption) (*QueryModuleAccountsResponse, error) { - out := new(QueryModuleAccountsResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/ModuleAccounts", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) { - out := new(QueryModuleAccountByNameResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/ModuleAccountByName", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Bech32Prefix(ctx context.Context, in *Bech32PrefixRequest, opts ...grpc.CallOption) (*Bech32PrefixResponse, error) { - out := new(Bech32PrefixResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/Bech32Prefix", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AddressBytesToString(ctx context.Context, in *AddressBytesToStringRequest, opts ...grpc.CallOption) (*AddressBytesToStringResponse, error) { - out := new(AddressBytesToStringResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AddressBytesToString", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AddressStringToBytes(ctx context.Context, in *AddressStringToBytesRequest, opts ...grpc.CallOption) (*AddressStringToBytesResponse, error) { - out := new(AddressStringToBytesResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AddressStringToBytes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AccountInfo(ctx context.Context, in *QueryAccountInfoRequest, opts ...grpc.CallOption) (*QueryAccountInfoResponse, error) { - out := new(QueryAccountInfoResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/AccountInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Accounts returns all the existing accounts. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.43 - Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) - // Account returns account details based on address. - Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // AccountAddressByID returns account address based on account number. - // - // Since: cosmos-sdk 0.46.2 - AccountAddressByID(context.Context, *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) - // Params queries all parameters. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // ModuleAccounts returns all the existing module accounts. - // - // Since: cosmos-sdk 0.46 - ModuleAccounts(context.Context, *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) - // ModuleAccountByName returns the module account info by module name - ModuleAccountByName(context.Context, *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error) - // Bech32Prefix queries bech32Prefix - // - // Since: cosmos-sdk 0.46 - Bech32Prefix(context.Context, *Bech32PrefixRequest) (*Bech32PrefixResponse, error) - // AddressBytesToString converts Account Address bytes to string - // - // Since: cosmos-sdk 0.46 - AddressBytesToString(context.Context, *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) - // AddressStringToBytes converts Address string to bytes - // - // Since: cosmos-sdk 0.46 - AddressStringToBytes(context.Context, *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) - // AccountInfo queries account info which is common to all account types. - // - // Since: cosmos-sdk 0.47 - AccountInfo(context.Context, *QueryAccountInfoRequest) (*QueryAccountInfoResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Accounts(ctx context.Context, req *QueryAccountsRequest) (*QueryAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented") -} -func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") -} -func (*UnimplementedQueryServer) AccountAddressByID(ctx context.Context, req *QueryAccountAddressByIDRequest) (*QueryAccountAddressByIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountAddressByID not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) ModuleAccounts(ctx context.Context, req *QueryModuleAccountsRequest) (*QueryModuleAccountsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModuleAccounts not implemented") -} -func (*UnimplementedQueryServer) ModuleAccountByName(ctx context.Context, req *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModuleAccountByName not implemented") -} -func (*UnimplementedQueryServer) Bech32Prefix(ctx context.Context, req *Bech32PrefixRequest) (*Bech32PrefixResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Bech32Prefix not implemented") -} -func (*UnimplementedQueryServer) AddressBytesToString(ctx context.Context, req *AddressBytesToStringRequest) (*AddressBytesToStringResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddressBytesToString not implemented") -} -func (*UnimplementedQueryServer) AddressStringToBytes(ctx context.Context, req *AddressStringToBytesRequest) (*AddressStringToBytesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddressStringToBytes not implemented") -} -func (*UnimplementedQueryServer) AccountInfo(ctx context.Context, req *QueryAccountInfoRequest) (*QueryAccountInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AccountInfo not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Accounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/Accounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Account(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/Account", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Account(ctx, req.(*QueryAccountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AccountAddressByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountAddressByIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AccountAddressByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountAddressByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountAddressByID(ctx, req.(*QueryAccountAddressByIDRequest)) - } - 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: "/cosmos.auth.v1beta1.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_ModuleAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryModuleAccountsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ModuleAccounts(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/ModuleAccounts", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ModuleAccounts(ctx, req.(*QueryModuleAccountsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ModuleAccountByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryModuleAccountByNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ModuleAccountByName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/ModuleAccountByName", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ModuleAccountByName(ctx, req.(*QueryModuleAccountByNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Bech32Prefix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Bech32PrefixRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Bech32Prefix(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/Bech32Prefix", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Bech32Prefix(ctx, req.(*Bech32PrefixRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AddressBytesToString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddressBytesToStringRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AddressBytesToString(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AddressBytesToString", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AddressBytesToString(ctx, req.(*AddressBytesToStringRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AddressStringToBytes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddressStringToBytesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AddressStringToBytes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AddressStringToBytes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AddressStringToBytes(ctx, req.(*AddressStringToBytesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AccountInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAccountInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AccountInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.auth.v1beta1.Query/AccountInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AccountInfo(ctx, req.(*QueryAccountInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.auth.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Accounts", - Handler: _Query_Accounts_Handler, - }, - { - MethodName: "Account", - Handler: _Query_Account_Handler, - }, - { - MethodName: "AccountAddressByID", - Handler: _Query_AccountAddressByID_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "ModuleAccounts", - Handler: _Query_ModuleAccounts_Handler, - }, - { - MethodName: "ModuleAccountByName", - Handler: _Query_ModuleAccountByName_Handler, - }, - { - MethodName: "Bech32Prefix", - Handler: _Query_Bech32Prefix_Handler, - }, - { - MethodName: "AddressBytesToString", - Handler: _Query_AddressBytesToString_Handler, - }, - { - MethodName: "AddressStringToBytes", - Handler: _Query_AddressStringToBytes_Handler, - }, - { - MethodName: "AccountInfo", - Handler: _Query_AccountInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/auth/v1beta1/query.proto", -} - -func (m *QueryAccountsRequest) 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 *QueryAccountsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountsRequest) 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 *QueryAccountsResponse) 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 *QueryAccountsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountsResponse) 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.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[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 *QueryAccountRequest) 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 *QueryAccountRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAccountResponse) 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 *QueryAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Account != nil { - { - size, err := m.Account.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 *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 *QueryModuleAccountsRequest) 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 *QueryModuleAccountsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryModuleAccountsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryModuleAccountsResponse) 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 *QueryModuleAccountsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryModuleAccountsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Accounts) > 0 { - for iNdEx := len(m.Accounts) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Accounts[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 *QueryModuleAccountByNameRequest) 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 *QueryModuleAccountByNameRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryModuleAccountByNameRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryModuleAccountByNameResponse) 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 *QueryModuleAccountByNameResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryModuleAccountByNameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Account != nil { - { - size, err := m.Account.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 *Bech32PrefixRequest) 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 *Bech32PrefixRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Bech32PrefixRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *Bech32PrefixResponse) 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 *Bech32PrefixResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Bech32PrefixResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Bech32Prefix) > 0 { - i -= len(m.Bech32Prefix) - copy(dAtA[i:], m.Bech32Prefix) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Bech32Prefix))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddressBytesToStringRequest) 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 *AddressBytesToStringRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddressBytesToStringRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AddressBytes) > 0 { - i -= len(m.AddressBytes) - copy(dAtA[i:], m.AddressBytes) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressBytes))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddressBytesToStringResponse) 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 *AddressBytesToStringResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddressBytesToStringResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AddressString) > 0 { - i -= len(m.AddressString) - copy(dAtA[i:], m.AddressString) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressString))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddressStringToBytesRequest) 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 *AddressStringToBytesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddressStringToBytesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AddressString) > 0 { - i -= len(m.AddressString) - copy(dAtA[i:], m.AddressString) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressString))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *AddressStringToBytesResponse) 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 *AddressStringToBytesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AddressStringToBytesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AddressBytes) > 0 { - i -= len(m.AddressBytes) - copy(dAtA[i:], m.AddressBytes) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AddressBytes))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAccountAddressByIDRequest) 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 *QueryAccountAddressByIDRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountAddressByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AccountId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.AccountId)) - i-- - dAtA[i] = 0x10 - } - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryAccountAddressByIDResponse) 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 *QueryAccountAddressByIDResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountAddressByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AccountAddress) > 0 { - i -= len(m.AccountAddress) - copy(dAtA[i:], m.AccountAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAccountInfoRequest) 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 *QueryAccountInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAccountInfoResponse) 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 *QueryAccountInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAccountInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Info != nil { - { - size, err := m.Info.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 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 *QueryAccountsRequest) 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 *QueryAccountsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - 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 *QueryAccountRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Account != nil { - l = m.Account.Size() - 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 *QueryModuleAccountsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryModuleAccountsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Accounts) > 0 { - for _, e := range m.Accounts { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryModuleAccountByNameRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryModuleAccountByNameResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Account != nil { - l = m.Account.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *Bech32PrefixRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *Bech32PrefixResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Bech32Prefix) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *AddressBytesToStringRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AddressBytes) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *AddressBytesToStringResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AddressString) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *AddressStringToBytesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AddressString) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *AddressStringToBytesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AddressBytes) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAccountAddressByIDRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - if m.AccountId != 0 { - n += 1 + sovQuery(uint64(m.AccountId)) - } - return n -} - -func (m *QueryAccountAddressByIDResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AccountAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAccountInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAccountInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Info != nil { - l = m.Info.Size() - n += 1 + l + sovQuery(uint64(l)) - } - 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 *QueryAccountsRequest) 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: QueryAccountsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountsRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountsResponse) 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: QueryAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", 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.Accounts = append(m.Accounts, &types.Any{}) - if err := m.Accounts[len(m.Accounts)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountRequest) 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: QueryAccountRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountResponse) 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: QueryAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account == nil { - m.Account = &types.Any{} - } - if err := m.Account.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) || (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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryModuleAccountsRequest) 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: QueryModuleAccountsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryModuleAccountsRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryModuleAccountsResponse) 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: QueryModuleAccountsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryModuleAccountsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accounts", 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.Accounts = append(m.Accounts, &types.Any{}) - if err := m.Accounts[len(m.Accounts)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryModuleAccountByNameRequest) 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: QueryModuleAccountByNameRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryModuleAccountByNameRequest: 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 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.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryModuleAccountByNameResponse) 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: QueryModuleAccountByNameResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryModuleAccountByNameResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Account", 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.Account == nil { - m.Account = &types.Any{} - } - if err := m.Account.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Bech32PrefixRequest) 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: Bech32PrefixRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Bech32PrefixRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Bech32PrefixResponse) 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: Bech32PrefixResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Bech32PrefixResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", 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.Bech32Prefix = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddressBytesToStringRequest) 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: AddressBytesToStringRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddressBytesToStringRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AddressBytes = append(m.AddressBytes[:0], dAtA[iNdEx:postIndex]...) - if m.AddressBytes == nil { - m.AddressBytes = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddressBytesToStringResponse) 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: AddressBytesToStringResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddressBytesToStringResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressString", 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.AddressString = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddressStringToBytesRequest) 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: AddressStringToBytesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddressStringToBytesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressString", 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.AddressString = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AddressStringToBytesResponse) 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: AddressStringToBytesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AddressStringToBytesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AddressBytes = append(m.AddressBytes[:0], dAtA[iNdEx:postIndex]...) - if m.AddressBytes == nil { - m.AddressBytes = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountAddressByIDRequest) 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: QueryAccountAddressByIDRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountAddressByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountId", wireType) - } - m.AccountId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AccountId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountAddressByIDResponse) 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: QueryAccountAddressByIDResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountAddressByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", 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.AccountAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountInfoRequest) 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: QueryAccountInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAccountInfoResponse) 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: QueryAccountInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAccountInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", 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.Info == nil { - m.Info = &BaseAccount{} - } - if err := m.Info.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) || (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/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go deleted file mode 100644 index 36c34cb6602a..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/auth/types/query.pb.gw.go +++ /dev/null @@ -1,990 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/auth/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Accounts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Accounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Accounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Accounts_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Accounts(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Account_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.Account(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Account_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.Account(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AccountAddressByID_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountAddressByIDRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AccountAddressByID_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AccountAddressByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AccountAddressByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountAddressByIDRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AccountAddressByID_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AccountAddressByID(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ModuleAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryModuleAccountsRequest - var metadata runtime.ServerMetadata - - msg, err := client.ModuleAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ModuleAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryModuleAccountsRequest - var metadata runtime.ServerMetadata - - msg, err := server.ModuleAccounts(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryModuleAccountByNameRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - msg, err := client.ModuleAccountByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryModuleAccountByNameRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - msg, err := server.ModuleAccountByName(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Bech32Prefix_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Bech32PrefixRequest - var metadata runtime.ServerMetadata - - msg, err := client.Bech32Prefix(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Bech32Prefix_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Bech32PrefixRequest - var metadata runtime.ServerMetadata - - msg, err := server.Bech32Prefix(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AddressBytesToString_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddressBytesToStringRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address_bytes"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_bytes") - } - - protoReq.AddressBytes, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_bytes", err) - } - - msg, err := client.AddressBytesToString(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AddressBytesToString_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddressBytesToStringRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address_bytes"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_bytes") - } - - protoReq.AddressBytes, err = runtime.Bytes(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_bytes", err) - } - - msg, err := server.AddressBytesToString(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AddressStringToBytes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddressStringToBytesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address_string"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_string") - } - - protoReq.AddressString, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_string", err) - } - - msg, err := client.AddressStringToBytes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AddressStringToBytes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq AddressStringToBytesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address_string"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address_string") - } - - protoReq.AddressString, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address_string", err) - } - - msg, err := server.AddressStringToBytes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := client.AccountInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AccountInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAccountInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - msg, err := server.AccountInfo(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Accounts_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Account_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Account_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AccountAddressByID_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ModuleAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ModuleAccounts_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ModuleAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Bech32Prefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Bech32Prefix_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Bech32Prefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AddressBytesToString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AddressBytesToString_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AddressBytesToString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AddressStringToBytes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AddressStringToBytes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AddressStringToBytes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AccountInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Accounts_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Account_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Account_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Account_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AccountAddressByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AccountAddressByID_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AccountAddressByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ModuleAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ModuleAccounts_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ModuleAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Bech32Prefix_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Bech32Prefix_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Bech32Prefix_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AddressBytesToString_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AddressBytesToString_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AddressBytesToString_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AddressStringToBytes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AddressStringToBytes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AddressStringToBytes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AccountInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AccountInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AccountInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "accounts"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AccountAddressByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "address_by_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ModuleAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "module_accounts"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ModuleAccountByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "module_accounts", "name"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Bech32Prefix_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "bech32"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AddressBytesToString_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "bech32", "address_bytes"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AddressStringToBytes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "bech32", "address_string"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AccountInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "account_info", "address"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Accounts_0 = runtime.ForwardResponseMessage - - forward_Query_Account_0 = runtime.ForwardResponseMessage - - forward_Query_AccountAddressByID_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_ModuleAccounts_0 = runtime.ForwardResponseMessage - - forward_Query_ModuleAccountByName_0 = runtime.ForwardResponseMessage - - forward_Query_Bech32Prefix_0 = runtime.ForwardResponseMessage - - forward_Query_AddressBytesToString_0 = runtime.ForwardResponseMessage - - forward_Query_AddressStringToBytes_0 = runtime.ForwardResponseMessage - - forward_Query_AccountInfo_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go deleted file mode 100644 index 7214842181cc..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/auth/types/tx.pb.go +++ /dev/null @@ -1,606 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/auth/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "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 - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -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 x/auth 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_c2d62bd9c4c212e5, []int{0} -} -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. -// -// Since: cosmos-sdk 0.47 -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_c2d62bd9c4c212e5, []int{1} -} -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((*MsgUpdateParams)(nil), "cosmos.auth.v1beta1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.auth.v1beta1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("cosmos/auth/v1beta1/tx.proto", fileDescriptor_c2d62bd9c4c212e5) } - -var fileDescriptor_c2d62bd9c4c212e5 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xd0, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0x81, 0x64, 0xf5, - 0xa0, 0xb2, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x79, 0x7d, 0x10, 0x0b, 0xa2, 0x54, 0x4a, - 0x12, 0xa2, 0x34, 0x1e, 0x22, 0x01, 0xd5, 0x07, 0x91, 0x12, 0x87, 0xda, 0x91, 0x5b, 0x9c, 0xae, - 0x5f, 0x66, 0x08, 0xa2, 0xa0, 0x12, 0x82, 0x89, 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x2a, - 0x24, 0x87, 0xcd, 0x3d, 0x60, 0xeb, 0xc1, 0xf2, 0x4a, 0xfb, 0x19, 0xb9, 0xf8, 0x7d, 0x8b, 0xd3, - 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x03, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x85, 0xcc, 0xb8, 0x38, - 0x41, 0x2a, 0xf2, 0x8b, 0x32, 0x4b, 0x2a, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x24, 0x2e, - 0x6d, 0xd1, 0x15, 0x81, 0x3a, 0xc2, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, - 0x33, 0x2f, 0x3d, 0x08, 0xa1, 0x54, 0xc8, 0x8e, 0x8b, 0xad, 0x00, 0x6c, 0x82, 0x04, 0x93, 0x02, - 0xa3, 0x06, 0xb7, 0x91, 0xb4, 0x1e, 0x16, 0xef, 0xea, 0x41, 0x2c, 0x71, 0xe2, 0x3c, 0x71, 0x4f, - 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0x5d, 0x56, 0x26, 0x4d, 0xcf, 0x37, 0x68, - 0x21, 0xcc, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x11, 0x62, 0x82, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0xc4, 0x13, 0x68, 0xae, 0x55, 0x92, 0xe4, 0x12, 0x47, 0x13, 0x0a, 0x4a, 0x2d, 0x2e, 0xc8, 0xcf, - 0x2b, 0x4e, 0x35, 0x2a, 0xe0, 0x62, 0xf6, 0x2d, 0x4e, 0x17, 0x4a, 0xe2, 0xe2, 0x41, 0xf1, 0x9f, - 0x0a, 0x56, 0x77, 0xa1, 0x19, 0x22, 0xa5, 0x43, 0x8c, 0x2a, 0x98, 0x55, 0x52, 0xac, 0x0d, 0x20, - 0xaf, 0x38, 0x39, 0x9f, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, - 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x66, 0x7a, - 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0x36, 0xf5, 0x31, 0xfd, 0x56, 0x52, - 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x8e, 0x1a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, - 0x2c, 0xd6, 0xf9, 0x4c, 0x02, 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 { - // UpdateParams defines a (governance) operation for updating the x/auth module - // parameters. The authority defaults to the x/gov module account. - // - // Since: cosmos-sdk 0.47 - 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) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.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 { - // UpdateParams defines a (governance) operation for updating the x/auth module - // parameters. The authority defaults to the x/gov module account. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -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_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: "/cosmos.auth.v1beta1.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: "cosmos.auth.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/auth/v1beta1/tx.proto", -} - -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 *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 *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) || (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) || (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/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go deleted file mode 100644 index 2b5bf359cb9f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/authz.pb.go +++ /dev/null @@ -1,1046 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/authz/v1beta1/authz.proto - -package authz - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "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 - -// GenericAuthorization gives the grantee unrestricted permissions to execute -// the provided method on behalf of the granter's account. -type GenericAuthorization struct { - // Msg, identified by it's type URL, to grant unrestricted permissions to execute - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` -} - -func (m *GenericAuthorization) Reset() { *m = GenericAuthorization{} } -func (m *GenericAuthorization) String() string { return proto.CompactTextString(m) } -func (*GenericAuthorization) ProtoMessage() {} -func (*GenericAuthorization) Descriptor() ([]byte, []int) { - return fileDescriptor_544dc2e84b61c637, []int{0} -} -func (m *GenericAuthorization) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenericAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenericAuthorization.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 *GenericAuthorization) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenericAuthorization.Merge(m, src) -} -func (m *GenericAuthorization) XXX_Size() int { - return m.Size() -} -func (m *GenericAuthorization) XXX_DiscardUnknown() { - xxx_messageInfo_GenericAuthorization.DiscardUnknown(m) -} - -var xxx_messageInfo_GenericAuthorization proto.InternalMessageInfo - -// Grant gives permissions to execute -// the provide method with expiration time. -type Grant struct { - Authorization *types.Any `protobuf:"bytes,1,opt,name=authorization,proto3" json:"authorization,omitempty"` - // time when the grant will expire and will be pruned. If null, then the grant - // doesn't have a time expiration (other conditions in `authorization` - // may apply to invalidate the grant) - Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` -} - -func (m *Grant) Reset() { *m = Grant{} } -func (m *Grant) String() string { return proto.CompactTextString(m) } -func (*Grant) ProtoMessage() {} -func (*Grant) Descriptor() ([]byte, []int) { - return fileDescriptor_544dc2e84b61c637, []int{1} -} -func (m *Grant) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Grant.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 *Grant) XXX_Merge(src proto.Message) { - xxx_messageInfo_Grant.Merge(m, src) -} -func (m *Grant) XXX_Size() int { - return m.Size() -} -func (m *Grant) XXX_DiscardUnknown() { - xxx_messageInfo_Grant.DiscardUnknown(m) -} - -var xxx_messageInfo_Grant proto.InternalMessageInfo - -// GrantAuthorization extends a grant with both the addresses of the grantee and granter. -// It is used in genesis.proto and query.proto -type GrantAuthorization struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - Authorization *types.Any `protobuf:"bytes,3,opt,name=authorization,proto3" json:"authorization,omitempty"` - Expiration *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` -} - -func (m *GrantAuthorization) Reset() { *m = GrantAuthorization{} } -func (m *GrantAuthorization) String() string { return proto.CompactTextString(m) } -func (*GrantAuthorization) ProtoMessage() {} -func (*GrantAuthorization) Descriptor() ([]byte, []int) { - return fileDescriptor_544dc2e84b61c637, []int{2} -} -func (m *GrantAuthorization) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrantAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrantAuthorization.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 *GrantAuthorization) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrantAuthorization.Merge(m, src) -} -func (m *GrantAuthorization) XXX_Size() int { - return m.Size() -} -func (m *GrantAuthorization) XXX_DiscardUnknown() { - xxx_messageInfo_GrantAuthorization.DiscardUnknown(m) -} - -var xxx_messageInfo_GrantAuthorization proto.InternalMessageInfo - -// GrantQueueItem contains the list of TypeURL of a sdk.Msg. -type GrantQueueItem struct { - // msg_type_urls contains the list of TypeURL of a sdk.Msg. - MsgTypeUrls []string `protobuf:"bytes,1,rep,name=msg_type_urls,json=msgTypeUrls,proto3" json:"msg_type_urls,omitempty"` -} - -func (m *GrantQueueItem) Reset() { *m = GrantQueueItem{} } -func (m *GrantQueueItem) String() string { return proto.CompactTextString(m) } -func (*GrantQueueItem) ProtoMessage() {} -func (*GrantQueueItem) Descriptor() ([]byte, []int) { - return fileDescriptor_544dc2e84b61c637, []int{3} -} -func (m *GrantQueueItem) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GrantQueueItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GrantQueueItem.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 *GrantQueueItem) XXX_Merge(src proto.Message) { - xxx_messageInfo_GrantQueueItem.Merge(m, src) -} -func (m *GrantQueueItem) XXX_Size() int { - return m.Size() -} -func (m *GrantQueueItem) XXX_DiscardUnknown() { - xxx_messageInfo_GrantQueueItem.DiscardUnknown(m) -} - -var xxx_messageInfo_GrantQueueItem proto.InternalMessageInfo - -func init() { - proto.RegisterType((*GenericAuthorization)(nil), "cosmos.authz.v1beta1.GenericAuthorization") - proto.RegisterType((*Grant)(nil), "cosmos.authz.v1beta1.Grant") - proto.RegisterType((*GrantAuthorization)(nil), "cosmos.authz.v1beta1.GrantAuthorization") - proto.RegisterType((*GrantQueueItem)(nil), "cosmos.authz.v1beta1.GrantQueueItem") -} - -func init() { proto.RegisterFile("cosmos/authz/v1beta1/authz.proto", fileDescriptor_544dc2e84b61c637) } - -var fileDescriptor_544dc2e84b61c637 = []byte{ - // 446 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0x3f, 0x8f, 0xd3, 0x30, - 0x18, 0xc6, 0xe3, 0xeb, 0xf1, 0xe7, 0x7c, 0x3a, 0x04, 0x51, 0x86, 0xd2, 0x21, 0xa9, 0x22, 0x84, - 0x4e, 0x48, 0x8d, 0x75, 0x07, 0x13, 0x13, 0x8d, 0x90, 0x4e, 0xb0, 0x11, 0x8e, 0x85, 0xa5, 0x72, - 0x5a, 0xe3, 0x5a, 0xd4, 0x71, 0x64, 0x3b, 0xe8, 0x72, 0x1f, 0x81, 0xe9, 0x3e, 0x03, 0x9f, 0x00, - 0xa4, 0x7e, 0x88, 0x8a, 0xa9, 0x62, 0x62, 0xe2, 0x4f, 0x3b, 0xf0, 0x35, 0x50, 0xed, 0x44, 0x34, - 0xb4, 0x12, 0x1d, 0x58, 0x22, 0xdb, 0xef, 0xf3, 0xbc, 0xef, 0x93, 0x5f, 0x62, 0xd8, 0x1d, 0x0a, - 0xc5, 0x85, 0x42, 0xb8, 0xd0, 0xe3, 0x4b, 0xf4, 0xee, 0x24, 0x25, 0x1a, 0x9f, 0xd8, 0x5d, 0x94, - 0x4b, 0xa1, 0x85, 0xeb, 0x59, 0x45, 0x64, 0xcf, 0x2a, 0x45, 0xe7, 0x0e, 0xe6, 0x2c, 0x13, 0xc8, - 0x3c, 0xad, 0xb0, 0x73, 0xd7, 0x0a, 0x07, 0x66, 0x87, 0x2a, 0x97, 0x2d, 0x05, 0x54, 0x08, 0x3a, - 0x21, 0xc8, 0xec, 0xd2, 0xe2, 0x0d, 0xd2, 0x8c, 0x13, 0xa5, 0x31, 0xcf, 0x2b, 0x81, 0x47, 0x05, - 0x15, 0xd6, 0xb8, 0x5a, 0xd5, 0x1d, 0xff, 0xb6, 0xe1, 0xac, 0xb4, 0xa5, 0x50, 0x43, 0xef, 0x8c, - 0x64, 0x44, 0xb2, 0x61, 0xbf, 0xd0, 0x63, 0x21, 0xd9, 0x25, 0xd6, 0x4c, 0x64, 0xee, 0x6d, 0xd8, - 0xe2, 0x8a, 0xb6, 0x41, 0x17, 0x1c, 0x1f, 0x24, 0xab, 0xe5, 0xe3, 0xe7, 0x9f, 0xa7, 0xbd, 0x70, - 0xdb, 0x3b, 0x44, 0x0d, 0xe7, 0xfb, 0x5f, 0x1f, 0x1f, 0x04, 0x56, 0xd6, 0x53, 0xa3, 0xb7, 0x68, - 0x5b, 0xf7, 0xf0, 0x13, 0x80, 0xd7, 0xce, 0x24, 0xce, 0xb4, 0x9b, 0xc2, 0x23, 0xbc, 0x5e, 0x32, - 0x13, 0x0f, 0x4f, 0xbd, 0xc8, 0x46, 0x8e, 0xea, 0xc8, 0x51, 0x3f, 0x2b, 0xe3, 0xfb, 0xbb, 0x45, - 0x48, 0x9a, 0x2d, 0xdd, 0xa7, 0x10, 0x92, 0x8b, 0x9c, 0x49, 0x3b, 0x60, 0xcf, 0x0c, 0xe8, 0x6c, - 0x0c, 0x38, 0xaf, 0x51, 0xc6, 0x37, 0x67, 0xdf, 0x02, 0x70, 0xf5, 0x3d, 0x00, 0xc9, 0x9a, 0x2f, - 0xfc, 0xb0, 0x07, 0x5d, 0x93, 0xb9, 0x09, 0xea, 0x14, 0xde, 0xa0, 0xab, 0x53, 0x22, 0x2d, 0xac, - 0xb8, 0xfd, 0x65, 0xda, 0xab, 0xbf, 0x75, 0x7f, 0x34, 0x92, 0x44, 0xa9, 0x97, 0x5a, 0xb2, 0x8c, - 0x26, 0xb5, 0xf0, 0x8f, 0x87, 0x98, 0x34, 0x3b, 0x78, 0xc8, 0x26, 0xa8, 0xd6, 0xff, 0x07, 0xf5, - 0xa4, 0x01, 0x6a, 0xff, 0x9f, 0xa0, 0xf6, 0x37, 0x20, 0x3d, 0x82, 0xb7, 0x0c, 0xa3, 0x17, 0x05, - 0x29, 0xc8, 0x33, 0x4d, 0xb8, 0x1b, 0xc2, 0x23, 0xae, 0xe8, 0x40, 0x97, 0x39, 0x19, 0x14, 0x72, - 0xa2, 0xda, 0xa0, 0xdb, 0x3a, 0x3e, 0x48, 0x0e, 0xb9, 0xa2, 0xe7, 0x65, 0x4e, 0x5e, 0xc9, 0x89, - 0x8a, 0xe3, 0xd9, 0x4f, 0xdf, 0x99, 0x2d, 0x7c, 0x30, 0x5f, 0xf8, 0xe0, 0xc7, 0xc2, 0x07, 0x57, - 0x4b, 0xdf, 0x99, 0x2f, 0x7d, 0xe7, 0xeb, 0xd2, 0x77, 0x5e, 0xdf, 0xa3, 0x4c, 0x8f, 0x8b, 0x34, - 0x1a, 0x0a, 0x5e, 0xdd, 0x06, 0xb4, 0xf6, 0x7f, 0x5d, 0xd8, 0x4b, 0x96, 0x5e, 0x37, 0xf9, 0x1e, - 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x50, 0x89, 0xaf, 0x02, 0x89, 0x03, 0x00, 0x00, -} - -func (m *GenericAuthorization) 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 *GenericAuthorization) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenericAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msg) > 0 { - i -= len(m.Msg) - copy(dAtA[i:], m.Msg) - i = encodeVarintAuthz(dAtA, i, uint64(len(m.Msg))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Grant) 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 *Grant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expiration != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintAuthz(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - } - if m.Authorization != nil { - { - size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuthz(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GrantAuthorization) 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 *GrantAuthorization) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GrantAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expiration != nil { - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintAuthz(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x22 - } - if m.Authorization != nil { - { - size, err := m.Authorization.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuthz(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintAuthz(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintAuthz(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GrantQueueItem) 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 *GrantQueueItem) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GrantQueueItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MsgTypeUrls) > 0 { - for iNdEx := len(m.MsgTypeUrls) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.MsgTypeUrls[iNdEx]) - copy(dAtA[i:], m.MsgTypeUrls[iNdEx]) - i = encodeVarintAuthz(dAtA, i, uint64(len(m.MsgTypeUrls[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { - offset -= sovAuthz(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenericAuthorization) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Msg) - if l > 0 { - n += 1 + l + sovAuthz(uint64(l)) - } - return n -} - -func (m *Grant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Authorization != nil { - l = m.Authorization.Size() - n += 1 + l + sovAuthz(uint64(l)) - } - if m.Expiration != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) - n += 1 + l + sovAuthz(uint64(l)) - } - return n -} - -func (m *GrantAuthorization) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovAuthz(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovAuthz(uint64(l)) - } - if m.Authorization != nil { - l = m.Authorization.Size() - n += 1 + l + sovAuthz(uint64(l)) - } - if m.Expiration != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) - n += 1 + l + sovAuthz(uint64(l)) - } - return n -} - -func (m *GrantQueueItem) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MsgTypeUrls) > 0 { - for _, s := range m.MsgTypeUrls { - l = len(s) - n += 1 + l + sovAuthz(uint64(l)) - } - } - return n -} - -func sovAuthz(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAuthz(x uint64) (n int) { - return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenericAuthorization) 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 ErrIntOverflowAuthz - } - 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: GenericAuthorization: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenericAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - 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 ErrInvalidLengthAuthz - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Msg = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuthz(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuthz - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Grant) 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 ErrIntOverflowAuthz - } - 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: Grant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthz - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authorization == nil { - m.Authorization = &types.Any{} - } - if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthz - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expiration == nil { - m.Expiration = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuthz(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuthz - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrantAuthorization) 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 ErrIntOverflowAuthz - } - 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: GrantAuthorization: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrantAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - 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 ErrInvalidLengthAuthz - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - 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 ErrInvalidLengthAuthz - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthz - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Authorization == nil { - m.Authorization = &types.Any{} - } - if err := m.Authorization.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthz - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expiration == nil { - m.Expiration = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuthz(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuthz - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GrantQueueItem) 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 ErrIntOverflowAuthz - } - 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: GrantQueueItem: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GrantQueueItem: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrls", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - 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 ErrInvalidLengthAuthz - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgTypeUrls = append(m.MsgTypeUrls, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuthz(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuthz - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuthz(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, ErrIntOverflowAuthz - } - 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, ErrIntOverflowAuthz - } - 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, ErrIntOverflowAuthz - } - 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, ErrInvalidLengthAuthz - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAuthz - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAuthz - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go deleted file mode 100644 index 454bd1611f15..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/event.pb.go +++ /dev/null @@ -1,703 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/authz/v1beta1/event.proto - -package authz - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// EventGrant is emitted on Msg/Grant -type EventGrant struct { - // Msg type URL for which an autorization is granted - MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` - // Granter account address - Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"` - // Grantee account address - Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"` -} - -func (m *EventGrant) Reset() { *m = EventGrant{} } -func (m *EventGrant) String() string { return proto.CompactTextString(m) } -func (*EventGrant) ProtoMessage() {} -func (*EventGrant) Descriptor() ([]byte, []int) { - return fileDescriptor_1f88cbc71a8baf1f, []int{0} -} -func (m *EventGrant) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventGrant.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 *EventGrant) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventGrant.Merge(m, src) -} -func (m *EventGrant) XXX_Size() int { - return m.Size() -} -func (m *EventGrant) XXX_DiscardUnknown() { - xxx_messageInfo_EventGrant.DiscardUnknown(m) -} - -var xxx_messageInfo_EventGrant proto.InternalMessageInfo - -func (m *EventGrant) GetMsgTypeUrl() string { - if m != nil { - return m.MsgTypeUrl - } - return "" -} - -func (m *EventGrant) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *EventGrant) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -// EventRevoke is emitted on Msg/Revoke -type EventRevoke struct { - // Msg type URL for which an autorization is revoked - MsgTypeUrl string `protobuf:"bytes,2,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` - // Granter account address - Granter string `protobuf:"bytes,3,opt,name=granter,proto3" json:"granter,omitempty"` - // Grantee account address - Grantee string `protobuf:"bytes,4,opt,name=grantee,proto3" json:"grantee,omitempty"` -} - -func (m *EventRevoke) Reset() { *m = EventRevoke{} } -func (m *EventRevoke) String() string { return proto.CompactTextString(m) } -func (*EventRevoke) ProtoMessage() {} -func (*EventRevoke) Descriptor() ([]byte, []int) { - return fileDescriptor_1f88cbc71a8baf1f, []int{1} -} -func (m *EventRevoke) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventRevoke.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 *EventRevoke) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventRevoke.Merge(m, src) -} -func (m *EventRevoke) XXX_Size() int { - return m.Size() -} -func (m *EventRevoke) XXX_DiscardUnknown() { - xxx_messageInfo_EventRevoke.DiscardUnknown(m) -} - -var xxx_messageInfo_EventRevoke proto.InternalMessageInfo - -func (m *EventRevoke) GetMsgTypeUrl() string { - if m != nil { - return m.MsgTypeUrl - } - return "" -} - -func (m *EventRevoke) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *EventRevoke) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func init() { - proto.RegisterType((*EventGrant)(nil), "cosmos.authz.v1beta1.EventGrant") - proto.RegisterType((*EventRevoke)(nil), "cosmos.authz.v1beta1.EventRevoke") -} - -func init() { proto.RegisterFile("cosmos/authz/v1beta1/event.proto", fileDescriptor_1f88cbc71a8baf1f) } - -var fileDescriptor_1f88cbc71a8baf1f = []byte{ - // 245 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, - 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x81, 0xa8, - 0xd0, 0x03, 0xab, 0xd0, 0x83, 0xaa, 0x90, 0x92, 0x84, 0x88, 0xc6, 0x83, 0xd5, 0xe8, 0x43, 0x95, - 0x80, 0x39, 0x4a, 0xd3, 0x18, 0xb9, 0xb8, 0x5c, 0x41, 0x06, 0xb8, 0x17, 0x25, 0xe6, 0x95, 0x08, - 0x29, 0x70, 0xf1, 0xe4, 0x16, 0xa7, 0xc7, 0x97, 0x54, 0x16, 0xa4, 0xc6, 0x97, 0x16, 0xe5, 0x48, - 0x30, 0x29, 0x30, 0x6a, 0x70, 0x06, 0x71, 0xe5, 0x16, 0xa7, 0x87, 0x54, 0x16, 0xa4, 0x86, 0x16, - 0xe5, 0x08, 0x19, 0x71, 0xb1, 0xa7, 0x83, 0x94, 0xa6, 0x16, 0x49, 0x30, 0x83, 0x24, 0x9d, 0x24, - 0x2e, 0x6d, 0xd1, 0x85, 0x59, 0xeb, 0x98, 0x92, 0x52, 0x94, 0x5a, 0x5c, 0x1c, 0x5c, 0x52, 0x94, - 0x99, 0x97, 0x1e, 0x04, 0x53, 0x88, 0xd0, 0x93, 0x2a, 0xc1, 0x42, 0x9c, 0x9e, 0x54, 0xa5, 0xe9, - 0x8c, 0x5c, 0xdc, 0x60, 0x87, 0x05, 0xa5, 0x96, 0xe5, 0x67, 0xa7, 0x0e, 0x1e, 0x97, 0x39, 0xd9, - 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, - 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x4a, 0x7a, 0x66, 0x49, 0x46, - 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0x94, 0xa1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0x24, 0xde, 0x92, 0xd8, 0xc0, 0x21, 0x6f, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5b, 0x74, 0xc2, - 0x29, 0xce, 0x01, 0x00, 0x00, -} - -func (m *EventGrant) 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 *EventGrant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x22 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0x1a - } - if len(m.MsgTypeUrl) > 0 { - i -= len(m.MsgTypeUrl) - copy(dAtA[i:], m.MsgTypeUrl) - i = encodeVarintEvent(dAtA, i, uint64(len(m.MsgTypeUrl))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *EventRevoke) 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 *EventRevoke) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x22 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0x1a - } - if len(m.MsgTypeUrl) > 0 { - i -= len(m.MsgTypeUrl) - copy(dAtA[i:], m.MsgTypeUrl) - i = encodeVarintEvent(dAtA, i, uint64(len(m.MsgTypeUrl))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventGrant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MsgTypeUrl) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func (m *EventRevoke) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.MsgTypeUrl) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) - } - return n -} - -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventGrant) 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 ErrIntOverflowEvent - } - 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: EventGrant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventGrant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventRevoke) 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 ErrIntOverflowEvent - } - 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: EventRevoke: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventRevoke: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - 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 ErrInvalidLengthEvent - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvent(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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrIntOverflowEvent - } - 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, ErrInvalidLengthEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go deleted file mode 100644 index caefd1c60be6..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/genesis.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/authz/v1beta1/genesis.proto - -package authz - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the authz module's genesis state. -type GenesisState struct { - Authorization []GrantAuthorization `protobuf:"bytes,1,rep,name=authorization,proto3" json:"authorization"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_4c2fbb971da7c892, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetAuthorization() []GrantAuthorization { - if m != nil { - return m.Authorization - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.authz.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/authz/v1beta1/genesis.proto", fileDescriptor_4c2fbb971da7c892) -} - -var fileDescriptor_4c2fbb971da7c892 = []byte{ - // 222 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, - 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, - 0x81, 0xa8, 0xd1, 0x03, 0xab, 0xd1, 0x83, 0xaa, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, - 0xd0, 0x07, 0xb1, 0x20, 0x6a, 0xa5, 0x14, 0xb0, 0x9a, 0x07, 0xd1, 0x09, 0x51, 0x21, 0x98, 0x98, - 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x99, 0x5c, 0x3c, 0xee, 0x10, 0x1b, 0x83, - 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x22, 0xb9, 0x78, 0x41, 0x3a, 0xf2, 0x8b, 0x32, 0xab, 0x12, 0x4b, - 0x32, 0xf3, 0xf3, 0x24, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0x34, 0xf4, 0xb0, 0x39, 0x44, 0xcf, - 0xbd, 0x28, 0x31, 0xaf, 0xc4, 0x11, 0x59, 0xbd, 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, - 0x6f, 0xd0, 0x62, 0x0c, 0x42, 0x35, 0xc9, 0xc9, 0xee, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0x54, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xa1, - 0x9e, 0x80, 0x50, 0xba, 0xc5, 0x29, 0xd9, 0xfa, 0x15, 0x10, 0x3f, 0x24, 0xb1, 0x81, 0x5d, 0x6c, - 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xc0, 0xfa, 0xde, 0xe7, 0x38, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Authorization) > 0 { - for iNdEx := len(m.Authorization) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Authorization[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Authorization) > 0 { - for _, e := range m.Authorization { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authorization", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Authorization = append(m.Authorization, GrantAuthorization{}) - if err := m.Authorization[len(m.Authorization)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go deleted file mode 100644 index c022c6e1893a..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/query.pb.go +++ /dev/null @@ -1,1873 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/authz/v1beta1/query.proto - -package authz - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryGrantsRequest is the request type for the Query/Grants RPC method. -type QueryGrantsRequest struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - // Optional, msg_type_url, when set, will query only grants matching given msg type. - MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGrantsRequest) Reset() { *m = QueryGrantsRequest{} } -func (m *QueryGrantsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGrantsRequest) ProtoMessage() {} -func (*QueryGrantsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{0} -} -func (m *QueryGrantsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGrantsRequest.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 *QueryGrantsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGrantsRequest.Merge(m, src) -} -func (m *QueryGrantsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGrantsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGrantsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGrantsRequest proto.InternalMessageInfo - -func (m *QueryGrantsRequest) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *QueryGrantsRequest) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func (m *QueryGrantsRequest) GetMsgTypeUrl() string { - if m != nil { - return m.MsgTypeUrl - } - return "" -} - -func (m *QueryGrantsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. -type QueryGrantsResponse struct { - // authorizations is a list of grants granted for grantee by granter. - Grants []*Grant `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGrantsResponse) Reset() { *m = QueryGrantsResponse{} } -func (m *QueryGrantsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGrantsResponse) ProtoMessage() {} -func (*QueryGrantsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{1} -} -func (m *QueryGrantsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGrantsResponse.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 *QueryGrantsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGrantsResponse.Merge(m, src) -} -func (m *QueryGrantsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGrantsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGrantsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGrantsResponse proto.InternalMessageInfo - -func (m *QueryGrantsResponse) GetGrants() []*Grant { - if m != nil { - return m.Grants - } - return nil -} - -func (m *QueryGrantsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. -type QueryGranterGrantsRequest struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGranterGrantsRequest) Reset() { *m = QueryGranterGrantsRequest{} } -func (m *QueryGranterGrantsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGranterGrantsRequest) ProtoMessage() {} -func (*QueryGranterGrantsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{2} -} -func (m *QueryGranterGrantsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGranterGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGranterGrantsRequest.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 *QueryGranterGrantsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGranterGrantsRequest.Merge(m, src) -} -func (m *QueryGranterGrantsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGranterGrantsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGranterGrantsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGranterGrantsRequest proto.InternalMessageInfo - -func (m *QueryGranterGrantsRequest) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *QueryGranterGrantsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. -type QueryGranterGrantsResponse struct { - // grants is a list of grants granted by the granter. - Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGranterGrantsResponse) Reset() { *m = QueryGranterGrantsResponse{} } -func (m *QueryGranterGrantsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGranterGrantsResponse) ProtoMessage() {} -func (*QueryGranterGrantsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{3} -} -func (m *QueryGranterGrantsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGranterGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGranterGrantsResponse.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 *QueryGranterGrantsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGranterGrantsResponse.Merge(m, src) -} -func (m *QueryGranterGrantsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGranterGrantsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGranterGrantsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGranterGrantsResponse proto.InternalMessageInfo - -func (m *QueryGranterGrantsResponse) GetGrants() []*GrantAuthorization { - if m != nil { - return m.Grants - } - return nil -} - -func (m *QueryGranterGrantsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. -type QueryGranteeGrantsRequest struct { - Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGranteeGrantsRequest) Reset() { *m = QueryGranteeGrantsRequest{} } -func (m *QueryGranteeGrantsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryGranteeGrantsRequest) ProtoMessage() {} -func (*QueryGranteeGrantsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{4} -} -func (m *QueryGranteeGrantsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGranteeGrantsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGranteeGrantsRequest.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 *QueryGranteeGrantsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGranteeGrantsRequest.Merge(m, src) -} -func (m *QueryGranteeGrantsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryGranteeGrantsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGranteeGrantsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGranteeGrantsRequest proto.InternalMessageInfo - -func (m *QueryGranteeGrantsRequest) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func (m *QueryGranteeGrantsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. -type QueryGranteeGrantsResponse struct { - // grants is a list of grants granted to the grantee. - Grants []*GrantAuthorization `protobuf:"bytes,1,rep,name=grants,proto3" json:"grants,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryGranteeGrantsResponse) Reset() { *m = QueryGranteeGrantsResponse{} } -func (m *QueryGranteeGrantsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryGranteeGrantsResponse) ProtoMessage() {} -func (*QueryGranteeGrantsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_376d714ffdeb1545, []int{5} -} -func (m *QueryGranteeGrantsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryGranteeGrantsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryGranteeGrantsResponse.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 *QueryGranteeGrantsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryGranteeGrantsResponse.Merge(m, src) -} -func (m *QueryGranteeGrantsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryGranteeGrantsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryGranteeGrantsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryGranteeGrantsResponse proto.InternalMessageInfo - -func (m *QueryGranteeGrantsResponse) GetGrants() []*GrantAuthorization { - if m != nil { - return m.Grants - } - return nil -} - -func (m *QueryGranteeGrantsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGrantsRequest") - proto.RegisterType((*QueryGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGrantsResponse") - proto.RegisterType((*QueryGranterGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGranterGrantsRequest") - proto.RegisterType((*QueryGranterGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGranterGrantsResponse") - proto.RegisterType((*QueryGranteeGrantsRequest)(nil), "cosmos.authz.v1beta1.QueryGranteeGrantsRequest") - proto.RegisterType((*QueryGranteeGrantsResponse)(nil), "cosmos.authz.v1beta1.QueryGranteeGrantsResponse") -} - -func init() { proto.RegisterFile("cosmos/authz/v1beta1/query.proto", fileDescriptor_376d714ffdeb1545) } - -var fileDescriptor_376d714ffdeb1545 = []byte{ - // 529 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x41, 0x6f, 0xd3, 0x3e, - 0x18, 0xc6, 0xeb, 0xf6, 0xff, 0x2f, 0xc2, 0x83, 0x8b, 0xe1, 0x90, 0x85, 0x29, 0x8a, 0xaa, 0x09, - 0x0a, 0xd2, 0xec, 0xad, 0x93, 0x38, 0x22, 0xb6, 0xc3, 0x76, 0x85, 0x00, 0x17, 0x2e, 0x55, 0xba, - 0xbe, 0x72, 0x23, 0xda, 0x38, 0xb3, 0x1d, 0x44, 0x87, 0x76, 0x81, 0x2f, 0x80, 0xb4, 0x03, 0x1f, - 0x01, 0x89, 0x33, 0x1f, 0x82, 0xe3, 0x04, 0x17, 0x8e, 0xa8, 0x45, 0xf0, 0x35, 0x50, 0x6d, 0x97, - 0xae, 0x23, 0xdb, 0x02, 0xd3, 0x24, 0x4e, 0xad, 0xa3, 0xe7, 0x7d, 0xde, 0xdf, 0xfb, 0x38, 0x76, - 0x70, 0xb8, 0x23, 0xd4, 0x40, 0x28, 0x16, 0xe7, 0xba, 0xb7, 0xc7, 0x9e, 0xaf, 0x75, 0x40, 0xc7, - 0x6b, 0x6c, 0x37, 0x07, 0x39, 0xa4, 0x99, 0x14, 0x5a, 0x90, 0xeb, 0x56, 0x41, 0x8d, 0x82, 0x3a, - 0x85, 0xbf, 0xc4, 0x85, 0xe0, 0x7d, 0x60, 0x71, 0x96, 0xb0, 0x38, 0x4d, 0x85, 0x8e, 0x75, 0x22, - 0x52, 0x65, 0x6b, 0xfc, 0x3b, 0xce, 0xb5, 0x13, 0x2b, 0xb0, 0x66, 0xbf, 0xac, 0xb3, 0x98, 0x27, - 0xa9, 0x11, 0x3b, 0x6d, 0x31, 0x81, 0xed, 0x66, 0x15, 0x8b, 0x56, 0xd1, 0x36, 0x2b, 0xe6, 0x70, - 0xcc, 0xa2, 0xf1, 0x1d, 0x61, 0xf2, 0x70, 0xe2, 0xbf, 0x2d, 0xe3, 0x54, 0xab, 0x08, 0x76, 0x73, - 0x50, 0x9a, 0xb4, 0xf0, 0x25, 0x3e, 0x79, 0x00, 0xd2, 0x43, 0x21, 0x6a, 0x5e, 0xde, 0xf4, 0x3e, - 0x7d, 0x58, 0x99, 0x0e, 0xb2, 0xd1, 0xed, 0x4a, 0x50, 0xea, 0x91, 0x96, 0x49, 0xca, 0xa3, 0xa9, - 0x70, 0x56, 0x03, 0x5e, 0xb5, 0x5c, 0x0d, 0x90, 0x10, 0x5f, 0x19, 0x28, 0xde, 0xd6, 0xc3, 0x0c, - 0xda, 0xb9, 0xec, 0x7b, 0xb5, 0x49, 0x61, 0x84, 0x07, 0x8a, 0x3f, 0x1e, 0x66, 0xf0, 0x44, 0xf6, - 0xc9, 0x16, 0xc6, 0xb3, 0x89, 0xbd, 0xff, 0x42, 0xd4, 0x5c, 0x68, 0xdd, 0xa4, 0xce, 0x75, 0x12, - 0x0f, 0xb5, 0x59, 0xbb, 0xb9, 0xe9, 0x83, 0x98, 0x83, 0x9b, 0x22, 0x3a, 0x52, 0xd9, 0x38, 0x40, - 0xf8, 0xda, 0xdc, 0xa0, 0x2a, 0x13, 0xa9, 0x02, 0xb2, 0x8e, 0xeb, 0x06, 0x46, 0x79, 0x28, 0xac, - 0x35, 0x17, 0x5a, 0x37, 0x68, 0xd1, 0x76, 0x51, 0x53, 0x15, 0x39, 0x29, 0xd9, 0x9e, 0x83, 0xaa, - 0x1a, 0xa8, 0x5b, 0x67, 0x42, 0xd9, 0x8e, 0x73, 0x54, 0x6f, 0x11, 0x5e, 0x9c, 0x51, 0x81, 0x3c, - 0xff, 0x2e, 0x6c, 0x15, 0xa0, 0xfd, 0x4d, 0x5e, 0xef, 0x10, 0xf6, 0x8b, 0xc8, 0x5c, 0x6c, 0xf7, - 0x8f, 0xc5, 0xd6, 0x3c, 0x25, 0xb6, 0x8d, 0x5c, 0xf7, 0x84, 0x4c, 0xf6, 0x8c, 0xf1, 0x85, 0x67, - 0x08, 0x27, 0x64, 0x08, 0x65, 0x33, 0x84, 0x8b, 0xca, 0x10, 0xfe, 0xd9, 0x0c, 0x5b, 0x3f, 0x6a, - 0xf8, 0x7f, 0x43, 0x4a, 0x5e, 0x23, 0x5c, 0xb7, 0x9c, 0xe4, 0x04, 0x9e, 0xdf, 0xaf, 0x0b, 0xff, - 0x76, 0x09, 0xa5, 0xed, 0xda, 0x58, 0x7e, 0xf5, 0xf9, 0xdb, 0x41, 0x35, 0x20, 0x4b, 0xac, 0xf0, - 0xda, 0x72, 0x83, 0xbd, 0x47, 0xf8, 0xea, 0xdc, 0x8b, 0x47, 0xd8, 0x59, 0x2d, 0x8e, 0x1d, 0x1e, - 0x7f, 0xb5, 0x7c, 0x81, 0x43, 0xbb, 0x6b, 0xd0, 0x56, 0x09, 0x3d, 0x0d, 0x8d, 0xb9, 0x83, 0xc6, - 0x5e, 0xba, 0x3f, 0xfb, 0x47, 0x60, 0xa1, 0x34, 0x2c, 0xfc, 0x29, 0x2c, 0x9c, 0x03, 0x16, 0xa6, - 0xb0, 0xb0, 0xbf, 0x79, 0xef, 0xe3, 0x28, 0x40, 0x87, 0xa3, 0x00, 0x7d, 0x1d, 0x05, 0xe8, 0xcd, - 0x38, 0xa8, 0x1c, 0x8e, 0x83, 0xca, 0x97, 0x71, 0x50, 0x79, 0xba, 0xcc, 0x13, 0xdd, 0xcb, 0x3b, - 0x74, 0x47, 0x0c, 0xa6, 0x9e, 0xf6, 0x67, 0x45, 0x75, 0x9f, 0xb1, 0x17, 0xb6, 0x41, 0xa7, 0x6e, - 0xbe, 0x1b, 0xeb, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x8b, 0x47, 0x69, 0xf8, 0x06, 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 { - // Returns list of `Authorization`, granted to the grantee by the granter. - Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) - // GranterGrants returns list of `GrantAuthorization`, granted by granter. - // - // Since: cosmos-sdk 0.46 - GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error) - // GranteeGrants returns a list of `GrantAuthorization` by grantee. - // - // Since: cosmos-sdk 0.46 - GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Grants(ctx context.Context, in *QueryGrantsRequest, opts ...grpc.CallOption) (*QueryGrantsResponse, error) { - out := new(QueryGrantsResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/Grants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GranterGrants(ctx context.Context, in *QueryGranterGrantsRequest, opts ...grpc.CallOption) (*QueryGranterGrantsResponse, error) { - out := new(QueryGranterGrantsResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/GranterGrants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) GranteeGrants(ctx context.Context, in *QueryGranteeGrantsRequest, opts ...grpc.CallOption) (*QueryGranteeGrantsResponse, error) { - out := new(QueryGranteeGrantsResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Query/GranteeGrants", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Returns list of `Authorization`, granted to the grantee by the granter. - Grants(context.Context, *QueryGrantsRequest) (*QueryGrantsResponse, error) - // GranterGrants returns list of `GrantAuthorization`, granted by granter. - // - // Since: cosmos-sdk 0.46 - GranterGrants(context.Context, *QueryGranterGrantsRequest) (*QueryGranterGrantsResponse, error) - // GranteeGrants returns a list of `GrantAuthorization` by grantee. - // - // Since: cosmos-sdk 0.46 - GranteeGrants(context.Context, *QueryGranteeGrantsRequest) (*QueryGranteeGrantsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Grants(ctx context.Context, req *QueryGrantsRequest) (*QueryGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Grants not implemented") -} -func (*UnimplementedQueryServer) GranterGrants(ctx context.Context, req *QueryGranterGrantsRequest) (*QueryGranterGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GranterGrants not implemented") -} -func (*UnimplementedQueryServer) GranteeGrants(ctx context.Context, req *QueryGranteeGrantsRequest) (*QueryGranteeGrantsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GranteeGrants not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Grants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Grants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Query/Grants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Grants(ctx, req.(*QueryGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GranterGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGranterGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GranterGrants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Query/GranterGrants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GranterGrants(ctx, req.(*QueryGranterGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_GranteeGrants_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryGranteeGrantsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GranteeGrants(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Query/GranteeGrants", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GranteeGrants(ctx, req.(*QueryGranteeGrantsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.authz.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Grants", - Handler: _Query_Grants_Handler, - }, - { - MethodName: "GranterGrants", - Handler: _Query_GranterGrants_Handler, - }, - { - MethodName: "GranteeGrants", - Handler: _Query_GranteeGrants_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/authz/v1beta1/query.proto", -} - -func (m *QueryGrantsRequest) 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 *QueryGrantsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGrantsRequest) 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] = 0x22 - } - if len(m.MsgTypeUrl) > 0 { - i -= len(m.MsgTypeUrl) - copy(dAtA[i:], m.MsgTypeUrl) - i = encodeVarintQuery(dAtA, i, uint64(len(m.MsgTypeUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGrantsResponse) 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 *QueryGrantsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGrantsResponse) 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.Grants) > 0 { - for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Grants[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 *QueryGranterGrantsRequest) 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 *QueryGranterGrantsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGranterGrantsRequest) 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.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGranterGrantsResponse) 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 *QueryGranterGrantsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGranterGrantsResponse) 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.Grants) > 0 { - for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Grants[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 *QueryGranteeGrantsRequest) 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 *QueryGranteeGrantsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGranteeGrantsRequest) 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.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryGranteeGrantsResponse) 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 *QueryGranteeGrantsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryGranteeGrantsResponse) 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.Grants) > 0 { - for iNdEx := len(m.Grants) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Grants[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 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 *QueryGrantsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.MsgTypeUrl) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGrantsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Grants) > 0 { - for _, e := range m.Grants { - 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 *QueryGranterGrantsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGranterGrantsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Grants) > 0 { - for _, e := range m.Grants { - 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 *QueryGranteeGrantsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryGranteeGrantsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Grants) > 0 { - for _, e := range m.Grants { - 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 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 *QueryGrantsRequest) 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: QueryGrantsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", 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.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGrantsResponse) 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: QueryGrantsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &Grant{}) - if err := m.Grants[len(m.Grants)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGranterGrantsRequest) 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: QueryGranterGrantsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGranterGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGranterGrantsResponse) 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: QueryGranterGrantsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGranterGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &GrantAuthorization{}) - if err := m.Grants[len(m.Grants)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGranteeGrantsRequest) 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: QueryGranteeGrantsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGranteeGrantsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryGranteeGrantsResponse) 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: QueryGranteeGrantsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryGranteeGrantsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grants", 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.Grants = append(m.Grants, &GrantAuthorization{}) - if err := m.Grants[len(m.Grants)-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) || (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/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go deleted file mode 100644 index 7259ffcf2dd7..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/query.pb.gw.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/authz/v1beta1/query.proto - -/* -Package authz is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package authz - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Grants_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Grants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGrantsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Grants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Grants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Grants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGrantsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Grants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Grants(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_GranterGrants_0 = &utilities.DoubleArray{Encoding: map[string]int{"granter": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_GranterGrants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGranterGrantsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranterGrants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GranterGrants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GranterGrants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGranterGrantsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranterGrants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GranterGrants(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_GranteeGrants_0 = &utilities.DoubleArray{Encoding: map[string]int{"grantee": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_GranteeGrants_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGranteeGrantsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranteeGrants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GranteeGrants(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GranteeGrants_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGranteeGrantsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GranteeGrants_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.GranteeGrants(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Grants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Grants_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Grants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GranterGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GranterGrants_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GranterGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GranteeGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GranteeGrants_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GranteeGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Grants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Grants_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Grants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GranterGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GranterGrants_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GranterGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GranteeGrants_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GranteeGrants_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GranteeGrants_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Grants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "authz", "v1beta1", "grants"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GranterGrants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "authz", "v1beta1", "grants", "granter"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GranteeGrants_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "authz", "v1beta1", "grants", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Grants_0 = runtime.ForwardResponseMessage - - forward_Query_GranterGrants_0 = runtime.ForwardResponseMessage - - forward_Query_GranteeGrants_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go deleted file mode 100644 index 369d9283e46c..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/authz/tx.pb.go +++ /dev/null @@ -1,1489 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/authz/v1beta1/tx.proto - -package authz - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// MsgGrant is a request type for Grant method. It declares authorization to the grantee -// on behalf of the granter with the provided expiration time. -type MsgGrant struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - Grant Grant `protobuf:"bytes,3,opt,name=grant,proto3" json:"grant"` -} - -func (m *MsgGrant) Reset() { *m = MsgGrant{} } -func (m *MsgGrant) String() string { return proto.CompactTextString(m) } -func (*MsgGrant) ProtoMessage() {} -func (*MsgGrant) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{0} -} -func (m *MsgGrant) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgGrant.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 *MsgGrant) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGrant.Merge(m, src) -} -func (m *MsgGrant) XXX_Size() int { - return m.Size() -} -func (m *MsgGrant) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGrant.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgGrant proto.InternalMessageInfo - -// MsgExecResponse defines the Msg/MsgExecResponse response type. -type MsgExecResponse struct { - Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` -} - -func (m *MsgExecResponse) Reset() { *m = MsgExecResponse{} } -func (m *MsgExecResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExecResponse) ProtoMessage() {} -func (*MsgExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{1} -} -func (m *MsgExecResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecResponse.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 *MsgExecResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecResponse.Merge(m, src) -} -func (m *MsgExecResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExecResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecResponse proto.InternalMessageInfo - -// MsgExec attempts to execute the provided messages using -// authorizations granted to the grantee. Each message should have only -// one signer corresponding to the granter of the authorization. -type MsgExec struct { - Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` - // Execute Msg. - // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - // triple and validate it. - Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` -} - -func (m *MsgExec) Reset() { *m = MsgExec{} } -func (m *MsgExec) String() string { return proto.CompactTextString(m) } -func (*MsgExec) ProtoMessage() {} -func (*MsgExec) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{2} -} -func (m *MsgExec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExec.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 *MsgExec) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExec.Merge(m, src) -} -func (m *MsgExec) XXX_Size() int { - return m.Size() -} -func (m *MsgExec) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExec.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExec proto.InternalMessageInfo - -// MsgGrantResponse defines the Msg/MsgGrant response type. -type MsgGrantResponse struct { -} - -func (m *MsgGrantResponse) Reset() { *m = MsgGrantResponse{} } -func (m *MsgGrantResponse) String() string { return proto.CompactTextString(m) } -func (*MsgGrantResponse) ProtoMessage() {} -func (*MsgGrantResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{3} -} -func (m *MsgGrantResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgGrantResponse.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 *MsgGrantResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGrantResponse.Merge(m, src) -} -func (m *MsgGrantResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgGrantResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGrantResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgGrantResponse proto.InternalMessageInfo - -// MsgRevoke revokes any authorization with the provided sdk.Msg type on the -// granter's account with that has been granted to the grantee. -type MsgRevoke struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - MsgTypeUrl string `protobuf:"bytes,3,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` -} - -func (m *MsgRevoke) Reset() { *m = MsgRevoke{} } -func (m *MsgRevoke) String() string { return proto.CompactTextString(m) } -func (*MsgRevoke) ProtoMessage() {} -func (*MsgRevoke) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{4} -} -func (m *MsgRevoke) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRevoke) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRevoke.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 *MsgRevoke) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRevoke.Merge(m, src) -} -func (m *MsgRevoke) XXX_Size() int { - return m.Size() -} -func (m *MsgRevoke) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRevoke.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRevoke proto.InternalMessageInfo - -// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. -type MsgRevokeResponse struct { -} - -func (m *MsgRevokeResponse) Reset() { *m = MsgRevokeResponse{} } -func (m *MsgRevokeResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRevokeResponse) ProtoMessage() {} -func (*MsgRevokeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ceddab7d8589ad1, []int{5} -} -func (m *MsgRevokeResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRevokeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRevokeResponse.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 *MsgRevokeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRevokeResponse.Merge(m, src) -} -func (m *MsgRevokeResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRevokeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRevokeResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRevokeResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgGrant)(nil), "cosmos.authz.v1beta1.MsgGrant") - proto.RegisterType((*MsgExecResponse)(nil), "cosmos.authz.v1beta1.MsgExecResponse") - proto.RegisterType((*MsgExec)(nil), "cosmos.authz.v1beta1.MsgExec") - proto.RegisterType((*MsgGrantResponse)(nil), "cosmos.authz.v1beta1.MsgGrantResponse") - proto.RegisterType((*MsgRevoke)(nil), "cosmos.authz.v1beta1.MsgRevoke") - proto.RegisterType((*MsgRevokeResponse)(nil), "cosmos.authz.v1beta1.MsgRevokeResponse") -} - -func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } - -var fileDescriptor_3ceddab7d8589ad1 = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x4f, 0x6f, 0x12, 0x4f, - 0x18, 0x66, 0x4a, 0x29, 0x3f, 0xa6, 0x4d, 0x7e, 0x76, 0x4b, 0xe2, 0x76, 0x9b, 0x6e, 0x37, 0x6b, - 0xab, 0x04, 0xc3, 0x4c, 0xc0, 0x1b, 0xf1, 0x52, 0x92, 0xc6, 0x8b, 0xc4, 0x64, 0xd5, 0x8b, 0x17, - 0xb2, 0xc0, 0x38, 0x25, 0x65, 0x77, 0xc8, 0xce, 0x42, 0xc0, 0x93, 0xf1, 0xe8, 0xc9, 0x8f, 0xa1, - 0x37, 0x0e, 0x3d, 0xfa, 0x01, 0x88, 0xa7, 0xc6, 0x83, 0xf1, 0x64, 0x14, 0x0e, 0x7c, 0x0c, 0xcd, - 0xce, 0x1f, 0xa4, 0x86, 0xd6, 0x9e, 0xbc, 0xc0, 0xbc, 0xef, 0xf3, 0xbc, 0xb3, 0xef, 0xf3, 0x3e, - 0x6f, 0x06, 0xee, 0xb7, 0x18, 0x0f, 0x18, 0xc7, 0x7e, 0x3f, 0x3e, 0x7d, 0x85, 0x07, 0xe5, 0x26, - 0x89, 0xfd, 0x32, 0x8e, 0x87, 0xa8, 0x17, 0xb1, 0x98, 0x19, 0x79, 0x09, 0x23, 0x01, 0x23, 0x05, - 0x5b, 0xbb, 0x32, 0xdb, 0x10, 0x1c, 0xac, 0x28, 0x22, 0xb0, 0xf2, 0x94, 0x51, 0x26, 0xf3, 0xc9, - 0x49, 0x65, 0x77, 0x29, 0x63, 0xb4, 0x4b, 0xb0, 0x88, 0x9a, 0xfd, 0x97, 0xd8, 0x0f, 0x47, 0x0a, - 0x72, 0x56, 0x36, 0x20, 0xbf, 0x27, 0x19, 0xb7, 0x15, 0x23, 0xe0, 0x14, 0x0f, 0xca, 0xc9, 0x9f, - 0x02, 0xb6, 0xfd, 0xa0, 0x13, 0x32, 0x2c, 0x7e, 0x65, 0xca, 0xfd, 0x02, 0xe0, 0x7f, 0x75, 0x4e, - 0x1f, 0x45, 0x7e, 0x18, 0x1b, 0x15, 0x98, 0xa5, 0xc9, 0x81, 0x44, 0x26, 0x70, 0x40, 0x21, 0x57, - 0x33, 0x3f, 0x9f, 0x97, 0xb4, 0xa2, 0xe3, 0x76, 0x3b, 0x22, 0x9c, 0x3f, 0x8d, 0xa3, 0x4e, 0x48, - 0x3d, 0x4d, 0xfc, 0x5d, 0x43, 0xcc, 0xb5, 0x9b, 0xd5, 0x10, 0xe3, 0x21, 0xcc, 0x88, 0xa3, 0x99, - 0x76, 0x40, 0x61, 0xb3, 0xb2, 0x87, 0x56, 0x0d, 0x0d, 0x89, 0x9e, 0x6a, 0xb9, 0xc9, 0xb7, 0x83, - 0xd4, 0xfb, 0xf9, 0xb8, 0x08, 0x3c, 0x59, 0x54, 0x3d, 0x7c, 0x33, 0x1f, 0x17, 0xf5, 0xf7, 0xdf, - 0xce, 0xc7, 0xc5, 0x1d, 0x59, 0x5e, 0xe2, 0xed, 0x33, 0xac, 0xb5, 0xb8, 0xf7, 0xe1, 0xff, 0x75, - 0x4e, 0x4f, 0x86, 0xa4, 0xe5, 0x11, 0xde, 0x63, 0x21, 0x27, 0x86, 0x09, 0xb3, 0x11, 0xe1, 0xfd, - 0x6e, 0xcc, 0x4d, 0xe0, 0xa4, 0x0b, 0x5b, 0x9e, 0x0e, 0xdd, 0x0f, 0x00, 0x66, 0x15, 0x7b, 0x59, - 0x10, 0xb8, 0xa9, 0xa0, 0x13, 0xb8, 0x1e, 0x70, 0xca, 0xcd, 0x35, 0x27, 0x5d, 0xd8, 0xac, 0xe4, - 0x91, 0x74, 0x0f, 0x69, 0xf7, 0xd0, 0x71, 0x38, 0xaa, 0xed, 0x7d, 0x3a, 0x2f, 0x29, 0x67, 0x50, - 0xd3, 0xe7, 0x64, 0xa1, 0xb3, 0xce, 0xa9, 0x27, 0xca, 0xab, 0x77, 0x96, 0x94, 0x91, 0x44, 0x99, - 0x71, 0x59, 0x59, 0xd2, 0x9f, 0x6b, 0xc0, 0x5b, 0x5a, 0xa4, 0x56, 0xe6, 0x7e, 0x04, 0x30, 0x97, - 0x5c, 0x43, 0x06, 0xec, 0x8c, 0xfc, 0x33, 0x1b, 0x1d, 0xb8, 0x15, 0x70, 0xda, 0x88, 0x47, 0x3d, - 0xd2, 0xe8, 0x47, 0x5d, 0xe1, 0x66, 0xce, 0x83, 0x01, 0xa7, 0xcf, 0x46, 0x3d, 0xf2, 0x3c, 0xea, - 0x56, 0x8f, 0xfe, 0xb4, 0x2a, 0x7f, 0x59, 0x90, 0x6c, 0xd8, 0xdd, 0x81, 0xdb, 0x8b, 0x40, 0x6b, - 0xaa, 0xfc, 0x04, 0x30, 0x5d, 0xe7, 0xd4, 0x78, 0x02, 0x33, 0x72, 0x3b, 0xed, 0xd5, 0x6b, 0xa2, - 0x87, 0x61, 0xdd, 0xbd, 0x1e, 0x5f, 0xac, 0xc1, 0x63, 0xb8, 0x2e, 0x8c, 0xde, 0xbf, 0x92, 0x9f, - 0xc0, 0xd6, 0xd1, 0xb5, 0xf0, 0xe2, 0x36, 0x0f, 0x6e, 0xa8, 0xb1, 0x1f, 0x5c, 0x59, 0x20, 0x09, - 0xd6, 0xbd, 0xbf, 0x10, 0xf4, 0x9d, 0x56, 0xe6, 0x75, 0xb2, 0xef, 0xb5, 0xda, 0xe4, 0x87, 0x9d, - 0x9a, 0x4c, 0x6d, 0x70, 0x31, 0xb5, 0xc1, 0xf7, 0xa9, 0x0d, 0xde, 0xcd, 0xec, 0xd4, 0xc5, 0xcc, - 0x4e, 0x7d, 0x9d, 0xd9, 0xa9, 0x17, 0x87, 0xb4, 0x13, 0x9f, 0xf6, 0x9b, 0xa8, 0xc5, 0x02, 0xf5, - 0xa2, 0xe0, 0xa5, 0xe1, 0x0e, 0xe5, 0x8b, 0xd0, 0xdc, 0x10, 0x3b, 0xf8, 0xe0, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xbb, 0x9d, 0x9d, 0x9e, 0xb7, 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 { - // Grant grants the provided authorization to the grantee on the granter's - // account with the provided expiration time. If there is already a grant - // for the given (granter, grantee, Authorization) triple, then the grant - // will be overwritten. - Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error) - // Exec attempts to execute the provided messages using - // authorizations granted to the grantee. Each message should have only - // one signer corresponding to the granter of the authorization. - Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) - // Revoke revokes any authorization corresponding to the provided method name on the - // granter's account that has been granted to the grantee. - Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) Grant(ctx context.Context, in *MsgGrant, opts ...grpc.CallOption) (*MsgGrantResponse, error) { - out := new(MsgGrantResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Grant", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Exec(ctx context.Context, in *MsgExec, opts ...grpc.CallOption) (*MsgExecResponse, error) { - out := new(MsgExecResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Exec", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Revoke(ctx context.Context, in *MsgRevoke, opts ...grpc.CallOption) (*MsgRevokeResponse, error) { - out := new(MsgRevokeResponse) - err := c.cc.Invoke(ctx, "/cosmos.authz.v1beta1.Msg/Revoke", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // Grant grants the provided authorization to the grantee on the granter's - // account with the provided expiration time. If there is already a grant - // for the given (granter, grantee, Authorization) triple, then the grant - // will be overwritten. - Grant(context.Context, *MsgGrant) (*MsgGrantResponse, error) - // Exec attempts to execute the provided messages using - // authorizations granted to the grantee. Each message should have only - // one signer corresponding to the granter of the authorization. - Exec(context.Context, *MsgExec) (*MsgExecResponse, error) - // Revoke revokes any authorization corresponding to the provided method name on the - // granter's account that has been granted to the grantee. - Revoke(context.Context, *MsgRevoke) (*MsgRevokeResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) Grant(ctx context.Context, req *MsgGrant) (*MsgGrantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Grant not implemented") -} -func (*UnimplementedMsgServer) Exec(ctx context.Context, req *MsgExec) (*MsgExecResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") -} -func (*UnimplementedMsgServer) Revoke(ctx context.Context, req *MsgRevoke) (*MsgRevokeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_Grant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgGrant) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Grant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Msg/Grant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Grant(ctx, req.(*MsgGrant)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExec) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Exec(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Msg/Exec", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Exec(ctx, req.(*MsgExec)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRevoke) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Revoke(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.authz.v1beta1.Msg/Revoke", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Revoke(ctx, req.(*MsgRevoke)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.authz.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Grant", - Handler: _Msg_Grant_Handler, - }, - { - MethodName: "Exec", - Handler: _Msg_Exec_Handler, - }, - { - MethodName: "Revoke", - Handler: _Msg_Revoke_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/authz/v1beta1/tx.proto", -} - -func (m *MsgGrant) 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 *MsgGrant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Grant.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExecResponse) 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 *MsgExecResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Results[iNdEx]) - copy(dAtA[i:], m.Results[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgExec) 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 *MsgExec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgGrantResponse) 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 *MsgGrantResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgGrantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRevoke) 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 *MsgRevoke) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRevoke) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MsgTypeUrl) > 0 { - i -= len(m.MsgTypeUrl) - copy(dAtA[i:], m.MsgTypeUrl) - i = encodeVarintTx(dAtA, i, uint64(len(m.MsgTypeUrl))) - i-- - dAtA[i] = 0x1a - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRevokeResponse) 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 *MsgRevokeResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRevokeResponse) 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 *MsgGrant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.Grant.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgExecResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Results) > 0 { - for _, b := range m.Results { - l = len(b) - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgExec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgGrantResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRevoke) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.MsgTypeUrl) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRevokeResponse) 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 *MsgGrant) 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: MsgGrant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGrant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grant", 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.Grant.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 *MsgExecResponse) 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: MsgExecResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Results = append(m.Results, make([]byte, postIndex-iNdEx)) - copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) - 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 *MsgExec) 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: MsgExec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", 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.Msgs = append(m.Msgs, &types.Any{}) - if err := m.Msgs[len(m.Msgs)-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 *MsgGrantResponse) 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: MsgGrantResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGrantResponse: 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 *MsgRevoke) 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: MsgRevoke: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRevoke: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgTypeUrl", 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.MsgTypeUrl = string(dAtA[iNdEx:postIndex]) - 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 *MsgRevokeResponse) 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: MsgRevokeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRevokeResponse: 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") -) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go deleted file mode 100644 index 17131972c91b..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/authz.pb.go +++ /dev/null @@ -1,405 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/bank/v1beta1/authz.proto - -package types - -import ( - 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/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// SendAuthorization allows the grantee to spend up to spend_limit coins from -// the granter's account. -// -// Since: cosmos-sdk 0.43 -type SendAuthorization struct { - SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` - // allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the - // granter. If omitted, any recipient is allowed. - // - // Since: cosmos-sdk 0.47 - AllowList []string `protobuf:"bytes,2,rep,name=allow_list,json=allowList,proto3" json:"allow_list,omitempty"` -} - -func (m *SendAuthorization) Reset() { *m = SendAuthorization{} } -func (m *SendAuthorization) String() string { return proto.CompactTextString(m) } -func (*SendAuthorization) ProtoMessage() {} -func (*SendAuthorization) Descriptor() ([]byte, []int) { - return fileDescriptor_a4d2a37888ea779f, []int{0} -} -func (m *SendAuthorization) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SendAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SendAuthorization.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 *SendAuthorization) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendAuthorization.Merge(m, src) -} -func (m *SendAuthorization) XXX_Size() int { - return m.Size() -} -func (m *SendAuthorization) XXX_DiscardUnknown() { - xxx_messageInfo_SendAuthorization.DiscardUnknown(m) -} - -var xxx_messageInfo_SendAuthorization proto.InternalMessageInfo - -func (m *SendAuthorization) GetSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.SpendLimit - } - return nil -} - -func (m *SendAuthorization) GetAllowList() []string { - if m != nil { - return m.AllowList - } - return nil -} - -func init() { - proto.RegisterType((*SendAuthorization)(nil), "cosmos.bank.v1beta1.SendAuthorization") -} - -func init() { proto.RegisterFile("cosmos/bank/v1beta1/authz.proto", fileDescriptor_a4d2a37888ea779f) } - -var fileDescriptor_a4d2a37888ea779f = []byte{ - // 339 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4a, 0xcc, 0xcb, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, - 0x4f, 0x2c, 0x2d, 0xc9, 0xa8, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, - 0x03, 0x29, 0xd0, 0x83, 0x2a, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, - 0x75, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x15, 0x95, 0x84, 0xe8, - 0x8e, 0x87, 0x48, 0x40, 0x8d, 0x82, 0x48, 0xc9, 0xc1, 0x6d, 0x2e, 0x4e, 0x85, 0xdb, 0x9c, 0x9c, - 0x9f, 0x99, 0x07, 0x91, 0x57, 0xea, 0x60, 0xe2, 0x12, 0x0c, 0x4e, 0xcd, 0x4b, 0x71, 0x2c, 0x2d, - 0xc9, 0xc8, 0x2f, 0xca, 0xac, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0x13, 0x2a, 0xe4, 0xe2, 0x2e, 0x2e, - 0x48, 0xcd, 0x4b, 0x89, 0xcf, 0xc9, 0xcc, 0xcd, 0x2c, 0x91, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, - 0x92, 0xd4, 0x83, 0x3b, 0xb2, 0x38, 0x15, 0xe6, 0x48, 0x3d, 0xe7, 0xfc, 0xcc, 0x3c, 0x27, 0xd3, - 0x13, 0xf7, 0xe4, 0x19, 0x56, 0xdd, 0x97, 0xd7, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, - 0xce, 0xcf, 0x85, 0x3a, 0x03, 0x4a, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x16, - 0x83, 0x35, 0x14, 0xaf, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x88, 0x0b, 0x6c, 0x89, 0x0f, 0xc8, 0x0e, - 0x21, 0x73, 0x2e, 0xae, 0xc4, 0x9c, 0x9c, 0xfc, 0xf2, 0xf8, 0x9c, 0xcc, 0xe2, 0x12, 0x09, 0x26, - 0x05, 0x66, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x96, 0x3a, 0xa6, 0xa4, 0x14, - 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, 0x07, 0x71, 0x82, 0xd5, 0xfa, 0x64, 0x16, - 0x97, 0x58, 0xb9, 0x9f, 0xda, 0xa2, 0xab, 0x04, 0x55, 0x04, 0x09, 0x52, 0x98, 0xd3, 0x50, 0xfc, - 0xd4, 0xf5, 0x7c, 0x83, 0x96, 0x0c, 0x92, 0x63, 0x30, 0x3c, 0xed, 0xe4, 0x7c, 0xe2, 0x91, 0x1c, - 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, - 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x9a, 0x78, 0xbd, 0x55, 0x01, 0x89, 0x56, 0xb0, 0xef, - 0x92, 0xd8, 0xc0, 0xc1, 0x6a, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x78, 0xc2, 0x7d, 0xd9, 0xf2, - 0x01, 0x00, 0x00, -} - -func (m *SendAuthorization) 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 *SendAuthorization) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SendAuthorization) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AllowList) > 0 { - for iNdEx := len(m.AllowList) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AllowList[iNdEx]) - copy(dAtA[i:], m.AllowList[iNdEx]) - i = encodeVarintAuthz(dAtA, i, uint64(len(m.AllowList[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.SpendLimit) > 0 { - for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintAuthz(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int { - offset -= sovAuthz(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SendAuthorization) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SpendLimit) > 0 { - for _, e := range m.SpendLimit { - l = e.Size() - n += 1 + l + sovAuthz(uint64(l)) - } - } - if len(m.AllowList) > 0 { - for _, s := range m.AllowList { - l = len(s) - n += 1 + l + sovAuthz(uint64(l)) - } - } - return n -} - -func sovAuthz(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozAuthz(x uint64) (n int) { - return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SendAuthorization) 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 ErrIntOverflowAuthz - } - 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: SendAuthorization: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SendAuthorization: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthAuthz - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpendLimit = append(m.SpendLimit, types.Coin{}) - if err := m.SpendLimit[len(m.SpendLimit)-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 AllowList", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuthz - } - 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 ErrInvalidLengthAuthz - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAuthz - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AllowList = append(m.AllowList, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAuthz(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAuthz - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipAuthz(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, ErrIntOverflowAuthz - } - 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, ErrIntOverflowAuthz - } - 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, ErrIntOverflowAuthz - } - 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, ErrInvalidLengthAuthz - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupAuthz - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthAuthz - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthAuthz = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowAuthz = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupAuthz = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go deleted file mode 100644 index fe19f342ee5c..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/bank.pb.go +++ /dev/null @@ -1,2122 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/bank/v1beta1/bank.proto - -package types - -import ( - 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" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the bank module. -type Params struct { - // Deprecated: Use of SendEnabled in params is deprecated. - // For genesis, use the newly added send_enabled field in the genesis object. - // Storage, lookup, and manipulation of this information is now in the keeper. - // - // As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. - SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` // Deprecated: Do not use. - DefaultSendEnabled bool `protobuf:"varint,2,opt,name=default_send_enabled,json=defaultSendEnabled,proto3" json:"default_send_enabled,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{0} -} -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 - -// Deprecated: Do not use. -func (m *Params) GetSendEnabled() []*SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - -func (m *Params) GetDefaultSendEnabled() bool { - if m != nil { - return m.DefaultSendEnabled - } - return false -} - -// SendEnabled maps coin denom to a send_enabled status (whether a denom is -// sendable). -type SendEnabled struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"` -} - -func (m *SendEnabled) Reset() { *m = SendEnabled{} } -func (*SendEnabled) ProtoMessage() {} -func (*SendEnabled) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{1} -} -func (m *SendEnabled) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SendEnabled.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 *SendEnabled) XXX_Merge(src proto.Message) { - xxx_messageInfo_SendEnabled.Merge(m, src) -} -func (m *SendEnabled) XXX_Size() int { - return m.Size() -} -func (m *SendEnabled) XXX_DiscardUnknown() { - xxx_messageInfo_SendEnabled.DiscardUnknown(m) -} - -var xxx_messageInfo_SendEnabled proto.InternalMessageInfo - -func (m *SendEnabled) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *SendEnabled) GetEnabled() bool { - if m != nil { - return m.Enabled - } - return false -} - -// Input models transaction input. -type Input struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *Input) Reset() { *m = Input{} } -func (m *Input) String() string { return proto.CompactTextString(m) } -func (*Input) ProtoMessage() {} -func (*Input) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{2} -} -func (m *Input) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Input) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Input.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 *Input) XXX_Merge(src proto.Message) { - xxx_messageInfo_Input.Merge(m, src) -} -func (m *Input) XXX_Size() int { - return m.Size() -} -func (m *Input) XXX_DiscardUnknown() { - xxx_messageInfo_Input.DiscardUnknown(m) -} - -var xxx_messageInfo_Input proto.InternalMessageInfo - -// Output models transaction outputs. -type Output struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *Output) Reset() { *m = Output{} } -func (m *Output) String() string { return proto.CompactTextString(m) } -func (*Output) ProtoMessage() {} -func (*Output) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{3} -} -func (m *Output) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Output) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Output.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 *Output) XXX_Merge(src proto.Message) { - xxx_messageInfo_Output.Merge(m, src) -} -func (m *Output) XXX_Size() int { - return m.Size() -} -func (m *Output) XXX_DiscardUnknown() { - xxx_messageInfo_Output.DiscardUnknown(m) -} - -var xxx_messageInfo_Output proto.InternalMessageInfo - -// Supply represents a struct that passively keeps track of the total supply -// amounts in the network. -// This message is deprecated now that supply is indexed by denom. -// -// Deprecated: Do not use. -type Supply struct { - Total github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total"` -} - -func (m *Supply) Reset() { *m = Supply{} } -func (m *Supply) String() string { return proto.CompactTextString(m) } -func (*Supply) ProtoMessage() {} -func (*Supply) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{4} -} -func (m *Supply) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Supply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Supply.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 *Supply) XXX_Merge(src proto.Message) { - xxx_messageInfo_Supply.Merge(m, src) -} -func (m *Supply) XXX_Size() int { - return m.Size() -} -func (m *Supply) XXX_DiscardUnknown() { - xxx_messageInfo_Supply.DiscardUnknown(m) -} - -var xxx_messageInfo_Supply proto.InternalMessageInfo - -// DenomUnit represents a struct that describes a given -// denomination unit of the basic token. -type DenomUnit struct { - // denom represents the string name of the given denom unit (e.g uatom). - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // exponent represents power of 10 exponent that one must - // raise the base_denom to in order to equal the given DenomUnit's denom - // 1 denom = 10^exponent base_denom - // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - // exponent = 6, thus: 1 atom = 10^6 uatom). - Exponent uint32 `protobuf:"varint,2,opt,name=exponent,proto3" json:"exponent,omitempty"` - // aliases is a list of string aliases for the given denom - Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` -} - -func (m *DenomUnit) Reset() { *m = DenomUnit{} } -func (m *DenomUnit) String() string { return proto.CompactTextString(m) } -func (*DenomUnit) ProtoMessage() {} -func (*DenomUnit) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{5} -} -func (m *DenomUnit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DenomUnit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DenomUnit.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 *DenomUnit) XXX_Merge(src proto.Message) { - xxx_messageInfo_DenomUnit.Merge(m, src) -} -func (m *DenomUnit) XXX_Size() int { - return m.Size() -} -func (m *DenomUnit) XXX_DiscardUnknown() { - xxx_messageInfo_DenomUnit.DiscardUnknown(m) -} - -var xxx_messageInfo_DenomUnit proto.InternalMessageInfo - -func (m *DenomUnit) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *DenomUnit) GetExponent() uint32 { - if m != nil { - return m.Exponent - } - return 0 -} - -func (m *DenomUnit) GetAliases() []string { - if m != nil { - return m.Aliases - } - return nil -} - -// Metadata represents a struct that describes -// a basic token. -type Metadata struct { - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - // denom_units represents the list of DenomUnit's for a given coin - DenomUnits []*DenomUnit `protobuf:"bytes,2,rep,name=denom_units,json=denomUnits,proto3" json:"denom_units,omitempty"` - // base represents the base denom (should be the DenomUnit with exponent = 0). - Base string `protobuf:"bytes,3,opt,name=base,proto3" json:"base,omitempty"` - // display indicates the suggested denom that should be - // displayed in clients. - Display string `protobuf:"bytes,4,opt,name=display,proto3" json:"display,omitempty"` - // name defines the name of the token (eg: Cosmos Atom) - // - // Since: cosmos-sdk 0.43 - Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` - // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - // be the same as the display. - // - // Since: cosmos-sdk 0.43 - Symbol string `protobuf:"bytes,6,opt,name=symbol,proto3" json:"symbol,omitempty"` - // URI to a document (on or off-chain) that contains additional information. Optional. - // - // Since: cosmos-sdk 0.46 - URI string `protobuf:"bytes,7,opt,name=uri,proto3" json:"uri,omitempty"` - // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - // the document didn't change. Optional. - // - // Since: cosmos-sdk 0.46 - URIHash string `protobuf:"bytes,8,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` -} - -func (m *Metadata) Reset() { *m = Metadata{} } -func (m *Metadata) String() string { return proto.CompactTextString(m) } -func (*Metadata) ProtoMessage() {} -func (*Metadata) Descriptor() ([]byte, []int) { - return fileDescriptor_dd052eee12edf988, []int{6} -} -func (m *Metadata) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Metadata.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 *Metadata) XXX_Merge(src proto.Message) { - xxx_messageInfo_Metadata.Merge(m, src) -} -func (m *Metadata) XXX_Size() int { - return m.Size() -} -func (m *Metadata) XXX_DiscardUnknown() { - xxx_messageInfo_Metadata.DiscardUnknown(m) -} - -var xxx_messageInfo_Metadata proto.InternalMessageInfo - -func (m *Metadata) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *Metadata) GetDenomUnits() []*DenomUnit { - if m != nil { - return m.DenomUnits - } - return nil -} - -func (m *Metadata) GetBase() string { - if m != nil { - return m.Base - } - return "" -} - -func (m *Metadata) GetDisplay() string { - if m != nil { - return m.Display - } - return "" -} - -func (m *Metadata) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Metadata) GetSymbol() string { - if m != nil { - return m.Symbol - } - return "" -} - -func (m *Metadata) GetURI() string { - if m != nil { - return m.URI - } - return "" -} - -func (m *Metadata) GetURIHash() string { - if m != nil { - return m.URIHash - } - return "" -} - -func init() { - proto.RegisterType((*Params)(nil), "cosmos.bank.v1beta1.Params") - proto.RegisterType((*SendEnabled)(nil), "cosmos.bank.v1beta1.SendEnabled") - proto.RegisterType((*Input)(nil), "cosmos.bank.v1beta1.Input") - proto.RegisterType((*Output)(nil), "cosmos.bank.v1beta1.Output") - proto.RegisterType((*Supply)(nil), "cosmos.bank.v1beta1.Supply") - proto.RegisterType((*DenomUnit)(nil), "cosmos.bank.v1beta1.DenomUnit") - proto.RegisterType((*Metadata)(nil), "cosmos.bank.v1beta1.Metadata") -} - -func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } - -var fileDescriptor_dd052eee12edf988 = []byte{ - // 670 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xbf, 0x6f, 0x13, 0x3f, - 0x14, 0x8f, 0x93, 0xe6, 0x47, 0x9d, 0xef, 0x77, 0xc0, 0x44, 0xe0, 0x16, 0xe9, 0x12, 0x32, 0xa0, - 0xb4, 0x52, 0x13, 0x5a, 0xc4, 0x92, 0x05, 0x91, 0x82, 0x4a, 0x06, 0x04, 0xba, 0xaa, 0x42, 0x62, - 0x89, 0x9c, 0x9c, 0x9b, 0x58, 0xbd, 0xb3, 0x4f, 0x67, 0x5f, 0xd5, 0xac, 0x4c, 0xa8, 0x13, 0x23, - 0x12, 0x4b, 0x27, 0x84, 0x18, 0x50, 0x87, 0x2e, 0xfc, 0x07, 0x15, 0x53, 0xc5, 0xc4, 0x54, 0x50, - 0x3a, 0x94, 0x3f, 0x03, 0xd9, 0xbe, 0x4b, 0x53, 0xa9, 0xb0, 0x21, 0xb1, 0x24, 0xef, 0xbd, 0xcf, - 0xf3, 0xfb, 0x7c, 0xfc, 0xde, 0xf3, 0x41, 0x67, 0x20, 0x64, 0x20, 0x64, 0xab, 0x4f, 0xf8, 0x4e, - 0x6b, 0x77, 0xb5, 0x4f, 0x15, 0x59, 0x35, 0x4e, 0x33, 0x8c, 0x84, 0x12, 0xe8, 0xba, 0xc5, 0x9b, - 0x26, 0x94, 0xe0, 0x8b, 0x95, 0xa1, 0x18, 0x0a, 0x83, 0xb7, 0xb4, 0x65, 0x53, 0x17, 0x17, 0x6c, - 0x6a, 0xcf, 0x02, 0xc9, 0x39, 0x0b, 0x5d, 0xb0, 0x48, 0x3a, 0x65, 0x19, 0x08, 0xc6, 0x13, 0xfc, - 0x66, 0x82, 0x07, 0x72, 0xd8, 0xda, 0x5d, 0xd5, 0x7f, 0x09, 0x70, 0x8d, 0x04, 0x8c, 0x8b, 0x96, - 0xf9, 0xb5, 0xa1, 0xfa, 0x7b, 0x00, 0x0b, 0xcf, 0x49, 0x44, 0x02, 0x89, 0x36, 0xe0, 0x7f, 0x92, - 0x72, 0xaf, 0x47, 0x39, 0xe9, 0xfb, 0xd4, 0xc3, 0xa0, 0x96, 0x6b, 0x94, 0xd7, 0x6a, 0xcd, 0x2b, - 0x34, 0x37, 0x37, 0x29, 0xf7, 0x1e, 0xdb, 0xbc, 0x4e, 0x16, 0x03, 0xb7, 0x2c, 0x2f, 0x02, 0xe8, - 0x2e, 0xac, 0x78, 0x74, 0x9b, 0xc4, 0xbe, 0xea, 0x5d, 0x2a, 0x98, 0xad, 0x81, 0x46, 0xc9, 0x45, - 0x09, 0x36, 0x53, 0xa2, 0x7d, 0xfb, 0xed, 0x41, 0x35, 0xb3, 0x7f, 0x7e, 0xb8, 0x8c, 0x2d, 0xd9, - 0x8a, 0xf4, 0x76, 0x5a, 0x7b, 0xb6, 0x8d, 0x56, 0x5d, 0x7d, 0x03, 0x96, 0x67, 0x4e, 0xa0, 0x0a, - 0xcc, 0x7b, 0x94, 0x8b, 0x00, 0x83, 0x1a, 0x68, 0xcc, 0xbb, 0xd6, 0x41, 0x18, 0x16, 0x2f, 0x93, - 0xa5, 0x6e, 0xbb, 0xa4, 0x19, 0x7e, 0x1e, 0x54, 0x41, 0xfd, 0x33, 0x80, 0xf9, 0x2e, 0x0f, 0x63, - 0x85, 0xd6, 0x60, 0x91, 0x78, 0x5e, 0x44, 0xa5, 0xb4, 0x55, 0x3a, 0xf8, 0xeb, 0xd1, 0x4a, 0x25, - 0xb9, 0xee, 0x43, 0x8b, 0x6c, 0xaa, 0x88, 0xf1, 0xa1, 0x9b, 0x26, 0xa2, 0x6d, 0x98, 0xd7, 0x9d, - 0x96, 0x38, 0x6b, 0xba, 0xb3, 0x70, 0xd1, 0x1d, 0x49, 0xa7, 0xdd, 0x59, 0x17, 0x8c, 0x77, 0xee, - 0x1f, 0x9f, 0x56, 0x33, 0x1f, 0xbf, 0x57, 0x1b, 0x43, 0xa6, 0x46, 0x71, 0xbf, 0x39, 0x10, 0x41, - 0x32, 0xc6, 0xd6, 0xcc, 0x25, 0xd5, 0x38, 0xa4, 0xd2, 0x1c, 0x90, 0x1f, 0xce, 0x0f, 0x97, 0x81, - 0x6b, 0xcb, 0xb7, 0x2b, 0xaf, 0xad, 0xde, 0xcc, 0xab, 0xf3, 0xc3, 0xe5, 0x94, 0xbd, 0xfe, 0x09, - 0xc0, 0xc2, 0xb3, 0x58, 0xfd, 0xeb, 0xe2, 0x4b, 0xa9, 0xf8, 0xfa, 0x3b, 0x00, 0x0b, 0x9b, 0x71, - 0x18, 0xfa, 0x63, 0x4d, 0xae, 0x84, 0x22, 0x7e, 0xb2, 0x57, 0x7f, 0x81, 0xdc, 0x94, 0x6f, 0x2f, - 0x25, 0xe4, 0xe0, 0xcb, 0xd1, 0xca, 0xad, 0x2b, 0x77, 0xd7, 0xe8, 0xe9, 0x62, 0x50, 0x7f, 0x01, - 0xe7, 0x1f, 0xe9, 0xbd, 0xd9, 0xe2, 0x4c, 0xfd, 0x66, 0xa3, 0x16, 0x61, 0x89, 0xee, 0x85, 0x82, - 0x53, 0xae, 0xcc, 0x4a, 0xfd, 0xef, 0x4e, 0x7d, 0xbd, 0x6d, 0xc4, 0x67, 0x44, 0x52, 0x89, 0x73, - 0xb5, 0x5c, 0x63, 0xde, 0x4d, 0xdd, 0xfa, 0x7e, 0x16, 0x96, 0x9e, 0x52, 0x45, 0x3c, 0xa2, 0x08, - 0xaa, 0xc1, 0xb2, 0x47, 0xe5, 0x20, 0x62, 0xa1, 0x62, 0x82, 0x27, 0xe5, 0x67, 0x43, 0xe8, 0x81, - 0xce, 0xe0, 0x22, 0xe8, 0xc5, 0x9c, 0xa9, 0x74, 0x3a, 0xce, 0x95, 0x0f, 0x6f, 0xaa, 0xd7, 0x85, - 0x5e, 0x6a, 0x4a, 0x84, 0xe0, 0x9c, 0x6e, 0x23, 0xce, 0x99, 0xda, 0xc6, 0xd6, 0xea, 0x3c, 0x26, - 0x43, 0x9f, 0x8c, 0xf1, 0x9c, 0x09, 0xa7, 0xae, 0xce, 0xe6, 0x24, 0xa0, 0x38, 0x6f, 0xb3, 0xb5, - 0x8d, 0x6e, 0xc0, 0x82, 0x1c, 0x07, 0x7d, 0xe1, 0xe3, 0x82, 0x89, 0x26, 0x1e, 0x5a, 0x80, 0xb9, - 0x38, 0x62, 0xb8, 0x68, 0x56, 0xac, 0x38, 0x39, 0xad, 0xe6, 0xb6, 0xdc, 0xae, 0xab, 0x63, 0xe8, - 0x0e, 0x2c, 0xc5, 0x11, 0xeb, 0x8d, 0x88, 0x1c, 0xe1, 0x92, 0xc1, 0xcb, 0x93, 0xd3, 0x6a, 0x71, - 0xcb, 0xed, 0x3e, 0x21, 0x72, 0xe4, 0x16, 0xe3, 0x88, 0x69, 0xa3, 0xb3, 0x7e, 0x3c, 0x71, 0xc0, - 0xc9, 0xc4, 0x01, 0x3f, 0x26, 0x0e, 0x78, 0x73, 0xe6, 0x64, 0x4e, 0xce, 0x9c, 0xcc, 0xb7, 0x33, - 0x27, 0xf3, 0x72, 0xe9, 0x8f, 0x03, 0x4e, 0xde, 0xbf, 0x99, 0x73, 0xbf, 0x60, 0x3e, 0x57, 0xf7, - 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf6, 0x7e, 0x4e, 0x62, 0x05, 0x00, 0x00, -} - -func (this *SendEnabled) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*SendEnabled) - if !ok { - that2, ok := that.(SendEnabled) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Denom != that1.Denom { - return false - } - if this.Enabled != that1.Enabled { - return false - } - return true -} -func (this *Supply) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Supply) - if !ok { - that2, ok := that.(Supply) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Total) != len(that1.Total) { - return false - } - for i := range this.Total { - if !this.Total[i].Equal(&that1.Total[i]) { - return false - } - } - return true -} -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.DefaultSendEnabled { - i-- - if m.DefaultSendEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SendEnabled) 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 *SendEnabled) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SendEnabled) 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.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintBank(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Input) 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 *Input) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Input) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintBank(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Output) 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 *Output) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Output) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintBank(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Supply) 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 *Supply) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Total) > 0 { - for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DenomUnit) 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 *DenomUnit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DenomUnit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Aliases) > 0 { - for iNdEx := len(m.Aliases) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aliases[iNdEx]) - copy(dAtA[i:], m.Aliases[iNdEx]) - i = encodeVarintBank(dAtA, i, uint64(len(m.Aliases[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if m.Exponent != 0 { - i = encodeVarintBank(dAtA, i, uint64(m.Exponent)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintBank(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Metadata) 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 *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.URIHash) > 0 { - i -= len(m.URIHash) - copy(dAtA[i:], m.URIHash) - i = encodeVarintBank(dAtA, i, uint64(len(m.URIHash))) - i-- - dAtA[i] = 0x42 - } - if len(m.URI) > 0 { - i -= len(m.URI) - copy(dAtA[i:], m.URI) - i = encodeVarintBank(dAtA, i, uint64(len(m.URI))) - i-- - dAtA[i] = 0x3a - } - if len(m.Symbol) > 0 { - i -= len(m.Symbol) - copy(dAtA[i:], m.Symbol) - i = encodeVarintBank(dAtA, i, uint64(len(m.Symbol))) - i-- - dAtA[i] = 0x32 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintBank(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x2a - } - if len(m.Display) > 0 { - i -= len(m.Display) - copy(dAtA[i:], m.Display) - i = encodeVarintBank(dAtA, i, uint64(len(m.Display))) - i-- - dAtA[i] = 0x22 - } - if len(m.Base) > 0 { - i -= len(m.Base) - copy(dAtA[i:], m.Base) - i = encodeVarintBank(dAtA, i, uint64(len(m.Base))) - i-- - dAtA[i] = 0x1a - } - if len(m.DenomUnits) > 0 { - for iNdEx := len(m.DenomUnits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DenomUnits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBank(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintBank(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBank(dAtA []byte, offset int, v uint64) int { - offset -= sovBank(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } - if m.DefaultSendEnabled { - n += 2 - } - return n -} - -func (m *SendEnabled) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - if m.Enabled { - n += 2 - } - return n -} - -func (m *Input) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } - return n -} - -func (m *Output) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } - return n -} - -func (m *Supply) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Total) > 0 { - for _, e := range m.Total { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } - return n -} - -func (m *DenomUnit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - if m.Exponent != 0 { - n += 1 + sovBank(uint64(m.Exponent)) - } - if len(m.Aliases) > 0 { - for _, s := range m.Aliases { - l = len(s) - n += 1 + l + sovBank(uint64(l)) - } - } - return n -} - -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Description) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - if len(m.DenomUnits) > 0 { - for _, e := range m.DenomUnits { - l = e.Size() - n += 1 + l + sovBank(uint64(l)) - } - } - l = len(m.Base) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - l = len(m.Display) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - l = len(m.Symbol) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - l = len(m.URI) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - l = len(m.URIHash) - if l > 0 { - n += 1 + l + sovBank(uint64(l)) - } - return n -} - -func sovBank(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBank(x uint64) (n int) { - return sovBank(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 ErrIntOverflowBank - } - 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 SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SendEnabled = append(m.SendEnabled, &SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultSendEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DefaultSendEnabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SendEnabled) 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 ErrIntOverflowBank - } - 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: SendEnabled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SendEnabled: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = 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 ErrIntOverflowBank - } - 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 := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Input) 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 ErrIntOverflowBank - } - 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: Input: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Input: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Output) 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 ErrIntOverflowBank - } - 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: Output: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Output: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Supply) 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 ErrIntOverflowBank - } - 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: Supply: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Supply: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Total = append(m.Total, types.Coin{}) - if err := m.Total[len(m.Total)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DenomUnit) 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 ErrIntOverflowBank - } - 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: DenomUnit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DenomUnit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Exponent", wireType) - } - m.Exponent = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Exponent |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aliases = append(m.Aliases, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Metadata) 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 ErrIntOverflowBank - } - 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: Metadata: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomUnits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBank - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DenomUnits = append(m.DenomUnits, &DenomUnit{}) - if err := m.DenomUnits[len(m.DenomUnits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Base = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Display", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Display = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - 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 ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Symbol", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Symbol = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.URI = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field URIHash", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBank - } - 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 ErrInvalidLengthBank - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBank - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.URIHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBank(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBank - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBank(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, ErrIntOverflowBank - } - 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, ErrIntOverflowBank - } - 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, ErrIntOverflowBank - } - 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, ErrInvalidLengthBank - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBank - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBank - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBank = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBank = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBank = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go deleted file mode 100644 index af5383cc7606..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/genesis.pb.go +++ /dev/null @@ -1,818 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/bank/v1beta1/genesis.proto - -package types - -import ( - 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/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the bank module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // balances is an array containing the balances of all the accounts. - Balances []Balance `protobuf:"bytes,2,rep,name=balances,proto3" json:"balances"` - // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` - // denom_metadata defines the metadata of the different coins. - DenomMetadata []Metadata `protobuf:"bytes,4,rep,name=denom_metadata,json=denomMetadata,proto3" json:"denom_metadata"` - // send_enabled defines the denoms where send is enabled or disabled. - // - // Since: cosmos-sdk 0.47 - SendEnabled []SendEnabled `protobuf:"bytes,5,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_8f007de11b420c6e, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func (m *GenesisState) GetBalances() []Balance { - if m != nil { - return m.Balances - } - return nil -} - -func (m *GenesisState) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Supply - } - return nil -} - -func (m *GenesisState) GetDenomMetadata() []Metadata { - if m != nil { - return m.DenomMetadata - } - return nil -} - -func (m *GenesisState) GetSendEnabled() []SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - -// Balance defines an account address and balance pair used in the bank module's -// genesis state. -type Balance struct { - // address is the address of the balance holder. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // coins defines the different coins this balance holds. - Coins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins"` -} - -func (m *Balance) Reset() { *m = Balance{} } -func (m *Balance) String() string { return proto.CompactTextString(m) } -func (*Balance) ProtoMessage() {} -func (*Balance) Descriptor() ([]byte, []int) { - return fileDescriptor_8f007de11b420c6e, []int{1} -} -func (m *Balance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Balance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Balance.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 *Balance) XXX_Merge(src proto.Message) { - xxx_messageInfo_Balance.Merge(m, src) -} -func (m *Balance) XXX_Size() int { - return m.Size() -} -func (m *Balance) XXX_DiscardUnknown() { - xxx_messageInfo_Balance.DiscardUnknown(m) -} - -var xxx_messageInfo_Balance proto.InternalMessageInfo - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.bank.v1beta1.GenesisState") - proto.RegisterType((*Balance)(nil), "cosmos.bank.v1beta1.Balance") -} - -func init() { proto.RegisterFile("cosmos/bank/v1beta1/genesis.proto", fileDescriptor_8f007de11b420c6e) } - -var fileDescriptor_8f007de11b420c6e = []byte{ - // 445 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbd, 0xae, 0xd3, 0x30, - 0x1c, 0xc5, 0x13, 0xca, 0xed, 0xbd, 0xd7, 0xbd, 0x20, 0x61, 0x3a, 0xa4, 0x05, 0x92, 0xd2, 0xa9, - 0x20, 0x35, 0x51, 0x8b, 0x58, 0x18, 0x90, 0x48, 0x85, 0x98, 0xf8, 0x50, 0xbb, 0xb1, 0x54, 0x4e, - 0x6c, 0xd2, 0xa8, 0x8d, 0x1d, 0xc5, 0x2e, 0xa2, 0x6f, 0xc0, 0xc8, 0x13, 0xa0, 0x8e, 0x88, 0x05, - 0x06, 0x1e, 0xa2, 0x63, 0xc5, 0xc4, 0x04, 0xa8, 0x1d, 0xe0, 0x31, 0x50, 0x6c, 0x37, 0x8d, 0x44, - 0xc4, 0xc4, 0x92, 0x44, 0x3e, 0xe7, 0xfc, 0xfe, 0x27, 0xb6, 0xc1, 0xed, 0x90, 0xf1, 0x84, 0x71, - 0x2f, 0x40, 0x74, 0xee, 0xbd, 0x1e, 0x04, 0x44, 0xa0, 0x81, 0x17, 0x11, 0x4a, 0x78, 0xcc, 0xdd, - 0x34, 0x63, 0x82, 0xc1, 0xeb, 0xca, 0xe2, 0xe6, 0x16, 0x57, 0x5b, 0xda, 0xcd, 0x88, 0x45, 0x4c, - 0xea, 0x5e, 0xfe, 0xa5, 0xac, 0x6d, 0xbb, 0xa0, 0x71, 0x52, 0xd0, 0x42, 0x16, 0xd3, 0xbf, 0xf4, - 0xd2, 0x34, 0xc9, 0x55, 0x7a, 0x4b, 0xe9, 0x53, 0x05, 0xd6, 0x73, 0x95, 0x74, 0x0d, 0x25, 0x31, - 0x65, 0x9e, 0x7c, 0xaa, 0xa5, 0xee, 0xfb, 0x1a, 0xb8, 0x78, 0xa2, 0xaa, 0x4e, 0x04, 0x12, 0x04, - 0x3e, 0x04, 0xf5, 0x14, 0x65, 0x28, 0xe1, 0x96, 0xd9, 0x31, 0x7b, 0x8d, 0xe1, 0x0d, 0xb7, 0xa2, - 0xba, 0xfb, 0x42, 0x5a, 0xfc, 0xf3, 0xcd, 0x77, 0xc7, 0xf8, 0xf0, 0xeb, 0xf3, 0x5d, 0x73, 0xac, - 0x53, 0x70, 0x04, 0xce, 0x02, 0xb4, 0x40, 0x34, 0x24, 0xdc, 0xba, 0xd4, 0xa9, 0xf5, 0x1a, 0xc3, - 0x9b, 0x95, 0x04, 0x5f, 0x99, 0xca, 0x88, 0x22, 0x08, 0x67, 0xa0, 0xce, 0x97, 0x69, 0xba, 0x58, - 0x59, 0x35, 0x89, 0x68, 0x1d, 0x11, 0x9c, 0x14, 0x88, 0x11, 0x8b, 0xa9, 0x7f, 0x3f, 0xcf, 0x7f, - 0xfc, 0xe1, 0xf4, 0xa2, 0x58, 0xcc, 0x96, 0x81, 0x1b, 0xb2, 0x44, 0xff, 0xb4, 0x7e, 0xf5, 0x39, - 0x9e, 0x7b, 0x62, 0x95, 0x12, 0x2e, 0x03, 0x5c, 0xd7, 0x55, 0x7c, 0xf8, 0x1c, 0x5c, 0xc5, 0x84, - 0xb2, 0x64, 0x9a, 0x10, 0x81, 0x30, 0x12, 0xc8, 0xba, 0x2c, 0x27, 0xde, 0xaa, 0x2c, 0xfd, 0x54, - 0x9b, 0xca, 0xad, 0xaf, 0xc8, 0xfc, 0x41, 0x81, 0xcf, 0xc0, 0x05, 0x27, 0x14, 0x4f, 0x09, 0x45, - 0xc1, 0x82, 0x60, 0xeb, 0x44, 0xe2, 0x3a, 0x95, 0xb8, 0x09, 0xa1, 0xf8, 0xb1, 0xf2, 0x95, 0x89, - 0x0d, 0x7e, 0x5c, 0xef, 0x7e, 0x32, 0xc1, 0xa9, 0xde, 0x2b, 0x38, 0x04, 0xa7, 0x08, 0xe3, 0x8c, - 0x70, 0x75, 0x38, 0xe7, 0xbe, 0xf5, 0xf5, 0x4b, 0xbf, 0xa9, 0xc9, 0x8f, 0x94, 0x32, 0x11, 0x59, - 0x4c, 0xa3, 0xf1, 0xc1, 0x08, 0x5f, 0x81, 0x93, 0xfc, 0xf2, 0x1c, 0x0e, 0xe3, 0xff, 0xef, 0xa4, - 0xc2, 0x3f, 0x38, 0x7b, 0xbb, 0x76, 0x8c, 0xdf, 0x6b, 0xc7, 0xf0, 0x47, 0x9b, 0x9d, 0x6d, 0x6e, - 0x77, 0xb6, 0xf9, 0x73, 0x67, 0x9b, 0xef, 0xf6, 0xb6, 0xb1, 0xdd, 0xdb, 0xc6, 0xb7, 0xbd, 0x6d, - 0xbc, 0xbc, 0xf3, 0x4f, 0xf2, 0x1b, 0x75, 0xa5, 0xe5, 0x80, 0xa0, 0x2e, 0xaf, 0xe7, 0xbd, 0x3f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x88, 0xa3, 0x71, 0x5c, 0x03, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.DenomMetadata) > 0 { - for iNdEx := len(m.DenomMetadata) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DenomMetadata[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Supply) > 0 { - for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Supply[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Balances) > 0 { - for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Balances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Balance) 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 *Balance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Balance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Coins) > 0 { - for iNdEx := len(m.Coins) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Coins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.Balances) > 0 { - for _, e := range m.Balances { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Supply) > 0 { - for _, e := range m.Supply { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DenomMetadata) > 0 { - for _, e := range m.DenomMetadata { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *Balance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.Coins) > 0 { - for _, e := range m.Coins { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Balances = append(m.Balances, Balance{}) - if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Supply = append(m.Supply, types.Coin{}) - if err := m.Supply[len(m.Supply)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomMetadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DenomMetadata = append(m.DenomMetadata, Metadata{}) - if err := m.DenomMetadata[len(m.DenomMetadata)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SendEnabled = append(m.SendEnabled, SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Balance) 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 ErrIntOverflowGenesis - } - 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: Balance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Balance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coins", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Coins = append(m.Coins, types.Coin{}) - if err := m.Coins[len(m.Coins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go deleted file mode 100644 index 7f8c6931b6c9..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.go +++ /dev/null @@ -1,5508 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/bank/v1beta1/query.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" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryBalanceRequest is the request type for the Query/Balance RPC method. -type QueryBalanceRequest struct { - // address is the address to query balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // denom is the coin denom to query balances for. - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QueryBalanceRequest) Reset() { *m = QueryBalanceRequest{} } -func (m *QueryBalanceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryBalanceRequest) ProtoMessage() {} -func (*QueryBalanceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{0} -} -func (m *QueryBalanceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryBalanceRequest.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 *QueryBalanceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBalanceRequest.Merge(m, src) -} -func (m *QueryBalanceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryBalanceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBalanceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryBalanceRequest proto.InternalMessageInfo - -// QueryBalanceResponse is the response type for the Query/Balance RPC method. -type QueryBalanceResponse struct { - // balance is the balance of the coin. - Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` -} - -func (m *QueryBalanceResponse) Reset() { *m = QueryBalanceResponse{} } -func (m *QueryBalanceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryBalanceResponse) ProtoMessage() {} -func (*QueryBalanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{1} -} -func (m *QueryBalanceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryBalanceResponse.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 *QueryBalanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryBalanceResponse.Merge(m, src) -} -func (m *QueryBalanceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryBalanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryBalanceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryBalanceResponse proto.InternalMessageInfo - -func (m *QueryBalanceResponse) GetBalance() *types.Coin { - if m != nil { - return m.Balance - } - return nil -} - -// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -type QueryAllBalancesRequest struct { - // address is the address to query balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllBalancesRequest) Reset() { *m = QueryAllBalancesRequest{} } -func (m *QueryAllBalancesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllBalancesRequest) ProtoMessage() {} -func (*QueryAllBalancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{2} -} -func (m *QueryAllBalancesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllBalancesRequest.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 *QueryAllBalancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllBalancesRequest.Merge(m, src) -} -func (m *QueryAllBalancesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllBalancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllBalancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllBalancesRequest proto.InternalMessageInfo - -// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -// method. -type QueryAllBalancesResponse struct { - // balances is the balances of all the coins. - Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllBalancesResponse) Reset() { *m = QueryAllBalancesResponse{} } -func (m *QueryAllBalancesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllBalancesResponse) ProtoMessage() {} -func (*QueryAllBalancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{3} -} -func (m *QueryAllBalancesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllBalancesResponse.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 *QueryAllBalancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllBalancesResponse.Merge(m, src) -} -func (m *QueryAllBalancesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllBalancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllBalancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllBalancesResponse proto.InternalMessageInfo - -func (m *QueryAllBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Balances - } - return nil -} - -func (m *QueryAllBalancesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QuerySpendableBalancesRequest defines the gRPC request structure for querying -// an account's spendable balances. -// -// Since: cosmos-sdk 0.46 -type QuerySpendableBalancesRequest struct { - // address is the address to query spendable balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySpendableBalancesRequest) Reset() { *m = QuerySpendableBalancesRequest{} } -func (m *QuerySpendableBalancesRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalancesRequest) ProtoMessage() {} -func (*QuerySpendableBalancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{4} -} -func (m *QuerySpendableBalancesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalancesRequest.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 *QuerySpendableBalancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalancesRequest.Merge(m, src) -} -func (m *QuerySpendableBalancesRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalancesRequest proto.InternalMessageInfo - -// QuerySpendableBalancesResponse defines the gRPC response structure for querying -// an account's spendable balances. -// -// Since: cosmos-sdk 0.46 -type QuerySpendableBalancesResponse struct { - // balances is the spendable balances of all the coins. - Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySpendableBalancesResponse) Reset() { *m = QuerySpendableBalancesResponse{} } -func (m *QuerySpendableBalancesResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalancesResponse) ProtoMessage() {} -func (*QuerySpendableBalancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{5} -} -func (m *QuerySpendableBalancesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalancesResponse.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 *QuerySpendableBalancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalancesResponse.Merge(m, src) -} -func (m *QuerySpendableBalancesResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalancesResponse proto.InternalMessageInfo - -func (m *QuerySpendableBalancesResponse) GetBalances() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Balances - } - return nil -} - -func (m *QuerySpendableBalancesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for -// querying an account's spendable balance for a specific denom. -// -// Since: cosmos-sdk 0.47 -type QuerySpendableBalanceByDenomRequest struct { - // address is the address to query balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // denom is the coin denom to query balances for. - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QuerySpendableBalanceByDenomRequest) Reset() { *m = QuerySpendableBalanceByDenomRequest{} } -func (m *QuerySpendableBalanceByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalanceByDenomRequest) ProtoMessage() {} -func (*QuerySpendableBalanceByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{6} -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalanceByDenomRequest.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 *QuerySpendableBalanceByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalanceByDenomRequest.Merge(m, src) -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalanceByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalanceByDenomRequest proto.InternalMessageInfo - -// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for -// querying an account's spendable balance for a specific denom. -// -// Since: cosmos-sdk 0.47 -type QuerySpendableBalanceByDenomResponse struct { - // balance is the balance of the coin. - Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` -} - -func (m *QuerySpendableBalanceByDenomResponse) Reset() { *m = QuerySpendableBalanceByDenomResponse{} } -func (m *QuerySpendableBalanceByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalanceByDenomResponse) ProtoMessage() {} -func (*QuerySpendableBalanceByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{7} -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalanceByDenomResponse.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 *QuerySpendableBalanceByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalanceByDenomResponse.Merge(m, src) -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalanceByDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalanceByDenomResponse proto.InternalMessageInfo - -func (m *QuerySpendableBalanceByDenomResponse) GetBalance() *types.Coin { - if m != nil { - return m.Balance - } - return nil -} - -// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -// method. -type QueryTotalSupplyRequest struct { - // pagination defines an optional pagination for the request. - // - // Since: cosmos-sdk 0.43 - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest{} } -func (m *QueryTotalSupplyRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTotalSupplyRequest) ProtoMessage() {} -func (*QueryTotalSupplyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{8} -} -func (m *QueryTotalSupplyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalSupplyRequest.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 *QueryTotalSupplyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalSupplyRequest.Merge(m, src) -} -func (m *QueryTotalSupplyRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalSupplyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalSupplyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalSupplyRequest proto.InternalMessageInfo - -// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -// method -type QueryTotalSupplyResponse struct { - // supply is the supply of the coins - Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` - // pagination defines the pagination in the response. - // - // Since: cosmos-sdk 0.43 - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyResponse{} } -func (m *QueryTotalSupplyResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTotalSupplyResponse) ProtoMessage() {} -func (*QueryTotalSupplyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{9} -} -func (m *QueryTotalSupplyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTotalSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTotalSupplyResponse.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 *QueryTotalSupplyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTotalSupplyResponse.Merge(m, src) -} -func (m *QueryTotalSupplyResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTotalSupplyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTotalSupplyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTotalSupplyResponse proto.InternalMessageInfo - -func (m *QueryTotalSupplyResponse) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Supply - } - return nil -} - -func (m *QueryTotalSupplyResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -type QuerySupplyOfRequest struct { - // denom is the coin denom to query balances for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QuerySupplyOfRequest) Reset() { *m = QuerySupplyOfRequest{} } -func (m *QuerySupplyOfRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySupplyOfRequest) ProtoMessage() {} -func (*QuerySupplyOfRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{10} -} -func (m *QuerySupplyOfRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySupplyOfRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySupplyOfRequest.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 *QuerySupplyOfRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySupplyOfRequest.Merge(m, src) -} -func (m *QuerySupplyOfRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySupplyOfRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySupplyOfRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySupplyOfRequest proto.InternalMessageInfo - -func (m *QuerySupplyOfRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -type QuerySupplyOfResponse struct { - // amount is the supply of the coin. - Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` -} - -func (m *QuerySupplyOfResponse) Reset() { *m = QuerySupplyOfResponse{} } -func (m *QuerySupplyOfResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySupplyOfResponse) ProtoMessage() {} -func (*QuerySupplyOfResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{11} -} -func (m *QuerySupplyOfResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySupplyOfResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySupplyOfResponse.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 *QuerySupplyOfResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySupplyOfResponse.Merge(m, src) -} -func (m *QuerySupplyOfResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySupplyOfResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySupplyOfResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySupplyOfResponse proto.InternalMessageInfo - -func (m *QuerySupplyOfResponse) GetAmount() types.Coin { - if m != nil { - return m.Amount - } - return types.Coin{} -} - -// QueryParamsRequest defines the request type for querying x/bank parameters. -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_9c6fc1939682df13, []int{12} -} -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 defines the response type for querying x/bank parameters. -type QueryParamsResponse struct { - 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_9c6fc1939682df13, []int{13} -} -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{} -} - -// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -type QueryDenomsMetadataRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDenomsMetadataRequest) Reset() { *m = QueryDenomsMetadataRequest{} } -func (m *QueryDenomsMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDenomsMetadataRequest) ProtoMessage() {} -func (*QueryDenomsMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{14} -} -func (m *QueryDenomsMetadataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomsMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomsMetadataRequest.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 *QueryDenomsMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomsMetadataRequest.Merge(m, src) -} -func (m *QueryDenomsMetadataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomsMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomsMetadataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomsMetadataRequest proto.InternalMessageInfo - -func (m *QueryDenomsMetadataRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -// method. -type QueryDenomsMetadataResponse struct { - // metadata provides the client information for all the registered tokens. - Metadatas []Metadata `protobuf:"bytes,1,rep,name=metadatas,proto3" json:"metadatas"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDenomsMetadataResponse) Reset() { *m = QueryDenomsMetadataResponse{} } -func (m *QueryDenomsMetadataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDenomsMetadataResponse) ProtoMessage() {} -func (*QueryDenomsMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{15} -} -func (m *QueryDenomsMetadataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomsMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomsMetadataResponse.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 *QueryDenomsMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomsMetadataResponse.Merge(m, src) -} -func (m *QueryDenomsMetadataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomsMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomsMetadataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomsMetadataResponse proto.InternalMessageInfo - -func (m *QueryDenomsMetadataResponse) GetMetadatas() []Metadata { - if m != nil { - return m.Metadatas - } - return nil -} - -func (m *QueryDenomsMetadataResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -type QueryDenomMetadataRequest struct { - // denom is the coin denom to query the metadata for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QueryDenomMetadataRequest) Reset() { *m = QueryDenomMetadataRequest{} } -func (m *QueryDenomMetadataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDenomMetadataRequest) ProtoMessage() {} -func (*QueryDenomMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{16} -} -func (m *QueryDenomMetadataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomMetadataRequest.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 *QueryDenomMetadataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomMetadataRequest.Merge(m, src) -} -func (m *QueryDenomMetadataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomMetadataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomMetadataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomMetadataRequest proto.InternalMessageInfo - -func (m *QueryDenomMetadataRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -// method. -type QueryDenomMetadataResponse struct { - // metadata describes and provides all the client information for the requested token. - Metadata Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` -} - -func (m *QueryDenomMetadataResponse) Reset() { *m = QueryDenomMetadataResponse{} } -func (m *QueryDenomMetadataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDenomMetadataResponse) ProtoMessage() {} -func (*QueryDenomMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{17} -} -func (m *QueryDenomMetadataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomMetadataResponse.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 *QueryDenomMetadataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomMetadataResponse.Merge(m, src) -} -func (m *QueryDenomMetadataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomMetadataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomMetadataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomMetadataResponse proto.InternalMessageInfo - -func (m *QueryDenomMetadataResponse) GetMetadata() Metadata { - if m != nil { - return m.Metadata - } - return Metadata{} -} - -// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, -// which queries for a paginated set of all account holders of a particular -// denomination. -type QueryDenomOwnersRequest struct { - // denom defines the coin denomination to query all account holders for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDenomOwnersRequest) Reset() { *m = QueryDenomOwnersRequest{} } -func (m *QueryDenomOwnersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDenomOwnersRequest) ProtoMessage() {} -func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{18} -} -func (m *QueryDenomOwnersRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomOwnersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomOwnersRequest.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 *QueryDenomOwnersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomOwnersRequest.Merge(m, src) -} -func (m *QueryDenomOwnersRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomOwnersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomOwnersRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomOwnersRequest proto.InternalMessageInfo - -func (m *QueryDenomOwnersRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -func (m *QueryDenomOwnersRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// DenomOwner defines structure representing an account that owns or holds a -// particular denominated token. It contains the account address and account -// balance of the denominated token. -// -// Since: cosmos-sdk 0.46 -type DenomOwner struct { - // address defines the address that owns a particular denomination. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // balance is the balance of the denominated coin for an account. - Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` -} - -func (m *DenomOwner) Reset() { *m = DenomOwner{} } -func (m *DenomOwner) String() string { return proto.CompactTextString(m) } -func (*DenomOwner) ProtoMessage() {} -func (*DenomOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{19} -} -func (m *DenomOwner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DenomOwner.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 *DenomOwner) XXX_Merge(src proto.Message) { - xxx_messageInfo_DenomOwner.Merge(m, src) -} -func (m *DenomOwner) XXX_Size() int { - return m.Size() -} -func (m *DenomOwner) XXX_DiscardUnknown() { - xxx_messageInfo_DenomOwner.DiscardUnknown(m) -} - -var xxx_messageInfo_DenomOwner proto.InternalMessageInfo - -func (m *DenomOwner) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -func (m *DenomOwner) GetBalance() types.Coin { - if m != nil { - return m.Balance - } - return types.Coin{} -} - -// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. -// -// Since: cosmos-sdk 0.46 -type QueryDenomOwnersResponse struct { - DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDenomOwnersResponse) Reset() { *m = QueryDenomOwnersResponse{} } -func (m *QueryDenomOwnersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDenomOwnersResponse) ProtoMessage() {} -func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{20} -} -func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomOwnersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomOwnersResponse.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 *QueryDenomOwnersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomOwnersResponse.Merge(m, src) -} -func (m *QueryDenomOwnersResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomOwnersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomOwnersResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomOwnersResponse proto.InternalMessageInfo - -func (m *QueryDenomOwnersResponse) GetDenomOwners() []*DenomOwner { - if m != nil { - return m.DenomOwners - } - return nil -} - -func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. -// -// Since: cosmos-sdk 0.47 -type QuerySendEnabledRequest struct { - // denoms is the specific denoms you want look up. Leave empty to get all entries. - Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` - // pagination defines an optional pagination for the request. This field is - // only read if the denoms field is empty. - Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest{} } -func (m *QuerySendEnabledRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySendEnabledRequest) ProtoMessage() {} -func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{21} -} -func (m *QuerySendEnabledRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySendEnabledRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySendEnabledRequest.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 *QuerySendEnabledRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySendEnabledRequest.Merge(m, src) -} -func (m *QuerySendEnabledRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySendEnabledRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySendEnabledRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySendEnabledRequest proto.InternalMessageInfo - -func (m *QuerySendEnabledRequest) GetDenoms() []string { - if m != nil { - return m.Denoms - } - return nil -} - -func (m *QuerySendEnabledRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QuerySendEnabledResponse defines the RPC response of a SendEnable query. -// -// Since: cosmos-sdk 0.47 -type QuerySendEnabledResponse struct { - SendEnabled []*SendEnabled `protobuf:"bytes,1,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - // pagination defines the pagination in the response. This field is only - // populated if the denoms field in the request is empty. - Pagination *query.PageResponse `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QuerySendEnabledResponse) Reset() { *m = QuerySendEnabledResponse{} } -func (m *QuerySendEnabledResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySendEnabledResponse) ProtoMessage() {} -func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{22} -} -func (m *QuerySendEnabledResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySendEnabledResponse.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 *QuerySendEnabledResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySendEnabledResponse.Merge(m, src) -} -func (m *QuerySendEnabledResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySendEnabledResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySendEnabledResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySendEnabledResponse proto.InternalMessageInfo - -func (m *QuerySendEnabledResponse) GetSendEnabled() []*SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - -func (m *QuerySendEnabledResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest") - proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse") - proto.RegisterType((*QueryAllBalancesRequest)(nil), "cosmos.bank.v1beta1.QueryAllBalancesRequest") - proto.RegisterType((*QueryAllBalancesResponse)(nil), "cosmos.bank.v1beta1.QueryAllBalancesResponse") - proto.RegisterType((*QuerySpendableBalancesRequest)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesRequest") - proto.RegisterType((*QuerySpendableBalancesResponse)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesResponse") - proto.RegisterType((*QuerySpendableBalanceByDenomRequest)(nil), "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest") - proto.RegisterType((*QuerySpendableBalanceByDenomResponse)(nil), "cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse") - proto.RegisterType((*QueryTotalSupplyRequest)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyRequest") - proto.RegisterType((*QueryTotalSupplyResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyResponse") - proto.RegisterType((*QuerySupplyOfRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfRequest") - proto.RegisterType((*QuerySupplyOfResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.bank.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.bank.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryDenomsMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataRequest") - proto.RegisterType((*QueryDenomsMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataResponse") - proto.RegisterType((*QueryDenomMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataRequest") - proto.RegisterType((*QueryDenomMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataResponse") - proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") - proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") - proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") - proto.RegisterType((*QuerySendEnabledRequest)(nil), "cosmos.bank.v1beta1.QuerySendEnabledRequest") - proto.RegisterType((*QuerySendEnabledResponse)(nil), "cosmos.bank.v1beta1.QuerySendEnabledResponse") -} - -func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } - -var fileDescriptor_9c6fc1939682df13 = []byte{ - // 1188 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x04, 0xd5, 0x49, 0x9e, 0x4b, 0xa5, 0x4e, 0x03, 0x4d, 0x36, 0xc4, 0x2e, 0xdb, 0xaa, - 0xf9, 0x41, 0xb2, 0xdb, 0x38, 0x80, 0x68, 0x55, 0x22, 0xd5, 0x29, 0xed, 0x01, 0xa1, 0x16, 0x87, - 0x5e, 0xe0, 0x60, 0xad, 0xbd, 0x83, 0x6b, 0xc5, 0xde, 0x71, 0x3d, 0x6b, 0x8a, 0x55, 0x55, 0x42, - 0x48, 0x48, 0x3d, 0x22, 0xd1, 0x13, 0x12, 0x22, 0x42, 0x02, 0x2a, 0x90, 0x10, 0x42, 0x1c, 0xf9, - 0x03, 0x7a, 0x41, 0x2a, 0x70, 0x28, 0x27, 0x40, 0x09, 0x12, 0xfc, 0x19, 0xc8, 0xf3, 0xc3, 0xbb, - 0x6b, 0x8f, 0x37, 0x9b, 0xd4, 0x95, 0xe8, 0xa5, 0xb5, 0x67, 0xde, 0x9b, 0xf7, 0x7d, 0xef, 0xbd, - 0x99, 0xf7, 0x39, 0x90, 0xab, 0x50, 0xd6, 0xa0, 0xcc, 0x2e, 0x3b, 0xde, 0x96, 0xfd, 0xde, 0x6a, - 0x99, 0xf8, 0xce, 0xaa, 0x7d, 0xa3, 0x4d, 0x5a, 0x1d, 0xab, 0xd9, 0xa2, 0x3e, 0xc5, 0xc7, 0x84, - 0x81, 0xd5, 0x35, 0xb0, 0xa4, 0x81, 0xb1, 0xd4, 0xf3, 0x62, 0x44, 0x58, 0xf7, 0x7c, 0x9b, 0x4e, - 0xb5, 0xe6, 0x39, 0x7e, 0x8d, 0x7a, 0xe2, 0x00, 0x63, 0xaa, 0x4a, 0xab, 0x94, 0x7f, 0xb4, 0xbb, - 0x9f, 0xe4, 0xea, 0x73, 0x55, 0x4a, 0xab, 0x75, 0x62, 0x3b, 0xcd, 0x9a, 0xed, 0x78, 0x1e, 0xf5, - 0xb9, 0x0b, 0x93, 0xbb, 0xd9, 0xf0, 0xf9, 0xea, 0xe4, 0x0a, 0xad, 0x79, 0x03, 0xfb, 0x21, 0xd4, - 0x1c, 0xa1, 0xd8, 0x9f, 0x11, 0xfb, 0x25, 0x11, 0x56, 0x32, 0x10, 0x5b, 0xb3, 0xd2, 0x55, 0xa1, - 0x0e, 0x93, 0x35, 0x8e, 0x3a, 0x8d, 0x9a, 0x47, 0x6d, 0xfe, 0xaf, 0x58, 0x32, 0x6b, 0x70, 0xec, - 0xcd, 0xae, 0x45, 0xc1, 0xa9, 0x3b, 0x5e, 0x85, 0x14, 0xc9, 0x8d, 0x36, 0x61, 0x3e, 0xce, 0xc3, - 0xb8, 0xe3, 0xba, 0x2d, 0xc2, 0xd8, 0x34, 0x3a, 0x81, 0x16, 0x26, 0x0b, 0xd3, 0xbf, 0xfe, 0xb8, - 0x32, 0x25, 0x23, 0x5d, 0x10, 0x3b, 0x9b, 0x7e, 0xab, 0xe6, 0x55, 0x8b, 0xca, 0x10, 0x4f, 0xc1, - 0x21, 0x97, 0x78, 0xb4, 0x31, 0x3d, 0xd6, 0xf5, 0x28, 0x8a, 0x2f, 0xe7, 0x26, 0xee, 0x6c, 0xe7, - 0x52, 0xff, 0x6e, 0xe7, 0x52, 0xe6, 0xeb, 0x30, 0x15, 0x0d, 0xc5, 0x9a, 0xd4, 0x63, 0x04, 0xaf, - 0xc1, 0x78, 0x59, 0x2c, 0xf1, 0x58, 0x99, 0xfc, 0x8c, 0xd5, 0x2b, 0x0a, 0x23, 0xaa, 0x28, 0xd6, - 0x06, 0xad, 0x79, 0x45, 0x65, 0x69, 0x7e, 0x8e, 0xe0, 0x38, 0x3f, 0xed, 0x42, 0xbd, 0x2e, 0x0f, - 0x64, 0x8f, 0x02, 0xfe, 0x12, 0x40, 0x50, 0x5a, 0xce, 0x20, 0x93, 0x3f, 0x1d, 0xc1, 0x21, 0x12, - 0xa9, 0xd0, 0x5c, 0x75, 0xaa, 0x2a, 0x59, 0xc5, 0x90, 0x67, 0x88, 0xee, 0x2f, 0x08, 0xa6, 0x07, - 0x11, 0x4a, 0xce, 0x75, 0x98, 0x90, 0x4c, 0xba, 0x18, 0x9f, 0x8a, 0x25, 0x5d, 0x78, 0xe9, 0xfe, - 0x1f, 0xb9, 0xd4, 0x37, 0x7f, 0xe6, 0x16, 0xaa, 0x35, 0xff, 0x7a, 0xbb, 0x6c, 0x55, 0x68, 0x43, - 0x16, 0x5d, 0xfe, 0xb7, 0xc2, 0xdc, 0x2d, 0xdb, 0xef, 0x34, 0x09, 0xe3, 0x0e, 0xec, 0xde, 0x3f, - 0xdf, 0x2f, 0xa1, 0x62, 0x2f, 0x02, 0xbe, 0xac, 0x21, 0x37, 0xbf, 0x27, 0x39, 0x01, 0x35, 0xcc, - 0xce, 0xfc, 0x12, 0xc1, 0x1c, 0xe7, 0xb4, 0xd9, 0x24, 0x9e, 0xeb, 0x94, 0xeb, 0xe4, 0xff, 0x99, - 0xfb, 0x87, 0x08, 0xb2, 0xc3, 0x70, 0x3e, 0xd9, 0x15, 0xe8, 0xc0, 0x49, 0x2d, 0xb1, 0x42, 0xe7, - 0x62, 0xf7, 0xba, 0x3d, 0xce, 0xfb, 0xfb, 0x0e, 0x9c, 0x8a, 0x0f, 0xfd, 0x28, 0xf7, 0x79, 0x4b, - 0x5e, 0xe7, 0xb7, 0xa8, 0xef, 0xd4, 0x37, 0xdb, 0xcd, 0x66, 0xbd, 0xa3, 0xb8, 0x44, 0xdb, 0x03, - 0x8d, 0xa0, 0x3d, 0x7e, 0x56, 0x57, 0x33, 0x12, 0x4d, 0xc2, 0xbf, 0x0e, 0x69, 0xc6, 0x57, 0x1e, - 0x5b, 0x5b, 0xc8, 0xf3, 0x47, 0xd7, 0x14, 0xcb, 0xf2, 0x65, 0x15, 0x4c, 0xae, 0xbc, 0xab, 0x32, - 0xd7, 0xab, 0x28, 0x0a, 0x55, 0xd4, 0xbc, 0x06, 0xcf, 0xf4, 0x59, 0x4b, 0xe6, 0xe7, 0x21, 0xed, - 0x34, 0x68, 0xdb, 0xf3, 0xf7, 0xac, 0x5b, 0x61, 0xb2, 0xcb, 0x5c, 0xb2, 0x11, 0x3e, 0xe6, 0x14, - 0x60, 0x7e, 0xec, 0x55, 0xa7, 0xe5, 0x34, 0xd4, 0x7b, 0x60, 0x5e, 0x93, 0xf3, 0x45, 0xad, 0xca, - 0x50, 0xeb, 0x90, 0x6e, 0xf2, 0x15, 0x19, 0x6a, 0xd6, 0xd2, 0xcc, 0x61, 0x4b, 0x38, 0x45, 0x82, - 0x09, 0x2f, 0xd3, 0x05, 0x83, 0x1f, 0xcb, 0x3b, 0x8f, 0xbd, 0x41, 0x7c, 0xc7, 0x75, 0x7c, 0x67, - 0xc4, 0x1d, 0x63, 0x7e, 0x87, 0x60, 0x56, 0x1b, 0x46, 0xb2, 0xb8, 0x04, 0x93, 0x0d, 0xb9, 0xa6, - 0x1e, 0x91, 0x39, 0x2d, 0x11, 0xe5, 0x19, 0xa6, 0x12, 0xb8, 0x8e, 0xae, 0x11, 0x56, 0x61, 0x26, - 0xc0, 0xdb, 0x9f, 0x15, 0x7d, 0x37, 0x94, 0xc3, 0x99, 0x1c, 0x60, 0x78, 0x11, 0x26, 0x14, 0x4c, - 0x99, 0xc7, 0xe4, 0x04, 0x7b, 0x9e, 0xe6, 0x4d, 0x79, 0xb9, 0x79, 0x8c, 0x2b, 0x37, 0x3d, 0xd2, - 0x62, 0xb1, 0xa0, 0x46, 0x35, 0x11, 0xcc, 0x0f, 0x10, 0x40, 0x10, 0xf4, 0x40, 0xaf, 0xe2, 0x7a, - 0xf0, 0x9a, 0x8d, 0xed, 0xe3, 0x56, 0xf4, 0x1e, 0xb6, 0xaf, 0xd5, 0x5b, 0x13, 0x21, 0x2f, 0xd3, - 0x5b, 0x80, 0xc3, 0x9c, 0x70, 0x89, 0xf2, 0x75, 0xd9, 0x43, 0x39, 0x6d, 0x8a, 0x03, 0xff, 0x62, - 0xc6, 0x0d, 0xce, 0x1a, 0xe5, 0x68, 0x11, 0x55, 0xda, 0x24, 0x9e, 0xfb, 0x9a, 0xd7, 0x7d, 0xe0, - 0x5d, 0x55, 0xa5, 0x67, 0x21, 0xcd, 0x43, 0x0a, 0x84, 0x93, 0x45, 0xf9, 0xad, 0xaf, 0x4e, 0x95, - 0x03, 0xd7, 0xe9, 0x9e, 0x4a, 0x52, 0x24, 0xb6, 0x4c, 0xd2, 0x06, 0x1c, 0x66, 0xc4, 0x73, 0x4b, - 0x44, 0xac, 0xcb, 0x24, 0x9d, 0xd0, 0x26, 0x29, 0xec, 0x9f, 0x61, 0xc1, 0x97, 0xbe, 0x2c, 0x55, - 0x0e, 0x9c, 0xa5, 0xfc, 0x0f, 0x47, 0xe0, 0x10, 0x87, 0x8a, 0x3f, 0x43, 0x30, 0x2e, 0x47, 0x20, - 0x5e, 0xd0, 0xa2, 0xd1, 0x28, 0x6b, 0x63, 0x31, 0x81, 0xa5, 0x08, 0x6b, 0xbe, 0x7a, 0xa7, 0xdb, - 0x4a, 0x1f, 0xfe, 0xf6, 0xf7, 0x27, 0x63, 0x79, 0x7c, 0xc6, 0xd6, 0xff, 0x28, 0x10, 0x02, 0xc3, - 0xbe, 0x25, 0xfb, 0xf5, 0xb6, 0x5d, 0xee, 0x94, 0xc4, 0x25, 0xda, 0x46, 0x90, 0x09, 0x69, 0x4f, - 0xbc, 0x3c, 0x3c, 0xf2, 0xa0, 0x88, 0x36, 0x56, 0x12, 0x5a, 0x4b, 0xac, 0x2f, 0x06, 0x58, 0x17, - 0xf1, 0x7c, 0x42, 0xac, 0xf8, 0x27, 0x04, 0x47, 0x07, 0x24, 0x1a, 0xce, 0x0f, 0x0f, 0x3d, 0x4c, - 0x77, 0x1a, 0x6b, 0xfb, 0xf2, 0x91, 0xa0, 0xd7, 0x03, 0xd0, 0x6b, 0x78, 0x55, 0x0b, 0x9a, 0x29, - 0xe7, 0x92, 0x06, 0xfe, 0x43, 0x04, 0xc7, 0x87, 0xa8, 0x21, 0xfc, 0x4a, 0x72, 0x40, 0x51, 0xed, - 0x66, 0x9c, 0x3d, 0x80, 0xa7, 0x24, 0x74, 0x39, 0x20, 0x74, 0x1e, 0x9f, 0xdb, 0x37, 0xa1, 0xa0, - 0x77, 0xee, 0x22, 0xc8, 0x84, 0xc4, 0x51, 0x5c, 0xef, 0x0c, 0x2a, 0xb6, 0xb8, 0xde, 0xd1, 0x28, - 0x2e, 0x73, 0x21, 0x40, 0x3d, 0x87, 0x67, 0xf5, 0xa8, 0x05, 0x8c, 0xbb, 0x08, 0x26, 0x94, 0x6c, - 0xc1, 0x31, 0x37, 0xa9, 0x4f, 0x08, 0x19, 0x4b, 0x49, 0x4c, 0x25, 0x9a, 0xd5, 0x00, 0xcd, 0x69, - 0x7c, 0x2a, 0x06, 0x4d, 0x90, 0xad, 0x8f, 0x10, 0xa4, 0x85, 0x56, 0xc1, 0xf3, 0xc3, 0x23, 0x45, - 0x84, 0x91, 0xb1, 0xb0, 0xb7, 0x61, 0xf2, 0xf4, 0x08, 0x55, 0x84, 0xbf, 0x45, 0xf0, 0x74, 0x64, - 0x8e, 0x63, 0x6b, 0x78, 0x14, 0x9d, 0x46, 0x30, 0xec, 0xc4, 0xf6, 0x12, 0xdc, 0xd9, 0x00, 0x9c, - 0x85, 0x97, 0xb5, 0xe0, 0xc4, 0xac, 0x28, 0x29, 0x35, 0x60, 0xdf, 0xe2, 0x0b, 0xb7, 0xf1, 0x57, - 0x08, 0x8e, 0x44, 0x85, 0x15, 0xde, 0x2b, 0x7c, 0xbf, 0xd2, 0x33, 0xce, 0x24, 0x77, 0x48, 0x5e, - 0xde, 0x3e, 0xc0, 0xf8, 0x0b, 0x04, 0x99, 0xd0, 0xf4, 0x8e, 0xbb, 0x0c, 0x83, 0x0a, 0x27, 0xee, - 0x32, 0x68, 0x24, 0x81, 0xf9, 0x72, 0x80, 0xef, 0x05, 0xbc, 0x38, 0x1c, 0x9f, 0x94, 0x0c, 0xbd, - 0x6c, 0x7e, 0x8a, 0x20, 0x13, 0x9a, 0x7e, 0x71, 0x20, 0x07, 0x07, 0x7c, 0x1c, 0x48, 0xcd, 0x48, - 0x36, 0xad, 0x00, 0xe4, 0x49, 0xfc, 0xbc, 0xfe, 0x8e, 0x84, 0x46, 0x76, 0x61, 0xe3, 0xfe, 0x4e, - 0x16, 0x3d, 0xd8, 0xc9, 0xa2, 0xbf, 0x76, 0xb2, 0xe8, 0xe3, 0xdd, 0x6c, 0xea, 0xc1, 0x6e, 0x36, - 0xf5, 0xfb, 0x6e, 0x36, 0xf5, 0xf6, 0x62, 0xec, 0x4f, 0xa7, 0xf7, 0xc5, 0x99, 0xfc, 0x17, 0x54, - 0x39, 0xcd, 0xff, 0x62, 0xb5, 0xf6, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf4, 0x2c, 0x27, 0x2a, - 0xd4, 0x13, 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 { - // Balance queries the balance of a single coin for a single account. - Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) - // AllBalances queries the balance of all coins for a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) - // SpendableBalances queries the spendable balance of all coins for a single - // account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) - // SpendableBalanceByDenom queries the spendable balance of a single denom for - // a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.47 - SpendableBalanceByDenom(ctx context.Context, in *QuerySpendableBalanceByDenomRequest, opts ...grpc.CallOption) (*QuerySpendableBalanceByDenomResponse, error) - // TotalSupply queries the total supply of all coins. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) - // SupplyOf queries the supply of a single coin. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) - // Params queries the parameters of x/bank module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) - // DenomsMetadata queries the client metadata for all registered coin - // denominations. - DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) - // DenomOwners queries for all account addresses that own a particular token - // denomination. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries. - // - // This query only returns denominations that have specific SendEnabled settings. - // Any denomination that does not have a specific setting will use the default - // params.default_send_enabled, and will not be returned by this query. - // - // Since: cosmos-sdk 0.47 - SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) { - out := new(QueryBalanceResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/Balance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) { - out := new(QueryAllBalancesResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/AllBalances", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) { - out := new(QuerySpendableBalancesResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SpendableBalances", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SpendableBalanceByDenom(ctx context.Context, in *QuerySpendableBalanceByDenomRequest, opts ...grpc.CallOption) (*QuerySpendableBalanceByDenomResponse, error) { - out := new(QuerySpendableBalanceByDenomResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { - out := new(QueryTotalSupplyResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/TotalSupply", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) { - out := new(QuerySupplyOfResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SupplyOf", 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, "/cosmos.bank.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) { - out := new(QueryDenomMetadataResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomMetadata", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) { - out := new(QueryDenomsMetadataResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomsMetadata", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) { - out := new(QueryDenomOwnersResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomOwners", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) SendEnabled(ctx context.Context, in *QuerySendEnabledRequest, opts ...grpc.CallOption) (*QuerySendEnabledResponse, error) { - out := new(QuerySendEnabledResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SendEnabled", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Balance queries the balance of a single coin for a single account. - Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) - // AllBalances queries the balance of all coins for a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - AllBalances(context.Context, *QueryAllBalancesRequest) (*QueryAllBalancesResponse, error) - // SpendableBalances queries the spendable balance of all coins for a single - // account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - SpendableBalances(context.Context, *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) - // SpendableBalanceByDenom queries the spendable balance of a single denom for - // a single account. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.47 - SpendableBalanceByDenom(context.Context, *QuerySpendableBalanceByDenomRequest) (*QuerySpendableBalanceByDenomResponse, error) - // TotalSupply queries the total supply of all coins. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) - // SupplyOf queries the supply of a single coin. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) - // Params queries the parameters of x/bank module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // DenomsMetadata queries the client metadata of a given coin denomination. - DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) - // DenomsMetadata queries the client metadata for all registered coin - // denominations. - DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) - // DenomOwners queries for all account addresses that own a particular token - // denomination. - // - // When called from another module, this query might consume a high amount of - // gas if the pagination field is incorrectly set. - // - // Since: cosmos-sdk 0.46 - DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) - // SendEnabled queries for SendEnabled entries. - // - // This query only returns denominations that have specific SendEnabled settings. - // Any denomination that does not have a specific setting will use the default - // params.default_send_enabled, and will not be returned by this query. - // - // Since: cosmos-sdk 0.47 - SendEnabled(context.Context, *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Balance(ctx context.Context, req *QueryBalanceRequest) (*QueryBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Balance not implemented") -} -func (*UnimplementedQueryServer) AllBalances(ctx context.Context, req *QueryAllBalancesRequest) (*QueryAllBalancesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllBalances not implemented") -} -func (*UnimplementedQueryServer) SpendableBalances(ctx context.Context, req *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SpendableBalances not implemented") -} -func (*UnimplementedQueryServer) SpendableBalanceByDenom(ctx context.Context, req *QuerySpendableBalanceByDenomRequest) (*QuerySpendableBalanceByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SpendableBalanceByDenom not implemented") -} -func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TotalSupply not implemented") -} -func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) DenomMetadata(ctx context.Context, req *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomMetadata not implemented") -} -func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") -} -func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") -} -func (*UnimplementedQueryServer) SendEnabled(ctx context.Context, req *QuerySendEnabledRequest) (*QuerySendEnabledResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendEnabled not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Balance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/Balance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Balance(ctx, req.(*QueryBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllBalancesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllBalances(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/AllBalances", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllBalances(ctx, req.(*QueryAllBalancesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SpendableBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySpendableBalancesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SpendableBalances(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/SpendableBalances", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SpendableBalances(ctx, req.(*QuerySpendableBalancesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SpendableBalanceByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySpendableBalanceByDenomRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SpendableBalanceByDenom(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SpendableBalanceByDenom(ctx, req.(*QuerySpendableBalanceByDenomRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TotalSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTotalSupplyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TotalSupply(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/TotalSupply", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SupplyOf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySupplyOfRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SupplyOf(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/SupplyOf", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SupplyOf(ctx, req.(*QuerySupplyOfRequest)) - } - 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: "/cosmos.bank.v1beta1.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_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomMetadataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DenomMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/DenomMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomMetadata(ctx, req.(*QueryDenomMetadataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomsMetadataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DenomsMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/DenomsMetadata", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomOwnersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DenomOwners(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/DenomOwners", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomOwners(ctx, req.(*QueryDenomOwnersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_SendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySendEnabledRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).SendEnabled(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Query/SendEnabled", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).SendEnabled(ctx, req.(*QuerySendEnabledRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.bank.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Balance", - Handler: _Query_Balance_Handler, - }, - { - MethodName: "AllBalances", - Handler: _Query_AllBalances_Handler, - }, - { - MethodName: "SpendableBalances", - Handler: _Query_SpendableBalances_Handler, - }, - { - MethodName: "SpendableBalanceByDenom", - Handler: _Query_SpendableBalanceByDenom_Handler, - }, - { - MethodName: "TotalSupply", - Handler: _Query_TotalSupply_Handler, - }, - { - MethodName: "SupplyOf", - Handler: _Query_SupplyOf_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "DenomMetadata", - Handler: _Query_DenomMetadata_Handler, - }, - { - MethodName: "DenomsMetadata", - Handler: _Query_DenomsMetadata_Handler, - }, - { - MethodName: "DenomOwners", - Handler: _Query_DenomOwners_Handler, - }, - { - MethodName: "SendEnabled", - Handler: _Query_SendEnabled_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/bank/v1beta1/query.proto", -} - -func (m *QueryBalanceRequest) 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 *QueryBalanceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryBalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryBalanceResponse) 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 *QueryBalanceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Balance != nil { - { - size, err := m.Balance.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 *QueryAllBalancesRequest) 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 *QueryAllBalancesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllBalancesRequest) 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.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllBalancesResponse) 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 *QueryAllBalancesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllBalancesResponse) 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.Balances) > 0 { - for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Balances[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 *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalancesRequest) 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.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySpendableBalancesResponse) 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 *QuerySpendableBalancesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalancesResponse) 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.Balances) > 0 { - for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Balances[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 *QuerySpendableBalanceByDenomRequest) 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 *QuerySpendableBalanceByDenomRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalanceByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySpendableBalanceByDenomResponse) 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 *QuerySpendableBalanceByDenomResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySpendableBalanceByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Balance != nil { - { - size, err := m.Balance.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 *QueryTotalSupplyRequest) 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 *QueryTotalSupplyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalSupplyRequest) 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 *QueryTotalSupplyResponse) 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 *QueryTotalSupplyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTotalSupplyResponse) 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.Supply) > 0 { - for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Supply[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 *QuerySupplyOfRequest) 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 *QuerySupplyOfRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySupplyOfRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QuerySupplyOfResponse) 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 *QuerySupplyOfResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySupplyOfResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Amount.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 *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 *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataResponse) 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 *QueryDenomsMetadataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomsMetadataResponse) 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.Metadatas) > 0 { - for iNdEx := len(m.Metadatas) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Metadatas[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 *QueryDenomMetadataRequest) 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 *QueryDenomMetadataRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDenomMetadataResponse) 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 *QueryDenomMetadataResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Metadata.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 *QueryDenomOwnersRequest) 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 *QueryDenomOwnersRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomOwnersRequest) 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.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DenomOwner) 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 *DenomOwner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDenomOwnersResponse) 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 *QueryDenomOwnersResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomOwnersResponse) 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.DenomOwners) > 0 { - for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DenomOwners[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 *QuerySendEnabledRequest) 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 *QuerySendEnabledRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySendEnabledRequest) 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] = 0x6 - i-- - dAtA[i] = 0x9a - } - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QuerySendEnabledResponse) 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 *QuerySendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QuerySendEnabledResponse) 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] = 0x6 - i-- - dAtA[i] = 0x9a - } - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[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 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 *QueryBalanceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryBalanceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Balance != nil { - l = m.Balance.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllBalancesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllBalancesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Balances) > 0 { - for _, e := range m.Balances { - 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 *QuerySpendableBalancesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySpendableBalancesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Balances) > 0 { - for _, e := range m.Balances { - 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 *QuerySpendableBalanceByDenomRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySpendableBalanceByDenomResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Balance != nil { - l = m.Balance.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTotalSupplyRequest) 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 *QueryTotalSupplyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Supply) > 0 { - for _, e := range m.Supply { - 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 *QuerySupplyOfRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySupplyOfResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Amount.Size() - 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 *QueryDenomsMetadataRequest) 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 *QueryDenomsMetadataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Metadatas) > 0 { - for _, e := range m.Metadatas { - 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 *QueryDenomMetadataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDenomMetadataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Metadata.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDenomOwnersRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *DenomOwner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = m.Balance.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDenomOwnersResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.DenomOwners) > 0 { - for _, e := range m.DenomOwners { - 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 *QuerySendEnabledRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Denoms) > 0 { - for _, s := range m.Denoms { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 2 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QuerySendEnabledResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 2 + l + sovQuery(uint64(l)) - } - 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 *QueryBalanceRequest) 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: QueryBalanceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryBalanceResponse) 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: QueryBalanceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance == nil { - m.Balance = &types.Coin{} - } - if err := m.Balance.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllBalancesRequest) 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: QueryAllBalancesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllBalancesResponse) 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: QueryAllBalancesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, types.Coin{}) - if err := m.Balances[len(m.Balances)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySpendableBalancesRequest) 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: QuerySpendableBalancesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySpendableBalancesResponse) 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: QuerySpendableBalancesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, types.Coin{}) - if err := m.Balances[len(m.Balances)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySpendableBalanceByDenomRequest) 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: QuerySpendableBalanceByDenomRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalanceByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySpendableBalanceByDenomResponse) 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: QuerySpendableBalanceByDenomResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySpendableBalanceByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance == nil { - m.Balance = &types.Coin{} - } - if err := m.Balance.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTotalSupplyRequest) 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: QueryTotalSupplyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalSupplyRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTotalSupplyResponse) 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: QueryTotalSupplyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTotalSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Supply", 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.Supply = append(m.Supply, types.Coin{}) - if err := m.Supply[len(m.Supply)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySupplyOfRequest) 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: QuerySupplyOfRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySupplyOfRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySupplyOfResponse) 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: QuerySupplyOfResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySupplyOfResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 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.Amount.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) || (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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomsMetadataRequest) 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: QueryDenomsMetadataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomsMetadataRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomsMetadataResponse) 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: QueryDenomsMetadataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomsMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadatas", 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.Metadatas = append(m.Metadatas, Metadata{}) - if err := m.Metadatas[len(m.Metadatas)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomMetadataRequest) 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: QueryDenomMetadataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomMetadataResponse) 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: QueryDenomMetadataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomOwnersRequest) 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: QueryDenomOwnersRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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.Denom = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DenomOwner) 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: DenomOwner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DenomOwner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDenomOwnersResponse) 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: QueryDenomOwnersResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomOwnersResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", 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.DenomOwners = append(m.DenomOwners, &DenomOwner{}) - if err := m.DenomOwners[len(m.DenomOwners)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySendEnabledRequest) 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: QuerySendEnabledRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySendEnabledRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denoms", 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.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 99: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QuerySendEnabledResponse) 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: QuerySendEnabledResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QuerySendEnabledResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SendEnabled", 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.SendEnabled = append(m.SendEnabled, &SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 99: - 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) || (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/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go deleted file mode 100644 index 982f53168300..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/query.pb.gw.go +++ /dev/null @@ -1,1181 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/bank/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Balance_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBalanceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Balance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryBalanceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Balance(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_AllBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllBalances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_SpendableBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SpendableBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SpendableBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SpendableBalances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_SpendableBalanceByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalanceByDenomRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SpendableBalanceByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalanceByDenomRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SpendableBalanceByDenom(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_TotalSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalSupplyRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalSupply_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.TotalSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTotalSupplyRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalSupply_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.TotalSupply(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_SupplyOf_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySupplyOfRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SupplyOf_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SupplyOf(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySupplyOfRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SupplyOf_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SupplyOf(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomMetadataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := client.DenomMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomMetadataRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := server.DenomMetadata(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_DenomsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsMetadataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DenomsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomsMetadataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DenomsMetadata(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomOwnersRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomOwnersRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DenomOwners(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_SendEnabled_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySendEnabledRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SendEnabled(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SendEnabled_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySendEnabledRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SendEnabled_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SendEnabled(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Balance_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Balance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AllBalances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SpendableBalances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SpendableBalanceByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TotalSupply_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SupplyOf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SupplyOf_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SupplyOf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DenomMetadata_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DenomsMetadata_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SendEnabled_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Balance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Balance_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Balance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AllBalances_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SpendableBalances_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SpendableBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SpendableBalanceByDenom_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TotalSupply_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SupplyOf_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SupplyOf_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SupplyOf_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DenomMetadata_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomsMetadata_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DenomsMetadata_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SendEnabled_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SendEnabled_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SendEnabled_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "bank", "v1beta1", "balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SpendableBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "spendable_balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SpendableBalanceByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "bank", "v1beta1", "spendable_balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SendEnabled_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "send_enabled"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Balance_0 = runtime.ForwardResponseMessage - - forward_Query_AllBalances_0 = runtime.ForwardResponseMessage - - forward_Query_SpendableBalances_0 = runtime.ForwardResponseMessage - - forward_Query_SpendableBalanceByDenom_0 = runtime.ForwardResponseMessage - - forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage - - forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage - - forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage - - forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage - - forward_Query_SendEnabled_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go deleted file mode 100644 index b3fd1ea3d863..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/bank/types/tx.pb.go +++ /dev/null @@ -1,1924 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/bank/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 - -// MsgSend represents a message to send coins from one account to another. -type MsgSend 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"` -} - -func (m *MsgSend) Reset() { *m = MsgSend{} } -func (m *MsgSend) String() string { return proto.CompactTextString(m) } -func (*MsgSend) ProtoMessage() {} -func (*MsgSend) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{0} -} -func (m *MsgSend) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSend.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 *MsgSend) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSend.Merge(m, src) -} -func (m *MsgSend) XXX_Size() int { - return m.Size() -} -func (m *MsgSend) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSend.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSend proto.InternalMessageInfo - -// MsgSendResponse defines the Msg/Send response type. -type MsgSendResponse struct { -} - -func (m *MsgSendResponse) Reset() { *m = MsgSendResponse{} } -func (m *MsgSendResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSendResponse) ProtoMessage() {} -func (*MsgSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{1} -} -func (m *MsgSendResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSendResponse.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 *MsgSendResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSendResponse.Merge(m, src) -} -func (m *MsgSendResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSendResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSendResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSendResponse proto.InternalMessageInfo - -// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -type MsgMultiSend struct { - // Inputs, despite being `repeated`, only allows one sender input. This is - // checked in MsgMultiSend's ValidateBasic. - Inputs []Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs"` - Outputs []Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs"` -} - -func (m *MsgMultiSend) Reset() { *m = MsgMultiSend{} } -func (m *MsgMultiSend) String() string { return proto.CompactTextString(m) } -func (*MsgMultiSend) ProtoMessage() {} -func (*MsgMultiSend) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{2} -} -func (m *MsgMultiSend) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMultiSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMultiSend.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 *MsgMultiSend) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMultiSend.Merge(m, src) -} -func (m *MsgMultiSend) XXX_Size() int { - return m.Size() -} -func (m *MsgMultiSend) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMultiSend.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMultiSend proto.InternalMessageInfo - -func (m *MsgMultiSend) GetInputs() []Input { - if m != nil { - return m.Inputs - } - return nil -} - -func (m *MsgMultiSend) GetOutputs() []Output { - if m != nil { - return m.Outputs - } - return nil -} - -// MsgMultiSendResponse defines the Msg/MultiSend response type. -type MsgMultiSendResponse struct { -} - -func (m *MsgMultiSendResponse) Reset() { *m = MsgMultiSendResponse{} } -func (m *MsgMultiSendResponse) String() string { return proto.CompactTextString(m) } -func (*MsgMultiSendResponse) ProtoMessage() {} -func (*MsgMultiSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{3} -} -func (m *MsgMultiSendResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgMultiSendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgMultiSendResponse.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 *MsgMultiSendResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgMultiSendResponse.Merge(m, src) -} -func (m *MsgMultiSendResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgMultiSendResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgMultiSendResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgMultiSendResponse proto.InternalMessageInfo - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -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 x/bank 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_1d8cb1613481f5b7, []int{4} -} -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. -// -// Since: cosmos-sdk 0.47 -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_1d8cb1613481f5b7, []int{5} -} -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 - -// MsgSetSendEnabled is the Msg/SetSendEnabled request type. -// -// Only entries to add/update/delete need to be included. -// Existing SendEnabled entries that are not included in this -// message are left unchanged. -// -// Since: cosmos-sdk 0.47 -type MsgSetSendEnabled struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // send_enabled is the list of entries to add or update. - SendEnabled []*SendEnabled `protobuf:"bytes,2,rep,name=send_enabled,json=sendEnabled,proto3" json:"send_enabled,omitempty"` - // use_default_for is a list of denoms that should use the params.default_send_enabled value. - // Denoms listed here will have their SendEnabled entries deleted. - // If a denom is included that doesn't have a SendEnabled entry, - // it will be ignored. - UseDefaultFor []string `protobuf:"bytes,3,rep,name=use_default_for,json=useDefaultFor,proto3" json:"use_default_for,omitempty"` -} - -func (m *MsgSetSendEnabled) Reset() { *m = MsgSetSendEnabled{} } -func (m *MsgSetSendEnabled) String() string { return proto.CompactTextString(m) } -func (*MsgSetSendEnabled) ProtoMessage() {} -func (*MsgSetSendEnabled) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{6} -} -func (m *MsgSetSendEnabled) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetSendEnabled) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetSendEnabled.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 *MsgSetSendEnabled) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetSendEnabled.Merge(m, src) -} -func (m *MsgSetSendEnabled) XXX_Size() int { - return m.Size() -} -func (m *MsgSetSendEnabled) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetSendEnabled.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetSendEnabled proto.InternalMessageInfo - -func (m *MsgSetSendEnabled) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgSetSendEnabled) GetSendEnabled() []*SendEnabled { - if m != nil { - return m.SendEnabled - } - return nil -} - -func (m *MsgSetSendEnabled) GetUseDefaultFor() []string { - if m != nil { - return m.UseDefaultFor - } - return nil -} - -// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -// -// Since: cosmos-sdk 0.47 -type MsgSetSendEnabledResponse struct { -} - -func (m *MsgSetSendEnabledResponse) Reset() { *m = MsgSetSendEnabledResponse{} } -func (m *MsgSetSendEnabledResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetSendEnabledResponse) ProtoMessage() {} -func (*MsgSetSendEnabledResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1d8cb1613481f5b7, []int{7} -} -func (m *MsgSetSendEnabledResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetSendEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetSendEnabledResponse.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 *MsgSetSendEnabledResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetSendEnabledResponse.Merge(m, src) -} -func (m *MsgSetSendEnabledResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSetSendEnabledResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetSendEnabledResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetSendEnabledResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgSend)(nil), "cosmos.bank.v1beta1.MsgSend") - proto.RegisterType((*MsgSendResponse)(nil), "cosmos.bank.v1beta1.MsgSendResponse") - proto.RegisterType((*MsgMultiSend)(nil), "cosmos.bank.v1beta1.MsgMultiSend") - proto.RegisterType((*MsgMultiSendResponse)(nil), "cosmos.bank.v1beta1.MsgMultiSendResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.bank.v1beta1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.bank.v1beta1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgSetSendEnabled)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabled") - proto.RegisterType((*MsgSetSendEnabledResponse)(nil), "cosmos.bank.v1beta1.MsgSetSendEnabledResponse") -} - -func init() { proto.RegisterFile("cosmos/bank/v1beta1/tx.proto", fileDescriptor_1d8cb1613481f5b7) } - -var fileDescriptor_1d8cb1613481f5b7 = []byte{ - // 690 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x4f, 0xd4, 0x5e, - 0x14, 0x6d, 0x99, 0xdf, 0x6f, 0x48, 0x1f, 0xa3, 0x84, 0x4a, 0x84, 0x29, 0xa4, 0x03, 0x8d, 0x21, - 0x80, 0xd2, 0x0a, 0x7e, 0x25, 0x63, 0x34, 0x3a, 0xa8, 0x89, 0x26, 0x13, 0xcd, 0x10, 0x17, 0xba, - 0x99, 0xb4, 0xf4, 0xd1, 0x69, 0xa0, 0x7d, 0x4d, 0xdf, 0x2b, 0x81, 0x9d, 0xba, 0x32, 0xae, 0xdc, - 0xbb, 0x61, 0x69, 0x5c, 0xb1, 0x70, 0x69, 0xe2, 0x96, 0x25, 0x71, 0xe5, 0x4a, 0x0d, 0x2c, 0xd0, - 0xff, 0xc2, 0xbc, 0x8f, 0x96, 0xce, 0x30, 0xc3, 0x10, 0x37, 0xd3, 0xce, 0xbb, 0xe7, 0x9c, 0x7b, - 0xcf, 0xed, 0x69, 0xc1, 0xe4, 0x2a, 0xc2, 0x01, 0xc2, 0x96, 0x63, 0x87, 0xeb, 0xd6, 0xe6, 0xa2, - 0x03, 0x89, 0xbd, 0x68, 0x91, 0x2d, 0x33, 0x8a, 0x11, 0x41, 0xea, 0x05, 0x5e, 0x35, 0x69, 0xd5, - 0x14, 0x55, 0x6d, 0xd4, 0x43, 0x1e, 0x62, 0x75, 0x8b, 0xde, 0x71, 0xa8, 0xa6, 0x67, 0x42, 0x18, - 0x66, 0x42, 0xab, 0xc8, 0x0f, 0x4f, 0xd4, 0x73, 0x8d, 0x98, 0x2e, 0xaf, 0x97, 0x79, 0xbd, 0xc9, - 0x85, 0x45, 0x5f, 0x5e, 0x1a, 0x13, 0xd4, 0x00, 0x7b, 0xd6, 0xe6, 0x22, 0xbd, 0x88, 0xc2, 0x88, - 0x1d, 0xf8, 0x21, 0xb2, 0xd8, 0x2f, 0x3f, 0x32, 0x3e, 0x0c, 0x80, 0xc1, 0x3a, 0xf6, 0x56, 0x60, - 0xe8, 0xaa, 0xb7, 0x41, 0x69, 0x2d, 0x46, 0x41, 0xd3, 0x76, 0xdd, 0x18, 0x62, 0x3c, 0x2e, 0x4f, - 0xc9, 0xb3, 0x4a, 0x6d, 0xfc, 0xdb, 0xe7, 0x85, 0x51, 0xa1, 0x7f, 0x9f, 0x57, 0x56, 0x48, 0xec, - 0x87, 0x5e, 0x63, 0x88, 0xa2, 0xc5, 0x91, 0x7a, 0x0b, 0x00, 0x82, 0x32, 0xea, 0x40, 0x1f, 0xaa, - 0x42, 0x50, 0x4a, 0x6c, 0x81, 0xa2, 0x1d, 0xa0, 0x24, 0x24, 0xe3, 0x85, 0xa9, 0xc2, 0xec, 0xd0, - 0x52, 0xd9, 0xcc, 0x96, 0x88, 0x61, 0xba, 0x44, 0x73, 0x19, 0xf9, 0x61, 0xed, 0xc6, 0xde, 0x8f, - 0x8a, 0xf4, 0xe9, 0x67, 0x65, 0xd6, 0xf3, 0x49, 0x2b, 0x71, 0xcc, 0x55, 0x14, 0x08, 0xe7, 0xe2, - 0xb2, 0x80, 0xdd, 0x75, 0x8b, 0x6c, 0x47, 0x10, 0x33, 0x02, 0xfe, 0x78, 0xb4, 0x3b, 0x2f, 0x37, - 0x84, 0x7e, 0xf5, 0xea, 0xdb, 0x9d, 0x8a, 0xf4, 0x7b, 0xa7, 0x22, 0xbd, 0x39, 0xda, 0x9d, 0x6f, - 0xb3, 0xfa, 0xee, 0x68, 0x77, 0x5e, 0xcd, 0x49, 0x88, 0x8d, 0x18, 0x23, 0x60, 0x58, 0xdc, 0x36, - 0x20, 0x8e, 0x50, 0x88, 0xa1, 0xf1, 0x45, 0x06, 0xa5, 0x3a, 0xf6, 0xea, 0xc9, 0x06, 0xf1, 0xd9, - 0xd6, 0xee, 0x80, 0xa2, 0x1f, 0x46, 0x09, 0xa1, 0xfb, 0xa2, 0xf3, 0x6b, 0x66, 0x97, 0x10, 0x98, - 0x8f, 0x29, 0xa4, 0xa6, 0x50, 0x03, 0x62, 0x28, 0x4e, 0x52, 0xef, 0x81, 0x41, 0x94, 0x10, 0xc6, - 0x1f, 0x60, 0xfc, 0x89, 0xae, 0xfc, 0xa7, 0x0c, 0x93, 0x17, 0x48, 0x69, 0xd5, 0xcb, 0xa9, 0x25, - 0x21, 0x49, 0xcd, 0x8c, 0xb5, 0x9b, 0xc9, 0xa6, 0x35, 0x2e, 0x82, 0xd1, 0xfc, 0xff, 0xcc, 0xd6, - 0x57, 0x99, 0x59, 0x7d, 0x1e, 0xb9, 0x36, 0x81, 0xcf, 0xec, 0xd8, 0x0e, 0xb0, 0x7a, 0x13, 0x28, - 0x76, 0x42, 0x5a, 0x28, 0xf6, 0xc9, 0x76, 0xdf, 0x30, 0x1c, 0x43, 0xd5, 0xbb, 0xa0, 0x18, 0x31, - 0x05, 0x16, 0x83, 0x5e, 0x8e, 0x78, 0x93, 0xb6, 0x95, 0x70, 0x56, 0xf5, 0x3a, 0x35, 0x73, 0xac, - 0x47, 0xfd, 0x4c, 0xe7, 0xfc, 0x6c, 0xf1, 0x77, 0xa2, 0x63, 0x5a, 0xa3, 0x0c, 0xc6, 0x3a, 0x8e, - 0x32, 0x73, 0x7f, 0x64, 0x30, 0xc2, 0x9e, 0x23, 0xa1, 0x9e, 0x1f, 0x86, 0xb6, 0xb3, 0x01, 0xdd, - 0x7f, 0xb6, 0xb7, 0x0c, 0x4a, 0x18, 0x86, 0x6e, 0x13, 0x72, 0x1d, 0xf1, 0xd8, 0xa6, 0xba, 0x9a, - 0xcc, 0xf5, 0x6b, 0x0c, 0xe1, 0x5c, 0xf3, 0x19, 0x30, 0x9c, 0x60, 0xd8, 0x74, 0xe1, 0x9a, 0x9d, - 0x6c, 0x90, 0xe6, 0x1a, 0x8a, 0x59, 0xfc, 0x95, 0xc6, 0xb9, 0x04, 0xc3, 0x07, 0xfc, 0xf4, 0x11, - 0x8a, 0xab, 0xd6, 0xc9, 0x5d, 0x4c, 0x76, 0x06, 0x35, 0xef, 0xca, 0x98, 0x00, 0xe5, 0x13, 0x87, - 0xe9, 0x22, 0x96, 0x5e, 0x17, 0x40, 0xa1, 0x8e, 0x3d, 0xf5, 0x09, 0xf8, 0x8f, 0x65, 0x77, 0xb2, - 0xeb, 0xd0, 0x22, 0xf2, 0xda, 0xa5, 0xd3, 0xaa, 0xa9, 0xa6, 0xfa, 0x02, 0x28, 0xc7, 0x2f, 0xc3, - 0x74, 0x2f, 0x4a, 0x06, 0xd1, 0xe6, 0xfa, 0x42, 0x32, 0x69, 0x07, 0x94, 0xda, 0x02, 0xd9, 0x73, - 0xa0, 0x3c, 0x4a, 0xbb, 0x72, 0x16, 0x54, 0xd6, 0xa3, 0x05, 0xce, 0x77, 0xe4, 0x62, 0xa6, 0xb7, - 0xed, 0x3c, 0x4e, 0x33, 0xcf, 0x86, 0x4b, 0x3b, 0x69, 0xff, 0xbf, 0xa2, 0x29, 0xaf, 0x2d, 0xef, - 0x1d, 0xe8, 0xf2, 0xfe, 0x81, 0x2e, 0xff, 0x3a, 0xd0, 0xe5, 0xf7, 0x87, 0xba, 0xb4, 0x7f, 0xa8, - 0x4b, 0xdf, 0x0f, 0x75, 0xe9, 0xe5, 0xdc, 0xa9, 0x9f, 0x35, 0x11, 0x7b, 0xf6, 0x75, 0x73, 0x8a, - 0xec, 0xeb, 0x7d, 0xed, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0xe8, 0x90, 0x24, 0x8f, 0x06, - 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 { - // Send defines a method for sending coins from one account to another account. - Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) - // MultiSend defines a method for sending coins from some accounts to other accounts. - MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) - // UpdateParams defines a governance operation for updating the x/bank module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag - // on any number of Denoms. Only the entries to add or update should be - // included. Entries that already exist in the store, but that aren't - // included in this message, will be left unchanged. - // - // Since: cosmos-sdk 0.47 - SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) Send(ctx context.Context, in *MsgSend, opts ...grpc.CallOption) (*MsgSendResponse, error) { - out := new(MsgSendResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/Send", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) MultiSend(ctx context.Context, in *MsgMultiSend, opts ...grpc.CallOption) (*MsgMultiSendResponse, error) { - out := new(MsgMultiSendResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/MultiSend", 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, "/cosmos.bank.v1beta1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SetSendEnabled(ctx context.Context, in *MsgSetSendEnabled, opts ...grpc.CallOption) (*MsgSetSendEnabledResponse, error) { - out := new(MsgSetSendEnabledResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Msg/SetSendEnabled", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // Send defines a method for sending coins from one account to another account. - Send(context.Context, *MsgSend) (*MsgSendResponse, error) - // MultiSend defines a method for sending coins from some accounts to other accounts. - MultiSend(context.Context, *MsgMultiSend) (*MsgMultiSendResponse, error) - // UpdateParams defines a governance operation for updating the x/bank module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // SetSendEnabled is a governance operation for setting the SendEnabled flag - // on any number of Denoms. Only the entries to add or update should be - // included. Entries that already exist in the store, but that aren't - // included in this message, will be left unchanged. - // - // Since: cosmos-sdk 0.47 - SetSendEnabled(context.Context, *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) Send(ctx context.Context, req *MsgSend) (*MsgSendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") -} -func (*UnimplementedMsgServer) MultiSend(ctx context.Context, req *MsgMultiSend) (*MsgMultiSendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method MultiSend not implemented") -} -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) SetSendEnabled(ctx context.Context, req *MsgSetSendEnabled) (*MsgSetSendEnabledResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetSendEnabled not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSend) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Send(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Msg/Send", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Send(ctx, req.(*MsgSend)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_MultiSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgMultiSend) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).MultiSend(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Msg/MultiSend", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).MultiSend(ctx, req.(*MsgMultiSend)) - } - 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: "/cosmos.bank.v1beta1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SetSendEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetSendEnabled) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetSendEnabled(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.bank.v1beta1.Msg/SetSendEnabled", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetSendEnabled(ctx, req.(*MsgSetSendEnabled)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.bank.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Send", - Handler: _Msg_Send_Handler, - }, - { - MethodName: "MultiSend", - Handler: _Msg_MultiSend_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "SetSendEnabled", - Handler: _Msg_SetSendEnabled_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/bank/v1beta1/tx.proto", -} - -func (m *MsgSend) 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 *MsgSend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSend) 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 *MsgSendResponse) 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 *MsgSendResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgMultiSend) 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 *MsgMultiSend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMultiSend) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Outputs) > 0 { - for iNdEx := len(m.Outputs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Outputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Inputs) > 0 { - for iNdEx := len(m.Inputs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Inputs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgMultiSendResponse) 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 *MsgMultiSendResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgMultiSendResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 (m *MsgSetSendEnabled) 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 *MsgSetSendEnabled) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetSendEnabled) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.UseDefaultFor) > 0 { - for iNdEx := len(m.UseDefaultFor) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.UseDefaultFor[iNdEx]) - copy(dAtA[i:], m.UseDefaultFor[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.UseDefaultFor[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.SendEnabled) > 0 { - for iNdEx := len(m.SendEnabled) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SendEnabled[iNdEx].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 *MsgSetSendEnabledResponse) 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 *MsgSetSendEnabledResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetSendEnabledResponse) 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 *MsgSend) 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 *MsgSendResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgMultiSend) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Inputs) > 0 { - for _, e := range m.Inputs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.Outputs) > 0 { - for _, e := range m.Outputs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgMultiSendResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - 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 (m *MsgSetSendEnabled) 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)) - } - if len(m.SendEnabled) > 0 { - for _, e := range m.SendEnabled { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.UseDefaultFor) > 0 { - for _, s := range m.UseDefaultFor { - l = len(s) - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgSetSendEnabledResponse) 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 *MsgSend) 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: MsgSend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSend: 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 *MsgSendResponse) 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: MsgSendResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSendResponse: 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 *MsgMultiSend) 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: MsgMultiSend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMultiSend: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Inputs", 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.Inputs = append(m.Inputs, Input{}) - if err := m.Inputs[len(m.Inputs)-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 Outputs", 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.Outputs = append(m.Outputs, Output{}) - if err := m.Outputs[len(m.Outputs)-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 *MsgMultiSendResponse) 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: MsgMultiSendResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgMultiSendResponse: 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 *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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgSetSendEnabled) 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: MsgSetSendEnabled: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetSendEnabled: 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 SendEnabled", 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.SendEnabled = append(m.SendEnabled, &SendEnabled{}) - if err := m.SendEnabled[len(m.SendEnabled)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UseDefaultFor", 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.UseDefaultFor = append(m.UseDefaultFor, string(dAtA[iNdEx:postIndex])) - 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 *MsgSetSendEnabledResponse) 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: MsgSetSendEnabledResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetSendEnabledResponse: 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") -) diff --git a/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go b/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go deleted file mode 100644 index 7f91e468ae1e..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/capability/types/capability.pb.go +++ /dev/null @@ -1,702 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/capability/v1beta1/capability.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Capability defines an implementation of an object capability. The index -// provided to a Capability must be globally unique. -type Capability struct { - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *Capability) Reset() { *m = Capability{} } -func (*Capability) ProtoMessage() {} -func (*Capability) Descriptor() ([]byte, []int) { - return fileDescriptor_6308261edd8470a9, []int{0} -} -func (m *Capability) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Capability.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 *Capability) XXX_Merge(src proto.Message) { - xxx_messageInfo_Capability.Merge(m, src) -} -func (m *Capability) XXX_Size() int { - return m.Size() -} -func (m *Capability) XXX_DiscardUnknown() { - xxx_messageInfo_Capability.DiscardUnknown(m) -} - -var xxx_messageInfo_Capability proto.InternalMessageInfo - -func (m *Capability) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - -// Owner defines a single capability owner. An owner is defined by the name of -// capability and the module name. -type Owner struct { - Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (m *Owner) Reset() { *m = Owner{} } -func (*Owner) ProtoMessage() {} -func (*Owner) Descriptor() ([]byte, []int) { - return fileDescriptor_6308261edd8470a9, []int{1} -} -func (m *Owner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Owner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Owner.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 *Owner) XXX_Merge(src proto.Message) { - xxx_messageInfo_Owner.Merge(m, src) -} -func (m *Owner) XXX_Size() int { - return m.Size() -} -func (m *Owner) XXX_DiscardUnknown() { - xxx_messageInfo_Owner.DiscardUnknown(m) -} - -var xxx_messageInfo_Owner proto.InternalMessageInfo - -// CapabilityOwners defines a set of owners of a single Capability. The set of -// owners must be unique. -type CapabilityOwners struct { - Owners []Owner `protobuf:"bytes,1,rep,name=owners,proto3" json:"owners"` -} - -func (m *CapabilityOwners) Reset() { *m = CapabilityOwners{} } -func (m *CapabilityOwners) String() string { return proto.CompactTextString(m) } -func (*CapabilityOwners) ProtoMessage() {} -func (*CapabilityOwners) Descriptor() ([]byte, []int) { - return fileDescriptor_6308261edd8470a9, []int{2} -} -func (m *CapabilityOwners) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CapabilityOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CapabilityOwners.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 *CapabilityOwners) XXX_Merge(src proto.Message) { - xxx_messageInfo_CapabilityOwners.Merge(m, src) -} -func (m *CapabilityOwners) XXX_Size() int { - return m.Size() -} -func (m *CapabilityOwners) XXX_DiscardUnknown() { - xxx_messageInfo_CapabilityOwners.DiscardUnknown(m) -} - -var xxx_messageInfo_CapabilityOwners proto.InternalMessageInfo - -func (m *CapabilityOwners) GetOwners() []Owner { - if m != nil { - return m.Owners - } - return nil -} - -func init() { - proto.RegisterType((*Capability)(nil), "cosmos.capability.v1beta1.Capability") - proto.RegisterType((*Owner)(nil), "cosmos.capability.v1beta1.Owner") - proto.RegisterType((*CapabilityOwners)(nil), "cosmos.capability.v1beta1.CapabilityOwners") -} - -func init() { - proto.RegisterFile("cosmos/capability/v1beta1/capability.proto", fileDescriptor_6308261edd8470a9) -} - -var fileDescriptor_6308261edd8470a9 = []byte{ - // 277 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xca, 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2f, 0x33, - 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0x44, 0x12, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, - 0xa8, 0xd5, 0x43, 0x92, 0x80, 0xaa, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, - 0xb1, 0x20, 0x1a, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x48, 0x49, - 0x83, 0x8b, 0xcb, 0x19, 0xae, 0x5d, 0x48, 0x84, 0x8b, 0x35, 0x33, 0x2f, 0x25, 0xb5, 0x42, 0x82, - 0x51, 0x81, 0x51, 0x83, 0x25, 0x08, 0xc2, 0xb1, 0x62, 0x99, 0xb1, 0x40, 0x9e, 0x41, 0xc9, 0x96, - 0x8b, 0xd5, 0xbf, 0x3c, 0x2f, 0xb5, 0x48, 0x48, 0x8c, 0x8b, 0x2d, 0x37, 0x3f, 0xa5, 0x34, 0x27, - 0x15, 0xac, 0x8a, 0x33, 0x08, 0xca, 0x13, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60, - 0x02, 0x8b, 0x82, 0xd9, 0x56, 0x1c, 0x1d, 0x0b, 0xe4, 0x19, 0xc0, 0xda, 0xc3, 0xb9, 0x04, 0x10, - 0x16, 0x81, 0x0d, 0x2a, 0x16, 0x72, 0xe6, 0x62, 0xcb, 0x07, 0xb3, 0x24, 0x18, 0x15, 0x98, 0x35, - 0xb8, 0x8d, 0x14, 0xf4, 0x70, 0xfa, 0x48, 0x0f, 0xac, 0xc5, 0x89, 0xf3, 0xc4, 0x3d, 0x79, 0x86, - 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0xb5, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, - 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, - 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, - 0x3e, 0x2c, 0x58, 0xc1, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, 0x72, 0x18, 0x97, 0x54, 0x16, - 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xc3, 0xc4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x27, 0x8c, 0xba, - 0x4e, 0x85, 0x01, 0x00, 0x00, -} - -func (m *Capability) 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 *Capability) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintCapability(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Owner) 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 *Owner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Owner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintCapability(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarintCapability(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CapabilityOwners) 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 *CapabilityOwners) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CapabilityOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owners) > 0 { - for iNdEx := len(m.Owners) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Owners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCapability(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintCapability(dAtA []byte, offset int, v uint64) int { - offset -= sovCapability(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Capability) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovCapability(uint64(m.Index)) - } - return n -} - -func (m *Owner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Module) - if l > 0 { - n += 1 + l + sovCapability(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovCapability(uint64(l)) - } - return n -} - -func (m *CapabilityOwners) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Owners) > 0 { - for _, e := range m.Owners { - l = e.Size() - n += 1 + l + sovCapability(uint64(l)) - } - } - return n -} - -func sovCapability(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCapability(x uint64) (n int) { - return sovCapability(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Capability) 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 ErrIntOverflowCapability - } - 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: Capability: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Capability: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCapability - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCapability(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCapability - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Owner) 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 ErrIntOverflowCapability - } - 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: Owner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Owner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCapability - } - 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 ErrInvalidLengthCapability - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCapability - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Module = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowCapability - } - 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 ErrInvalidLengthCapability - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCapability - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCapability(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCapability - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CapabilityOwners) 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 ErrIntOverflowCapability - } - 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: CapabilityOwners: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CapabilityOwners: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCapability - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCapability - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCapability - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owners = append(m.Owners, Owner{}) - if err := m.Owners[len(m.Owners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCapability(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCapability - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipCapability(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, ErrIntOverflowCapability - } - 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, ErrIntOverflowCapability - } - 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, ErrIntOverflowCapability - } - 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, ErrInvalidLengthCapability - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCapability - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCapability - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCapability = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCapability = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCapability = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go deleted file mode 100644 index 785d99b51b94..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/capability/types/genesis.pb.go +++ /dev/null @@ -1,586 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/capability/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisOwners defines the capability owners with their corresponding index. -type GenesisOwners struct { - // index is the index of the capability owner. - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - // index_owners are the owners at the given index. - IndexOwners CapabilityOwners `protobuf:"bytes,2,opt,name=index_owners,json=indexOwners,proto3" json:"index_owners"` -} - -func (m *GenesisOwners) Reset() { *m = GenesisOwners{} } -func (m *GenesisOwners) String() string { return proto.CompactTextString(m) } -func (*GenesisOwners) ProtoMessage() {} -func (*GenesisOwners) Descriptor() ([]byte, []int) { - return fileDescriptor_94922dd16a11c23e, []int{0} -} -func (m *GenesisOwners) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisOwners.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 *GenesisOwners) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisOwners.Merge(m, src) -} -func (m *GenesisOwners) XXX_Size() int { - return m.Size() -} -func (m *GenesisOwners) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisOwners.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisOwners proto.InternalMessageInfo - -func (m *GenesisOwners) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *GenesisOwners) GetIndexOwners() CapabilityOwners { - if m != nil { - return m.IndexOwners - } - return CapabilityOwners{} -} - -// GenesisState defines the capability module's genesis state. -type GenesisState struct { - // index is the capability global index. - Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - // owners represents a map from index to owners of the capability index - // index key is string to allow amino marshalling. - Owners []GenesisOwners `protobuf:"bytes,2,rep,name=owners,proto3" json:"owners"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_94922dd16a11c23e, []int{1} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetIndex() uint64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *GenesisState) GetOwners() []GenesisOwners { - if m != nil { - return m.Owners - } - return nil -} - -func init() { - proto.RegisterType((*GenesisOwners)(nil), "cosmos.capability.v1beta1.GenesisOwners") - proto.RegisterType((*GenesisState)(nil), "cosmos.capability.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/capability/v1beta1/genesis.proto", fileDescriptor_94922dd16a11c23e) -} - -var fileDescriptor_94922dd16a11c23e = []byte{ - // 280 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4e, 0x2c, 0x48, 0x4c, 0xca, 0xcc, 0xc9, 0x2c, 0xa9, 0xd4, 0x2f, 0x33, - 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x84, 0x28, 0xd4, 0x43, 0x28, 0xd4, 0x83, 0x2a, 0x94, 0x12, 0x49, - 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd2, 0x07, 0xb1, 0x20, 0x1a, 0xa4, 0xb4, 0x70, 0x9b, 0x8c, 0x64, - 0x06, 0x44, 0xad, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x08, 0x29, 0x35, 0x30, - 0x72, 0xf1, 0xba, 0x43, 0x5c, 0xe0, 0x5f, 0x9e, 0x97, 0x5a, 0x54, 0x2c, 0x24, 0xc2, 0xc5, 0x9a, - 0x99, 0x97, 0x92, 0x5a, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x12, 0x04, 0xe1, 0x08, 0x45, 0x72, - 0xf1, 0x80, 0x19, 0xf1, 0xf9, 0x60, 0x55, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0xda, 0x7a, - 0x38, 0x9d, 0xab, 0xe7, 0x0c, 0x17, 0x82, 0x18, 0xec, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, - 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xb8, 0xc1, 0x66, 0x41, 0xc4, 0x95, 0x0a, 0xb9, 0x78, 0xa0, 0x2e, - 0x08, 0x2e, 0x49, 0x2c, 0x49, 0xc5, 0xe1, 0x00, 0x6f, 0x2e, 0x36, 0xb8, 0xd5, 0xcc, 0x1a, 0xdc, - 0x46, 0x1a, 0x78, 0xac, 0x46, 0xf1, 0x10, 0xb2, 0xbd, 0x50, 0x23, 0x9c, 0x3c, 0x4f, 0x3c, 0x92, - 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, - 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x3f, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, - 0x39, 0x3f, 0x57, 0x1f, 0x16, 0xb2, 0x60, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x39, 0x98, - 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xe1, 0x68, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, - 0xa2, 0x39, 0xc7, 0xe6, 0xe2, 0x01, 0x00, 0x00, -} - -func (m *GenesisOwners) 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 *GenesisOwners) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.IndexOwners.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Index != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owners) > 0 { - for iNdEx := len(m.Owners) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Owners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Index != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisOwners) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovGenesis(uint64(m.Index)) - } - l = m.IndexOwners.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovGenesis(uint64(m.Index)) - } - if len(m.Owners) > 0 { - for _, e := range m.Owners { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisOwners) 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 ErrIntOverflowGenesis - } - 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: GenesisOwners: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisOwners: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IndexOwners", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.IndexOwners.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owners", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owners = append(m.Owners, GenesisOwners{}) - if err := m.Owners[len(m.Owners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go deleted file mode 100644 index b6f6df03ec71..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.go +++ /dev/null @@ -1,544 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - types "github.com/cometbft/cometbft/proto/tendermint/types" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryParamsRequest defines the request type for querying x/consensus parameters. -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_bf54d1e5df04cee9, []int{0} -} -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 defines the response type for querying x/consensus parameters. -type QueryParamsResponse struct { - // params are the tendermint consensus params stored in the consensus module. - // Please note that `params.version` is not populated in this response, it is - // tracked separately in the x/upgrade module. - Params *types.ConsensusParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` -} - -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_bf54d1e5df04cee9, []int{1} -} -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() *types.ConsensusParams { - if m != nil { - return m.Params - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.consensus.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.consensus.v1.QueryParamsResponse") -} - -func init() { proto.RegisterFile("cosmos/consensus/v1/query.proto", fileDescriptor_bf54d1e5df04cee9) } - -var fileDescriptor_bf54d1e5df04cee9 = []byte{ - // 279 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd0, - 0x83, 0x2b, 0xd0, 0x2b, 0x33, 0x94, 0x92, 0x49, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x4f, 0x2c, - 0xc8, 0xd4, 0x4f, 0xcc, 0xcb, 0xcb, 0x2f, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0x86, 0x68, 0x91, - 0x92, 0x2d, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, - 0x2d, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x85, 0x4a, 0x2b, 0x89, 0x70, 0x09, 0x05, 0x82, 0x2c, - 0x08, 0x00, 0x0b, 0x06, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x28, 0x05, 0x70, 0x09, 0xa3, 0x88, - 0x16, 0x17, 0x80, 0x2c, 0x14, 0xb2, 0xe4, 0x62, 0x83, 0x68, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, - 0x36, 0x52, 0xd4, 0x43, 0x18, 0xae, 0x07, 0x36, 0x5c, 0xcf, 0x19, 0xe6, 0x32, 0xa8, 0x56, 0xa8, - 0x06, 0xa3, 0x2e, 0x46, 0x2e, 0x56, 0xb0, 0x91, 0x42, 0x0d, 0x8c, 0x5c, 0x6c, 0x10, 0x49, 0x21, - 0x75, 0x3d, 0x2c, 0xfe, 0xd1, 0xc3, 0x74, 0x8f, 0x94, 0x06, 0x61, 0x85, 0x10, 0x27, 0x2a, 0x29, - 0x37, 0x5d, 0x7e, 0x32, 0x99, 0x49, 0x56, 0x48, 0x5a, 0x1f, 0x5b, 0x58, 0x42, 0x1c, 0xe3, 0xe4, - 0x71, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, - 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x7a, 0xe9, 0x99, 0x25, 0x19, - 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0x08, 0x03, 0x40, 0x94, 0x6e, 0x71, 0x4a, 0xb6, 0x7e, 0x05, - 0x92, 0x69, 0x60, 0xef, 0x26, 0xb1, 0x81, 0x43, 0xd1, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x1b, - 0xa2, 0x35, 0xa1, 0xba, 0x01, 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 { - // Params queries the parameters of x/consensus_param module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params queries the parameters of x/consensus_param module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/cosmos.consensus.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) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.consensus.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus/v1/query.proto", -} - -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 - if m.Params != nil { - { - 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 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 *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 - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - 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 *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) || (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 m.Params == nil { - m.Params = &types.ConsensusParams{} - } - 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) || (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/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go deleted file mode 100644 index c2bd4deb378f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/consensus/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/consensus/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "consensus", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go deleted file mode 100644 index abb69d2dc8db..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/consensus/types/tx.pb.go +++ /dev/null @@ -1,732 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/consensus/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - types "github.com/cometbft/cometbft/proto/tendermint/types" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - 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 - -// 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 x/consensus parameters to update. - // VersionsParams is not included in this Msg because it is tracked - // separarately in x/upgrade. - // - // NOTE: All parameters must be supplied. - Block *types.BlockParams `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` - Evidence *types.EvidenceParams `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence,omitempty"` - Validator *types.ValidatorParams `protobuf:"bytes,4,opt,name=validator,proto3" json:"validator,omitempty"` -} - -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_2135c60575ab504d, []int{0} -} -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) GetBlock() *types.BlockParams { - if m != nil { - return m.Block - } - return nil -} - -func (m *MsgUpdateParams) GetEvidence() *types.EvidenceParams { - if m != nil { - return m.Evidence - } - return nil -} - -func (m *MsgUpdateParams) GetValidator() *types.ValidatorParams { - if m != nil { - return m.Validator - } - return nil -} - -// 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_2135c60575ab504d, []int{1} -} -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((*MsgUpdateParams)(nil), "cosmos.consensus.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.consensus.v1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("cosmos/consensus/v1/tx.proto", fileDescriptor_2135c60575ab504d) } - -var fileDescriptor_2135c60575ab504d = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0xce, 0xcf, 0x2b, 0x4e, 0xcd, 0x2b, 0x2e, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xea, 0xc1, 0x65, 0xf5, - 0xca, 0x0c, 0xa5, 0x24, 0x21, 0x82, 0xf1, 0x60, 0x25, 0xfa, 0x50, 0x15, 0x60, 0x8e, 0x94, 0x38, - 0xd4, 0xb4, 0xdc, 0xe2, 0x74, 0x90, 0x39, 0xb9, 0xc5, 0xe9, 0x50, 0x09, 0xd9, 0x92, 0xd4, 0xbc, - 0x94, 0xd4, 0xa2, 0xdc, 0xcc, 0xbc, 0x12, 0xfd, 0x92, 0xca, 0x82, 0xd4, 0x62, 0xfd, 0x82, 0xc4, - 0xa2, 0xc4, 0x5c, 0xa8, 0x3e, 0xa5, 0x5e, 0x26, 0x2e, 0x7e, 0xdf, 0xe2, 0xf4, 0xd0, 0x82, 0x94, - 0xc4, 0x92, 0xd4, 0x00, 0xb0, 0x8c, 0x90, 0x19, 0x17, 0x67, 0x62, 0x69, 0x49, 0x46, 0x7e, 0x51, - 0x66, 0x49, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xa7, 0x93, 0xc4, 0xa5, 0x2d, 0xba, 0x22, 0x50, - 0x0b, 0x1d, 0x53, 0x52, 0x8a, 0x52, 0x8b, 0x8b, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, 0x10, - 0x4a, 0x85, 0x8c, 0xb9, 0x58, 0x93, 0x72, 0xf2, 0x93, 0xb3, 0x25, 0x98, 0x14, 0x18, 0x35, 0xb8, - 0x8d, 0x64, 0xf5, 0x10, 0x56, 0xeb, 0x81, 0xad, 0xd6, 0x73, 0x02, 0x49, 0x43, 0x6c, 0x09, 0x82, - 0xa8, 0x15, 0xb2, 0xe1, 0xe2, 0x48, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0x95, 0x60, 0x06, - 0xeb, 0x53, 0xc0, 0xd4, 0xe7, 0x0a, 0x55, 0x01, 0xd5, 0x0a, 0xd7, 0x21, 0x64, 0xcf, 0xc5, 0x59, - 0x96, 0x98, 0x93, 0x99, 0x92, 0x58, 0x92, 0x5f, 0x24, 0xc1, 0x02, 0xd6, 0xae, 0x88, 0xa9, 0x3d, - 0x0c, 0xa6, 0x04, 0xaa, 0x1f, 0xa1, 0xc7, 0x8a, 0xaf, 0xe9, 0xf9, 0x06, 0x2d, 0x84, 0x1f, 0x94, - 0x24, 0xb9, 0xc4, 0xd1, 0x82, 0x23, 0x28, 0xb5, 0xb8, 0x00, 0x14, 0x09, 0x46, 0x99, 0x5c, 0xcc, - 0xbe, 0xc5, 0xe9, 0x42, 0x49, 0x5c, 0x3c, 0x28, 0xa1, 0xa5, 0xa2, 0x87, 0x25, 0xaa, 0xf4, 0xd0, - 0x0c, 0x91, 0xd2, 0x21, 0x46, 0x15, 0xcc, 0x2a, 0x27, 0x8f, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, - 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, - 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, - 0x87, 0x27, 0x20, 0x10, 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x81, 0x94, 0x9a, 0xc0, 0x5e, 0x4f, - 0x62, 0x03, 0x47, 0xb3, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x89, 0xc5, 0x6c, 0x6e, 0x02, - 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 { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - 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) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { - out := new(MsgUpdateParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.consensus.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 { - // UpdateParams defines a governance operation for updating the x/consensus_param module parameters. - // The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -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_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: "/cosmos.consensus.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: "cosmos.consensus.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/consensus/v1/tx.proto", -} - -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 - if m.Validator != nil { - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Evidence != nil { - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Block != nil { - { - size, err := m.Block.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 *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)) - } - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.Evidence != nil { - l = m.Evidence.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.Validator != nil { - l = m.Validator.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 *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 Block", 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 m.Block == nil { - m.Block = &types.BlockParams{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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 m.Evidence == nil { - m.Evidence = &types.EvidenceParams{} - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", 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 m.Validator == nil { - m.Validator = &types.ValidatorParams{} - } - if err := m.Validator.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 *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) || (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/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go deleted file mode 100644 index fbd2981eab58..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/crisis/types/genesis.pb.go +++ /dev/null @@ -1,330 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crisis/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// GenesisState defines the crisis module's genesis state. -type GenesisState struct { - // constant_fee is the fee used to verify the invariant in the crisis - // module. - ConstantFee types.Coin `protobuf:"bytes,3,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_7a9c2781aa8a27ae, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetConstantFee() types.Coin { - if m != nil { - return m.ConstantFee - } - return types.Coin{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.crisis.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/crisis/v1beta1/genesis.proto", fileDescriptor_7a9c2781aa8a27ae) -} - -var fileDescriptor_7a9c2781aa8a27ae = []byte{ - // 241 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2c, 0xce, 0x2c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, - 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x85, 0x28, 0xd2, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0xe4, 0xa0, 0x26, 0x26, 0x25, 0x16, 0xa7, 0xc2, 0xcd, - 0x4b, 0xce, 0xcf, 0xcc, 0x83, 0xca, 0x0b, 0x26, 0xe6, 0x66, 0xe6, 0xe5, 0xeb, 0x83, 0x49, 0x88, - 0x90, 0x52, 0x38, 0x17, 0x8f, 0x3b, 0xc4, 0xc2, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x77, 0x2e, - 0x9e, 0xe4, 0xfc, 0xbc, 0xe2, 0x92, 0xc4, 0xbc, 0x92, 0xf8, 0xb4, 0xd4, 0x54, 0x09, 0x66, 0x05, - 0x46, 0x0d, 0x6e, 0x23, 0x49, 0x3d, 0xa8, 0x33, 0x40, 0x26, 0xc3, 0x1c, 0xa1, 0xe7, 0x9c, 0x9f, - 0x99, 0xe7, 0xc4, 0x79, 0xe2, 0x9e, 0x3c, 0xc3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xb8, 0x61, - 0x3a, 0xdd, 0x52, 0x53, 0x9d, 0x5c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, - 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, - 0x4a, 0x3b, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0x16, 0x04, 0x60, - 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x16, 0x1e, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, - 0x60, 0x67, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x98, 0x45, 0xfd, 0x02, 0x2d, 0x01, 0x00, - 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ConstantFee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ConstantFee.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConstantFee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConstantFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go deleted file mode 100644 index 96458da2529e..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/crisis/types/tx.pb.go +++ /dev/null @@ -1,1028 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crisis/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - 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 - -// MsgVerifyInvariant represents a message to verify a particular invariance. -type MsgVerifyInvariant struct { - // sender is the account address of private key to send coins to fee collector account. - Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` - // name of the invariant module. - InvariantModuleName string `protobuf:"bytes,2,opt,name=invariant_module_name,json=invariantModuleName,proto3" json:"invariant_module_name,omitempty"` - // invariant_route is the msg's invariant route. - InvariantRoute string `protobuf:"bytes,3,opt,name=invariant_route,json=invariantRoute,proto3" json:"invariant_route,omitempty"` -} - -func (m *MsgVerifyInvariant) Reset() { *m = MsgVerifyInvariant{} } -func (m *MsgVerifyInvariant) String() string { return proto.CompactTextString(m) } -func (*MsgVerifyInvariant) ProtoMessage() {} -func (*MsgVerifyInvariant) Descriptor() ([]byte, []int) { - return fileDescriptor_61276163172fe867, []int{0} -} -func (m *MsgVerifyInvariant) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVerifyInvariant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVerifyInvariant.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 *MsgVerifyInvariant) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVerifyInvariant.Merge(m, src) -} -func (m *MsgVerifyInvariant) XXX_Size() int { - return m.Size() -} -func (m *MsgVerifyInvariant) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVerifyInvariant.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVerifyInvariant proto.InternalMessageInfo - -// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. -type MsgVerifyInvariantResponse struct { -} - -func (m *MsgVerifyInvariantResponse) Reset() { *m = MsgVerifyInvariantResponse{} } -func (m *MsgVerifyInvariantResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVerifyInvariantResponse) ProtoMessage() {} -func (*MsgVerifyInvariantResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_61276163172fe867, []int{1} -} -func (m *MsgVerifyInvariantResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVerifyInvariantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVerifyInvariantResponse.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 *MsgVerifyInvariantResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVerifyInvariantResponse.Merge(m, src) -} -func (m *MsgVerifyInvariantResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVerifyInvariantResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVerifyInvariantResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVerifyInvariantResponse proto.InternalMessageInfo - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -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"` - // constant_fee defines the x/crisis parameter. - ConstantFee types.Coin `protobuf:"bytes,2,opt,name=constant_fee,json=constantFee,proto3" json:"constant_fee"` -} - -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_61276163172fe867, []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) GetConstantFee() types.Coin { - if m != nil { - return m.ConstantFee - } - return types.Coin{} -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -// -// Since: cosmos-sdk 0.47 -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_61276163172fe867, []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((*MsgVerifyInvariant)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariant") - proto.RegisterType((*MsgVerifyInvariantResponse)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.crisis.v1beta1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.crisis.v1beta1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("cosmos/crisis/v1beta1/tx.proto", fileDescriptor_61276163172fe867) } - -var fileDescriptor_61276163172fe867 = []byte{ - // 506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6b, 0x13, 0x41, - 0x14, 0xde, 0xb5, 0x58, 0xc8, 0xb4, 0x18, 0x5c, 0x5b, 0x9a, 0x2c, 0xba, 0x91, 0x08, 0xfe, 0x88, - 0x74, 0xd7, 0x44, 0xec, 0xa1, 0x37, 0x23, 0x2a, 0x1e, 0x22, 0xb2, 0xa2, 0x07, 0x2f, 0x61, 0xb2, - 0x3b, 0xd9, 0x0e, 0xba, 0x33, 0x61, 0xde, 0x24, 0x34, 0x37, 0xf1, 0x24, 0x9e, 0xfc, 0x13, 0x7a, - 0xf4, 0x98, 0x83, 0x7f, 0x44, 0xf1, 0x54, 0x3c, 0x89, 0x07, 0x91, 0x04, 0x89, 0x7f, 0x86, 0xec, - 0xce, 0x4c, 0x52, 0x93, 0x8a, 0xb9, 0x24, 0xcb, 0xfb, 0xbe, 0xf7, 0xde, 0xf7, 0x7d, 0x33, 0x83, - 0xbc, 0x88, 0x43, 0xca, 0x21, 0x88, 0x04, 0x05, 0x0a, 0xc1, 0xa0, 0xde, 0x21, 0x12, 0xd7, 0x03, - 0x79, 0xe8, 0xf7, 0x04, 0x97, 0xdc, 0xd9, 0x56, 0xb8, 0xaf, 0x70, 0x5f, 0xe3, 0xee, 0x56, 0xc2, - 0x13, 0x9e, 0x33, 0x82, 0xec, 0x4b, 0x91, 0xdd, 0xb2, 0x22, 0xb7, 0x15, 0xa0, 0x3b, 0x15, 0xb4, - 0xa3, 0xf7, 0xa4, 0x90, 0x04, 0x83, 0x7a, 0xf6, 0xa7, 0x81, 0x8b, 0x38, 0xa5, 0x8c, 0x07, 0xf9, - 0xaf, 0x2e, 0x19, 0x4d, 0x1d, 0x0c, 0x64, 0xa6, 0x28, 0xe2, 0x94, 0x29, 0xbc, 0xfa, 0xdd, 0x46, - 0x4e, 0x0b, 0x92, 0x97, 0x44, 0xd0, 0xee, 0xf0, 0x09, 0x1b, 0x60, 0x41, 0x31, 0x93, 0xce, 0x1d, - 0xb4, 0x0e, 0x84, 0xc5, 0x44, 0x94, 0xec, 0xab, 0xf6, 0xcd, 0x42, 0xb3, 0xf4, 0xf5, 0xf3, 0xee, - 0x96, 0x16, 0x71, 0x3f, 0x8e, 0x05, 0x01, 0x78, 0x2e, 0x05, 0x65, 0x49, 0xa8, 0x79, 0x4e, 0x03, - 0x6d, 0x53, 0xd3, 0xde, 0x4e, 0x79, 0xdc, 0x7f, 0x43, 0xda, 0x0c, 0xa7, 0xa4, 0x74, 0x2e, 0x1b, - 0x10, 0x5e, 0x9a, 0x81, 0xad, 0x1c, 0x7b, 0x8a, 0x53, 0xe2, 0xdc, 0x40, 0xc5, 0x79, 0x8f, 0xe0, - 0x7d, 0x49, 0x4a, 0x6b, 0x39, 0xfb, 0xc2, 0xac, 0x1c, 0x66, 0xd5, 0xfd, 0x7b, 0xef, 0x8f, 0x2a, - 0xd6, 0xef, 0xa3, 0x8a, 0xf5, 0x6e, 0x3a, 0xaa, 0xe9, 0x8d, 0x1f, 0xa6, 0xa3, 0xda, 0x15, 0x25, - 0x69, 0x17, 0xe2, 0xd7, 0xc1, 0xb2, 0x8b, 0xea, 0x65, 0xe4, 0x2e, 0x57, 0x43, 0x02, 0x3d, 0xce, - 0x80, 0x54, 0xbf, 0xd8, 0xa8, 0xd8, 0x82, 0xe4, 0x45, 0x2f, 0xc6, 0x92, 0x3c, 0xc3, 0x02, 0xa7, - 0xe0, 0xec, 0xa1, 0x02, 0xee, 0xcb, 0x03, 0x2e, 0xa8, 0x1c, 0xfe, 0xd7, 0xfa, 0x9c, 0xea, 0x3c, - 0x46, 0x9b, 0x11, 0x67, 0x20, 0x33, 0x23, 0x5d, 0xa2, 0x4c, 0x6f, 0x34, 0xca, 0xbe, 0xee, 0xcb, - 0xd2, 0x37, 0xe7, 0xed, 0x3f, 0xe0, 0x94, 0x35, 0x0b, 0xc7, 0x3f, 0x2a, 0xd6, 0xa7, 0xe9, 0xa8, - 0x66, 0x87, 0x1b, 0xa6, 0xf3, 0x11, 0x21, 0xfb, 0x7b, 0x99, 0xc3, 0xf9, 0xe0, 0xcc, 0xe4, 0xb5, - 0x53, 0x26, 0x0f, 0xcd, 0xe5, 0x5a, 0x10, 0x5e, 0x2d, 0xa3, 0x9d, 0x85, 0x92, 0xf1, 0xd9, 0xf8, - 0x65, 0xa3, 0xb5, 0x16, 0x24, 0x0e, 0x47, 0xc5, 0xc5, 0x63, 0xbe, 0xe5, 0x9f, 0x79, 0x25, 0xfd, - 0xe5, 0xd4, 0xdc, 0xfa, 0xca, 0x54, 0xb3, 0xd8, 0xe9, 0xa2, 0xcd, 0xbf, 0xc2, 0xbd, 0xfe, 0xef, - 0x11, 0xa7, 0x79, 0xae, 0xbf, 0x1a, 0xcf, 0xec, 0x71, 0xcf, 0xbf, 0xcd, 0x72, 0x6c, 0x3e, 0x3c, - 0x1e, 0x7b, 0xf6, 0xc9, 0xd8, 0xb3, 0x7f, 0x8e, 0x3d, 0xfb, 0xe3, 0xc4, 0xb3, 0x4e, 0x26, 0x9e, - 0xf5, 0x6d, 0xe2, 0x59, 0xaf, 0x6e, 0x27, 0x54, 0x1e, 0xf4, 0x3b, 0x7e, 0xc4, 0xd3, 0xc0, 0xbc, - 0xd1, 0x33, 0x32, 0x95, 0xc3, 0x1e, 0x81, 0xce, 0x7a, 0xfe, 0x30, 0xee, 0xfe, 0x09, 0x00, 0x00, - 0xff, 0xff, 0x2a, 0xe4, 0x45, 0xe4, 0xce, 0x03, 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 { - // VerifyInvariant defines a method to verify a particular invariant. - VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) - // UpdateParams defines a governance operation for updating the x/crisis module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - 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) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) { - out := new(MsgVerifyInvariantResponse) - err := c.cc.Invoke(ctx, "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", 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, "/cosmos.crisis.v1beta1.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 { - // VerifyInvariant defines a method to verify a particular invariant. - VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) - // UpdateParams defines a governance operation for updating the x/crisis module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) VerifyInvariant(ctx context.Context, req *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VerifyInvariant 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_VerifyInvariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVerifyInvariant) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).VerifyInvariant(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).VerifyInvariant(ctx, req.(*MsgVerifyInvariant)) - } - 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: "/cosmos.crisis.v1beta1.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: "cosmos.crisis.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "VerifyInvariant", - Handler: _Msg_VerifyInvariant_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/crisis/v1beta1/tx.proto", -} - -func (m *MsgVerifyInvariant) 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 *MsgVerifyInvariant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InvariantRoute) > 0 { - i -= len(m.InvariantRoute) - copy(dAtA[i:], m.InvariantRoute) - i = encodeVarintTx(dAtA, i, uint64(len(m.InvariantRoute))) - i-- - dAtA[i] = 0x1a - } - if len(m.InvariantModuleName) > 0 { - i -= len(m.InvariantModuleName) - copy(dAtA[i:], m.InvariantModuleName) - i = encodeVarintTx(dAtA, i, uint64(len(m.InvariantModuleName))) - i-- - dAtA[i] = 0x12 - } - 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] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgVerifyInvariantResponse) 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 *MsgVerifyInvariantResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVerifyInvariantResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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.ConstantFee.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 *MsgVerifyInvariant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.InvariantModuleName) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.InvariantRoute) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgVerifyInvariantResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - 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.ConstantFee.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 *MsgVerifyInvariant) 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: MsgVerifyInvariant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVerifyInvariant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InvariantModuleName", 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.InvariantModuleName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InvariantRoute", 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.InvariantRoute = string(dAtA[iNdEx:postIndex]) - 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 *MsgVerifyInvariantResponse) 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: MsgVerifyInvariantResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVerifyInvariantResponse: 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 *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 ConstantFee", 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.ConstantFee.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 *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) || (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/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go deleted file mode 100644 index b1d71354fc9f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/distribution/types/distribution.pb.go +++ /dev/null @@ -1,3585 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/distribution.proto - -package types - -import ( - 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/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the set of params for the distribution module. -type Params struct { - CommunityTax github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=community_tax,json=communityTax,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"community_tax"` - // Deprecated: The base_proposer_reward field is deprecated and is no longer used - // in the x/distribution module's reward mechanism. - BaseProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=base_proposer_reward,json=baseProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"base_proposer_reward"` // Deprecated: Do not use. - // Deprecated: The bonus_proposer_reward field is deprecated and is no longer used - // in the x/distribution module's reward mechanism. - BonusProposerReward github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bonus_proposer_reward,json=bonusProposerReward,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bonus_proposer_reward"` // Deprecated: Do not use. - WithdrawAddrEnabled bool `protobuf:"varint,4,opt,name=withdraw_addr_enabled,json=withdrawAddrEnabled,proto3" json:"withdraw_addr_enabled,omitempty"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{0} -} -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) GetWithdrawAddrEnabled() bool { - if m != nil { - return m.WithdrawAddrEnabled - } - return false -} - -// ValidatorHistoricalRewards represents historical rewards for a validator. -// Height is implicit within the store key. -// Cumulative reward ratio is the sum from the zeroeth period -// until this period of rewards / tokens, per the spec. -// The reference count indicates the number of objects -// which might need to reference this historical entry at any point. -// ReferenceCount = -// -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization -type ValidatorHistoricalRewards struct { - CumulativeRewardRatio github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"cumulative_reward_ratio"` - ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty"` -} - -func (m *ValidatorHistoricalRewards) Reset() { *m = ValidatorHistoricalRewards{} } -func (m *ValidatorHistoricalRewards) String() string { return proto.CompactTextString(m) } -func (*ValidatorHistoricalRewards) ProtoMessage() {} -func (*ValidatorHistoricalRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{1} -} -func (m *ValidatorHistoricalRewards) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorHistoricalRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorHistoricalRewards.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 *ValidatorHistoricalRewards) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorHistoricalRewards.Merge(m, src) -} -func (m *ValidatorHistoricalRewards) XXX_Size() int { - return m.Size() -} -func (m *ValidatorHistoricalRewards) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorHistoricalRewards.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorHistoricalRewards proto.InternalMessageInfo - -func (m *ValidatorHistoricalRewards) GetCumulativeRewardRatio() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.CumulativeRewardRatio - } - return nil -} - -func (m *ValidatorHistoricalRewards) GetReferenceCount() uint32 { - if m != nil { - return m.ReferenceCount - } - return 0 -} - -// ValidatorCurrentRewards represents current rewards and current -// period for a validator kept as a running counter and incremented -// each block as long as the validator's tokens remain constant. -type ValidatorCurrentRewards struct { - Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` - Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` -} - -func (m *ValidatorCurrentRewards) Reset() { *m = ValidatorCurrentRewards{} } -func (m *ValidatorCurrentRewards) String() string { return proto.CompactTextString(m) } -func (*ValidatorCurrentRewards) ProtoMessage() {} -func (*ValidatorCurrentRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{2} -} -func (m *ValidatorCurrentRewards) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorCurrentRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorCurrentRewards.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 *ValidatorCurrentRewards) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorCurrentRewards.Merge(m, src) -} -func (m *ValidatorCurrentRewards) XXX_Size() int { - return m.Size() -} -func (m *ValidatorCurrentRewards) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorCurrentRewards.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorCurrentRewards proto.InternalMessageInfo - -func (m *ValidatorCurrentRewards) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Rewards - } - return nil -} - -func (m *ValidatorCurrentRewards) GetPeriod() uint64 { - if m != nil { - return m.Period - } - return 0 -} - -// ValidatorAccumulatedCommission represents accumulated commission -// for a validator kept as a running counter, can be withdrawn at any time. -type ValidatorAccumulatedCommission struct { - Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=commission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"commission"` -} - -func (m *ValidatorAccumulatedCommission) Reset() { *m = ValidatorAccumulatedCommission{} } -func (m *ValidatorAccumulatedCommission) String() string { return proto.CompactTextString(m) } -func (*ValidatorAccumulatedCommission) ProtoMessage() {} -func (*ValidatorAccumulatedCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{3} -} -func (m *ValidatorAccumulatedCommission) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorAccumulatedCommission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorAccumulatedCommission.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 *ValidatorAccumulatedCommission) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorAccumulatedCommission.Merge(m, src) -} -func (m *ValidatorAccumulatedCommission) XXX_Size() int { - return m.Size() -} -func (m *ValidatorAccumulatedCommission) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorAccumulatedCommission.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorAccumulatedCommission proto.InternalMessageInfo - -func (m *ValidatorAccumulatedCommission) GetCommission() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Commission - } - return nil -} - -// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -// for a validator inexpensive to track, allows simple sanity checks. -type ValidatorOutstandingRewards struct { - Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` -} - -func (m *ValidatorOutstandingRewards) Reset() { *m = ValidatorOutstandingRewards{} } -func (m *ValidatorOutstandingRewards) String() string { return proto.CompactTextString(m) } -func (*ValidatorOutstandingRewards) ProtoMessage() {} -func (*ValidatorOutstandingRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{4} -} -func (m *ValidatorOutstandingRewards) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorOutstandingRewards) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorOutstandingRewards.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 *ValidatorOutstandingRewards) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorOutstandingRewards.Merge(m, src) -} -func (m *ValidatorOutstandingRewards) XXX_Size() int { - return m.Size() -} -func (m *ValidatorOutstandingRewards) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorOutstandingRewards.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorOutstandingRewards proto.InternalMessageInfo - -func (m *ValidatorOutstandingRewards) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Rewards - } - return nil -} - -// ValidatorSlashEvent represents a validator slash event. -// Height is implicit within the store key. -// This is needed to calculate appropriate amount of staking tokens -// for delegations which are withdrawn after a slash has occurred. -type ValidatorSlashEvent struct { - ValidatorPeriod uint64 `protobuf:"varint,1,opt,name=validator_period,json=validatorPeriod,proto3" json:"validator_period,omitempty"` - Fraction github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=fraction,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"fraction"` -} - -func (m *ValidatorSlashEvent) Reset() { *m = ValidatorSlashEvent{} } -func (m *ValidatorSlashEvent) String() string { return proto.CompactTextString(m) } -func (*ValidatorSlashEvent) ProtoMessage() {} -func (*ValidatorSlashEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{5} -} -func (m *ValidatorSlashEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorSlashEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorSlashEvent.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 *ValidatorSlashEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorSlashEvent.Merge(m, src) -} -func (m *ValidatorSlashEvent) XXX_Size() int { - return m.Size() -} -func (m *ValidatorSlashEvent) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorSlashEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorSlashEvent proto.InternalMessageInfo - -func (m *ValidatorSlashEvent) GetValidatorPeriod() uint64 { - if m != nil { - return m.ValidatorPeriod - } - return 0 -} - -// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. -type ValidatorSlashEvents struct { - ValidatorSlashEvents []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` -} - -func (m *ValidatorSlashEvents) Reset() { *m = ValidatorSlashEvents{} } -func (*ValidatorSlashEvents) ProtoMessage() {} -func (*ValidatorSlashEvents) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{6} -} -func (m *ValidatorSlashEvents) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorSlashEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorSlashEvents.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 *ValidatorSlashEvents) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorSlashEvents.Merge(m, src) -} -func (m *ValidatorSlashEvents) XXX_Size() int { - return m.Size() -} -func (m *ValidatorSlashEvents) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorSlashEvents.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorSlashEvents proto.InternalMessageInfo - -func (m *ValidatorSlashEvents) GetValidatorSlashEvents() []ValidatorSlashEvent { - if m != nil { - return m.ValidatorSlashEvents - } - return nil -} - -// FeePool is the global fee pool for distribution. -type FeePool struct { - CommunityPool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=community_pool,json=communityPool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"community_pool"` -} - -func (m *FeePool) Reset() { *m = FeePool{} } -func (m *FeePool) String() string { return proto.CompactTextString(m) } -func (*FeePool) ProtoMessage() {} -func (*FeePool) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{7} -} -func (m *FeePool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FeePool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FeePool.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 *FeePool) XXX_Merge(src proto.Message) { - xxx_messageInfo_FeePool.Merge(m, src) -} -func (m *FeePool) XXX_Size() int { - return m.Size() -} -func (m *FeePool) XXX_DiscardUnknown() { - xxx_messageInfo_FeePool.DiscardUnknown(m) -} - -var xxx_messageInfo_FeePool proto.InternalMessageInfo - -func (m *FeePool) GetCommunityPool() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.CommunityPool - } - return nil -} - -// TokenizeShareRecordReward represents the properties of tokenize share -type TokenizeShareRecordReward struct { - RecordId uint64 `protobuf:"varint,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` - Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` -} - -func (m *TokenizeShareRecordReward) Reset() { *m = TokenizeShareRecordReward{} } -func (m *TokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } -func (*TokenizeShareRecordReward) ProtoMessage() {} -func (*TokenizeShareRecordReward) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{8} -} -func (m *TokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenizeShareRecordReward.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 *TokenizeShareRecordReward) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenizeShareRecordReward.Merge(m, src) -} -func (m *TokenizeShareRecordReward) XXX_Size() int { - return m.Size() -} -func (m *TokenizeShareRecordReward) XXX_DiscardUnknown() { - xxx_messageInfo_TokenizeShareRecordReward.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenizeShareRecordReward proto.InternalMessageInfo - -// CommunityPoolSpendProposal details a proposal for use of community funds, -// together with how many coins are proposed to be spent, and to which -// recipient account. -// -// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no -// longer a need for an explicit CommunityPoolSpendProposal. To spend community -// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov -// module via a v1 governance proposal. -// -// Deprecated: Do not use. -type CommunityPoolSpendProposal 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"` - Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` -} - -func (m *CommunityPoolSpendProposal) Reset() { *m = CommunityPoolSpendProposal{} } -func (*CommunityPoolSpendProposal) ProtoMessage() {} -func (*CommunityPoolSpendProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{9} -} -func (m *CommunityPoolSpendProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CommunityPoolSpendProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CommunityPoolSpendProposal.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 *CommunityPoolSpendProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommunityPoolSpendProposal.Merge(m, src) -} -func (m *CommunityPoolSpendProposal) XXX_Size() int { - return m.Size() -} -func (m *CommunityPoolSpendProposal) XXX_DiscardUnknown() { - xxx_messageInfo_CommunityPoolSpendProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_CommunityPoolSpendProposal proto.InternalMessageInfo - -// DelegatorStartingInfo represents the starting info for a delegator reward -// period. It tracks the previous validator period, the delegation's amount of -// staking token, and the creation height (to check later on if any slashes have -// occurred). NOTE: Even though validators are slashed to whole staking tokens, -// the delegators within the validator may be left with less than a full token, -// thus sdk.Dec is used. -type DelegatorStartingInfo struct { - PreviousPeriod uint64 `protobuf:"varint,1,opt,name=previous_period,json=previousPeriod,proto3" json:"previous_period,omitempty"` - Stake github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=stake,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"stake"` - Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"creation_height"` -} - -func (m *DelegatorStartingInfo) Reset() { *m = DelegatorStartingInfo{} } -func (m *DelegatorStartingInfo) String() string { return proto.CompactTextString(m) } -func (*DelegatorStartingInfo) ProtoMessage() {} -func (*DelegatorStartingInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{10} -} -func (m *DelegatorStartingInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelegatorStartingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelegatorStartingInfo.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 *DelegatorStartingInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelegatorStartingInfo.Merge(m, src) -} -func (m *DelegatorStartingInfo) XXX_Size() int { - return m.Size() -} -func (m *DelegatorStartingInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DelegatorStartingInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_DelegatorStartingInfo proto.InternalMessageInfo - -func (m *DelegatorStartingInfo) GetPreviousPeriod() uint64 { - if m != nil { - return m.PreviousPeriod - } - return 0 -} - -func (m *DelegatorStartingInfo) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -// DelegationDelegatorReward represents the properties -// of a delegator's delegation reward. -type DelegationDelegatorReward struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Reward github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"reward"` -} - -func (m *DelegationDelegatorReward) Reset() { *m = DelegationDelegatorReward{} } -func (m *DelegationDelegatorReward) String() string { return proto.CompactTextString(m) } -func (*DelegationDelegatorReward) ProtoMessage() {} -func (*DelegationDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{11} -} -func (m *DelegationDelegatorReward) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelegationDelegatorReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelegationDelegatorReward.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 *DelegationDelegatorReward) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelegationDelegatorReward.Merge(m, src) -} -func (m *DelegationDelegatorReward) XXX_Size() int { - return m.Size() -} -func (m *DelegationDelegatorReward) XXX_DiscardUnknown() { - xxx_messageInfo_DelegationDelegatorReward.DiscardUnknown(m) -} - -var xxx_messageInfo_DelegationDelegatorReward proto.InternalMessageInfo - -// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -// with a deposit -type CommunityPoolSpendProposalWithDeposit 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"` - Recipient string `protobuf:"bytes,3,opt,name=recipient,proto3" json:"recipient,omitempty"` - Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,omitempty"` - Deposit string `protobuf:"bytes,5,opt,name=deposit,proto3" json:"deposit,omitempty"` -} - -func (m *CommunityPoolSpendProposalWithDeposit) Reset() { *m = CommunityPoolSpendProposalWithDeposit{} } -func (m *CommunityPoolSpendProposalWithDeposit) String() string { return proto.CompactTextString(m) } -func (*CommunityPoolSpendProposalWithDeposit) ProtoMessage() {} -func (*CommunityPoolSpendProposalWithDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_cd78a31ea281a992, []int{12} -} -func (m *CommunityPoolSpendProposalWithDeposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *CommunityPoolSpendProposalWithDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.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 *CommunityPoolSpendProposalWithDeposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.Merge(m, src) -} -func (m *CommunityPoolSpendProposalWithDeposit) XXX_Size() int { - return m.Size() -} -func (m *CommunityPoolSpendProposalWithDeposit) XXX_DiscardUnknown() { - xxx_messageInfo_CommunityPoolSpendProposalWithDeposit.DiscardUnknown(m) -} - -var xxx_messageInfo_CommunityPoolSpendProposalWithDeposit proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "cosmos.distribution.v1beta1.Params") - proto.RegisterType((*ValidatorHistoricalRewards)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewards") - proto.RegisterType((*ValidatorCurrentRewards)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewards") - proto.RegisterType((*ValidatorAccumulatedCommission)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission") - proto.RegisterType((*ValidatorOutstandingRewards)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewards") - proto.RegisterType((*ValidatorSlashEvent)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvent") - proto.RegisterType((*ValidatorSlashEvents)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEvents") - proto.RegisterType((*FeePool)(nil), "cosmos.distribution.v1beta1.FeePool") - proto.RegisterType((*TokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.TokenizeShareRecordReward") - proto.RegisterType((*CommunityPoolSpendProposal)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposal") - proto.RegisterType((*DelegatorStartingInfo)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfo") - proto.RegisterType((*DelegationDelegatorReward)(nil), "cosmos.distribution.v1beta1.DelegationDelegatorReward") - proto.RegisterType((*CommunityPoolSpendProposalWithDeposit)(nil), "cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit") -} - -func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/distribution.proto", fileDescriptor_cd78a31ea281a992) -} - -var fileDescriptor_cd78a31ea281a992 = []byte{ - // 1044 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0x41, 0x4f, 0x1b, 0x47, - 0x14, 0xf6, 0x04, 0x30, 0x30, 0x69, 0xa0, 0x19, 0x0c, 0x31, 0x26, 0xb2, 0xd1, 0x4a, 0x4d, 0x09, - 0x0d, 0xa6, 0x24, 0xaa, 0x54, 0x59, 0x55, 0x25, 0x6c, 0x53, 0x35, 0xa7, 0xa0, 0x25, 0x6a, 0xab, - 0x5e, 0x56, 0xe3, 0xdd, 0xc1, 0x1e, 0xb1, 0x3b, 0xb3, 0x9d, 0x19, 0x1b, 0x52, 0xa9, 0xf7, 0x28, - 0x87, 0xb6, 0x47, 0xd4, 0x13, 0x6a, 0x2f, 0x51, 0xa5, 0x4a, 0x1c, 0xf8, 0x11, 0x51, 0x4f, 0x51, - 0x0e, 0x6d, 0x15, 0x55, 0xb4, 0x82, 0x03, 0x55, 0x7f, 0x45, 0x35, 0x3b, 0xe3, 0xb5, 0x21, 0x94, - 0xa6, 0x49, 0x50, 0x2e, 0xe0, 0xf7, 0xde, 0xee, 0xfb, 0xbe, 0xef, 0xcd, 0x7b, 0x6f, 0x16, 0x96, - 0x7d, 0x2e, 0x23, 0x2e, 0x17, 0x03, 0x2a, 0x95, 0xa0, 0x8d, 0xb6, 0xa2, 0x9c, 0x2d, 0x76, 0x96, - 0x1a, 0x44, 0xe1, 0xa5, 0x63, 0xce, 0x72, 0x2c, 0xb8, 0xe2, 0x68, 0xc6, 0x3c, 0x5f, 0x3e, 0x16, - 0xb2, 0xcf, 0x17, 0x72, 0x4d, 0xde, 0xe4, 0xc9, 0x73, 0x8b, 0xfa, 0x97, 0x79, 0xa5, 0x50, 0xb4, - 0x10, 0x0d, 0x2c, 0x49, 0x9a, 0xda, 0xe7, 0xd4, 0xa6, 0x2c, 0x4c, 0x9b, 0xb8, 0x67, 0x5e, 0xb4, - 0xf9, 0x4d, 0xe8, 0x32, 0x8e, 0x28, 0xe3, 0x8b, 0xc9, 0x5f, 0xe3, 0x72, 0x76, 0x07, 0x60, 0x76, - 0x15, 0x0b, 0x1c, 0x49, 0x84, 0xe1, 0x25, 0x9f, 0x47, 0x51, 0x9b, 0x51, 0x75, 0xcf, 0x53, 0x78, - 0x2b, 0x0f, 0x66, 0xc1, 0xdc, 0x68, 0xf5, 0x83, 0x47, 0xfb, 0xa5, 0xcc, 0xd3, 0xfd, 0xd2, 0xb5, - 0x26, 0x55, 0xad, 0x76, 0xa3, 0xec, 0xf3, 0xc8, 0x66, 0xb5, 0xff, 0x16, 0x64, 0xb0, 0xb1, 0xa8, - 0xee, 0xc5, 0x44, 0x96, 0xeb, 0xc4, 0x7f, 0xb2, 0xb7, 0x00, 0x2d, 0x68, 0x9d, 0xf8, 0xee, 0x1b, - 0x69, 0xca, 0xbb, 0x78, 0x0b, 0xc5, 0x30, 0xa7, 0x69, 0x6b, 0x6e, 0x31, 0x97, 0x44, 0x78, 0x82, - 0x6c, 0x62, 0x11, 0xe4, 0x2f, 0x24, 0x48, 0x1f, 0xbe, 0x0c, 0x52, 0x1e, 0xb8, 0x48, 0xe7, 0x5e, - 0xb5, 0xa9, 0xdd, 0x24, 0x33, 0x12, 0x70, 0xb2, 0xc1, 0x59, 0x5b, 0x3e, 0x03, 0x39, 0xf0, 0x4a, - 0x20, 0x27, 0x92, 0xe4, 0x27, 0x30, 0x6f, 0xc2, 0xc9, 0x4d, 0xaa, 0x5a, 0x81, 0xc0, 0x9b, 0x1e, - 0x0e, 0x02, 0xe1, 0x11, 0x86, 0x1b, 0x21, 0x09, 0xf2, 0x83, 0xb3, 0x60, 0x6e, 0xc4, 0x9d, 0xe8, - 0x06, 0x97, 0x83, 0x40, 0xac, 0x98, 0x50, 0xe5, 0xfa, 0xf6, 0x4e, 0x29, 0xf3, 0xe0, 0x68, 0x77, - 0x7e, 0xb6, 0x0f, 0x77, 0xeb, 0x78, 0x1f, 0x99, 0x73, 0x72, 0x7e, 0x01, 0xb0, 0xf0, 0x09, 0x0e, - 0x69, 0x80, 0x15, 0x17, 0x1f, 0x53, 0xa9, 0xb8, 0xa0, 0x3e, 0x0e, 0x0d, 0xb8, 0x44, 0x5f, 0x03, - 0x78, 0xc5, 0x6f, 0x47, 0xed, 0x10, 0x2b, 0xda, 0x21, 0x56, 0xae, 0x27, 0xb0, 0xa2, 0x3c, 0x0f, - 0x66, 0x07, 0xe6, 0x2e, 0xde, 0xbc, 0x6a, 0xbb, 0xb4, 0xac, 0xeb, 0xd5, 0xed, 0x36, 0x2d, 0xa8, - 0xc6, 0x29, 0xab, 0xbe, 0xaf, 0x4b, 0xf2, 0xe3, 0x1f, 0xa5, 0x77, 0x9e, 0xaf, 0x24, 0xfa, 0x1d, - 0xf9, 0xf0, 0x68, 0x77, 0x1e, 0xb8, 0x93, 0x3d, 0x58, 0x43, 0xc6, 0xd5, 0xa0, 0xe8, 0x6d, 0x38, - 0x2e, 0xc8, 0x3a, 0x11, 0x84, 0xf9, 0xc4, 0xf3, 0x79, 0x9b, 0xa9, 0xe4, 0xbc, 0x2f, 0xb9, 0x63, - 0xa9, 0xbb, 0xa6, 0xbd, 0xce, 0x0f, 0x00, 0x5e, 0x49, 0x85, 0xd5, 0xda, 0x42, 0x10, 0xa6, 0xba, - 0xaa, 0x62, 0x38, 0x6c, 0x94, 0xc8, 0x73, 0x16, 0xd1, 0x85, 0x41, 0x53, 0x30, 0x1b, 0x13, 0x41, - 0xb9, 0xe9, 0xce, 0x41, 0xd7, 0x5a, 0xce, 0x36, 0x80, 0xc5, 0x94, 0xe5, 0xb2, 0x6f, 0x35, 0x93, - 0xa0, 0xc6, 0xa3, 0x88, 0x4a, 0x49, 0x39, 0x43, 0x1d, 0x08, 0xfd, 0xd4, 0x3a, 0x67, 0xbe, 0x7d, - 0x48, 0xce, 0x37, 0x00, 0xce, 0xa4, 0xd4, 0xee, 0xb4, 0x95, 0x54, 0x98, 0x05, 0x94, 0x35, 0x5f, - 0x5b, 0x11, 0x9d, 0xef, 0x00, 0x9c, 0x48, 0x19, 0xad, 0x85, 0x58, 0xb6, 0x56, 0x3a, 0x84, 0x29, - 0x74, 0x1d, 0xbe, 0xd9, 0xe9, 0xba, 0x3d, 0x5b, 0x66, 0x90, 0x94, 0x79, 0x3c, 0xf5, 0xaf, 0x26, - 0x6e, 0xf4, 0x19, 0x1c, 0x59, 0x17, 0xd8, 0xd7, 0x13, 0x60, 0xf7, 0xc4, 0xcb, 0x6d, 0xa4, 0x34, - 0x9b, 0x2e, 0x57, 0xee, 0x14, 0x72, 0x12, 0x7d, 0x01, 0xa7, 0x7a, 0xec, 0xa4, 0x0e, 0x78, 0x24, - 0x89, 0xd8, 0xb2, 0xbd, 0x5b, 0x3e, 0x63, 0x6d, 0x97, 0x4f, 0x49, 0x59, 0x1d, 0xd5, 0x94, 0x4d, - 0x6d, 0x72, 0x9d, 0x53, 0x20, 0x2b, 0x83, 0x7a, 0xfe, 0x9d, 0xfb, 0x00, 0x0e, 0x7f, 0x44, 0xc8, - 0x2a, 0xe7, 0x21, 0xfa, 0x0a, 0x8e, 0xf5, 0xd6, 0x71, 0xcc, 0x79, 0x78, 0xce, 0x67, 0xd6, 0x5b, - 0xfe, 0x1a, 0xde, 0xf9, 0x09, 0xc0, 0xe9, 0xbb, 0x7c, 0x83, 0x30, 0xfa, 0x25, 0x59, 0x6b, 0x61, - 0x41, 0x5c, 0xe2, 0x73, 0x11, 0xd8, 0x15, 0x37, 0x03, 0x47, 0x45, 0x62, 0x7b, 0xb4, 0x7b, 0x70, - 0x23, 0xc6, 0x71, 0x3b, 0x40, 0x14, 0x66, 0xd3, 0xbd, 0xfe, 0xdf, 0x8c, 0x6f, 0xbd, 0x00, 0x63, - 0xd7, 0x02, 0x54, 0x46, 0xee, 0xef, 0x94, 0x32, 0xdb, 0x3b, 0x25, 0xe0, 0x3c, 0xb8, 0x00, 0x0b, - 0xb5, 0x7e, 0x05, 0x6b, 0x31, 0x61, 0x81, 0xd9, 0xcc, 0x38, 0x44, 0x39, 0x38, 0xa4, 0xa8, 0x0a, - 0x89, 0xb9, 0xd4, 0x5c, 0x63, 0xa0, 0x59, 0x78, 0x31, 0x20, 0xd2, 0x17, 0x34, 0xee, 0xb5, 0x97, - 0xdb, 0xef, 0x42, 0x57, 0x13, 0xa1, 0x34, 0xa6, 0x84, 0x29, 0x73, 0x67, 0xb8, 0x3d, 0x07, 0x6a, - 0xc1, 0x2c, 0x8e, 0x92, 0x8d, 0x36, 0x98, 0x28, 0x9d, 0x3e, 0x55, 0x69, 0x22, 0xf3, 0x3d, 0x2b, - 0x73, 0xee, 0x39, 0x64, 0xf6, 0x9d, 0x8a, 0xcd, 0x5f, 0xb9, 0x61, 0x85, 0x66, 0xfe, 0xda, 0x29, - 0x65, 0x7e, 0xde, 0x5b, 0x28, 0x58, 0xa0, 0x26, 0xef, 0xf4, 0xe1, 0x30, 0xa5, 0x69, 0x02, 0xe7, - 0x29, 0x80, 0x93, 0x75, 0x12, 0x92, 0x66, 0xd2, 0x66, 0x0a, 0x0b, 0x45, 0x59, 0xf3, 0x36, 0x5b, - 0x4f, 0x96, 0x71, 0x2c, 0x48, 0x87, 0x72, 0x7d, 0x25, 0xf6, 0xcf, 0xdd, 0x58, 0xd7, 0x6d, 0xc7, - 0xce, 0x85, 0x43, 0x52, 0xe1, 0x0d, 0xf2, 0x4a, 0x66, 0xce, 0xa4, 0x42, 0x75, 0x98, 0x6d, 0x11, - 0xda, 0x6c, 0x99, 0x4a, 0x0e, 0x56, 0x6f, 0xfc, 0xbd, 0x5f, 0x1a, 0xf7, 0x05, 0xd1, 0xd7, 0x04, - 0xf3, 0x4c, 0xe8, 0xfb, 0xa3, 0xdd, 0xf9, 0x93, 0x3e, 0x5b, 0x0a, 0x63, 0x38, 0xbf, 0x03, 0x38, - 0x6d, 0xc5, 0x51, 0xce, 0x52, 0x99, 0xb6, 0x33, 0x57, 0xe0, 0xe5, 0xde, 0xec, 0xea, 0xdb, 0x97, - 0x48, 0x69, 0xbf, 0x64, 0xf2, 0x4f, 0xf6, 0x16, 0x72, 0x96, 0xd5, 0xb2, 0x89, 0xac, 0x29, 0xa1, - 0xf7, 0x63, 0x6f, 0x19, 0x59, 0x3f, 0x62, 0xff, 0xab, 0x87, 0x5f, 0x7c, 0xea, 0x9e, 0x6d, 0xe4, - 0x5f, 0x01, 0x7c, 0xeb, 0xdf, 0x1b, 0xf9, 0x53, 0xaa, 0x5a, 0x75, 0x12, 0x73, 0x49, 0xd5, 0x39, - 0xf5, 0xf4, 0x54, 0x5f, 0x4f, 0xeb, 0x90, 0xb5, 0x50, 0x1e, 0x0e, 0x07, 0x06, 0x38, 0x3f, 0x94, - 0x04, 0xba, 0x66, 0xe5, 0x5a, 0x97, 0xfb, 0xd9, 0x7d, 0x59, 0xbd, 0xf3, 0xf0, 0xa0, 0x08, 0x1e, - 0x1d, 0x14, 0xc1, 0xe3, 0x83, 0x22, 0xf8, 0xf3, 0xa0, 0x08, 0xbe, 0x3d, 0x2c, 0x66, 0x1e, 0x1f, - 0x16, 0x33, 0xbf, 0x1d, 0x16, 0x33, 0x9f, 0x2f, 0x9d, 0x59, 0xbb, 0x13, 0x9f, 0x42, 0x49, 0x29, - 0x1b, 0xd9, 0xe4, 0x1b, 0xf6, 0xd6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x1c, 0x82, 0xe5, - 0x76, 0x0b, 0x00, 0x00, -} - -func (this *Params) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Params) - if !ok { - that2, ok := that.(Params) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.CommunityTax.Equal(that1.CommunityTax) { - return false - } - if !this.BaseProposerReward.Equal(that1.BaseProposerReward) { - return false - } - if !this.BonusProposerReward.Equal(that1.BonusProposerReward) { - return false - } - if this.WithdrawAddrEnabled != that1.WithdrawAddrEnabled { - return false - } - return true -} -func (this *ValidatorHistoricalRewards) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorHistoricalRewards) - if !ok { - that2, ok := that.(ValidatorHistoricalRewards) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.CumulativeRewardRatio) != len(that1.CumulativeRewardRatio) { - return false - } - for i := range this.CumulativeRewardRatio { - if !this.CumulativeRewardRatio[i].Equal(&that1.CumulativeRewardRatio[i]) { - return false - } - } - if this.ReferenceCount != that1.ReferenceCount { - return false - } - return true -} -func (this *ValidatorCurrentRewards) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorCurrentRewards) - if !ok { - that2, ok := that.(ValidatorCurrentRewards) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Rewards) != len(that1.Rewards) { - return false - } - for i := range this.Rewards { - if !this.Rewards[i].Equal(&that1.Rewards[i]) { - return false - } - } - if this.Period != that1.Period { - return false - } - return true -} -func (this *ValidatorAccumulatedCommission) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorAccumulatedCommission) - if !ok { - that2, ok := that.(ValidatorAccumulatedCommission) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Commission) != len(that1.Commission) { - return false - } - for i := range this.Commission { - if !this.Commission[i].Equal(&that1.Commission[i]) { - return false - } - } - return true -} -func (this *ValidatorOutstandingRewards) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorOutstandingRewards) - if !ok { - that2, ok := that.(ValidatorOutstandingRewards) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Rewards) != len(that1.Rewards) { - return false - } - for i := range this.Rewards { - if !this.Rewards[i].Equal(&that1.Rewards[i]) { - return false - } - } - return true -} -func (this *ValidatorSlashEvent) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorSlashEvent) - if !ok { - that2, ok := that.(ValidatorSlashEvent) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ValidatorPeriod != that1.ValidatorPeriod { - return false - } - if !this.Fraction.Equal(that1.Fraction) { - return false - } - return true -} -func (this *ValidatorSlashEvents) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorSlashEvents) - if !ok { - that2, ok := that.(ValidatorSlashEvents) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.ValidatorSlashEvents) != len(that1.ValidatorSlashEvents) { - return false - } - for i := range this.ValidatorSlashEvents { - if !this.ValidatorSlashEvents[i].Equal(&that1.ValidatorSlashEvents[i]) { - return false - } - } - return true -} -func (this *FeePool) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*FeePool) - if !ok { - that2, ok := that.(FeePool) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.CommunityPool) != len(that1.CommunityPool) { - return false - } - for i := range this.CommunityPool { - if !this.CommunityPool[i].Equal(&that1.CommunityPool[i]) { - return false - } - } - return true -} -func (this *TokenizeShareRecordReward) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TokenizeShareRecordReward) - if !ok { - that2, ok := that.(TokenizeShareRecordReward) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.RecordId != that1.RecordId { - return false - } - if len(this.Reward) != len(that1.Reward) { - return false - } - for i := range this.Reward { - if !this.Reward[i].Equal(&that1.Reward[i]) { - return false - } - } - return true -} -func (this *DelegatorStartingInfo) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DelegatorStartingInfo) - if !ok { - that2, ok := that.(DelegatorStartingInfo) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.PreviousPeriod != that1.PreviousPeriod { - return false - } - if !this.Stake.Equal(that1.Stake) { - return false - } - if this.Height != that1.Height { - return false - } - return true -} -func (this *DelegationDelegatorReward) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*DelegationDelegatorReward) - if !ok { - that2, ok := that.(DelegationDelegatorReward) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ValidatorAddress != that1.ValidatorAddress { - return false - } - if len(this.Reward) != len(that1.Reward) { - return false - } - for i := range this.Reward { - if !this.Reward[i].Equal(&that1.Reward[i]) { - return false - } - } - return true -} -func (this *CommunityPoolSpendProposalWithDeposit) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CommunityPoolSpendProposalWithDeposit) - if !ok { - that2, ok := that.(CommunityPoolSpendProposalWithDeposit) - 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.Recipient != that1.Recipient { - return false - } - if this.Amount != that1.Amount { - return false - } - if this.Deposit != that1.Deposit { - return false - } - return true -} -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.WithdrawAddrEnabled { - i-- - if m.WithdrawAddrEnabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - { - size := m.BonusProposerReward.Size() - i -= size - if _, err := m.BonusProposerReward.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.BaseProposerReward.Size() - i -= size - if _, err := m.BaseProposerReward.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.CommunityTax.Size() - i -= size - if _, err := m.CommunityTax.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ValidatorHistoricalRewards) 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 *ValidatorHistoricalRewards) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorHistoricalRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ReferenceCount != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.ReferenceCount)) - i-- - dAtA[i] = 0x10 - } - if len(m.CumulativeRewardRatio) > 0 { - for iNdEx := len(m.CumulativeRewardRatio) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CumulativeRewardRatio[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ValidatorCurrentRewards) 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 *ValidatorCurrentRewards) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorCurrentRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Period != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.Period)) - i-- - dAtA[i] = 0x10 - } - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ValidatorAccumulatedCommission) 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 *ValidatorAccumulatedCommission) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorAccumulatedCommission) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Commission) > 0 { - for iNdEx := len(m.Commission) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Commission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ValidatorOutstandingRewards) 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 *ValidatorOutstandingRewards) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorOutstandingRewards) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ValidatorSlashEvent) 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 *ValidatorSlashEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorSlashEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Fraction.Size() - i -= size - if _, err := m.Fraction.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.ValidatorPeriod != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.ValidatorPeriod)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValidatorSlashEvents) 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 *ValidatorSlashEvents) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorSlashEvents) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorSlashEvents) > 0 { - for iNdEx := len(m.ValidatorSlashEvents) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorSlashEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *FeePool) 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 *FeePool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FeePool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.CommunityPool) > 0 { - for iNdEx := len(m.CommunityPool) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.CommunityPool[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenizeShareRecordReward) 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 *TokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Reward) > 0 { - for iNdEx := len(m.Reward) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Reward[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.RecordId != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.RecordId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CommunityPoolSpendProposal) 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 *CommunityPoolSpendProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommunityPoolSpendProposal) 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 = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintDistribution(dAtA, i, uint64(len(m.Recipient))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintDistribution(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 = encodeVarintDistribution(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DelegatorStartingInfo) 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 *DelegatorStartingInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelegatorStartingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - { - size := m.Stake.Size() - i -= size - if _, err := m.Stake.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.PreviousPeriod != 0 { - i = encodeVarintDistribution(dAtA, i, uint64(m.PreviousPeriod)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DelegationDelegatorReward) 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 *DelegationDelegatorReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelegationDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Reward) > 0 { - for iNdEx := len(m.Reward) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Reward[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintDistribution(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintDistribution(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CommunityPoolSpendProposalWithDeposit) 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 *CommunityPoolSpendProposalWithDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommunityPoolSpendProposalWithDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Deposit) > 0 { - i -= len(m.Deposit) - copy(dAtA[i:], m.Deposit) - i = encodeVarintDistribution(dAtA, i, uint64(len(m.Deposit))) - i-- - dAtA[i] = 0x2a - } - if len(m.Amount) > 0 { - i -= len(m.Amount) - copy(dAtA[i:], m.Amount) - i = encodeVarintDistribution(dAtA, i, uint64(len(m.Amount))) - i-- - dAtA[i] = 0x22 - } - if len(m.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintDistribution(dAtA, i, uint64(len(m.Recipient))) - i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintDistribution(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 = encodeVarintDistribution(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDistribution(dAtA []byte, offset int, v uint64) int { - offset -= sovDistribution(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.CommunityTax.Size() - n += 1 + l + sovDistribution(uint64(l)) - l = m.BaseProposerReward.Size() - n += 1 + l + sovDistribution(uint64(l)) - l = m.BonusProposerReward.Size() - n += 1 + l + sovDistribution(uint64(l)) - if m.WithdrawAddrEnabled { - n += 2 - } - return n -} - -func (m *ValidatorHistoricalRewards) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.CumulativeRewardRatio) > 0 { - for _, e := range m.CumulativeRewardRatio { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - if m.ReferenceCount != 0 { - n += 1 + sovDistribution(uint64(m.ReferenceCount)) - } - return n -} - -func (m *ValidatorCurrentRewards) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - if m.Period != 0 { - n += 1 + sovDistribution(uint64(m.Period)) - } - return n -} - -func (m *ValidatorAccumulatedCommission) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Commission) > 0 { - for _, e := range m.Commission { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *ValidatorOutstandingRewards) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *ValidatorSlashEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ValidatorPeriod != 0 { - n += 1 + sovDistribution(uint64(m.ValidatorPeriod)) - } - l = m.Fraction.Size() - n += 1 + l + sovDistribution(uint64(l)) - return n -} - -func (m *ValidatorSlashEvents) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ValidatorSlashEvents) > 0 { - for _, e := range m.ValidatorSlashEvents { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *FeePool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.CommunityPool) > 0 { - for _, e := range m.CommunityPool { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *TokenizeShareRecordReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RecordId != 0 { - n += 1 + sovDistribution(uint64(m.RecordId)) - } - if len(m.Reward) > 0 { - for _, e := range m.Reward { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *CommunityPoolSpendProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *DelegatorStartingInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PreviousPeriod != 0 { - n += 1 + sovDistribution(uint64(m.PreviousPeriod)) - } - l = m.Stake.Size() - n += 1 + l + sovDistribution(uint64(l)) - if m.Height != 0 { - n += 1 + sovDistribution(uint64(m.Height)) - } - return n -} - -func (m *DelegationDelegatorReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - if len(m.Reward) > 0 { - for _, e := range m.Reward { - l = e.Size() - n += 1 + l + sovDistribution(uint64(l)) - } - } - return n -} - -func (m *CommunityPoolSpendProposalWithDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Recipient) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Amount) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - l = len(m.Deposit) - if l > 0 { - n += 1 + l + sovDistribution(uint64(l)) - } - return n -} - -func sovDistribution(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDistribution(x uint64) (n int) { - return sovDistribution(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -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 ErrIntOverflowDistribution - } - 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 CommunityTax", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.CommunityTax.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseProposerReward", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BaseProposerReward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BonusProposerReward", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BonusProposerReward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddrEnabled", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WithdrawAddrEnabled = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorHistoricalRewards) 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 ErrIntOverflowDistribution - } - 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: ValidatorHistoricalRewards: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorHistoricalRewards: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CumulativeRewardRatio", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CumulativeRewardRatio = append(m.CumulativeRewardRatio, types.DecCoin{}) - if err := m.CumulativeRewardRatio[len(m.CumulativeRewardRatio)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReferenceCount", wireType) - } - m.ReferenceCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ReferenceCount |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorCurrentRewards) 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 ErrIntOverflowDistribution - } - 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: ValidatorCurrentRewards: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorCurrentRewards: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rewards = append(m.Rewards, types.DecCoin{}) - if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - m.Period = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Period |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorAccumulatedCommission) 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 ErrIntOverflowDistribution - } - 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: ValidatorAccumulatedCommission: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorAccumulatedCommission: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commission", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Commission = append(m.Commission, types.DecCoin{}) - if err := m.Commission[len(m.Commission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorOutstandingRewards) 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 ErrIntOverflowDistribution - } - 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: ValidatorOutstandingRewards: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorOutstandingRewards: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Rewards = append(m.Rewards, types.DecCoin{}) - if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorSlashEvent) 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 ErrIntOverflowDistribution - } - 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: ValidatorSlashEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorSlashEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorPeriod", wireType) - } - m.ValidatorPeriod = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorPeriod |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fraction", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Fraction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorSlashEvents) 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 ErrIntOverflowDistribution - } - 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: ValidatorSlashEvents: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorSlashEvents: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvents", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorSlashEvents = append(m.ValidatorSlashEvents, ValidatorSlashEvent{}) - if err := m.ValidatorSlashEvents[len(m.ValidatorSlashEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FeePool) 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 ErrIntOverflowDistribution - } - 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: FeePool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FeePool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CommunityPool", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CommunityPool = append(m.CommunityPool, types.DecCoin{}) - if err := m.CommunityPool[len(m.CommunityPool)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenizeShareRecordReward) 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 ErrIntOverflowDistribution - } - 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: TokenizeShareRecordReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) - } - m.RecordId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RecordId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reward = append(m.Reward, types.DecCoin{}) - if err := m.Reward[len(m.Reward)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommunityPoolSpendProposal) 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 ErrIntOverflowDistribution - } - 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: CommunityPoolSpendProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommunityPoolSpendProposal: 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 ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - 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 ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - 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 Recipient", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Recipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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 ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - 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 := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DelegatorStartingInfo) 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 ErrIntOverflowDistribution - } - 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: DelegatorStartingInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelegatorStartingInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PreviousPeriod", wireType) - } - m.PreviousPeriod = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PreviousPeriod |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Stake", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Stake.Unmarshal(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 ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DelegationDelegatorReward) 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 ErrIntOverflowDistribution - } - 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: DelegationDelegatorReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelegationDelegatorReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthDistribution - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Reward = append(m.Reward, types.DecCoin{}) - if err := m.Reward[len(m.Reward)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommunityPoolSpendProposalWithDeposit) 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 ErrIntOverflowDistribution - } - 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: CommunityPoolSpendProposalWithDeposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommunityPoolSpendProposalWithDeposit: 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 ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - 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 ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - 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 Recipient", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Recipient = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Amount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDistribution - } - 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 ErrInvalidLengthDistribution - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDistribution - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deposit = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDistribution(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDistribution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDistribution(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, ErrIntOverflowDistribution - } - 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, ErrIntOverflowDistribution - } - 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, ErrIntOverflowDistribution - } - 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, ErrInvalidLengthDistribution - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDistribution - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDistribution - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDistribution = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDistribution = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDistribution = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go deleted file mode 100644 index a5a4933261ba..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/distribution/types/genesis.pb.go +++ /dev/null @@ -1,2477 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/genesis.proto - -package types - -import ( - 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/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// DelegatorWithdrawInfo is the address for where distributions rewards are -// withdrawn to by default this struct is only used at genesis to feed in -// default withdraw addresses. -type DelegatorWithdrawInfo struct { - // delegator_address is the address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // withdraw_address is the address to withdraw the delegation rewards to. - WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` -} - -func (m *DelegatorWithdrawInfo) Reset() { *m = DelegatorWithdrawInfo{} } -func (m *DelegatorWithdrawInfo) String() string { return proto.CompactTextString(m) } -func (*DelegatorWithdrawInfo) ProtoMessage() {} -func (*DelegatorWithdrawInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{0} -} -func (m *DelegatorWithdrawInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelegatorWithdrawInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelegatorWithdrawInfo.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 *DelegatorWithdrawInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelegatorWithdrawInfo.Merge(m, src) -} -func (m *DelegatorWithdrawInfo) XXX_Size() int { - return m.Size() -} -func (m *DelegatorWithdrawInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DelegatorWithdrawInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_DelegatorWithdrawInfo proto.InternalMessageInfo - -// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. -type ValidatorOutstandingRewardsRecord struct { - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // outstanding_rewards represents the outstanding rewards of a validator. - OutstandingRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"outstanding_rewards"` -} - -func (m *ValidatorOutstandingRewardsRecord) Reset() { *m = ValidatorOutstandingRewardsRecord{} } -func (m *ValidatorOutstandingRewardsRecord) String() string { return proto.CompactTextString(m) } -func (*ValidatorOutstandingRewardsRecord) ProtoMessage() {} -func (*ValidatorOutstandingRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{1} -} -func (m *ValidatorOutstandingRewardsRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorOutstandingRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorOutstandingRewardsRecord.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 *ValidatorOutstandingRewardsRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorOutstandingRewardsRecord.Merge(m, src) -} -func (m *ValidatorOutstandingRewardsRecord) XXX_Size() int { - return m.Size() -} -func (m *ValidatorOutstandingRewardsRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorOutstandingRewardsRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorOutstandingRewardsRecord proto.InternalMessageInfo - -// ValidatorAccumulatedCommissionRecord is used for import / export via genesis -// json. -type ValidatorAccumulatedCommissionRecord struct { - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // accumulated is the accumulated commission of a validator. - Accumulated ValidatorAccumulatedCommission `protobuf:"bytes,2,opt,name=accumulated,proto3" json:"accumulated"` -} - -func (m *ValidatorAccumulatedCommissionRecord) Reset() { *m = ValidatorAccumulatedCommissionRecord{} } -func (m *ValidatorAccumulatedCommissionRecord) String() string { return proto.CompactTextString(m) } -func (*ValidatorAccumulatedCommissionRecord) ProtoMessage() {} -func (*ValidatorAccumulatedCommissionRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{2} -} -func (m *ValidatorAccumulatedCommissionRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorAccumulatedCommissionRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorAccumulatedCommissionRecord.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 *ValidatorAccumulatedCommissionRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorAccumulatedCommissionRecord.Merge(m, src) -} -func (m *ValidatorAccumulatedCommissionRecord) XXX_Size() int { - return m.Size() -} -func (m *ValidatorAccumulatedCommissionRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorAccumulatedCommissionRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorAccumulatedCommissionRecord proto.InternalMessageInfo - -// ValidatorHistoricalRewardsRecord is used for import / export via genesis -// json. -type ValidatorHistoricalRewardsRecord struct { - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // period defines the period the historical rewards apply to. - Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"` - // rewards defines the historical rewards of a validator. - Rewards ValidatorHistoricalRewards `protobuf:"bytes,3,opt,name=rewards,proto3" json:"rewards"` -} - -func (m *ValidatorHistoricalRewardsRecord) Reset() { *m = ValidatorHistoricalRewardsRecord{} } -func (m *ValidatorHistoricalRewardsRecord) String() string { return proto.CompactTextString(m) } -func (*ValidatorHistoricalRewardsRecord) ProtoMessage() {} -func (*ValidatorHistoricalRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{3} -} -func (m *ValidatorHistoricalRewardsRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorHistoricalRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorHistoricalRewardsRecord.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 *ValidatorHistoricalRewardsRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorHistoricalRewardsRecord.Merge(m, src) -} -func (m *ValidatorHistoricalRewardsRecord) XXX_Size() int { - return m.Size() -} -func (m *ValidatorHistoricalRewardsRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorHistoricalRewardsRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorHistoricalRewardsRecord proto.InternalMessageInfo - -// ValidatorCurrentRewardsRecord is used for import / export via genesis json. -type ValidatorCurrentRewardsRecord struct { - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // rewards defines the current rewards of a validator. - Rewards ValidatorCurrentRewards `protobuf:"bytes,2,opt,name=rewards,proto3" json:"rewards"` -} - -func (m *ValidatorCurrentRewardsRecord) Reset() { *m = ValidatorCurrentRewardsRecord{} } -func (m *ValidatorCurrentRewardsRecord) String() string { return proto.CompactTextString(m) } -func (*ValidatorCurrentRewardsRecord) ProtoMessage() {} -func (*ValidatorCurrentRewardsRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{4} -} -func (m *ValidatorCurrentRewardsRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorCurrentRewardsRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorCurrentRewardsRecord.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 *ValidatorCurrentRewardsRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorCurrentRewardsRecord.Merge(m, src) -} -func (m *ValidatorCurrentRewardsRecord) XXX_Size() int { - return m.Size() -} -func (m *ValidatorCurrentRewardsRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorCurrentRewardsRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorCurrentRewardsRecord proto.InternalMessageInfo - -// DelegatorStartingInfoRecord used for import / export via genesis json. -type DelegatorStartingInfoRecord struct { - // delegator_address is the address of the delegator. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // starting_info defines the starting info of a delegator. - StartingInfo DelegatorStartingInfo `protobuf:"bytes,3,opt,name=starting_info,json=startingInfo,proto3" json:"starting_info"` -} - -func (m *DelegatorStartingInfoRecord) Reset() { *m = DelegatorStartingInfoRecord{} } -func (m *DelegatorStartingInfoRecord) String() string { return proto.CompactTextString(m) } -func (*DelegatorStartingInfoRecord) ProtoMessage() {} -func (*DelegatorStartingInfoRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{5} -} -func (m *DelegatorStartingInfoRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DelegatorStartingInfoRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DelegatorStartingInfoRecord.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 *DelegatorStartingInfoRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_DelegatorStartingInfoRecord.Merge(m, src) -} -func (m *DelegatorStartingInfoRecord) XXX_Size() int { - return m.Size() -} -func (m *DelegatorStartingInfoRecord) XXX_DiscardUnknown() { - xxx_messageInfo_DelegatorStartingInfoRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_DelegatorStartingInfoRecord proto.InternalMessageInfo - -// ValidatorSlashEventRecord is used for import / export via genesis json. -type ValidatorSlashEventRecord struct { - // validator_address is the address of the validator. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // height defines the block height at which the slash event occurred. - Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - // period is the period of the slash event. - Period uint64 `protobuf:"varint,3,opt,name=period,proto3" json:"period,omitempty"` - // validator_slash_event describes the slash event. - ValidatorSlashEvent ValidatorSlashEvent `protobuf:"bytes,4,opt,name=validator_slash_event,json=validatorSlashEvent,proto3" json:"validator_slash_event"` -} - -func (m *ValidatorSlashEventRecord) Reset() { *m = ValidatorSlashEventRecord{} } -func (m *ValidatorSlashEventRecord) String() string { return proto.CompactTextString(m) } -func (*ValidatorSlashEventRecord) ProtoMessage() {} -func (*ValidatorSlashEventRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{6} -} -func (m *ValidatorSlashEventRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ValidatorSlashEventRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorSlashEventRecord.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 *ValidatorSlashEventRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorSlashEventRecord.Merge(m, src) -} -func (m *ValidatorSlashEventRecord) XXX_Size() int { - return m.Size() -} -func (m *ValidatorSlashEventRecord) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorSlashEventRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorSlashEventRecord proto.InternalMessageInfo - -// GenesisState defines the distribution module's genesis state. -type GenesisState struct { - // params defines all the parameters of the module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - // fee_pool defines the fee pool at genesis. - FeePool FeePool `protobuf:"bytes,2,opt,name=fee_pool,json=feePool,proto3" json:"fee_pool"` - // fee_pool defines the delegator withdraw infos at genesis. - DelegatorWithdrawInfos []DelegatorWithdrawInfo `protobuf:"bytes,3,rep,name=delegator_withdraw_infos,json=delegatorWithdrawInfos,proto3" json:"delegator_withdraw_infos"` - // fee_pool defines the previous proposer at genesis. - PreviousProposer string `protobuf:"bytes,4,opt,name=previous_proposer,json=previousProposer,proto3" json:"previous_proposer,omitempty"` - // fee_pool defines the outstanding rewards of all validators at genesis. - OutstandingRewards []ValidatorOutstandingRewardsRecord `protobuf:"bytes,5,rep,name=outstanding_rewards,json=outstandingRewards,proto3" json:"outstanding_rewards"` - // fee_pool defines the accumulated commissions of all validators at genesis. - ValidatorAccumulatedCommissions []ValidatorAccumulatedCommissionRecord `protobuf:"bytes,6,rep,name=validator_accumulated_commissions,json=validatorAccumulatedCommissions,proto3" json:"validator_accumulated_commissions"` - // fee_pool defines the historical rewards of all validators at genesis. - ValidatorHistoricalRewards []ValidatorHistoricalRewardsRecord `protobuf:"bytes,7,rep,name=validator_historical_rewards,json=validatorHistoricalRewards,proto3" json:"validator_historical_rewards"` - // fee_pool defines the current rewards of all validators at genesis. - ValidatorCurrentRewards []ValidatorCurrentRewardsRecord `protobuf:"bytes,8,rep,name=validator_current_rewards,json=validatorCurrentRewards,proto3" json:"validator_current_rewards"` - // fee_pool defines the delegator starting infos at genesis. - DelegatorStartingInfos []DelegatorStartingInfoRecord `protobuf:"bytes,9,rep,name=delegator_starting_infos,json=delegatorStartingInfos,proto3" json:"delegator_starting_infos"` - // fee_pool defines the validator slash events at genesis. - ValidatorSlashEvents []ValidatorSlashEventRecord `protobuf:"bytes,10,rep,name=validator_slash_events,json=validatorSlashEvents,proto3" json:"validator_slash_events"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_76eed0f9489db580, []int{7} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func init() { - proto.RegisterType((*DelegatorWithdrawInfo)(nil), "cosmos.distribution.v1beta1.DelegatorWithdrawInfo") - proto.RegisterType((*ValidatorOutstandingRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord") - proto.RegisterType((*ValidatorAccumulatedCommissionRecord)(nil), "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord") - proto.RegisterType((*ValidatorHistoricalRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord") - proto.RegisterType((*ValidatorCurrentRewardsRecord)(nil), "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord") - proto.RegisterType((*DelegatorStartingInfoRecord)(nil), "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord") - proto.RegisterType((*ValidatorSlashEventRecord)(nil), "cosmos.distribution.v1beta1.ValidatorSlashEventRecord") - proto.RegisterType((*GenesisState)(nil), "cosmos.distribution.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/genesis.proto", fileDescriptor_76eed0f9489db580) -} - -var fileDescriptor_76eed0f9489db580 = []byte{ - // 921 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0x38, 0x25, 0x4d, 0xc6, 0x45, 0xb4, 0xdb, 0x34, 0x6c, 0xd2, 0xb2, 0x4e, 0x4b, 0x0f, - 0x05, 0xd4, 0x35, 0x31, 0x08, 0xaa, 0x22, 0x90, 0x62, 0xb7, 0xe5, 0xe3, 0xd2, 0xc8, 0x96, 0x40, - 0x20, 0x24, 0x6b, 0xbc, 0x3b, 0x5e, 0x8f, 0xb0, 0x77, 0xac, 0x99, 0xf1, 0x1a, 0x90, 0x38, 0x70, - 0x02, 0x21, 0x90, 0x38, 0xc2, 0xad, 0xc7, 0x0a, 0x09, 0x89, 0x03, 0x7f, 0x44, 0x25, 0x2e, 0x15, - 0x27, 0x4e, 0x7c, 0x38, 0x07, 0xe0, 0x9f, 0x40, 0x68, 0x67, 0x66, 0x77, 0xc7, 0xda, 0xed, 0xd6, - 0x69, 0x93, 0x4b, 0xe2, 0x9d, 0x79, 0x1f, 0xbf, 0xdf, 0x7b, 0x3f, 0xbd, 0x37, 0xf0, 0x39, 0x8f, - 0xf2, 0x31, 0xe5, 0x0d, 0x9f, 0x70, 0xc1, 0x48, 0x7f, 0x2a, 0x08, 0x0d, 0x1b, 0xd1, 0x6e, 0x1f, - 0x0b, 0xb4, 0xdb, 0x08, 0x70, 0x88, 0x39, 0xe1, 0xee, 0x84, 0x51, 0x41, 0xad, 0xf3, 0xca, 0xd4, - 0x35, 0x4d, 0x5d, 0x6d, 0xba, 0xbd, 0x11, 0xd0, 0x80, 0x4a, 0xbb, 0x46, 0xfc, 0x4b, 0xb9, 0x6c, - 0x3b, 0x3a, 0x7a, 0x1f, 0x71, 0x9c, 0x46, 0xf5, 0x28, 0x09, 0xf5, 0xbd, 0x5b, 0x96, 0x7d, 0x21, - 0x8f, 0xb2, 0xdf, 0x52, 0xf6, 0x3d, 0x95, 0x48, 0xe3, 0x51, 0x57, 0x67, 0xd0, 0x98, 0x84, 0xb4, - 0x21, 0xff, 0xaa, 0xa3, 0x4b, 0x3f, 0x02, 0x78, 0xee, 0x06, 0x1e, 0xe1, 0x00, 0x09, 0xca, 0xde, - 0x23, 0x62, 0xe8, 0x33, 0x34, 0x7b, 0x3b, 0x1c, 0x50, 0xeb, 0x26, 0x3c, 0xe3, 0x27, 0x17, 0x3d, - 0xe4, 0xfb, 0x0c, 0x73, 0x6e, 0x83, 0x1d, 0x70, 0x65, 0xbd, 0x65, 0xff, 0xfa, 0xf3, 0xd5, 0x0d, - 0x1d, 0x79, 0x4f, 0xdd, 0x74, 0x05, 0x23, 0x61, 0xd0, 0x39, 0x9d, 0xba, 0xe8, 0x73, 0xab, 0x0d, - 0x4f, 0xcf, 0x74, 0xd8, 0x34, 0x4a, 0xf5, 0x21, 0x51, 0x9e, 0x4a, 0x3c, 0xf4, 0xf1, 0xf5, 0xb5, - 0x2f, 0xef, 0xd4, 0x2b, 0xff, 0xdc, 0xa9, 0x57, 0x2e, 0xfd, 0x07, 0xe0, 0xc5, 0x77, 0xd1, 0x88, - 0xf8, 0x71, 0x8e, 0xdb, 0x53, 0xc1, 0x05, 0x0a, 0xfd, 0xd8, 0x07, 0xcf, 0x10, 0xf3, 0x79, 0x07, - 0x7b, 0x94, 0xf9, 0x31, 0xf6, 0x28, 0x31, 0x5a, 0x1e, 0x7b, 0xea, 0x92, 0x60, 0xff, 0x02, 0xc0, - 0xb3, 0x34, 0xcb, 0xd1, 0x63, 0x2a, 0x89, 0x5d, 0xdd, 0x59, 0xb9, 0x52, 0x6b, 0x5e, 0xd0, 0x9d, - 0x71, 0xe3, 0xce, 0x25, 0x4d, 0x76, 0x6f, 0x60, 0xaf, 0x4d, 0x49, 0xd8, 0xba, 0x76, 0xef, 0xf7, - 0x7a, 0xe5, 0x87, 0x3f, 0xea, 0x2f, 0x04, 0x44, 0x0c, 0xa7, 0x7d, 0xd7, 0xa3, 0x63, 0xdd, 0x0c, - 0xfd, 0xef, 0x2a, 0xf7, 0x3f, 0x6a, 0x88, 0x4f, 0x26, 0x98, 0x27, 0x3e, 0xfc, 0xee, 0xdf, 0x3f, - 0x3d, 0x0f, 0x3a, 0x16, 0xcd, 0xd1, 0x32, 0x0a, 0xf0, 0x17, 0x80, 0x97, 0xd3, 0x02, 0xec, 0x79, - 0xde, 0x74, 0x3c, 0x1d, 0x21, 0x81, 0xfd, 0x36, 0x1d, 0x8f, 0x09, 0xe7, 0x84, 0x86, 0x47, 0x5b, - 0x83, 0x21, 0xac, 0xa1, 0x2c, 0x8b, 0x6c, 0x5d, 0xad, 0xf9, 0x9a, 0x5b, 0xa2, 0x73, 0xb7, 0x1c, - 0x5e, 0x6b, 0x3d, 0xae, 0x8c, 0xa2, 0x6a, 0x86, 0x36, 0x38, 0xfe, 0x0b, 0xe0, 0x4e, 0x1a, 0xe4, - 0x2d, 0xc2, 0x05, 0x65, 0xc4, 0x43, 0xa3, 0x63, 0xe9, 0xf1, 0x26, 0x5c, 0x9d, 0x60, 0x46, 0xa8, - 0xa2, 0x76, 0xa2, 0xa3, 0xbf, 0xac, 0x0f, 0xe1, 0xc9, 0xa4, 0xdd, 0x2b, 0x92, 0xf3, 0xab, 0xcb, - 0x71, 0xce, 0xc1, 0x35, 0xf9, 0x26, 0x21, 0x0d, 0xae, 0xbf, 0x00, 0xf8, 0x4c, 0xea, 0xdc, 0x9e, - 0x32, 0x86, 0x43, 0x71, 0x2c, 0x44, 0xdf, 0xcf, 0x08, 0xa9, 0x26, 0xbe, 0xbc, 0x1c, 0xa1, 0x45, - 0x4c, 0x0f, 0x61, 0xf3, 0x7d, 0x15, 0x9e, 0x4f, 0xc7, 0x49, 0x57, 0x20, 0x26, 0x48, 0x18, 0xc4, - 0xe3, 0x24, 0xe3, 0x72, 0x14, 0x43, 0xa5, 0xb0, 0x24, 0xd5, 0x43, 0x97, 0xa4, 0x0f, 0x9f, 0xe4, - 0x1a, 0x63, 0x8f, 0x84, 0x03, 0xaa, 0x3b, 0xdd, 0x2c, 0x2d, 0x4c, 0x21, 0x3d, 0xb3, 0x2c, 0xa7, - 0xb8, 0x71, 0x61, 0xd4, 0xe6, 0x9b, 0x2a, 0xdc, 0x4a, 0xab, 0xda, 0x1d, 0x21, 0x3e, 0xbc, 0x19, - 0xc9, 0xc2, 0x1e, 0xb1, 0x9c, 0x87, 0x98, 0x04, 0x43, 0x91, 0xc8, 0x59, 0x7d, 0x19, 0x32, 0x5f, - 0x59, 0x90, 0x39, 0x85, 0xe7, 0xb2, 0xb4, 0x3c, 0x06, 0xd5, 0xc3, 0x31, 0x2a, 0xfb, 0x84, 0x2c, - 0xc5, 0x8b, 0xcb, 0x69, 0x24, 0x63, 0x63, 0x16, 0xe2, 0x6c, 0x94, 0xbf, 0x37, 0xea, 0xf1, 0xf5, - 0x3a, 0x3c, 0xf5, 0xa6, 0xda, 0x9e, 0x5d, 0x81, 0x04, 0xb6, 0x6e, 0xc1, 0xd5, 0x09, 0x62, 0x68, - 0xac, 0x78, 0xd7, 0x9a, 0xcf, 0x96, 0x26, 0xdf, 0x97, 0xa6, 0x66, 0x3e, 0xed, 0x6d, 0xbd, 0x03, - 0xd7, 0x06, 0x18, 0xf7, 0x26, 0x94, 0x8e, 0xb4, 0xd4, 0x2f, 0x97, 0x46, 0xba, 0x85, 0xf1, 0x3e, - 0xa5, 0xa3, 0x05, 0x69, 0x0f, 0xd4, 0x99, 0x35, 0x83, 0x76, 0x26, 0xd8, 0x74, 0x91, 0xc5, 0x62, - 0x89, 0xe7, 0xc2, 0xca, 0xf2, 0x6a, 0x31, 0x77, 0xab, 0x99, 0x69, 0xd3, 0x2f, 0xb2, 0x90, 0x12, - 0x9f, 0x30, 0x1c, 0x11, 0x3a, 0x95, 0xab, 0x7c, 0x42, 0x39, 0x66, 0xb2, 0x29, 0xa5, 0x7a, 0x48, - 0x5c, 0xf6, 0xb5, 0x87, 0xf5, 0x69, 0xf1, 0x06, 0x7b, 0x42, 0x42, 0x7f, 0x63, 0xb9, 0xee, 0x3e, - 0x68, 0xcd, 0x9a, 0x34, 0x0a, 0x96, 0x96, 0xf5, 0x1d, 0x80, 0x17, 0x0d, 0x4d, 0x67, 0xa3, 0xbe, - 0xe7, 0xa5, 0xdb, 0x80, 0xdb, 0xab, 0x12, 0xca, 0xde, 0x63, 0x6c, 0x94, 0x3c, 0x9a, 0x7a, 0x54, - 0xea, 0xc0, 0xad, 0xaf, 0x00, 0xbc, 0x90, 0x41, 0x1b, 0xa6, 0x33, 0x3b, 0x2d, 0xd0, 0x49, 0x89, - 0xea, 0xf5, 0x47, 0x9c, 0xf9, 0x79, 0x44, 0xdb, 0xd1, 0x03, 0x8d, 0xad, 0xcf, 0x01, 0xdc, 0xca, - 0xc0, 0x78, 0x6a, 0xde, 0xa6, 0x48, 0xd6, 0x24, 0x92, 0xeb, 0x8f, 0x32, 0xac, 0xf3, 0x30, 0x9e, - 0x8e, 0x8a, 0x2d, 0xad, 0xcf, 0x4c, 0x9d, 0x2f, 0x0c, 0x45, 0x6e, 0xaf, 0x4b, 0x04, 0xd7, 0x0e, - 0x3f, 0x15, 0xf3, 0xf9, 0x33, 0xb5, 0x9b, 0x76, 0xdc, 0x9a, 0xc1, 0xcd, 0xc2, 0x31, 0xc4, 0x6d, - 0x28, 0x93, 0xbf, 0x72, 0xd8, 0x39, 0x94, 0x4f, 0xbd, 0x51, 0x30, 0x8d, 0x8c, 0xd5, 0xd5, 0xba, - 0x7d, 0x77, 0xee, 0x80, 0x7b, 0x73, 0x07, 0xdc, 0x9f, 0x3b, 0xe0, 0xcf, 0xb9, 0x03, 0xbe, 0x3d, - 0x70, 0x2a, 0xf7, 0x0f, 0x9c, 0xca, 0x6f, 0x07, 0x4e, 0xe5, 0x83, 0xdd, 0xd2, 0x67, 0xdc, 0xc7, - 0x8b, 0xaf, 0x73, 0xf9, 0xaa, 0xeb, 0xaf, 0xca, 0x17, 0xf6, 0x4b, 0xff, 0x07, 0x00, 0x00, 0xff, - 0xff, 0x71, 0x88, 0x91, 0xf2, 0x3f, 0x0c, 0x00, 0x00, -} - -func (m *DelegatorWithdrawInfo) 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 *DelegatorWithdrawInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelegatorWithdrawInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.WithdrawAddress) > 0 { - i -= len(m.WithdrawAddress) - copy(dAtA[i:], m.WithdrawAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.WithdrawAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorOutstandingRewardsRecord) 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 *ValidatorOutstandingRewardsRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorOutstandingRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OutstandingRewards) > 0 { - for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorAccumulatedCommissionRecord) 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 *ValidatorAccumulatedCommissionRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorAccumulatedCommissionRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Accumulated.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorHistoricalRewardsRecord) 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 *ValidatorHistoricalRewardsRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorHistoricalRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Rewards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Period != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Period)) - i-- - dAtA[i] = 0x10 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorCurrentRewardsRecord) 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 *ValidatorCurrentRewardsRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorCurrentRewardsRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Rewards.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DelegatorStartingInfoRecord) 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 *DelegatorStartingInfoRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DelegatorStartingInfoRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.StartingInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ValidatorSlashEventRecord) 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 *ValidatorSlashEventRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorSlashEventRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ValidatorSlashEvent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Period != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Period)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorSlashEvents) > 0 { - for iNdEx := len(m.ValidatorSlashEvents) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorSlashEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - } - if len(m.DelegatorStartingInfos) > 0 { - for iNdEx := len(m.DelegatorStartingInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DelegatorStartingInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if len(m.ValidatorCurrentRewards) > 0 { - for iNdEx := len(m.ValidatorCurrentRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorCurrentRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.ValidatorHistoricalRewards) > 0 { - for iNdEx := len(m.ValidatorHistoricalRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorHistoricalRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if len(m.ValidatorAccumulatedCommissions) > 0 { - for iNdEx := len(m.ValidatorAccumulatedCommissions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ValidatorAccumulatedCommissions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.OutstandingRewards) > 0 { - for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.PreviousProposer) > 0 { - i -= len(m.PreviousProposer) - copy(dAtA[i:], m.PreviousProposer) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.PreviousProposer))) - i-- - dAtA[i] = 0x22 - } - if len(m.DelegatorWithdrawInfos) > 0 { - for iNdEx := len(m.DelegatorWithdrawInfos) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DelegatorWithdrawInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.FeePool.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *DelegatorWithdrawInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.WithdrawAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func (m *ValidatorOutstandingRewardsRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.OutstandingRewards) > 0 { - for _, e := range m.OutstandingRewards { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *ValidatorAccumulatedCommissionRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = m.Accumulated.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *ValidatorHistoricalRewardsRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Period != 0 { - n += 1 + sovGenesis(uint64(m.Period)) - } - l = m.Rewards.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *ValidatorCurrentRewardsRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = m.Rewards.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *DelegatorStartingInfoRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = m.StartingInfo.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *ValidatorSlashEventRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovGenesis(uint64(m.Height)) - } - if m.Period != 0 { - n += 1 + sovGenesis(uint64(m.Period)) - } - l = m.ValidatorSlashEvent.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.FeePool.Size() - n += 1 + l + sovGenesis(uint64(l)) - if len(m.DelegatorWithdrawInfos) > 0 { - for _, e := range m.DelegatorWithdrawInfos { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = len(m.PreviousProposer) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.OutstandingRewards) > 0 { - for _, e := range m.OutstandingRewards { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ValidatorAccumulatedCommissions) > 0 { - for _, e := range m.ValidatorAccumulatedCommissions { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ValidatorHistoricalRewards) > 0 { - for _, e := range m.ValidatorHistoricalRewards { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ValidatorCurrentRewards) > 0 { - for _, e := range m.ValidatorCurrentRewards { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.DelegatorStartingInfos) > 0 { - for _, e := range m.DelegatorStartingInfos { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.ValidatorSlashEvents) > 0 { - for _, e := range m.ValidatorSlashEvents { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *DelegatorWithdrawInfo) 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 ErrIntOverflowGenesis - } - 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: DelegatorWithdrawInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelegatorWithdrawInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WithdrawAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorOutstandingRewardsRecord) 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 ErrIntOverflowGenesis - } - 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: ValidatorOutstandingRewardsRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorOutstandingRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OutstandingRewards = append(m.OutstandingRewards, types.DecCoin{}) - if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorAccumulatedCommissionRecord) 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 ErrIntOverflowGenesis - } - 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: ValidatorAccumulatedCommissionRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorAccumulatedCommissionRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Accumulated", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Accumulated.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorHistoricalRewardsRecord) 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 ErrIntOverflowGenesis - } - 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: ValidatorHistoricalRewardsRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorHistoricalRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - m.Period = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Period |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorCurrentRewardsRecord) 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 ErrIntOverflowGenesis - } - 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: ValidatorCurrentRewardsRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorCurrentRewardsRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Rewards.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DelegatorStartingInfoRecord) 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 ErrIntOverflowGenesis - } - 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: DelegatorStartingInfoRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DelegatorStartingInfoRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.StartingInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ValidatorSlashEventRecord) 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 ErrIntOverflowGenesis - } - 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: ValidatorSlashEventRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorSlashEventRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - m.Period = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Period |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvent", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ValidatorSlashEvent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FeePool", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FeePool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorWithdrawInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorWithdrawInfos = append(m.DelegatorWithdrawInfos, DelegatorWithdrawInfo{}) - if err := m.DelegatorWithdrawInfos[len(m.DelegatorWithdrawInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PreviousProposer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - 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 ErrInvalidLengthGenesis - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PreviousProposer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OutstandingRewards = append(m.OutstandingRewards, ValidatorOutstandingRewardsRecord{}) - if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAccumulatedCommissions", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAccumulatedCommissions = append(m.ValidatorAccumulatedCommissions, ValidatorAccumulatedCommissionRecord{}) - if err := m.ValidatorAccumulatedCommissions[len(m.ValidatorAccumulatedCommissions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHistoricalRewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorHistoricalRewards = append(m.ValidatorHistoricalRewards, ValidatorHistoricalRewardsRecord{}) - if err := m.ValidatorHistoricalRewards[len(m.ValidatorHistoricalRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCurrentRewards", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorCurrentRewards = append(m.ValidatorCurrentRewards, ValidatorCurrentRewardsRecord{}) - if err := m.ValidatorCurrentRewards[len(m.ValidatorCurrentRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorStartingInfos", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DelegatorStartingInfos = append(m.DelegatorStartingInfos, DelegatorStartingInfoRecord{}) - if err := m.DelegatorStartingInfos[len(m.DelegatorStartingInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSlashEvents", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorSlashEvents = append(m.ValidatorSlashEvents, ValidatorSlashEventRecord{}) - if err := m.ValidatorSlashEvents[len(m.ValidatorSlashEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go deleted file mode 100644 index 0b8c1a1ace93..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.go +++ /dev/null @@ -1,4882 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/query.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" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryParamsRequest is the 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_5efd02cbc06efdc9, []int{0} -} -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 the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params defines the parameters of the 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_5efd02cbc06efdc9, []int{1} -} -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{} -} - -// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. -type QueryValidatorDistributionInfoRequest struct { - // validator_address defines the validator address to query for. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *QueryValidatorDistributionInfoRequest) Reset() { *m = QueryValidatorDistributionInfoRequest{} } -func (m *QueryValidatorDistributionInfoRequest) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorDistributionInfoRequest) ProtoMessage() {} -func (*QueryValidatorDistributionInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{2} -} -func (m *QueryValidatorDistributionInfoRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorDistributionInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorDistributionInfoRequest.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 *QueryValidatorDistributionInfoRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorDistributionInfoRequest.Merge(m, src) -} -func (m *QueryValidatorDistributionInfoRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorDistributionInfoRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorDistributionInfoRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorDistributionInfoRequest proto.InternalMessageInfo - -func (m *QueryValidatorDistributionInfoRequest) GetValidatorAddress() string { - if m != nil { - return m.ValidatorAddress - } - return "" -} - -// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. -type QueryValidatorDistributionInfoResponse struct { - // operator_address defines the validator operator address. - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - // self_bond_rewards defines the self delegations rewards. - SelfBondRewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=self_bond_rewards,json=selfBondRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"self_bond_rewards"` - // commission defines the commission the validator received. - Commission github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,3,rep,name=commission,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"commission"` -} - -func (m *QueryValidatorDistributionInfoResponse) Reset() { - *m = QueryValidatorDistributionInfoResponse{} -} -func (m *QueryValidatorDistributionInfoResponse) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorDistributionInfoResponse) ProtoMessage() {} -func (*QueryValidatorDistributionInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{3} -} -func (m *QueryValidatorDistributionInfoResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorDistributionInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorDistributionInfoResponse.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 *QueryValidatorDistributionInfoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorDistributionInfoResponse.Merge(m, src) -} -func (m *QueryValidatorDistributionInfoResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorDistributionInfoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorDistributionInfoResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorDistributionInfoResponse proto.InternalMessageInfo - -func (m *QueryValidatorDistributionInfoResponse) GetOperatorAddress() string { - if m != nil { - return m.OperatorAddress - } - return "" -} - -func (m *QueryValidatorDistributionInfoResponse) GetSelfBondRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.SelfBondRewards - } - return nil -} - -func (m *QueryValidatorDistributionInfoResponse) GetCommission() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Commission - } - return nil -} - -// QueryValidatorOutstandingRewardsRequest is the request type for the -// Query/ValidatorOutstandingRewards RPC method. -type QueryValidatorOutstandingRewardsRequest struct { - // validator_address defines the validator address to query for. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *QueryValidatorOutstandingRewardsRequest) Reset() { - *m = QueryValidatorOutstandingRewardsRequest{} -} -func (m *QueryValidatorOutstandingRewardsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorOutstandingRewardsRequest) ProtoMessage() {} -func (*QueryValidatorOutstandingRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{4} -} -func (m *QueryValidatorOutstandingRewardsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorOutstandingRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.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 *QueryValidatorOutstandingRewardsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.Merge(m, src) -} -func (m *QueryValidatorOutstandingRewardsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorOutstandingRewardsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorOutstandingRewardsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorOutstandingRewardsRequest proto.InternalMessageInfo - -func (m *QueryValidatorOutstandingRewardsRequest) GetValidatorAddress() string { - if m != nil { - return m.ValidatorAddress - } - return "" -} - -// QueryValidatorOutstandingRewardsResponse is the response type for the -// Query/ValidatorOutstandingRewards RPC method. -type QueryValidatorOutstandingRewardsResponse struct { - Rewards ValidatorOutstandingRewards `protobuf:"bytes,1,opt,name=rewards,proto3" json:"rewards"` -} - -func (m *QueryValidatorOutstandingRewardsResponse) Reset() { - *m = QueryValidatorOutstandingRewardsResponse{} -} -func (m *QueryValidatorOutstandingRewardsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorOutstandingRewardsResponse) ProtoMessage() {} -func (*QueryValidatorOutstandingRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{5} -} -func (m *QueryValidatorOutstandingRewardsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorOutstandingRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.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 *QueryValidatorOutstandingRewardsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.Merge(m, src) -} -func (m *QueryValidatorOutstandingRewardsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorOutstandingRewardsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorOutstandingRewardsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorOutstandingRewardsResponse proto.InternalMessageInfo - -func (m *QueryValidatorOutstandingRewardsResponse) GetRewards() ValidatorOutstandingRewards { - if m != nil { - return m.Rewards - } - return ValidatorOutstandingRewards{} -} - -// QueryValidatorCommissionRequest is the request type for the -// Query/ValidatorCommission RPC method -type QueryValidatorCommissionRequest struct { - // validator_address defines the validator address to query for. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *QueryValidatorCommissionRequest) Reset() { *m = QueryValidatorCommissionRequest{} } -func (m *QueryValidatorCommissionRequest) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorCommissionRequest) ProtoMessage() {} -func (*QueryValidatorCommissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{6} -} -func (m *QueryValidatorCommissionRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorCommissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorCommissionRequest.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 *QueryValidatorCommissionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorCommissionRequest.Merge(m, src) -} -func (m *QueryValidatorCommissionRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorCommissionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorCommissionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorCommissionRequest proto.InternalMessageInfo - -func (m *QueryValidatorCommissionRequest) GetValidatorAddress() string { - if m != nil { - return m.ValidatorAddress - } - return "" -} - -// QueryValidatorCommissionResponse is the response type for the -// Query/ValidatorCommission RPC method -type QueryValidatorCommissionResponse struct { - // commission defines the commission the validator received. - Commission ValidatorAccumulatedCommission `protobuf:"bytes,1,opt,name=commission,proto3" json:"commission"` -} - -func (m *QueryValidatorCommissionResponse) Reset() { *m = QueryValidatorCommissionResponse{} } -func (m *QueryValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorCommissionResponse) ProtoMessage() {} -func (*QueryValidatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{7} -} -func (m *QueryValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorCommissionResponse.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 *QueryValidatorCommissionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorCommissionResponse.Merge(m, src) -} -func (m *QueryValidatorCommissionResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorCommissionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorCommissionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorCommissionResponse proto.InternalMessageInfo - -func (m *QueryValidatorCommissionResponse) GetCommission() ValidatorAccumulatedCommission { - if m != nil { - return m.Commission - } - return ValidatorAccumulatedCommission{} -} - -// QueryValidatorSlashesRequest is the request type for the -// Query/ValidatorSlashes RPC method -type QueryValidatorSlashesRequest struct { - // validator_address defines the validator address to query for. - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - // starting_height defines the optional starting height to query the slashes. - StartingHeight uint64 `protobuf:"varint,2,opt,name=starting_height,json=startingHeight,proto3" json:"starting_height,omitempty"` - // starting_height defines the optional ending height to query the slashes. - EndingHeight uint64 `protobuf:"varint,3,opt,name=ending_height,json=endingHeight,proto3" json:"ending_height,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryValidatorSlashesRequest) Reset() { *m = QueryValidatorSlashesRequest{} } -func (m *QueryValidatorSlashesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorSlashesRequest) ProtoMessage() {} -func (*QueryValidatorSlashesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{8} -} -func (m *QueryValidatorSlashesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorSlashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorSlashesRequest.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 *QueryValidatorSlashesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorSlashesRequest.Merge(m, src) -} -func (m *QueryValidatorSlashesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorSlashesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorSlashesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorSlashesRequest proto.InternalMessageInfo - -// QueryValidatorSlashesResponse is the response type for the -// Query/ValidatorSlashes RPC method. -type QueryValidatorSlashesResponse struct { - // slashes defines the slashes the validator received. - Slashes []ValidatorSlashEvent `protobuf:"bytes,1,rep,name=slashes,proto3" json:"slashes"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryValidatorSlashesResponse) Reset() { *m = QueryValidatorSlashesResponse{} } -func (m *QueryValidatorSlashesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryValidatorSlashesResponse) ProtoMessage() {} -func (*QueryValidatorSlashesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{9} -} -func (m *QueryValidatorSlashesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryValidatorSlashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryValidatorSlashesResponse.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 *QueryValidatorSlashesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryValidatorSlashesResponse.Merge(m, src) -} -func (m *QueryValidatorSlashesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryValidatorSlashesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryValidatorSlashesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryValidatorSlashesResponse proto.InternalMessageInfo - -func (m *QueryValidatorSlashesResponse) GetSlashes() []ValidatorSlashEvent { - if m != nil { - return m.Slashes - } - return nil -} - -func (m *QueryValidatorSlashesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryDelegationRewardsRequest is the request type for the -// Query/DelegationRewards RPC method. -type QueryDelegationRewardsRequest struct { - // delegator_address defines the delegator address to query for. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - // validator_address defines the validator address to query for. - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *QueryDelegationRewardsRequest) Reset() { *m = QueryDelegationRewardsRequest{} } -func (m *QueryDelegationRewardsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDelegationRewardsRequest) ProtoMessage() {} -func (*QueryDelegationRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{10} -} -func (m *QueryDelegationRewardsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegationRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegationRewardsRequest.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 *QueryDelegationRewardsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegationRewardsRequest.Merge(m, src) -} -func (m *QueryDelegationRewardsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegationRewardsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegationRewardsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegationRewardsRequest proto.InternalMessageInfo - -// QueryDelegationRewardsResponse is the response type for the -// Query/DelegationRewards RPC method. -type QueryDelegationRewardsResponse struct { - // rewards defines the rewards accrued by a delegation. - Rewards github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"rewards"` -} - -func (m *QueryDelegationRewardsResponse) Reset() { *m = QueryDelegationRewardsResponse{} } -func (m *QueryDelegationRewardsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDelegationRewardsResponse) ProtoMessage() {} -func (*QueryDelegationRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{11} -} -func (m *QueryDelegationRewardsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegationRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegationRewardsResponse.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 *QueryDelegationRewardsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegationRewardsResponse.Merge(m, src) -} -func (m *QueryDelegationRewardsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegationRewardsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegationRewardsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegationRewardsResponse proto.InternalMessageInfo - -func (m *QueryDelegationRewardsResponse) GetRewards() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Rewards - } - return nil -} - -// QueryDelegationTotalRewardsRequest is the request type for the -// Query/DelegationTotalRewards RPC method. -type QueryDelegationTotalRewardsRequest struct { - // delegator_address defines the delegator address to query for. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` -} - -func (m *QueryDelegationTotalRewardsRequest) Reset() { *m = QueryDelegationTotalRewardsRequest{} } -func (m *QueryDelegationTotalRewardsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDelegationTotalRewardsRequest) ProtoMessage() {} -func (*QueryDelegationTotalRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{12} -} -func (m *QueryDelegationTotalRewardsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegationTotalRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegationTotalRewardsRequest.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 *QueryDelegationTotalRewardsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegationTotalRewardsRequest.Merge(m, src) -} -func (m *QueryDelegationTotalRewardsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegationTotalRewardsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegationTotalRewardsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegationTotalRewardsRequest proto.InternalMessageInfo - -// QueryDelegationTotalRewardsResponse is the response type for the -// Query/DelegationTotalRewards RPC method. -type QueryDelegationTotalRewardsResponse struct { - // rewards defines all the rewards accrued by a delegator. - Rewards []DelegationDelegatorReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` - // total defines the sum of all the rewards. - Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` -} - -func (m *QueryDelegationTotalRewardsResponse) Reset() { *m = QueryDelegationTotalRewardsResponse{} } -func (m *QueryDelegationTotalRewardsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDelegationTotalRewardsResponse) ProtoMessage() {} -func (*QueryDelegationTotalRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{13} -} -func (m *QueryDelegationTotalRewardsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegationTotalRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegationTotalRewardsResponse.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 *QueryDelegationTotalRewardsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegationTotalRewardsResponse.Merge(m, src) -} -func (m *QueryDelegationTotalRewardsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegationTotalRewardsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegationTotalRewardsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegationTotalRewardsResponse proto.InternalMessageInfo - -func (m *QueryDelegationTotalRewardsResponse) GetRewards() []DelegationDelegatorReward { - if m != nil { - return m.Rewards - } - return nil -} - -func (m *QueryDelegationTotalRewardsResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Total - } - return nil -} - -// QueryDelegatorValidatorsRequest is the request type for the -// Query/DelegatorValidators RPC method. -type QueryDelegatorValidatorsRequest struct { - // delegator_address defines the delegator address to query for. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` -} - -func (m *QueryDelegatorValidatorsRequest) Reset() { *m = QueryDelegatorValidatorsRequest{} } -func (m *QueryDelegatorValidatorsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDelegatorValidatorsRequest) ProtoMessage() {} -func (*QueryDelegatorValidatorsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{14} -} -func (m *QueryDelegatorValidatorsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegatorValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegatorValidatorsRequest.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 *QueryDelegatorValidatorsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegatorValidatorsRequest.Merge(m, src) -} -func (m *QueryDelegatorValidatorsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegatorValidatorsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegatorValidatorsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegatorValidatorsRequest proto.InternalMessageInfo - -// QueryDelegatorValidatorsResponse is the response type for the -// Query/DelegatorValidators RPC method. -type QueryDelegatorValidatorsResponse struct { - // validators defines the validators a delegator is delegating for. - Validators []string `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` -} - -func (m *QueryDelegatorValidatorsResponse) Reset() { *m = QueryDelegatorValidatorsResponse{} } -func (m *QueryDelegatorValidatorsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDelegatorValidatorsResponse) ProtoMessage() {} -func (*QueryDelegatorValidatorsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{15} -} -func (m *QueryDelegatorValidatorsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegatorValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegatorValidatorsResponse.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 *QueryDelegatorValidatorsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegatorValidatorsResponse.Merge(m, src) -} -func (m *QueryDelegatorValidatorsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegatorValidatorsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegatorValidatorsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegatorValidatorsResponse proto.InternalMessageInfo - -// QueryDelegatorWithdrawAddressRequest is the request type for the -// Query/DelegatorWithdrawAddress RPC method. -type QueryDelegatorWithdrawAddressRequest struct { - // delegator_address defines the delegator address to query for. - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` -} - -func (m *QueryDelegatorWithdrawAddressRequest) Reset() { *m = QueryDelegatorWithdrawAddressRequest{} } -func (m *QueryDelegatorWithdrawAddressRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDelegatorWithdrawAddressRequest) ProtoMessage() {} -func (*QueryDelegatorWithdrawAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{16} -} -func (m *QueryDelegatorWithdrawAddressRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegatorWithdrawAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.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 *QueryDelegatorWithdrawAddressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.Merge(m, src) -} -func (m *QueryDelegatorWithdrawAddressRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegatorWithdrawAddressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegatorWithdrawAddressRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegatorWithdrawAddressRequest proto.InternalMessageInfo - -// QueryDelegatorWithdrawAddressResponse is the response type for the -// Query/DelegatorWithdrawAddress RPC method. -type QueryDelegatorWithdrawAddressResponse struct { - // withdraw_address defines the delegator address to query for. - WithdrawAddress string `protobuf:"bytes,1,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` -} - -func (m *QueryDelegatorWithdrawAddressResponse) Reset() { *m = QueryDelegatorWithdrawAddressResponse{} } -func (m *QueryDelegatorWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDelegatorWithdrawAddressResponse) ProtoMessage() {} -func (*QueryDelegatorWithdrawAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{17} -} -func (m *QueryDelegatorWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDelegatorWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.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 *QueryDelegatorWithdrawAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.Merge(m, src) -} -func (m *QueryDelegatorWithdrawAddressResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDelegatorWithdrawAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDelegatorWithdrawAddressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDelegatorWithdrawAddressResponse proto.InternalMessageInfo - -// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC -// method. -type QueryCommunityPoolRequest struct { -} - -func (m *QueryCommunityPoolRequest) Reset() { *m = QueryCommunityPoolRequest{} } -func (m *QueryCommunityPoolRequest) String() string { return proto.CompactTextString(m) } -func (*QueryCommunityPoolRequest) ProtoMessage() {} -func (*QueryCommunityPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{18} -} -func (m *QueryCommunityPoolRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCommunityPoolRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCommunityPoolRequest.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 *QueryCommunityPoolRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCommunityPoolRequest.Merge(m, src) -} -func (m *QueryCommunityPoolRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryCommunityPoolRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCommunityPoolRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCommunityPoolRequest proto.InternalMessageInfo - -// QueryCommunityPoolResponse is the response type for the Query/CommunityPool -// RPC method. -type QueryCommunityPoolResponse struct { - // pool defines community pool's coins. - Pool github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=pool,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"pool"` -} - -func (m *QueryCommunityPoolResponse) Reset() { *m = QueryCommunityPoolResponse{} } -func (m *QueryCommunityPoolResponse) String() string { return proto.CompactTextString(m) } -func (*QueryCommunityPoolResponse) ProtoMessage() {} -func (*QueryCommunityPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{19} -} -func (m *QueryCommunityPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryCommunityPoolResponse.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 *QueryCommunityPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryCommunityPoolResponse.Merge(m, src) -} -func (m *QueryCommunityPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryCommunityPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryCommunityPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryCommunityPoolResponse proto.InternalMessageInfo - -func (m *QueryCommunityPoolResponse) GetPool() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Pool - } - return nil -} - -// QueryTokenizeShareRecordRewardRequest is the request type for the Query/TokenizeShareRecordReward RPC -// method. -type QueryTokenizeShareRecordRewardRequest struct { - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` -} - -func (m *QueryTokenizeShareRecordRewardRequest) Reset() { *m = QueryTokenizeShareRecordRewardRequest{} } -func (m *QueryTokenizeShareRecordRewardRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTokenizeShareRecordRewardRequest) ProtoMessage() {} -func (*QueryTokenizeShareRecordRewardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{20} -} -func (m *QueryTokenizeShareRecordRewardRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTokenizeShareRecordRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.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 *QueryTokenizeShareRecordRewardRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.Merge(m, src) -} -func (m *QueryTokenizeShareRecordRewardRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTokenizeShareRecordRewardRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTokenizeShareRecordRewardRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTokenizeShareRecordRewardRequest proto.InternalMessageInfo - -// QueryTokenizeShareRecordRewardResponse is the response type for the Query/TokenizeShareRecordReward -// RPC method. -type QueryTokenizeShareRecordRewardResponse struct { - // rewards defines all the rewards accrued by a delegator. - Rewards []TokenizeShareRecordReward `protobuf:"bytes,1,rep,name=rewards,proto3" json:"rewards"` - // total defines the sum of all the rewards. - Total github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"total"` -} - -func (m *QueryTokenizeShareRecordRewardResponse) Reset() { - *m = QueryTokenizeShareRecordRewardResponse{} -} -func (m *QueryTokenizeShareRecordRewardResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTokenizeShareRecordRewardResponse) ProtoMessage() {} -func (*QueryTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5efd02cbc06efdc9, []int{21} -} -func (m *QueryTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.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 *QueryTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.Merge(m, src) -} -func (m *QueryTokenizeShareRecordRewardResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTokenizeShareRecordRewardResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTokenizeShareRecordRewardResponse proto.InternalMessageInfo - -func (m *QueryTokenizeShareRecordRewardResponse) GetRewards() []TokenizeShareRecordReward { - if m != nil { - return m.Rewards - } - return nil -} - -func (m *QueryTokenizeShareRecordRewardResponse) GetTotal() github_com_cosmos_cosmos_sdk_types.DecCoins { - if m != nil { - return m.Total - } - return nil -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.distribution.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.distribution.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryValidatorDistributionInfoRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest") - proto.RegisterType((*QueryValidatorDistributionInfoResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse") - proto.RegisterType((*QueryValidatorOutstandingRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest") - proto.RegisterType((*QueryValidatorOutstandingRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse") - proto.RegisterType((*QueryValidatorCommissionRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionRequest") - proto.RegisterType((*QueryValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorCommissionResponse") - proto.RegisterType((*QueryValidatorSlashesRequest)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesRequest") - proto.RegisterType((*QueryValidatorSlashesResponse)(nil), "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse") - proto.RegisterType((*QueryDelegationRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsRequest") - proto.RegisterType((*QueryDelegationRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse") - proto.RegisterType((*QueryDelegationTotalRewardsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest") - proto.RegisterType((*QueryDelegationTotalRewardsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse") - proto.RegisterType((*QueryDelegatorValidatorsRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest") - proto.RegisterType((*QueryDelegatorValidatorsResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse") - proto.RegisterType((*QueryDelegatorWithdrawAddressRequest)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest") - proto.RegisterType((*QueryDelegatorWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse") - proto.RegisterType((*QueryCommunityPoolRequest)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolRequest") - proto.RegisterType((*QueryCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.QueryCommunityPoolResponse") - proto.RegisterType((*QueryTokenizeShareRecordRewardRequest)(nil), "cosmos.distribution.v1beta1.QueryTokenizeShareRecordRewardRequest") - proto.RegisterType((*QueryTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.QueryTokenizeShareRecordRewardResponse") -} - -func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/query.proto", fileDescriptor_5efd02cbc06efdc9) -} - -var fileDescriptor_5efd02cbc06efdc9 = []byte{ - // 1381 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4d, 0x6c, 0x1b, 0x45, - 0x14, 0xf6, 0xb8, 0x69, 0x4b, 0xa7, 0x2d, 0x49, 0x26, 0x11, 0x72, 0x36, 0xc1, 0x8e, 0x36, 0xb4, - 0x89, 0x1a, 0xc5, 0xdb, 0x24, 0x52, 0x29, 0x09, 0x11, 0xc4, 0x4e, 0x42, 0xa1, 0x51, 0x7f, 0x9c, - 0xd0, 0x08, 0x50, 0x65, 0xad, 0xbd, 0x93, 0xf5, 0x52, 0x7b, 0xc7, 0xd9, 0x5d, 0xc7, 0x84, 0x28, - 0x97, 0x22, 0xa4, 0xc2, 0x09, 0xc1, 0xa5, 0xc7, 0x1c, 0x11, 0x27, 0x0e, 0x20, 0x8e, 0xbd, 0xf6, - 0x58, 0x81, 0x84, 0x38, 0x15, 0x94, 0x80, 0x68, 0x0f, 0x48, 0x88, 0x0b, 0x1c, 0x91, 0x67, 0x66, - 0xed, 0xdd, 0xd8, 0x5e, 0xef, 0xda, 0xf1, 0x25, 0xd9, 0xcc, 0xcc, 0xfb, 0xde, 0xfb, 0xde, 0x9b, - 0x37, 0xf3, 0x4d, 0xe0, 0x78, 0x96, 0x98, 0x05, 0x62, 0x4a, 0x8a, 0x66, 0x5a, 0x86, 0x96, 0x29, - 0x59, 0x1a, 0xd1, 0xa5, 0xed, 0xe9, 0x0c, 0xb6, 0xe4, 0x69, 0x69, 0xab, 0x84, 0x8d, 0x9d, 0x78, - 0xd1, 0x20, 0x16, 0x41, 0xc3, 0x6c, 0x61, 0xdc, 0xb9, 0x30, 0xce, 0x17, 0x0a, 0x97, 0x38, 0x4a, - 0x46, 0x36, 0x31, 0xb3, 0xaa, 0x62, 0x14, 0x65, 0x55, 0xd3, 0x65, 0xba, 0x9a, 0x02, 0x09, 0x83, - 0x2a, 0x51, 0x09, 0xfd, 0x94, 0x2a, 0x5f, 0x7c, 0x74, 0x44, 0x25, 0x44, 0xcd, 0x63, 0x49, 0x2e, - 0x6a, 0x92, 0xac, 0xeb, 0xc4, 0xa2, 0x26, 0x26, 0x9f, 0x8d, 0x3a, 0xf1, 0x6d, 0xe4, 0x2c, 0xd1, - 0x6c, 0xcc, 0xb8, 0x17, 0x0b, 0x57, 0xc4, 0x6c, 0xfd, 0x10, 0x5b, 0x9f, 0x66, 0x61, 0x70, 0x66, - 0x6c, 0xaa, 0x5f, 0x2e, 0x68, 0x3a, 0x91, 0xe8, 0x4f, 0x36, 0x24, 0x0e, 0x42, 0x74, 0xbb, 0xc2, - 0xe9, 0x96, 0x6c, 0xc8, 0x05, 0x33, 0x85, 0xb7, 0x4a, 0xd8, 0xb4, 0xc4, 0xbb, 0x70, 0xc0, 0x35, - 0x6a, 0x16, 0x89, 0x6e, 0x62, 0xb4, 0x02, 0x4f, 0x15, 0xe9, 0x48, 0x04, 0x8c, 0x82, 0x89, 0xb3, - 0x33, 0x63, 0x71, 0x8f, 0xc4, 0xc5, 0x99, 0x71, 0xe2, 0xcc, 0xe3, 0xa7, 0xb1, 0xd0, 0xd7, 0x7f, - 0x7e, 0x7b, 0x09, 0xa4, 0xb8, 0xb5, 0xa8, 0xc3, 0x0b, 0x14, 0xfe, 0x8e, 0x9c, 0xd7, 0x14, 0xd9, - 0x22, 0xc6, 0x92, 0xc3, 0xfe, 0x6d, 0x7d, 0x93, 0xf0, 0x38, 0xd0, 0x32, 0xec, 0xdf, 0xb6, 0xd7, - 0xa4, 0x65, 0x45, 0x31, 0xb0, 0xc9, 0x7c, 0x9f, 0x49, 0x44, 0x7e, 0xfc, 0x6e, 0x6a, 0x90, 0xbb, - 0x5f, 0x64, 0x33, 0x6b, 0x96, 0xa1, 0xe9, 0x6a, 0xaa, 0xaf, 0x6a, 0xc2, 0xc7, 0xc5, 0x3f, 0xc2, - 0xf0, 0x62, 0x2b, 0x87, 0x9c, 0x62, 0x12, 0xf6, 0x91, 0x22, 0x36, 0x02, 0x39, 0xec, 0xb5, 0x2d, - 0xf8, 0x30, 0xba, 0x0f, 0x60, 0xbf, 0x89, 0xf3, 0x9b, 0xe9, 0x0c, 0xd1, 0x95, 0xb4, 0x81, 0xcb, - 0xb2, 0xa1, 0x98, 0x91, 0xf0, 0xe8, 0x89, 0x89, 0xb3, 0x33, 0x23, 0x76, 0xce, 0x2a, 0xf5, 0xae, - 0xe6, 0x6a, 0x09, 0x67, 0x93, 0x44, 0xd3, 0x13, 0x57, 0x2b, 0xc9, 0xfa, 0xe6, 0xd7, 0xd8, 0xa4, - 0xaa, 0x59, 0xb9, 0x52, 0x26, 0x9e, 0x25, 0x05, 0x5e, 0x42, 0xfe, 0x6b, 0xca, 0x54, 0xee, 0x49, - 0xd6, 0x4e, 0x11, 0x9b, 0xb6, 0x8d, 0xc9, 0x72, 0xdb, 0x5b, 0x71, 0x98, 0x20, 0xba, 0x92, 0x62, - 0xee, 0xd0, 0x16, 0x84, 0x59, 0x52, 0x28, 0x68, 0xa6, 0xa9, 0x11, 0x3d, 0x72, 0xc2, 0x87, 0xf3, - 0xd9, 0x36, 0x9c, 0xa7, 0x1c, 0x4e, 0xc4, 0x22, 0x1c, 0x77, 0xa7, 0xf9, 0x66, 0xc9, 0x32, 0x2d, - 0x59, 0x57, 0x2a, 0x59, 0x62, 0x61, 0x1d, 0x73, 0x65, 0x3f, 0x03, 0x70, 0xa2, 0xb5, 0x4b, 0x5e, - 0xdb, 0xbb, 0xf0, 0xb4, 0x5d, 0x0b, 0xb6, 0x7f, 0xaf, 0x7a, 0xee, 0x5f, 0x0f, 0x48, 0xe7, 0xa6, - 0xb6, 0x31, 0xc5, 0x1c, 0x8c, 0xb9, 0x43, 0x49, 0x56, 0x33, 0x73, 0xcc, 0xac, 0x3f, 0x07, 0x70, - 0xb4, 0xb9, 0x2b, 0xce, 0x76, 0xd3, 0x55, 0x7f, 0x46, 0x78, 0xde, 0x1f, 0xe1, 0xc5, 0x6c, 0xb6, - 0x54, 0x28, 0xe5, 0x65, 0x0b, 0x2b, 0x35, 0x60, 0x27, 0x67, 0x67, 0xd1, 0x3f, 0x0d, 0xc3, 0x11, - 0x77, 0x30, 0x6b, 0x79, 0xd9, 0xcc, 0xe1, 0x63, 0x2e, 0x35, 0x1a, 0x87, 0xbd, 0xa6, 0x25, 0x1b, - 0x96, 0xa6, 0xab, 0xe9, 0x1c, 0xd6, 0xd4, 0x9c, 0x15, 0x09, 0x8f, 0x82, 0x89, 0x9e, 0xd4, 0x8b, - 0xf6, 0xf0, 0x35, 0x3a, 0x8a, 0xc6, 0xe0, 0x79, 0x4c, 0x8b, 0x65, 0x2f, 0x3b, 0x41, 0x97, 0x9d, - 0x63, 0x83, 0x7c, 0xd1, 0x0a, 0x84, 0xb5, 0xd3, 0x3b, 0xd2, 0x43, 0xb3, 0x73, 0xd1, 0xd5, 0x1d, - 0xec, 0x82, 0xa8, 0x1d, 0x66, 0x2a, 0xe6, 0x84, 0x52, 0x0e, 0xcb, 0xb9, 0x17, 0x1e, 0xec, 0xc7, - 0x42, 0x0f, 0xf7, 0x63, 0x40, 0x7c, 0x04, 0xe0, 0xcb, 0x4d, 0xf2, 0xc0, 0x2b, 0xf2, 0x2e, 0x3c, - 0x6d, 0xb2, 0xa1, 0x08, 0xa0, 0xed, 0x78, 0xd9, 0x5f, 0x39, 0x28, 0xce, 0xf2, 0x36, 0xd6, 0x2d, - 0xd7, 0xbe, 0xe3, 0x58, 0xe8, 0x2d, 0x17, 0x95, 0x30, 0xa5, 0x32, 0xde, 0x92, 0x0a, 0x8b, 0xc9, - 0xc9, 0x45, 0xfc, 0xc1, 0x66, 0xb0, 0x84, 0xf3, 0x58, 0xa5, 0x63, 0xf5, 0x5d, 0xab, 0xb0, 0xb9, - 0x20, 0xa5, 0xac, 0x9a, 0xd8, 0xa5, 0x6c, 0xb8, 0x23, 0xc2, 0x41, 0x77, 0x04, 0xcb, 0xfd, 0xb3, - 0xfd, 0x58, 0x48, 0xfc, 0x12, 0xc0, 0x68, 0xb3, 0xc8, 0x79, 0xf2, 0x8b, 0xce, 0xe6, 0xef, 0xe6, - 0x41, 0x5c, 0x3d, 0x0f, 0x4a, 0x50, 0x3c, 0x12, 0xd3, 0x3a, 0xb1, 0xe4, 0x7c, 0x57, 0x52, 0xea, - 0xc8, 0xc5, 0xdf, 0x00, 0x8e, 0x79, 0xfa, 0xe5, 0x09, 0xf9, 0xe0, 0x68, 0x42, 0xae, 0x78, 0xee, - 0xc6, 0x1a, 0xda, 0x92, 0xed, 0x9b, 0x21, 0x36, 0x3a, 0x0b, 0x51, 0x1e, 0x9e, 0xb4, 0x2a, 0x4e, - 0xbb, 0x7c, 0xe9, 0x31, 0x27, 0xa2, 0xc1, 0x4f, 0xde, 0x6a, 0x64, 0xd5, 0xd6, 0xe9, 0x5e, 0x9a, - 0x57, 0xf9, 0x11, 0xdc, 0xd0, 0x27, 0x4f, 0x71, 0x14, 0xc2, 0xea, 0xa6, 0x65, 0x59, 0x3e, 0x93, - 0x72, 0x8c, 0x38, 0xd0, 0xca, 0xf0, 0x15, 0x37, 0xda, 0x86, 0x66, 0xe5, 0x14, 0x43, 0x2e, 0x73, - 0xc7, 0x5d, 0xa3, 0xb1, 0xcd, 0xa5, 0x58, 0x73, 0xc7, 0x35, 0x61, 0x54, 0xe6, 0x53, 0xfe, 0x85, - 0x51, 0xd9, 0x0d, 0xe6, 0xf0, 0x3b, 0x0c, 0x87, 0xa8, 0xdf, 0xca, 0xfd, 0x52, 0xd2, 0x35, 0x6b, - 0xe7, 0x16, 0x21, 0x79, 0x5b, 0x7e, 0x3e, 0x00, 0x50, 0x68, 0x34, 0xcb, 0x43, 0xf9, 0x10, 0xf6, - 0x14, 0x09, 0xc9, 0x77, 0xb9, 0x8f, 0xa9, 0x0f, 0xb1, 0xc8, 0xf3, 0xb3, 0x4e, 0xee, 0x61, 0x5d, - 0xfb, 0x18, 0xaf, 0xe5, 0x64, 0x03, 0xa7, 0x70, 0x96, 0x18, 0x5c, 0x68, 0xd9, 0x95, 0x59, 0x80, - 0xe7, 0x49, 0x59, 0xc7, 0x75, 0x55, 0xf9, 0xe7, 0x69, 0x6c, 0x70, 0x47, 0x2e, 0xe4, 0xe7, 0x44, - 0xd7, 0xb4, 0x98, 0x3a, 0x47, 0xff, 0xae, 0xcf, 0xcc, 0x73, 0xc0, 0xc5, 0xaa, 0x87, 0x4b, 0x9e, - 0x88, 0x3b, 0xc1, 0x5a, 0xb8, 0x29, 0x60, 0xa2, 0xa7, 0x92, 0xa5, 0x5a, 0xf7, 0xaa, 0x41, 0xba, - 0xb7, 0x2d, 0xd5, 0xc8, 0xf0, 0x67, 0x1e, 0x0d, 0xc0, 0x93, 0x94, 0x2b, 0x7a, 0x08, 0xe0, 0x29, - 0xf6, 0x60, 0x40, 0x92, 0x27, 0x89, 0xfa, 0xd7, 0x8a, 0x70, 0xd9, 0xbf, 0x01, 0x4b, 0x9c, 0x38, - 0x79, 0xff, 0xa7, 0xdf, 0xbf, 0x0a, 0x5f, 0x40, 0x63, 0x92, 0xd7, 0xe3, 0x8a, 0xbd, 0x56, 0xd0, - 0x73, 0x00, 0x87, 0x9a, 0x3e, 0x1c, 0x50, 0xa2, 0xb5, 0xf3, 0x56, 0xcf, 0x1c, 0x21, 0xd9, 0x11, - 0x06, 0xe7, 0x94, 0xa4, 0x9c, 0x16, 0xd0, 0xbc, 0x27, 0xa7, 0xda, 0xe9, 0x23, 0xed, 0xd6, 0xdd, - 0xc1, 0x7b, 0xe8, 0x93, 0x30, 0x1c, 0xf6, 0xd0, 0xbd, 0x68, 0x29, 0x40, 0xa4, 0x4d, 0xc5, 0xbf, - 0xb0, 0xdc, 0x21, 0x0a, 0x67, 0xbc, 0x41, 0x19, 0xdf, 0x46, 0x37, 0x3b, 0x60, 0x2c, 0x91, 0x1a, - 0xbe, 0xfd, 0x52, 0x43, 0x07, 0x00, 0x0e, 0x34, 0x90, 0xd6, 0xe8, 0xf5, 0x00, 0x71, 0xd7, 0x89, - 0x7f, 0x61, 0xa1, 0x4d, 0x6b, 0xce, 0xf6, 0x06, 0x65, 0x7b, 0x0d, 0xad, 0x74, 0xc2, 0xb6, 0xa6, - 0xdb, 0xd1, 0xcf, 0x00, 0xf6, 0x1d, 0x95, 0xaa, 0xe8, 0xb5, 0x00, 0x31, 0xba, 0x65, 0xbe, 0x30, - 0xd7, 0x8e, 0x29, 0xe7, 0x76, 0x9d, 0x72, 0x5b, 0x46, 0xc9, 0x4e, 0xb8, 0xd9, 0x7a, 0xf8, 0x2f, - 0x00, 0xfb, 0xeb, 0x74, 0x20, 0xf2, 0x11, 0x5e, 0x33, 0xd9, 0x2b, 0xcc, 0xb7, 0x65, 0xcb, 0xb9, - 0xa5, 0x29, 0xb7, 0xf7, 0xd0, 0x86, 0x27, 0xb7, 0xea, 0x15, 0x6d, 0x4a, 0xbb, 0x75, 0x37, 0xfc, - 0x9e, 0xc4, 0x77, 0x66, 0xc3, 0x9e, 0x7d, 0x06, 0xe0, 0x4b, 0x8d, 0xb5, 0x1e, 0x7a, 0x23, 0x48, - 0xe0, 0x0d, 0xd4, 0xa9, 0xf0, 0x66, 0xfb, 0x00, 0x81, 0x4a, 0xeb, 0x8f, 0x3e, 0x6d, 0xcc, 0x06, - 0x82, 0xcb, 0x4f, 0x63, 0x36, 0xd7, 0x86, 0x7e, 0x1a, 0xd3, 0x43, 0xe5, 0xf9, 0x6c, 0xcc, 0x16, - 0x0c, 0x6b, 0x7b, 0x1b, 0xfd, 0x0b, 0x60, 0xa4, 0x99, 0x1c, 0x43, 0x8b, 0x01, 0x62, 0x6d, 0xac, - 0x21, 0x85, 0x44, 0x27, 0x10, 0x9c, 0xf3, 0x3a, 0xe5, 0x7c, 0x03, 0xad, 0x76, 0xc2, 0xf9, 0xa8, - 0x9e, 0x44, 0xdf, 0x03, 0x78, 0xde, 0x25, 0xf9, 0xd0, 0x95, 0xd6, 0xb1, 0x36, 0x52, 0x90, 0xc2, - 0xab, 0x81, 0xed, 0x38, 0xb1, 0x59, 0x4a, 0x6c, 0x0a, 0x4d, 0x7a, 0x12, 0xcb, 0xda, 0xb6, 0xe9, - 0x8a, 0x48, 0x44, 0xff, 0x01, 0x38, 0xd4, 0x54, 0x5c, 0xf9, 0x51, 0x08, 0xad, 0xd4, 0xa5, 0x1f, - 0x85, 0xd0, 0x52, 0x2e, 0x8a, 0x29, 0xca, 0x6d, 0x15, 0xbd, 0xe3, 0xc9, 0x6d, 0xd7, 0xa5, 0x53, - 0xf7, 0x24, 0x8b, 0xe3, 0xa6, 0xcd, 0x0a, 0x70, 0xda, 0xa0, 0xc8, 0xf6, 0x55, 0x99, 0xb8, 0xfe, - 0xf8, 0x20, 0x0a, 0x9e, 0x1c, 0x44, 0xc1, 0x6f, 0x07, 0x51, 0xf0, 0xc5, 0x61, 0x34, 0xf4, 0xe4, - 0x30, 0x1a, 0xfa, 0xe5, 0x30, 0x1a, 0x7a, 0x7f, 0xda, 0x53, 0x0f, 0x7e, 0xe4, 0x76, 0x4e, 0xe5, - 0x61, 0xe6, 0x14, 0xfd, 0x9f, 0xf4, 0xec, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x94, 0xd7, - 0x10, 0xb9, 0x17, 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 { - // Params queries params of the distribution module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator - ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) - // ValidatorOutstandingRewards queries rewards of a validator address. - ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) - // ValidatorCommission queries accumulated commission for a validator. - ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) - // ValidatorSlashes queries slash events of a validator. - ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) - // DelegationRewards queries the total rewards accrued by a delegation. - DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) - // DelegationTotalRewards queries the total rewards accrued by a each - // validator. - DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) - // DelegatorValidators queries the validators of a delegator. - DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) - // DelegatorWithdrawAddress queries withdraw address of a delegator. - DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) - // CommunityPool queries the community pool coins. - CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) - // TokenizeShareRecordReward queries the tokenize share record rewards - TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ValidatorDistributionInfo(ctx context.Context, in *QueryValidatorDistributionInfoRequest, opts ...grpc.CallOption) (*QueryValidatorDistributionInfoResponse, error) { - out := new(QueryValidatorDistributionInfoResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ValidatorOutstandingRewards(ctx context.Context, in *QueryValidatorOutstandingRewardsRequest, opts ...grpc.CallOption) (*QueryValidatorOutstandingRewardsResponse, error) { - out := new(QueryValidatorOutstandingRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ValidatorCommission(ctx context.Context, in *QueryValidatorCommissionRequest, opts ...grpc.CallOption) (*QueryValidatorCommissionResponse, error) { - out := new(QueryValidatorCommissionResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorCommission", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ValidatorSlashes(ctx context.Context, in *QueryValidatorSlashesRequest, opts ...grpc.CallOption) (*QueryValidatorSlashesResponse, error) { - out := new(QueryValidatorSlashesResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DelegationRewards(ctx context.Context, in *QueryDelegationRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationRewardsResponse, error) { - out := new(QueryDelegationRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationRewards", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DelegationTotalRewards(ctx context.Context, in *QueryDelegationTotalRewardsRequest, opts ...grpc.CallOption) (*QueryDelegationTotalRewardsResponse, error) { - out := new(QueryDelegationTotalRewardsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DelegatorValidators(ctx context.Context, in *QueryDelegatorValidatorsRequest, opts ...grpc.CallOption) (*QueryDelegatorValidatorsResponse, error) { - out := new(QueryDelegatorValidatorsResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorValidators", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) DelegatorWithdrawAddress(ctx context.Context, in *QueryDelegatorWithdrawAddressRequest, opts ...grpc.CallOption) (*QueryDelegatorWithdrawAddressResponse, error) { - out := new(QueryDelegatorWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) CommunityPool(ctx context.Context, in *QueryCommunityPoolRequest, opts ...grpc.CallOption) (*QueryCommunityPoolResponse, error) { - out := new(QueryCommunityPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/CommunityPool", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TokenizeShareRecordReward(ctx context.Context, in *QueryTokenizeShareRecordRewardRequest, opts ...grpc.CallOption) (*QueryTokenizeShareRecordRewardResponse, error) { - out := new(QueryTokenizeShareRecordRewardResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Query/TokenizeShareRecordReward", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Params queries params of the distribution module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // ValidatorDistributionInfo queries validator commission and self-delegation rewards for validator - ValidatorDistributionInfo(context.Context, *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) - // ValidatorOutstandingRewards queries rewards of a validator address. - ValidatorOutstandingRewards(context.Context, *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) - // ValidatorCommission queries accumulated commission for a validator. - ValidatorCommission(context.Context, *QueryValidatorCommissionRequest) (*QueryValidatorCommissionResponse, error) - // ValidatorSlashes queries slash events of a validator. - ValidatorSlashes(context.Context, *QueryValidatorSlashesRequest) (*QueryValidatorSlashesResponse, error) - // DelegationRewards queries the total rewards accrued by a delegation. - DelegationRewards(context.Context, *QueryDelegationRewardsRequest) (*QueryDelegationRewardsResponse, error) - // DelegationTotalRewards queries the total rewards accrued by a each - // validator. - DelegationTotalRewards(context.Context, *QueryDelegationTotalRewardsRequest) (*QueryDelegationTotalRewardsResponse, error) - // DelegatorValidators queries the validators of a delegator. - DelegatorValidators(context.Context, *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) - // DelegatorWithdrawAddress queries withdraw address of a delegator. - DelegatorWithdrawAddress(context.Context, *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) - // CommunityPool queries the community pool coins. - CommunityPool(context.Context, *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) - // TokenizeShareRecordReward queries the tokenize share record rewards - TokenizeShareRecordReward(context.Context, *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) ValidatorDistributionInfo(ctx context.Context, req *QueryValidatorDistributionInfoRequest) (*QueryValidatorDistributionInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorDistributionInfo not implemented") -} -func (*UnimplementedQueryServer) ValidatorOutstandingRewards(ctx context.Context, req *QueryValidatorOutstandingRewardsRequest) (*QueryValidatorOutstandingRewardsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorOutstandingRewards not implemented") -} -func (*UnimplementedQueryServer) ValidatorCommission(ctx context.Context, req *QueryValidatorCommissionRequest) (*QueryValidatorCommissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorCommission not implemented") -} -func (*UnimplementedQueryServer) ValidatorSlashes(ctx context.Context, req *QueryValidatorSlashesRequest) (*QueryValidatorSlashesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorSlashes not implemented") -} -func (*UnimplementedQueryServer) DelegationRewards(ctx context.Context, req *QueryDelegationRewardsRequest) (*QueryDelegationRewardsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegationRewards not implemented") -} -func (*UnimplementedQueryServer) DelegationTotalRewards(ctx context.Context, req *QueryDelegationTotalRewardsRequest) (*QueryDelegationTotalRewardsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegationTotalRewards not implemented") -} -func (*UnimplementedQueryServer) DelegatorValidators(ctx context.Context, req *QueryDelegatorValidatorsRequest) (*QueryDelegatorValidatorsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorValidators not implemented") -} -func (*UnimplementedQueryServer) DelegatorWithdrawAddress(ctx context.Context, req *QueryDelegatorWithdrawAddressRequest) (*QueryDelegatorWithdrawAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelegatorWithdrawAddress not implemented") -} -func (*UnimplementedQueryServer) CommunityPool(ctx context.Context, req *QueryCommunityPoolRequest) (*QueryCommunityPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommunityPool not implemented") -} -func (*UnimplementedQueryServer) TokenizeShareRecordReward(ctx context.Context, req *QueryTokenizeShareRecordRewardRequest) (*QueryTokenizeShareRecordRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TokenizeShareRecordReward not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -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: "/cosmos.distribution.v1beta1.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_ValidatorDistributionInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorDistributionInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorDistributionInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorDistributionInfo(ctx, req.(*QueryValidatorDistributionInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ValidatorOutstandingRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorOutstandingRewardsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorOutstandingRewards(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorOutstandingRewards(ctx, req.(*QueryValidatorOutstandingRewardsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorCommissionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorCommission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorCommission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorCommission(ctx, req.(*QueryValidatorCommissionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ValidatorSlashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryValidatorSlashesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ValidatorSlashes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ValidatorSlashes(ctx, req.(*QueryValidatorSlashesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DelegationRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegationRewardsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegationRewards(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationRewards", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegationRewards(ctx, req.(*QueryDelegationRewardsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DelegationTotalRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegationTotalRewardsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegationTotalRewards(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegationTotalRewards(ctx, req.(*QueryDelegationTotalRewardsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DelegatorValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorValidatorsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegatorValidators(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorValidators", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorValidators(ctx, req.(*QueryDelegatorValidatorsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_DelegatorWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDelegatorWithdrawAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DelegatorWithdrawAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/DelegatorWithdrawAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DelegatorWithdrawAddress(ctx, req.(*QueryDelegatorWithdrawAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_CommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryCommunityPoolRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).CommunityPool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/CommunityPool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).CommunityPool(ctx, req.(*QueryCommunityPoolRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTokenizeShareRecordRewardRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TokenizeShareRecordReward(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Query/TokenizeShareRecordReward", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TokenizeShareRecordReward(ctx, req.(*QueryTokenizeShareRecordRewardRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.distribution.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "ValidatorDistributionInfo", - Handler: _Query_ValidatorDistributionInfo_Handler, - }, - { - MethodName: "ValidatorOutstandingRewards", - Handler: _Query_ValidatorOutstandingRewards_Handler, - }, - { - MethodName: "ValidatorCommission", - Handler: _Query_ValidatorCommission_Handler, - }, - { - MethodName: "ValidatorSlashes", - Handler: _Query_ValidatorSlashes_Handler, - }, - { - MethodName: "DelegationRewards", - Handler: _Query_DelegationRewards_Handler, - }, - { - MethodName: "DelegationTotalRewards", - Handler: _Query_DelegationTotalRewards_Handler, - }, - { - MethodName: "DelegatorValidators", - Handler: _Query_DelegatorValidators_Handler, - }, - { - MethodName: "DelegatorWithdrawAddress", - Handler: _Query_DelegatorWithdrawAddress_Handler, - }, - { - MethodName: "CommunityPool", - Handler: _Query_CommunityPool_Handler, - }, - { - MethodName: "TokenizeShareRecordReward", - Handler: _Query_TokenizeShareRecordReward_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/distribution/v1beta1/query.proto", -} - -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 *QueryValidatorDistributionInfoRequest) 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 *QueryValidatorDistributionInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorDistributionInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryValidatorDistributionInfoResponse) 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 *QueryValidatorDistributionInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorDistributionInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Commission) > 0 { - for iNdEx := len(m.Commission) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Commission[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.SelfBondRewards) > 0 { - for iNdEx := len(m.SelfBondRewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SelfBondRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.OperatorAddress) > 0 { - i -= len(m.OperatorAddress) - copy(dAtA[i:], m.OperatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryValidatorOutstandingRewardsRequest) 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 *QueryValidatorOutstandingRewardsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorOutstandingRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryValidatorOutstandingRewardsResponse) 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 *QueryValidatorOutstandingRewardsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorOutstandingRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Rewards.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 *QueryValidatorCommissionRequest) 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 *QueryValidatorCommissionRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorCommissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryValidatorCommissionResponse) 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 *QueryValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorCommissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Commission.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 *QueryValidatorSlashesRequest) 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 *QueryValidatorSlashesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorSlashesRequest) 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] = 0x22 - } - if m.EndingHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.EndingHeight)) - i-- - dAtA[i] = 0x18 - } - if m.StartingHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.StartingHeight)) - i-- - dAtA[i] = 0x10 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryValidatorSlashesResponse) 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 *QueryValidatorSlashesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryValidatorSlashesResponse) 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.Slashes) > 0 { - for iNdEx := len(m.Slashes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Slashes[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 *QueryDelegationRewardsRequest) 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 *QueryDelegationRewardsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegationRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDelegationRewardsResponse) 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 *QueryDelegationRewardsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegationRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[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 *QueryDelegationTotalRewardsRequest) 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 *QueryDelegationTotalRewardsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegationTotalRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDelegationTotalRewardsResponse) 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 *QueryDelegationTotalRewardsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegationTotalRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Total) > 0 { - for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[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 *QueryDelegatorValidatorsRequest) 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 *QueryDelegatorValidatorsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegatorValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDelegatorValidatorsResponse) 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 *QueryDelegatorValidatorsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegatorValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Validators[iNdEx]) - copy(dAtA[i:], m.Validators[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Validators[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryDelegatorWithdrawAddressRequest) 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 *QueryDelegatorWithdrawAddressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegatorWithdrawAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryDelegatorWithdrawAddressResponse) 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 *QueryDelegatorWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDelegatorWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.WithdrawAddress) > 0 { - i -= len(m.WithdrawAddress) - copy(dAtA[i:], m.WithdrawAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.WithdrawAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryCommunityPoolRequest) 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 *QueryCommunityPoolRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCommunityPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryCommunityPoolResponse) 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 *QueryCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Pool) > 0 { - for iNdEx := len(m.Pool) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Pool[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 *QueryTokenizeShareRecordRewardRequest) 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 *QueryTokenizeShareRecordRewardRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTokenizeShareRecordRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryTokenizeShareRecordRewardResponse) 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 *QueryTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Total) > 0 { - for iNdEx := len(m.Total) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Total[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Rewards) > 0 { - for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Rewards[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 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 *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 *QueryValidatorDistributionInfoRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryValidatorDistributionInfoResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.SelfBondRewards) > 0 { - for _, e := range m.SelfBondRewards { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Commission) > 0 { - for _, e := range m.Commission { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryValidatorOutstandingRewardsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryValidatorOutstandingRewardsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Rewards.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryValidatorCommissionRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryValidatorCommissionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Commission.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryValidatorSlashesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.StartingHeight != 0 { - n += 1 + sovQuery(uint64(m.StartingHeight)) - } - if m.EndingHeight != 0 { - n += 1 + sovQuery(uint64(m.EndingHeight)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryValidatorSlashesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Slashes) > 0 { - for _, e := range m.Slashes { - 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 *QueryDelegationRewardsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDelegationRewardsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDelegationTotalRewardsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDelegationTotalRewardsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Total) > 0 { - for _, e := range m.Total { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDelegatorValidatorsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDelegatorValidatorsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Validators) > 0 { - for _, s := range m.Validators { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryDelegatorWithdrawAddressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDelegatorWithdrawAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.WithdrawAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryCommunityPoolRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryCommunityPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Pool) > 0 { - for _, e := range m.Pool { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryTokenizeShareRecordRewardRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryTokenizeShareRecordRewardResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Rewards) > 0 { - for _, e := range m.Rewards { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Total) > 0 { - for _, e := range m.Total { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - 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 *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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorDistributionInfoRequest) 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: QueryValidatorDistributionInfoRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorDistributionInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorDistributionInfoResponse) 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: QueryValidatorDistributionInfoResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorDistributionInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", 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.OperatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SelfBondRewards", 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.SelfBondRewards = append(m.SelfBondRewards, types.DecCoin{}) - if err := m.SelfBondRewards[len(m.SelfBondRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission = append(m.Commission, types.DecCoin{}) - if err := m.Commission[len(m.Commission)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorOutstandingRewardsRequest) 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: QueryValidatorOutstandingRewardsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorOutstandingRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorOutstandingRewardsResponse) 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: QueryValidatorOutstandingRewardsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorOutstandingRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorCommissionRequest) 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: QueryValidatorCommissionRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorCommissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorCommissionResponse) 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: QueryValidatorCommissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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.Commission.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorSlashesRequest) 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: QueryValidatorSlashesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorSlashesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingHeight", wireType) - } - m.StartingHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndingHeight", wireType) - } - m.EndingHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndingHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryValidatorSlashesResponse) 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: QueryValidatorSlashesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryValidatorSlashesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Slashes", 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.Slashes = append(m.Slashes, ValidatorSlashEvent{}) - if err := m.Slashes[len(m.Slashes)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegationRewardsRequest) 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: QueryDelegationRewardsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegationRewardsResponse) 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: QueryDelegationRewardsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, types.DecCoin{}) - if err := m.Rewards[len(m.Rewards)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegationTotalRewardsRequest) 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: QueryDelegationTotalRewardsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationTotalRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegationTotalRewardsResponse) 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: QueryDelegationTotalRewardsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegationTotalRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, DelegationDelegatorReward{}) - if err := m.Rewards[len(m.Rewards)-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 Total", 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.Total = append(m.Total, types.DecCoin{}) - if err := m.Total[len(m.Total)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegatorValidatorsRequest) 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: QueryDelegatorValidatorsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegatorValidatorsResponse) 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: QueryDelegatorValidatorsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorValidatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", 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.Validators = append(m.Validators, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegatorWithdrawAddressRequest) 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: QueryDelegatorWithdrawAddressRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorWithdrawAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDelegatorWithdrawAddressResponse) 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: QueryDelegatorWithdrawAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDelegatorWithdrawAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", 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.WithdrawAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCommunityPoolRequest) 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: QueryCommunityPoolRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCommunityPoolRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryCommunityPoolResponse) 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: QueryCommunityPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryCommunityPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pool", 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.Pool = append(m.Pool, types.DecCoin{}) - if err := m.Pool[len(m.Pool)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTokenizeShareRecordRewardRequest) 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: QueryTokenizeShareRecordRewardRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTokenizeShareRecordRewardRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTokenizeShareRecordRewardResponse) 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: QueryTokenizeShareRecordRewardResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTokenizeShareRecordRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewards", 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.Rewards = append(m.Rewards, TokenizeShareRecordReward{}) - if err := m.Rewards[len(m.Rewards)-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 Total", 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.Total = append(m.Total, types.DecCoin{}) - if err := m.Total[len(m.Total)-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) || (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/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go deleted file mode 100644 index 7dec9a7ed004..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/distribution/types/query.pb.gw.go +++ /dev/null @@ -1,1167 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/distribution/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ValidatorDistributionInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorDistributionInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := client.ValidatorDistributionInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ValidatorDistributionInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorDistributionInfoRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := server.ValidatorDistributionInfo(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ValidatorOutstandingRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorOutstandingRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := client.ValidatorOutstandingRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ValidatorOutstandingRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorOutstandingRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := server.ValidatorOutstandingRewards(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ValidatorCommission_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorCommissionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := client.ValidatorCommission(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ValidatorCommission_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorCommissionRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := server.ValidatorCommission(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ValidatorSlashes_0 = &utilities.DoubleArray{Encoding: map[string]int{"validator_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_ValidatorSlashes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorSlashesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorSlashes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ValidatorSlashes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ValidatorSlashes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryValidatorSlashesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ValidatorSlashes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ValidatorSlashes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DelegationRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegationRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := client.DelegationRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DelegationRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegationRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - val, ok = pathParams["validator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") - } - - protoReq.ValidatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) - } - - msg, err := server.DelegationRewards(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DelegationTotalRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegationTotalRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := client.DelegationTotalRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DelegationTotalRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegationTotalRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := server.DelegationTotalRewards(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DelegatorValidators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegatorValidatorsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := client.DelegatorValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DelegatorValidators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegatorValidatorsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := server.DelegatorValidators(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_DelegatorWithdrawAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegatorWithdrawAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := client.DelegatorWithdrawAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DelegatorWithdrawAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDelegatorWithdrawAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["delegator_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "delegator_address") - } - - protoReq.DelegatorAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "delegator_address", err) - } - - msg, err := server.DelegatorWithdrawAddress(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCommunityPoolRequest - var metadata runtime.ServerMetadata - - msg, err := client.CommunityPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_CommunityPool_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryCommunityPoolRequest - var metadata runtime.ServerMetadata - - msg, err := server.CommunityPool(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTokenizeShareRecordRewardRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") - } - - protoReq.OwnerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) - } - - msg, err := client.TokenizeShareRecordReward(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TokenizeShareRecordReward_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTokenizeShareRecordRewardRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner_address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner_address") - } - - protoReq.OwnerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner_address", err) - } - - msg, err := server.TokenizeShareRecordReward(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorDistributionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ValidatorDistributionInfo_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorDistributionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorOutstandingRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ValidatorOutstandingRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorOutstandingRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ValidatorCommission_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorCommission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorSlashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ValidatorSlashes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorSlashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegationRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DelegationRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegationRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegationTotalRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DelegationTotalRewards_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegationTotalRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DelegatorValidators_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegatorValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegatorWithdrawAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DelegatorWithdrawAddress_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegatorWithdrawAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_CommunityPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_CommunityPool_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorDistributionInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ValidatorDistributionInfo_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorDistributionInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorOutstandingRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ValidatorOutstandingRewards_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorOutstandingRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorCommission_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ValidatorCommission_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorCommission_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ValidatorSlashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ValidatorSlashes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ValidatorSlashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegationRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DelegationRewards_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegationRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegationTotalRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DelegationTotalRewards_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegationTotalRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegatorValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DelegatorValidators_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegatorValidators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_DelegatorWithdrawAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DelegatorWithdrawAddress_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DelegatorWithdrawAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_CommunityPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_CommunityPool_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_CommunityPool_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TokenizeShareRecordReward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TokenizeShareRecordReward_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TokenizeShareRecordReward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ValidatorDistributionInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ValidatorOutstandingRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "outstanding_rewards"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ValidatorCommission_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "commission"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ValidatorSlashes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "validators", "validator_address", "slashes"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DelegationRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards", "validator_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DelegationTotalRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "rewards"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DelegatorValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "validators"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DelegatorWithdrawAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "distribution", "v1beta1", "delegators", "delegator_address", "withdraw_address"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_CommunityPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "distribution", "v1beta1", "community_pool"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_TokenizeShareRecordReward_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"cosmos", "distribution", "v1beta1", "owner_address", "tokenize_share_record_rewards"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_ValidatorDistributionInfo_0 = runtime.ForwardResponseMessage - - forward_Query_ValidatorOutstandingRewards_0 = runtime.ForwardResponseMessage - - forward_Query_ValidatorCommission_0 = runtime.ForwardResponseMessage - - forward_Query_ValidatorSlashes_0 = runtime.ForwardResponseMessage - - forward_Query_DelegationRewards_0 = runtime.ForwardResponseMessage - - forward_Query_DelegationTotalRewards_0 = runtime.ForwardResponseMessage - - forward_Query_DelegatorValidators_0 = runtime.ForwardResponseMessage - - forward_Query_DelegatorWithdrawAddress_0 = runtime.ForwardResponseMessage - - forward_Query_CommunityPool_0 = runtime.ForwardResponseMessage - - forward_Query_TokenizeShareRecordReward_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go deleted file mode 100644 index f72244e68b11..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/distribution/types/tx.pb.go +++ /dev/null @@ -1,3615 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/distribution/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 - -// MsgSetWithdrawAddress sets the withdraw address for -// a delegator (or validator self-delegation). -type MsgSetWithdrawAddress struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - WithdrawAddress string `protobuf:"bytes,2,opt,name=withdraw_address,json=withdrawAddress,proto3" json:"withdraw_address,omitempty"` -} - -func (m *MsgSetWithdrawAddress) Reset() { *m = MsgSetWithdrawAddress{} } -func (m *MsgSetWithdrawAddress) String() string { return proto.CompactTextString(m) } -func (*MsgSetWithdrawAddress) ProtoMessage() {} -func (*MsgSetWithdrawAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{0} -} -func (m *MsgSetWithdrawAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetWithdrawAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetWithdrawAddress.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 *MsgSetWithdrawAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetWithdrawAddress.Merge(m, src) -} -func (m *MsgSetWithdrawAddress) XXX_Size() int { - return m.Size() -} -func (m *MsgSetWithdrawAddress) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetWithdrawAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetWithdrawAddress proto.InternalMessageInfo - -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response -// type. -type MsgSetWithdrawAddressResponse struct { -} - -func (m *MsgSetWithdrawAddressResponse) Reset() { *m = MsgSetWithdrawAddressResponse{} } -func (m *MsgSetWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSetWithdrawAddressResponse) ProtoMessage() {} -func (*MsgSetWithdrawAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{1} -} -func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSetWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSetWithdrawAddressResponse.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 *MsgSetWithdrawAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSetWithdrawAddressResponse.Merge(m, src) -} -func (m *MsgSetWithdrawAddressResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSetWithdrawAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSetWithdrawAddressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSetWithdrawAddressResponse proto.InternalMessageInfo - -// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator -// from a single validator. -type MsgWithdrawDelegatorReward struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegatorReward{} } -func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawDelegatorReward) ProtoMessage() {} -func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{2} -} -func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawDelegatorReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawDelegatorReward.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 *MsgWithdrawDelegatorReward) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawDelegatorReward.Merge(m, src) -} -func (m *MsgWithdrawDelegatorReward) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawDelegatorReward) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawDelegatorReward.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawDelegatorReward proto.InternalMessageInfo - -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward -// response type. -type MsgWithdrawDelegatorRewardResponse struct { - // Since: cosmos-sdk 0.46 - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` -} - -func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawDelegatorRewardResponse{} } -func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} -func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{3} -} -func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawDelegatorRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.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 *MsgWithdrawDelegatorRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.Merge(m, src) -} -func (m *MsgWithdrawDelegatorRewardResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawDelegatorRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawDelegatorRewardResponse proto.InternalMessageInfo - -func (m *MsgWithdrawDelegatorRewardResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -// MsgWithdrawValidatorCommission withdraws the full commission to the validator -// address. -type MsgWithdrawValidatorCommission struct { - ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` -} - -func (m *MsgWithdrawValidatorCommission) Reset() { *m = MsgWithdrawValidatorCommission{} } -func (m *MsgWithdrawValidatorCommission) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawValidatorCommission) ProtoMessage() {} -func (*MsgWithdrawValidatorCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{4} -} -func (m *MsgWithdrawValidatorCommission) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawValidatorCommission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawValidatorCommission.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 *MsgWithdrawValidatorCommission) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawValidatorCommission.Merge(m, src) -} -func (m *MsgWithdrawValidatorCommission) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawValidatorCommission) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawValidatorCommission.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawValidatorCommission proto.InternalMessageInfo - -// MsgWithdrawValidatorCommissionResponse defines the -// Msg/WithdrawValidatorCommission response type. -type MsgWithdrawValidatorCommissionResponse struct { - // Since: cosmos-sdk 0.46 - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` -} - -func (m *MsgWithdrawValidatorCommissionResponse) Reset() { - *m = MsgWithdrawValidatorCommissionResponse{} -} -func (m *MsgWithdrawValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawValidatorCommissionResponse) ProtoMessage() {} -func (*MsgWithdrawValidatorCommissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{5} -} -func (m *MsgWithdrawValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.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 *MsgWithdrawValidatorCommissionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.Merge(m, src) -} -func (m *MsgWithdrawValidatorCommissionResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawValidatorCommissionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawValidatorCommissionResponse proto.InternalMessageInfo - -func (m *MsgWithdrawValidatorCommissionResponse) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -// MsgFundCommunityPool allows an account to directly -// fund the community pool. -type MsgFundCommunityPool struct { - Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` -} - -func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } -func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } -func (*MsgFundCommunityPool) ProtoMessage() {} -func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{6} -} -func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgFundCommunityPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgFundCommunityPool.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 *MsgFundCommunityPool) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgFundCommunityPool.Merge(m, src) -} -func (m *MsgFundCommunityPool) XXX_Size() int { - return m.Size() -} -func (m *MsgFundCommunityPool) XXX_DiscardUnknown() { - xxx_messageInfo_MsgFundCommunityPool.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgFundCommunityPool proto.InternalMessageInfo - -// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. -type MsgFundCommunityPoolResponse struct { -} - -func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPoolResponse{} } -func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } -func (*MsgFundCommunityPoolResponse) ProtoMessage() {} -func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{7} -} -func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgFundCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgFundCommunityPoolResponse.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 *MsgFundCommunityPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgFundCommunityPoolResponse.Merge(m, src) -} -func (m *MsgFundCommunityPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgFundCommunityPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -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 x/distribution 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_ed4f433d965e58ca, []int{8} -} -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. -// -// Since: cosmos-sdk 0.47 -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_ed4f433d965e58ca, []int{9} -} -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 - -// MsgCommunityPoolSpend defines a message for sending tokens from the community -// pool to another account. This message is typically executed via a governance -// proposal with the governance module being the executing authority. -// -// Since: cosmos-sdk 0.47 -type MsgCommunityPoolSpend 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"` - Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,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"` -} - -func (m *MsgCommunityPoolSpend) Reset() { *m = MsgCommunityPoolSpend{} } -func (m *MsgCommunityPoolSpend) String() string { return proto.CompactTextString(m) } -func (*MsgCommunityPoolSpend) ProtoMessage() {} -func (*MsgCommunityPoolSpend) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{10} -} -func (m *MsgCommunityPoolSpend) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCommunityPoolSpend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCommunityPoolSpend.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 *MsgCommunityPoolSpend) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCommunityPoolSpend.Merge(m, src) -} -func (m *MsgCommunityPoolSpend) XXX_Size() int { - return m.Size() -} -func (m *MsgCommunityPoolSpend) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCommunityPoolSpend.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCommunityPoolSpend proto.InternalMessageInfo - -func (m *MsgCommunityPoolSpend) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgCommunityPoolSpend) GetRecipient() string { - if m != nil { - return m.Recipient - } - return "" -} - -func (m *MsgCommunityPoolSpend) GetAmount() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Amount - } - return nil -} - -// MsgWithdrawTokenizeShareRecordReward withdraws tokenize share rewards for a specific record -type MsgWithdrawTokenizeShareRecordReward struct { - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` - RecordId uint64 `protobuf:"varint,2,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty"` -} - -func (m *MsgWithdrawTokenizeShareRecordReward) Reset() { *m = MsgWithdrawTokenizeShareRecordReward{} } -func (m *MsgWithdrawTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawTokenizeShareRecordReward) ProtoMessage() {} -func (*MsgWithdrawTokenizeShareRecordReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{11} -} -func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.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 *MsgWithdrawTokenizeShareRecordReward) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.Merge(m, src) -} -func (m *MsgWithdrawTokenizeShareRecordReward) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawTokenizeShareRecordReward) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawTokenizeShareRecordReward proto.InternalMessageInfo - -// MsgWithdrawTokenizeShareRecordReward defines the Msg/WithdrawTokenizeShareRecordReward response type. -type MsgWithdrawTokenizeShareRecordRewardResponse struct { -} - -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Reset() { - *m = MsgWithdrawTokenizeShareRecordRewardResponse{} -} -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) String() string { - return proto.CompactTextString(m) -} -func (*MsgWithdrawTokenizeShareRecordRewardResponse) ProtoMessage() {} -func (*MsgWithdrawTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{12} -} -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.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 *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.Merge(m, src) -} -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawTokenizeShareRecordRewardResponse proto.InternalMessageInfo - -// MsgWithdrawAllTokenizeShareRecordReward withdraws tokenize share rewards or all -// records owned by the designated owner -type MsgWithdrawAllTokenizeShareRecordReward struct { - OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" yaml:"owner_address"` -} - -func (m *MsgWithdrawAllTokenizeShareRecordReward) Reset() { - *m = MsgWithdrawAllTokenizeShareRecordReward{} -} -func (m *MsgWithdrawAllTokenizeShareRecordReward) String() string { return proto.CompactTextString(m) } -func (*MsgWithdrawAllTokenizeShareRecordReward) ProtoMessage() {} -func (*MsgWithdrawAllTokenizeShareRecordReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{13} -} -func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.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 *MsgWithdrawAllTokenizeShareRecordReward) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.Merge(m, src) -} -func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawAllTokenizeShareRecordReward) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordReward proto.InternalMessageInfo - -// MsgWithdrawAllTokenizeShareRecordRewardResponse defines the Msg/WithdrawTokenizeShareRecordReward response type. -type MsgWithdrawAllTokenizeShareRecordRewardResponse struct { -} - -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Reset() { - *m = MsgWithdrawAllTokenizeShareRecordRewardResponse{} -} -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) String() string { - return proto.CompactTextString(m) -} -func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) ProtoMessage() {} -func (*MsgWithdrawAllTokenizeShareRecordRewardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{14} -} -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.Merge(m, src) -} -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWithdrawAllTokenizeShareRecordRewardResponse proto.InternalMessageInfo - -// MsgCommunityPoolSpendResponse defines the response to executing a -// MsgCommunityPoolSpend message. -// -// Since: cosmos-sdk 0.47 -type MsgCommunityPoolSpendResponse struct { -} - -func (m *MsgCommunityPoolSpendResponse) Reset() { *m = MsgCommunityPoolSpendResponse{} } -func (m *MsgCommunityPoolSpendResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCommunityPoolSpendResponse) ProtoMessage() {} -func (*MsgCommunityPoolSpendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{15} -} -func (m *MsgCommunityPoolSpendResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCommunityPoolSpendResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCommunityPoolSpendResponse.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 *MsgCommunityPoolSpendResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCommunityPoolSpendResponse.Merge(m, src) -} -func (m *MsgCommunityPoolSpendResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCommunityPoolSpendResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCommunityPoolSpendResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCommunityPoolSpendResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress") - proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") - proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") - proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") - proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") - proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") - proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPool") - proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.distribution.v1beta1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.distribution.v1beta1.MsgUpdateParamsResponse") - proto.RegisterType((*MsgCommunityPoolSpend)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpend") - proto.RegisterType((*MsgWithdrawTokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordReward") - proto.RegisterType((*MsgWithdrawTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawTokenizeShareRecordRewardResponse") - proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordReward") - proto.RegisterType((*MsgWithdrawAllTokenizeShareRecordRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawAllTokenizeShareRecordRewardResponse") - proto.RegisterType((*MsgCommunityPoolSpendResponse)(nil), "cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse") -} - -func init() { - proto.RegisterFile("cosmos/distribution/v1beta1/tx.proto", fileDescriptor_ed4f433d965e58ca) -} - -var fileDescriptor_ed4f433d965e58ca = []byte{ - // 998 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xde, 0x69, 0x20, 0x62, 0xa7, 0x45, 0x4d, 0xac, 0xa0, 0x24, 0x4e, 0xf1, 0x16, 0x37, 0x4a, - 0xa3, 0xa8, 0xb5, 0xb5, 0x81, 0x02, 0x35, 0x42, 0x28, 0x49, 0x1b, 0x29, 0x12, 0x2b, 0x2a, 0xa7, - 0x50, 0x89, 0x4b, 0xe4, 0xdd, 0x19, 0xbc, 0xa3, 0xae, 0x3d, 0x96, 0x67, 0x36, 0xdb, 0xe5, 0x04, - 0x88, 0x03, 0xe2, 0x80, 0x50, 0xf9, 0x03, 0xe8, 0xb1, 0xe2, 0x42, 0x90, 0x38, 0xc1, 0x89, 0x5b, - 0x2f, 0x48, 0x15, 0xa7, 0x9e, 0x0a, 0x4a, 0x0e, 0x41, 0xe2, 0x86, 0xe0, 0x8e, 0xfc, 0x73, 0xed, - 0xb5, 0xd7, 0xde, 0xed, 0x0f, 0x7a, 0x49, 0x76, 0x67, 0xde, 0xfb, 0xe6, 0xfb, 0xbe, 0x79, 0xf3, - 0x66, 0x16, 0x2e, 0xb7, 0x28, 0xb3, 0x28, 0x53, 0x11, 0x61, 0xdc, 0x25, 0xcd, 0x2e, 0x27, 0xd4, - 0x56, 0xf7, 0xeb, 0x4d, 0xcc, 0x8d, 0xba, 0xca, 0x6f, 0x29, 0x8e, 0x4b, 0x39, 0x15, 0x96, 0x82, - 0x28, 0x25, 0x19, 0xa5, 0x84, 0x51, 0xe2, 0x9c, 0x49, 0x4d, 0xea, 0xc7, 0xa9, 0xde, 0xa7, 0x20, - 0x45, 0x94, 0x42, 0xe0, 0xa6, 0xc1, 0x70, 0x0c, 0xd8, 0xa2, 0xc4, 0x0e, 0xe7, 0x17, 0x83, 0xf9, - 0xbd, 0x20, 0x31, 0xc4, 0x0f, 0xa6, 0xe6, 0xc3, 0x54, 0x8b, 0x99, 0xea, 0x7e, 0xdd, 0xfb, 0x17, - 0x4e, 0xcc, 0x1a, 0x16, 0xb1, 0xa9, 0xea, 0xff, 0x0d, 0x87, 0x94, 0x22, 0xfe, 0x29, 0xba, 0x7e, - 0xbc, 0xfc, 0x17, 0x80, 0x2f, 0x35, 0x98, 0xb9, 0x8b, 0xf9, 0x0d, 0xc2, 0xdb, 0xc8, 0x35, 0x7a, - 0x1b, 0x08, 0xb9, 0x98, 0x31, 0xe1, 0x2a, 0x9c, 0x45, 0xb8, 0x83, 0x4d, 0x83, 0x53, 0x77, 0xcf, - 0x08, 0x06, 0x17, 0xc0, 0x59, 0xb0, 0x5a, 0xdd, 0x5c, 0xf8, 0xed, 0xc7, 0x8b, 0x73, 0x21, 0xc5, - 0x30, 0x7c, 0x97, 0xbb, 0xc4, 0x36, 0xf5, 0x99, 0x38, 0x25, 0x82, 0xd9, 0x82, 0x33, 0xbd, 0x10, - 0x39, 0x46, 0x39, 0x51, 0x82, 0x72, 0xba, 0x97, 0xe6, 0xa2, 0x6d, 0x7f, 0x71, 0xa7, 0x56, 0xf9, - 0xf3, 0x4e, 0xad, 0xf2, 0xd9, 0xf1, 0xc1, 0x5a, 0x96, 0xd6, 0x97, 0xc7, 0x07, 0x6b, 0xe7, 0x02, - 0xa4, 0x8b, 0x0c, 0xdd, 0x54, 0x1b, 0xcc, 0x6c, 0x50, 0x44, 0x3e, 0xea, 0x0f, 0x69, 0x92, 0x6b, - 0xf0, 0xe5, 0x5c, 0xb1, 0x3a, 0x66, 0x0e, 0xb5, 0x19, 0x96, 0xff, 0x05, 0x50, 0x6c, 0x30, 0x33, - 0x9a, 0xbe, 0x12, 0xad, 0xa4, 0xe3, 0x9e, 0xe1, 0xa2, 0x27, 0xe5, 0xc9, 0x55, 0x38, 0xbb, 0x6f, - 0x74, 0x08, 0x4a, 0xc1, 0x94, 0x99, 0x32, 0x13, 0xa7, 0x44, 0xae, 0xec, 0x94, 0xbb, 0xb2, 0x92, - 0x76, 0x65, 0x48, 0x17, 0xa1, 0x76, 0x20, 0x4c, 0xfe, 0x0a, 0x40, 0x79, 0xb4, 0xee, 0xc8, 0x1e, - 0xa1, 0x0d, 0xa7, 0x0d, 0x8b, 0x76, 0x6d, 0xbe, 0x00, 0xce, 0x4e, 0xad, 0x9e, 0x5c, 0x5f, 0x0c, - 0xcb, 0x4d, 0xf1, 0xaa, 0x3a, 0x3a, 0x00, 0xca, 0x16, 0x25, 0xf6, 0xe6, 0xa5, 0x7b, 0x0f, 0x6b, - 0x95, 0xef, 0x7e, 0xaf, 0xad, 0x9a, 0x84, 0xb7, 0xbb, 0x4d, 0xa5, 0x45, 0xad, 0xb0, 0xaa, 0xd5, - 0x04, 0x27, 0xde, 0x77, 0x30, 0xf3, 0x13, 0xd8, 0xdd, 0xe3, 0x83, 0x35, 0xa0, 0x87, 0xf8, 0xf2, - 0xf7, 0x00, 0x4a, 0x09, 0x42, 0x1f, 0x44, 0xda, 0xb7, 0xa8, 0x65, 0x11, 0xc6, 0x08, 0xb5, 0xf3, - 0x5d, 0x04, 0x13, 0xbb, 0x98, 0xae, 0xad, 0x0c, 0x62, 0x4e, 0x6d, 0x25, 0x48, 0x0d, 0xe8, 0xc8, - 0xb7, 0x01, 0x5c, 0x29, 0x66, 0xfc, 0x0c, 0x6c, 0xfc, 0x07, 0xc0, 0xb9, 0x06, 0x33, 0xb7, 0xbb, - 0x36, 0xf2, 0x78, 0x74, 0x6d, 0xc2, 0xfb, 0xd7, 0x28, 0xed, 0xfc, 0x7f, 0x14, 0x84, 0xd7, 0x61, - 0x15, 0x61, 0x87, 0x32, 0xc2, 0xa9, 0x5b, 0x5a, 0xe4, 0x83, 0x50, 0x4d, 0x4b, 0xee, 0xcb, 0x60, - 0xdc, 0xdb, 0x8f, 0x5a, 0x7a, 0x3f, 0x32, 0xea, 0x64, 0x09, 0x9e, 0xc9, 0x1b, 0x8f, 0x8f, 0xf9, - 0xaf, 0x00, 0x9e, 0x6e, 0x30, 0xf3, 0x7d, 0x07, 0x19, 0x1c, 0x5f, 0x33, 0x5c, 0xc3, 0x62, 0x1e, - 0x4f, 0xa3, 0xcb, 0xdb, 0xd4, 0x25, 0xbc, 0x5f, 0x5a, 0x46, 0x83, 0x50, 0x61, 0x1b, 0x4e, 0x3b, - 0x3e, 0x82, 0x2f, 0xee, 0xe4, 0xfa, 0x39, 0xa5, 0xe0, 0x72, 0x50, 0x82, 0xc5, 0x36, 0xab, 0x9e, - 0xa7, 0xa1, 0x4f, 0x41, 0xb6, 0xa6, 0xf9, 0x3a, 0x63, 0x5c, 0x4f, 0xe7, 0xf9, 0x84, 0xce, 0x54, - 0x43, 0x1f, 0xe2, 0x2e, 0x2f, 0xc2, 0xf9, 0xa1, 0xa1, 0x58, 0xea, 0xed, 0x13, 0x7e, 0x83, 0x4f, - 0xf9, 0xb0, 0xeb, 0x60, 0x1b, 0x3d, 0xb2, 0xe0, 0x33, 0xb0, 0xea, 0xe2, 0x16, 0x71, 0x08, 0xb6, - 0x79, 0xb0, 0xa1, 0xfa, 0x60, 0x20, 0x51, 0x58, 0x53, 0x4f, 0xb7, 0xb0, 0xb4, 0xcb, 0x59, 0xc3, - 0x56, 0x86, 0x0d, 0x53, 0x73, 0xa5, 0xcb, 0x0f, 0x00, 0x5c, 0x4e, 0x9c, 0xd5, 0xeb, 0xf4, 0x26, - 0xb6, 0xc9, 0xc7, 0x78, 0xb7, 0x6d, 0xb8, 0x58, 0xc7, 0x2d, 0xea, 0xb5, 0x3c, 0xbf, 0xe1, 0xbf, - 0x0d, 0x5f, 0xa4, 0x3d, 0x1b, 0x67, 0xfa, 0xcb, 0xdf, 0x0f, 0x6b, 0x73, 0x7d, 0xc3, 0xea, 0x68, - 0x72, 0x6a, 0x5a, 0xd6, 0x4f, 0xf9, 0xdf, 0xa3, 0x46, 0xbf, 0xe4, 0x5b, 0x45, 0x5d, 0xb4, 0x47, - 0x90, 0x6f, 0xd5, 0x73, 0xfa, 0x0b, 0xc1, 0xc0, 0x0e, 0xd2, 0xae, 0x27, 0x0b, 0x3c, 0xbd, 0x8c, - 0xa7, 0xe5, 0x52, 0x9e, 0x96, 0x52, 0xc6, 0xb2, 0x02, 0x2f, 0x8c, 0x13, 0x17, 0xd7, 0xc7, 0x2f, - 0x00, 0x9e, 0x4f, 0x24, 0x6c, 0x74, 0x3a, 0x4f, 0xcb, 0x0d, 0xed, 0x46, 0xb1, 0xe0, 0x37, 0x8b, - 0x04, 0x17, 0xf1, 0x92, 0xeb, 0x70, 0xdc, 0xd0, 0x58, 0x76, 0xf0, 0x12, 0xc8, 0x96, 0x46, 0x14, - 0xb0, 0xfe, 0x73, 0x15, 0x4e, 0x35, 0x98, 0x29, 0x7c, 0x0e, 0xa0, 0x90, 0xf3, 0x3a, 0x5a, 0x2f, - 0x3c, 0xe5, 0xb9, 0x8f, 0x0c, 0x51, 0x9b, 0x3c, 0x27, 0xbe, 0x32, 0xbe, 0x01, 0x70, 0x7e, 0xd4, - 0xab, 0xe4, 0x8d, 0x32, 0xdc, 0x11, 0x89, 0xe2, 0x3b, 0x8f, 0x98, 0x18, 0xb3, 0xfa, 0x16, 0xc0, - 0xa5, 0xa2, 0x2b, 0xfa, 0xad, 0x71, 0x17, 0xc8, 0x49, 0x16, 0xb7, 0x1e, 0x23, 0x39, 0x66, 0xf8, - 0x29, 0x80, 0xb3, 0xd9, 0xdb, 0xaf, 0x5e, 0x06, 0x9d, 0x49, 0x11, 0x2f, 0x4f, 0x9c, 0x12, 0x73, - 0x70, 0xe1, 0xa9, 0xd4, 0x4d, 0x73, 0xa1, 0x0c, 0x2a, 0x19, 0x2d, 0xbe, 0x36, 0x49, 0x74, 0xbc, - 0xa6, 0x57, 0xb6, 0x39, 0x3d, 0xbf, 0xb4, 0x6c, 0xb3, 0x39, 0xe5, 0x65, 0x3b, 0xfa, 0x14, 0x09, - 0x3f, 0x00, 0xf8, 0x4a, 0x79, 0x97, 0xdd, 0x18, 0x77, 0xa7, 0x47, 0x42, 0x88, 0x3b, 0x8f, 0x0d, - 0x11, 0x73, 0xfe, 0x09, 0xc0, 0xe5, 0xb1, 0xda, 0xe1, 0x95, 0x71, 0xd7, 0x2c, 0x42, 0x11, 0xdf, - 0x7d, 0x12, 0x28, 0x11, 0x79, 0xf1, 0xf9, 0x4f, 0xbc, 0x3b, 0x72, 0xf3, 0xbd, 0xbb, 0x87, 0x12, - 0xb8, 0x77, 0x28, 0x81, 0xfb, 0x87, 0x12, 0xf8, 0xe3, 0x50, 0x02, 0x5f, 0x1f, 0x49, 0x95, 0xfb, - 0x47, 0x52, 0xe5, 0xc1, 0x91, 0x54, 0xf9, 0xb0, 0x5e, 0x78, 0xe1, 0xde, 0x4a, 0xbf, 0x35, 0xfc, - 0xfb, 0xb7, 0x39, 0xed, 0xff, 0x5c, 0x7c, 0xf5, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x06, - 0x36, 0xfb, 0x20, 0x0f, 0x00, 0x00, -} - -func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgSetWithdrawAddressResponse) - if !ok { - that2, ok := that.(MsgSetWithdrawAddressResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgWithdrawDelegatorRewardResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgWithdrawDelegatorRewardResponse) - if !ok { - that2, ok := that.(MsgWithdrawDelegatorRewardResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - 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 -} -func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgWithdrawValidatorCommissionResponse) - if !ok { - that2, ok := that.(MsgWithdrawValidatorCommissionResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - 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 -} -func (this *MsgFundCommunityPoolResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgFundCommunityPoolResponse) - if !ok { - that2, ok := that.(MsgFundCommunityPoolResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgUpdateParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgUpdateParams) - if !ok { - that2, ok := that.(MsgUpdateParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Authority != that1.Authority { - return false - } - if !this.Params.Equal(&that1.Params) { - return false - } - return true -} -func (this *MsgUpdateParamsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgUpdateParamsResponse) - if !ok { - that2, ok := that.(MsgUpdateParamsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgCommunityPoolSpend) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgCommunityPoolSpend) - if !ok { - that2, ok := that.(MsgCommunityPoolSpend) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Authority != that1.Authority { - return false - } - if this.Recipient != that1.Recipient { - 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 -} -func (this *MsgWithdrawTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgWithdrawTokenizeShareRecordRewardResponse) - if !ok { - that2, ok := that.(MsgWithdrawTokenizeShareRecordRewardResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgWithdrawAllTokenizeShareRecordRewardResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgWithdrawAllTokenizeShareRecordRewardResponse) - if !ok { - that2, ok := that.(MsgWithdrawAllTokenizeShareRecordRewardResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgCommunityPoolSpendResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgCommunityPoolSpendResponse) - if !ok { - that2, ok := that.(MsgCommunityPoolSpendResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - 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 { - // SetWithdrawAddress defines a method to change the withdraw address - // for a delegator (or validator self-delegation). - SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) - // WithdrawDelegatorReward defines a method to withdraw rewards of delegator - // from a single validator. - WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) - // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address. - WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) - // FundCommunityPool defines a method to allow an account to directly - // fund the community pool. - FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) - // UpdateParams defines a governance operation for updating the x/distribution - // module parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) - // CommunityPoolSpend defines a governance operation for sending tokens from - // the community pool in the x/distribution module to another account, which - // could be the governance module itself. The authority is defined in the - // keeper. - // - // Since: cosmos-sdk 0.47 - CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) - // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord - WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) - // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord - WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { - out := new(MsgSetWithdrawAddressResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { - out := new(MsgWithdrawDelegatorRewardResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { - out := new(MsgWithdrawValidatorCommissionResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { - out := new(MsgFundCommunityPoolResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", 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, "/cosmos.distribution.v1beta1.Msg/UpdateParams", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) CommunityPoolSpend(ctx context.Context, in *MsgCommunityPoolSpend, opts ...grpc.CallOption) (*MsgCommunityPoolSpendResponse, error) { - out := new(MsgCommunityPoolSpendResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) WithdrawTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { - out := new(MsgWithdrawTokenizeShareRecordRewardResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) WithdrawAllTokenizeShareRecordReward(ctx context.Context, in *MsgWithdrawAllTokenizeShareRecordReward, opts ...grpc.CallOption) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { - out := new(MsgWithdrawAllTokenizeShareRecordRewardResponse) - err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // SetWithdrawAddress defines a method to change the withdraw address - // for a delegator (or validator self-delegation). - SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) - // WithdrawDelegatorReward defines a method to withdraw rewards of delegator - // from a single validator. - WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) - // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address. - WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) - // FundCommunityPool defines a method to allow an account to directly - // fund the community pool. - FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) - // UpdateParams defines a governance operation for updating the x/distribution - // module parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) - // CommunityPoolSpend defines a governance operation for sending tokens from - // the community pool in the x/distribution module to another account, which - // could be the governance module itself. The authority is defined in the - // keeper. - // - // Since: cosmos-sdk 0.47 - CommunityPoolSpend(context.Context, *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) - // WithdrawTokenizeShareRecordReward defines a method to withdraw reward for an owning TokenizeShareRecord - WithdrawTokenizeShareRecordReward(context.Context, *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) - // WithdrawAllTokenizeShareRecordReward defines a method to withdraw reward for all owning TokenizeShareRecord - WithdrawAllTokenizeShareRecordReward(context.Context, *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) SetWithdrawAddress(ctx context.Context, req *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SetWithdrawAddress not implemented") -} -func (*UnimplementedMsgServer) WithdrawDelegatorReward(ctx context.Context, req *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WithdrawDelegatorReward not implemented") -} -func (*UnimplementedMsgServer) WithdrawValidatorCommission(ctx context.Context, req *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WithdrawValidatorCommission not implemented") -} -func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") -} -func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") -} -func (*UnimplementedMsgServer) CommunityPoolSpend(ctx context.Context, req *MsgCommunityPoolSpend) (*MsgCommunityPoolSpendResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CommunityPoolSpend not implemented") -} -func (*UnimplementedMsgServer) WithdrawTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawTokenizeShareRecordReward) (*MsgWithdrawTokenizeShareRecordRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WithdrawTokenizeShareRecordReward not implemented") -} -func (*UnimplementedMsgServer) WithdrawAllTokenizeShareRecordReward(ctx context.Context, req *MsgWithdrawAllTokenizeShareRecordReward) (*MsgWithdrawAllTokenizeShareRecordRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method WithdrawAllTokenizeShareRecordReward not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSetWithdrawAddress) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SetWithdrawAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawDelegatorReward) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).WithdrawDelegatorReward(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawValidatorCommission) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).WithdrawValidatorCommission(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawValidatorCommission(ctx, req.(*MsgWithdrawValidatorCommission)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgFundCommunityPool) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).FundCommunityPool(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) - } - 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: "/cosmos.distribution.v1beta1.Msg/UpdateParams", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_CommunityPoolSpend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCommunityPoolSpend) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CommunityPoolSpend(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CommunityPoolSpend(ctx, req.(*MsgCommunityPoolSpend)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_WithdrawTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawTokenizeShareRecordReward) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawTokenizeShareRecordReward", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawTokenizeShareRecordReward(ctx, req.(*MsgWithdrawTokenizeShareRecordReward)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_WithdrawAllTokenizeShareRecordReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWithdrawAllTokenizeShareRecordReward) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawAllTokenizeShareRecordReward", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).WithdrawAllTokenizeShareRecordReward(ctx, req.(*MsgWithdrawAllTokenizeShareRecordReward)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.distribution.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetWithdrawAddress", - Handler: _Msg_SetWithdrawAddress_Handler, - }, - { - MethodName: "WithdrawDelegatorReward", - Handler: _Msg_WithdrawDelegatorReward_Handler, - }, - { - MethodName: "WithdrawValidatorCommission", - Handler: _Msg_WithdrawValidatorCommission_Handler, - }, - { - MethodName: "FundCommunityPool", - Handler: _Msg_FundCommunityPool_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - { - MethodName: "CommunityPoolSpend", - Handler: _Msg_CommunityPoolSpend_Handler, - }, - { - MethodName: "WithdrawTokenizeShareRecordReward", - Handler: _Msg_WithdrawTokenizeShareRecordReward_Handler, - }, - { - MethodName: "WithdrawAllTokenizeShareRecordReward", - Handler: _Msg_WithdrawAllTokenizeShareRecordReward_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/distribution/v1beta1/tx.proto", -} - -func (m *MsgSetWithdrawAddress) 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 *MsgSetWithdrawAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetWithdrawAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.WithdrawAddress) > 0 { - i -= len(m.WithdrawAddress) - copy(dAtA[i:], m.WithdrawAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.WithdrawAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSetWithdrawAddressResponse) 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 *MsgSetWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSetWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawDelegatorReward) 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 *MsgWithdrawDelegatorReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.DelegatorAddress) > 0 { - i -= len(m.DelegatorAddress) - copy(dAtA[i:], m.DelegatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.DelegatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawDelegatorRewardResponse) 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 *MsgWithdrawDelegatorRewardResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawDelegatorRewardResponse) 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] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawValidatorCommission) 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 *MsgWithdrawValidatorCommission) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawValidatorCommission) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawValidatorCommissionResponse) 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 *MsgWithdrawValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawValidatorCommissionResponse) 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] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgFundCommunityPool) 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 *MsgFundCommunityPool) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - 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] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgFundCommunityPoolResponse) 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 *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgFundCommunityPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 (m *MsgCommunityPoolSpend) 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 *MsgCommunityPoolSpend) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCommunityPoolSpend) 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.Recipient) > 0 { - i -= len(m.Recipient) - copy(dAtA[i:], m.Recipient) - i = encodeVarintTx(dAtA, i, uint64(len(m.Recipient))) - 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 *MsgWithdrawTokenizeShareRecordReward) 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 *MsgWithdrawTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RecordId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.RecordId)) - i-- - dAtA[i] = 0x10 - } - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) 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 *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawAllTokenizeShareRecordReward) 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 *MsgWithdrawAllTokenizeShareRecordReward) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawAllTokenizeShareRecordReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OwnerAddress) > 0 { - i -= len(m.OwnerAddress) - copy(dAtA[i:], m.OwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.OwnerAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) 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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgCommunityPoolSpendResponse) 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 *MsgCommunityPoolSpendResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCommunityPoolSpendResponse) 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 *MsgSetWithdrawAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.WithdrawAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSetWithdrawAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgWithdrawDelegatorReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.DelegatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgWithdrawDelegatorRewardResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgWithdrawValidatorCommission) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgWithdrawValidatorCommissionResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgFundCommunityPool) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgFundCommunityPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - 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 (m *MsgCommunityPoolSpend) 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 = len(m.Recipient) - 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 *MsgWithdrawTokenizeShareRecordReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.RecordId != 0 { - n += 1 + sovTx(uint64(m.RecordId)) - } - return n -} - -func (m *MsgWithdrawTokenizeShareRecordRewardResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgWithdrawAllTokenizeShareRecordReward) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OwnerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgWithdrawAllTokenizeShareRecordRewardResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgCommunityPoolSpendResponse) 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 *MsgSetWithdrawAddress) 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: MsgSetWithdrawAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetWithdrawAddress: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WithdrawAddress", 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.WithdrawAddress = string(dAtA[iNdEx:postIndex]) - 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 *MsgSetWithdrawAddressResponse) 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: MsgSetWithdrawAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSetWithdrawAddressResponse: 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 *MsgWithdrawDelegatorReward) 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: MsgWithdrawDelegatorReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawDelegatorReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DelegatorAddress", 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.DelegatorAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - 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 *MsgWithdrawDelegatorRewardResponse) 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: MsgWithdrawDelegatorRewardResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 *MsgWithdrawValidatorCommission) 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: MsgWithdrawValidatorCommission: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommission: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", 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.ValidatorAddress = string(dAtA[iNdEx:postIndex]) - 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 *MsgWithdrawValidatorCommissionResponse) 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: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 *MsgFundCommunityPool) 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: MsgFundCommunityPool: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgFundCommunityPool: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - 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 *MsgFundCommunityPoolResponse) 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: MsgFundCommunityPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgFundCommunityPoolResponse: 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 *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) || (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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCommunityPoolSpend) 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: MsgCommunityPoolSpend: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCommunityPoolSpend: 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 Recipient", 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.Recipient = 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 *MsgWithdrawTokenizeShareRecordReward) 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: MsgWithdrawTokenizeShareRecordReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RecordId", wireType) - } - m.RecordId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RecordId |= uint64(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 *MsgWithdrawTokenizeShareRecordRewardResponse) 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: MsgWithdrawTokenizeShareRecordRewardResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawTokenizeShareRecordRewardResponse: 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 *MsgWithdrawAllTokenizeShareRecordReward) 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: MsgWithdrawAllTokenizeShareRecordReward: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordReward: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) - 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 *MsgWithdrawAllTokenizeShareRecordRewardResponse) 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: MsgWithdrawAllTokenizeShareRecordRewardResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWithdrawAllTokenizeShareRecordRewardResponse: 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 *MsgCommunityPoolSpendResponse) 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: MsgCommunityPoolSpendResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCommunityPoolSpendResponse: 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") -) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go deleted file mode 100644 index ea366eb67314..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/evidence/types/evidence.pb.go +++ /dev/null @@ -1,434 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evidence/v1beta1/evidence.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "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 - -// Equivocation implements the Evidence interface and defines evidence of double -// signing misbehavior. -type Equivocation struct { - // height is the equivocation height. - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - // time is the equivocation time. - Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` - // power is the equivocation validator power. - Power int64 `protobuf:"varint,3,opt,name=power,proto3" json:"power,omitempty"` - // consensus_address is the equivocation validator consensus address. - ConsensusAddress string `protobuf:"bytes,4,opt,name=consensus_address,json=consensusAddress,proto3" json:"consensus_address,omitempty"` -} - -func (m *Equivocation) Reset() { *m = Equivocation{} } -func (*Equivocation) ProtoMessage() {} -func (*Equivocation) Descriptor() ([]byte, []int) { - return fileDescriptor_dd143e71a177f0dd, []int{0} -} -func (m *Equivocation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Equivocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Equivocation.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 *Equivocation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Equivocation.Merge(m, src) -} -func (m *Equivocation) XXX_Size() int { - return m.Size() -} -func (m *Equivocation) XXX_DiscardUnknown() { - xxx_messageInfo_Equivocation.DiscardUnknown(m) -} - -var xxx_messageInfo_Equivocation proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Equivocation)(nil), "cosmos.evidence.v1beta1.Equivocation") -} - -func init() { - proto.RegisterFile("cosmos/evidence/v1beta1/evidence.proto", fileDescriptor_dd143e71a177f0dd) -} - -var fileDescriptor_dd143e71a177f0dd = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4b, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, - 0x2d, 0x49, 0x34, 0x84, 0x0b, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x89, 0x43, 0xd4, 0xe9, - 0xc1, 0x85, 0xa1, 0xea, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0xad, - 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd3, 0xf3, 0xf3, - 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, 0x34, 0xfd, 0x92, 0xcc, 0xdc, 0xd4, 0xe2, 0x92, - 0xc4, 0xdc, 0x02, 0xa8, 0x02, 0x49, 0x88, 0x15, 0xf1, 0x10, 0x9d, 0x50, 0xfb, 0xc0, 0x1c, 0xa5, - 0x37, 0x8c, 0x5c, 0x3c, 0xae, 0x85, 0xa5, 0x99, 0x65, 0xf9, 0xc9, 0x89, 0x25, 0x99, 0xf9, 0x79, - 0x42, 0x62, 0x5c, 0x6c, 0x19, 0xa9, 0x99, 0xe9, 0x19, 0x25, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, - 0x41, 0x50, 0x9e, 0x90, 0x2d, 0x17, 0x0b, 0xc8, 0x58, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, - 0x29, 0x3d, 0x88, 0x9d, 0x7a, 0x30, 0x3b, 0xf5, 0x42, 0x60, 0x76, 0x3a, 0xf1, 0x9e, 0xb8, 0x27, - 0xcf, 0x30, 0xe1, 0xbe, 0x3c, 0xe3, 0x8a, 0xe7, 0x1b, 0xb4, 0x18, 0x83, 0xc0, 0xda, 0x84, 0x44, - 0xb8, 0x58, 0x0b, 0xf2, 0xcb, 0x53, 0x8b, 0x24, 0x98, 0xc1, 0xa6, 0x42, 0x38, 0x42, 0xae, 0x5c, - 0x82, 0xc9, 0xf9, 0x79, 0xc5, 0xa9, 0x79, 0xc5, 0xa5, 0xc5, 0xf1, 0x89, 0x29, 0x29, 0x45, 0xa9, - 0xc5, 0xc5, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x12, 0x97, 0xb6, 0xe8, 0x8a, 0x40, 0x9d, - 0xea, 0x08, 0x91, 0x09, 0x2e, 0x29, 0xca, 0xcc, 0x4b, 0x0f, 0x12, 0x80, 0x6b, 0x81, 0x8a, 0x5b, - 0x69, 0x74, 0x2c, 0x90, 0x67, 0x98, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0x86, 0xae, 0xe7, - 0x1b, 0xb4, 0xa0, 0x61, 0xaa, 0x5b, 0x9c, 0x92, 0xad, 0x8f, 0xec, 0x3b, 0x27, 0xef, 0x15, 0x8f, - 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, - 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x37, 0x3d, 0xb3, - 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, 0x1a, 0x4a, 0xfa, 0x48, 0x06, 0x55, 0x20, 0xa2, - 0xb2, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x79, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x8d, 0x61, 0xa8, 0x30, 0xea, 0x01, 0x00, 0x00, -} - -func (m *Equivocation) 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 *Equivocation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Equivocation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ConsensusAddress) > 0 { - i -= len(m.ConsensusAddress) - copy(dAtA[i:], m.ConsensusAddress) - i = encodeVarintEvidence(dAtA, i, uint64(len(m.ConsensusAddress))) - i-- - dAtA[i] = 0x22 - } - if m.Power != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.Power)) - i-- - dAtA[i] = 0x18 - } - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintEvidence(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - if m.Height != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvidence(dAtA []byte, offset int, v uint64) int { - offset -= sovEvidence(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Equivocation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovEvidence(uint64(m.Height)) - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.Time) - n += 1 + l + sovEvidence(uint64(l)) - if m.Power != 0 { - n += 1 + sovEvidence(uint64(m.Power)) - } - l = len(m.ConsensusAddress) - if l > 0 { - n += 1 + l + sovEvidence(uint64(l)) - } - return n -} - -func sovEvidence(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvidence(x uint64) (n int) { - return sovEvidence(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Equivocation) 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 ErrIntOverflowEvidence - } - 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: Equivocation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Equivocation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_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 Power", wireType) - } - m.Power = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Power |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - 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 ErrInvalidLengthEvidence - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsensusAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvidence(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvidence - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvidence(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, ErrIntOverflowEvidence - } - 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, ErrIntOverflowEvidence - } - 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, ErrIntOverflowEvidence - } - 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, ErrInvalidLengthEvidence - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvidence - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvidence - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvidence = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvidence = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvidence = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go deleted file mode 100644 index fdf89c8118dd..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/evidence/types/genesis.pb.go +++ /dev/null @@ -1,333 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evidence/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the evidence module's genesis state. -type GenesisState struct { - // evidence defines all the evidence at genesis. - Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_c610c52c26e0e202, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetEvidence() []*types.Any { - if m != nil { - return m.Evidence - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.evidence.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/evidence/v1beta1/genesis.proto", fileDescriptor_c610c52c26e0e202) -} - -var fileDescriptor_c610c52c26e0e202 = []byte{ - // 195 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, - 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x12, 0x87, 0x28, 0xd3, 0x83, 0x29, 0xd3, 0x83, 0x2a, 0x93, 0x92, 0x4c, 0xcf, 0xcf, - 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0x2b, 0x4b, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xe8, 0x51, - 0x72, 0xe0, 0xe2, 0x71, 0x87, 0x18, 0x12, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc0, 0xc5, 0x01, - 0xd3, 0x2e, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa2, 0x07, 0xd1, 0xad, 0x07, 0xd3, 0xad, - 0xe7, 0x98, 0x57, 0x19, 0x04, 0x57, 0xe5, 0xe4, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, - 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, - 0x72, 0x0c, 0x51, 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x50, - 0x1f, 0x40, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0x84, 0x77, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, - 0x93, 0xd8, 0xc0, 0x16, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x4b, 0xa9, 0xfe, 0xee, - 0x00, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Evidence) > 0 { - for _, e := range m.Evidence { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Evidence = append(m.Evidence, &types.Any{}) - if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go deleted file mode 100644 index 200881ef6c0f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.go +++ /dev/null @@ -1,1134 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evidence/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes" - types "github.com/cosmos/cosmos-sdk/codec/types" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. -type QueryEvidenceRequest struct { - // evidence_hash defines the hash of the requested evidence. - // Deprecated: Use hash, a HEX encoded string, instead. - EvidenceHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=evidence_hash,json=evidenceHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"evidence_hash,omitempty"` // Deprecated: Do not use. - // hash defines the evidence hash of the requested evidence. - // - // Since: cosmos-sdk 0.47 - Hash string `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *QueryEvidenceRequest) Reset() { *m = QueryEvidenceRequest{} } -func (m *QueryEvidenceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryEvidenceRequest) ProtoMessage() {} -func (*QueryEvidenceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07043de1a84d215a, []int{0} -} -func (m *QueryEvidenceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEvidenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEvidenceRequest.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 *QueryEvidenceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEvidenceRequest.Merge(m, src) -} -func (m *QueryEvidenceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryEvidenceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEvidenceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEvidenceRequest proto.InternalMessageInfo - -// Deprecated: Do not use. -func (m *QueryEvidenceRequest) GetEvidenceHash() github_com_cometbft_cometbft_libs_bytes.HexBytes { - if m != nil { - return m.EvidenceHash - } - return nil -} - -func (m *QueryEvidenceRequest) GetHash() string { - if m != nil { - return m.Hash - } - return "" -} - -// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. -type QueryEvidenceResponse struct { - // evidence returns the requested evidence. - Evidence *types.Any `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"` -} - -func (m *QueryEvidenceResponse) Reset() { *m = QueryEvidenceResponse{} } -func (m *QueryEvidenceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryEvidenceResponse) ProtoMessage() {} -func (*QueryEvidenceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07043de1a84d215a, []int{1} -} -func (m *QueryEvidenceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryEvidenceResponse.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 *QueryEvidenceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryEvidenceResponse.Merge(m, src) -} -func (m *QueryEvidenceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryEvidenceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryEvidenceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryEvidenceResponse proto.InternalMessageInfo - -func (m *QueryEvidenceResponse) GetEvidence() *types.Any { - if m != nil { - return m.Evidence - } - return nil -} - -// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -// method. -type QueryAllEvidenceRequest struct { - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllEvidenceRequest) Reset() { *m = QueryAllEvidenceRequest{} } -func (m *QueryAllEvidenceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllEvidenceRequest) ProtoMessage() {} -func (*QueryAllEvidenceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_07043de1a84d215a, []int{2} -} -func (m *QueryAllEvidenceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllEvidenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllEvidenceRequest.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 *QueryAllEvidenceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllEvidenceRequest.Merge(m, src) -} -func (m *QueryAllEvidenceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllEvidenceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllEvidenceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllEvidenceRequest proto.InternalMessageInfo - -func (m *QueryAllEvidenceRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -// method. -type QueryAllEvidenceResponse struct { - // evidence returns all evidences. - Evidence []*types.Any `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllEvidenceResponse) Reset() { *m = QueryAllEvidenceResponse{} } -func (m *QueryAllEvidenceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllEvidenceResponse) ProtoMessage() {} -func (*QueryAllEvidenceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_07043de1a84d215a, []int{3} -} -func (m *QueryAllEvidenceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllEvidenceResponse.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 *QueryAllEvidenceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllEvidenceResponse.Merge(m, src) -} -func (m *QueryAllEvidenceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllEvidenceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllEvidenceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllEvidenceResponse proto.InternalMessageInfo - -func (m *QueryAllEvidenceResponse) GetEvidence() []*types.Any { - if m != nil { - return m.Evidence - } - return nil -} - -func (m *QueryAllEvidenceResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryEvidenceRequest)(nil), "cosmos.evidence.v1beta1.QueryEvidenceRequest") - proto.RegisterType((*QueryEvidenceResponse)(nil), "cosmos.evidence.v1beta1.QueryEvidenceResponse") - proto.RegisterType((*QueryAllEvidenceRequest)(nil), "cosmos.evidence.v1beta1.QueryAllEvidenceRequest") - proto.RegisterType((*QueryAllEvidenceResponse)(nil), "cosmos.evidence.v1beta1.QueryAllEvidenceResponse") -} - -func init() { - proto.RegisterFile("cosmos/evidence/v1beta1/query.proto", fileDescriptor_07043de1a84d215a) -} - -var fileDescriptor_07043de1a84d215a = []byte{ - // 480 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0xeb, 0xf2, 0x43, 0xc3, 0x1b, 0x17, 0xab, 0x68, 0x25, 0x42, 0x61, 0x64, 0x12, 0x94, - 0x49, 0xb5, 0xd3, 0x21, 0x71, 0x5f, 0x25, 0xd8, 0xb8, 0x41, 0x8e, 0x70, 0x40, 0x76, 0xe6, 0x25, - 0x11, 0xa9, 0x9d, 0xcd, 0xce, 0xb4, 0x08, 0x71, 0xe1, 0xc2, 0x15, 0x09, 0x71, 0x42, 0xfc, 0x39, - 0x48, 0x1c, 0x27, 0x71, 0xe1, 0x84, 0x50, 0xcb, 0x5f, 0xc1, 0x09, 0xc5, 0x76, 0xda, 0xee, 0x17, - 0x85, 0x53, 0x5f, 0xed, 0xf7, 0xfd, 0xbe, 0xcf, 0x7b, 0xcf, 0x81, 0xeb, 0xb1, 0x54, 0x23, 0xa9, - 0x08, 0x3f, 0xcc, 0x76, 0xb9, 0x88, 0x39, 0x39, 0x1c, 0x30, 0xae, 0xe9, 0x80, 0xec, 0x97, 0xfc, - 0xa0, 0xc2, 0xc5, 0x81, 0xd4, 0x12, 0xad, 0xda, 0x24, 0xdc, 0x24, 0x61, 0x97, 0xe4, 0x6d, 0x38, - 0x35, 0xa3, 0x8a, 0x5b, 0xc5, 0x54, 0x5f, 0xd0, 0x24, 0x13, 0x54, 0x67, 0x52, 0x58, 0x13, 0xaf, - 0x93, 0xc8, 0x44, 0x9a, 0x90, 0xd4, 0x91, 0x3b, 0xbd, 0x99, 0x48, 0x99, 0xe4, 0x9c, 0x98, 0x7f, - 0xac, 0xdc, 0x23, 0x54, 0xb8, 0xaa, 0xde, 0x2d, 0x77, 0x45, 0x8b, 0x8c, 0x50, 0x21, 0xa4, 0x36, - 0x6e, 0xca, 0xde, 0x06, 0xef, 0x00, 0xec, 0x3c, 0xab, 0x2b, 0x3e, 0x72, 0x50, 0x11, 0xdf, 0x2f, - 0xb9, 0xd2, 0xe8, 0x05, 0xbc, 0xde, 0x70, 0xbe, 0x4c, 0xa9, 0x4a, 0xbb, 0x60, 0x0d, 0xf4, 0x56, - 0x86, 0x0f, 0x7f, 0xff, 0xb8, 0x1d, 0x26, 0x99, 0x4e, 0x4b, 0x86, 0x63, 0x39, 0x22, 0xb1, 0x1c, - 0x71, 0xcd, 0xf6, 0xf4, 0x2c, 0xc8, 0x33, 0xa6, 0x08, 0xab, 0x34, 0x57, 0x78, 0x87, 0x1f, 0x0d, - 0xeb, 0xa0, 0x0b, 0xa2, 0x95, 0xc6, 0x6c, 0x87, 0xaa, 0x14, 0x21, 0x78, 0xd9, 0x78, 0xb6, 0xd7, - 0x40, 0xef, 0x5a, 0x64, 0xe2, 0xe0, 0x09, 0xbc, 0x71, 0x0a, 0x44, 0x15, 0x52, 0x28, 0x8e, 0x42, - 0xb8, 0xd4, 0x88, 0x0d, 0xc4, 0xf2, 0x66, 0x07, 0xdb, 0x9e, 0x70, 0xd3, 0x2e, 0xde, 0x12, 0x55, - 0x34, 0xcd, 0x0a, 0x28, 0x5c, 0x35, 0x56, 0x5b, 0x79, 0x7e, 0xba, 0xad, 0xc7, 0x10, 0xce, 0x46, - 0xea, 0xec, 0xee, 0x62, 0xb7, 0x98, 0x7a, 0xfe, 0xd8, 0x6e, 0xcc, 0xcd, 0x1f, 0x3f, 0xa5, 0x49, - 0xa3, 0x8d, 0xe6, 0x94, 0xc1, 0x47, 0x00, 0xbb, 0x67, 0x6b, 0x9c, 0x4b, 0x7c, 0x69, 0x31, 0x31, - 0xda, 0x3e, 0x81, 0xd5, 0x36, 0x58, 0xf7, 0x16, 0x62, 0xd9, 0x72, 0xf3, 0x5c, 0x9b, 0x5f, 0xda, - 0xf0, 0x8a, 0xe1, 0x42, 0x9f, 0x00, 0x5c, 0x6a, 0xc8, 0x50, 0x1f, 0x5f, 0xf0, 0xf6, 0xf0, 0x79, - 0xcb, 0xf7, 0xf0, 0xbf, 0xa6, 0x5b, 0x82, 0x20, 0x7c, 0xfb, 0xed, 0xd7, 0x87, 0xf6, 0x06, 0xea, - 0x91, 0x8b, 0xbe, 0x83, 0xe9, 0xc1, 0xeb, 0x7a, 0xd9, 0x6f, 0xd0, 0x67, 0x00, 0x97, 0xe7, 0x46, - 0x87, 0xc2, 0xbf, 0x57, 0x3c, 0xbb, 0x49, 0x6f, 0xf0, 0x1f, 0x0a, 0x87, 0x79, 0xdf, 0x60, 0xae, - 0xa3, 0x3b, 0x0b, 0x31, 0x87, 0xdb, 0x5f, 0xc7, 0x3e, 0x38, 0x1e, 0xfb, 0xe0, 0xe7, 0xd8, 0x07, - 0xef, 0x27, 0x7e, 0xeb, 0x78, 0xe2, 0xb7, 0xbe, 0x4f, 0xfc, 0xd6, 0xf3, 0xfe, 0x89, 0xd7, 0x6f, - 0x6c, 0xec, 0x4f, 0x5f, 0xed, 0xbe, 0x22, 0x47, 0x33, 0x4f, 0x5d, 0x15, 0x5c, 0xb1, 0xab, 0x66, - 0xe3, 0x0f, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0x76, 0x1c, 0x26, 0x0a, 0x22, 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 - -// 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 { - // Evidence queries evidence based on evidence hash. - Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) - // AllEvidence queries all evidence. - AllEvidence(ctx context.Context, in *QueryAllEvidenceRequest, opts ...grpc.CallOption) (*QueryAllEvidenceResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Evidence(ctx context.Context, in *QueryEvidenceRequest, opts ...grpc.CallOption) (*QueryEvidenceResponse, error) { - out := new(QueryEvidenceResponse) - err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Query/Evidence", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllEvidence(ctx context.Context, in *QueryAllEvidenceRequest, opts ...grpc.CallOption) (*QueryAllEvidenceResponse, error) { - out := new(QueryAllEvidenceResponse) - err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Query/AllEvidence", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Evidence queries evidence based on evidence hash. - Evidence(context.Context, *QueryEvidenceRequest) (*QueryEvidenceResponse, error) - // AllEvidence queries all evidence. - AllEvidence(context.Context, *QueryAllEvidenceRequest) (*QueryAllEvidenceResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Evidence(ctx context.Context, req *QueryEvidenceRequest) (*QueryEvidenceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Evidence not implemented") -} -func (*UnimplementedQueryServer) AllEvidence(ctx context.Context, req *QueryAllEvidenceRequest) (*QueryAllEvidenceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllEvidence not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Evidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryEvidenceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Evidence(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.evidence.v1beta1.Query/Evidence", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Evidence(ctx, req.(*QueryEvidenceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllEvidenceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllEvidence(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.evidence.v1beta1.Query/AllEvidence", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllEvidence(ctx, req.(*QueryAllEvidenceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.evidence.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Evidence", - Handler: _Query_Evidence_Handler, - }, - { - MethodName: "AllEvidence", - Handler: _Query_AllEvidence_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/evidence/v1beta1/query.proto", -} - -func (m *QueryEvidenceRequest) 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 *QueryEvidenceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEvidenceRequest) 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] = 0x12 - } - if len(m.EvidenceHash) > 0 { - i -= len(m.EvidenceHash) - copy(dAtA[i:], m.EvidenceHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.EvidenceHash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryEvidenceResponse) 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 *QueryEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryEvidenceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Evidence != nil { - { - size, err := m.Evidence.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 *QueryAllEvidenceRequest) 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 *QueryAllEvidenceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllEvidenceRequest) 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 *QueryAllEvidenceResponse) 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 *QueryAllEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllEvidenceResponse) 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.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[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 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 *QueryEvidenceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.EvidenceHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryEvidenceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Evidence != nil { - l = m.Evidence.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllEvidenceRequest) 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 *QueryAllEvidenceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Evidence) > 0 { - for _, e := range m.Evidence { - 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 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 *QueryEvidenceRequest) 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: QueryEvidenceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEvidenceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) - if m.EvidenceHash == nil { - m.EvidenceHash = []byte{} - } - iNdEx = postIndex - case 2: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryEvidenceResponse) 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: QueryEvidenceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence == nil { - m.Evidence = &types.Any{} - } - if err := m.Evidence.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllEvidenceRequest) 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: QueryAllEvidenceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllEvidenceRequest: 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllEvidenceResponse) 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: QueryAllEvidenceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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.Evidence = append(m.Evidence, &types.Any{}) - if err := m.Evidence[len(m.Evidence)-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) || (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/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go deleted file mode 100644 index fb112060574d..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/evidence/types/query.pb.gw.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/evidence/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Evidence_0 = &utilities.DoubleArray{Encoding: map[string]int{"hash": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Evidence_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEvidenceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") - } - - protoReq.Hash, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Evidence_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Evidence(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Evidence_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryEvidenceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["hash"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "hash") - } - - protoReq.Hash, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "hash", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Evidence_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Evidence(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllEvidence_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllEvidenceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllEvidence_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllEvidence(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllEvidence_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllEvidenceRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllEvidence_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllEvidence(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Evidence_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Evidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllEvidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AllEvidence_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllEvidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Evidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Evidence_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Evidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllEvidence_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AllEvidence_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllEvidence_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Evidence_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1, 1, 0, 4, 1, 5, 3}, []string{"cosmos", "evidence", "v1beta1", "hash"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllEvidence_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"cosmos", "evidence", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Evidence_0 = runtime.ForwardResponseMessage - - forward_Query_AllEvidence_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go deleted file mode 100644 index c2969960122f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/evidence/types/tx.pb.go +++ /dev/null @@ -1,673 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evidence/v1beta1/tx.proto - -package types - -import ( - bytes "bytes" - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// MsgSubmitEvidence represents a message that supports submitting arbitrary -// Evidence of misbehavior such as equivocation or counterfactual signing. -type MsgSubmitEvidence struct { - // submitter is the signer account address of evidence. - Submitter string `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"` - // evidence defines the evidence of misbehavior. - Evidence *types.Any `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence,omitempty"` -} - -func (m *MsgSubmitEvidence) Reset() { *m = MsgSubmitEvidence{} } -func (m *MsgSubmitEvidence) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitEvidence) ProtoMessage() {} -func (*MsgSubmitEvidence) Descriptor() ([]byte, []int) { - return fileDescriptor_3e3242cb23c956e0, []int{0} -} -func (m *MsgSubmitEvidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitEvidence.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 *MsgSubmitEvidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitEvidence.Merge(m, src) -} -func (m *MsgSubmitEvidence) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitEvidence.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo - -// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. -type MsgSubmitEvidenceResponse struct { - // hash defines the hash of the evidence. - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *MsgSubmitEvidenceResponse) Reset() { *m = MsgSubmitEvidenceResponse{} } -func (m *MsgSubmitEvidenceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitEvidenceResponse) ProtoMessage() {} -func (*MsgSubmitEvidenceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3e3242cb23c956e0, []int{1} -} -func (m *MsgSubmitEvidenceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitEvidenceResponse.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 *MsgSubmitEvidenceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitEvidenceResponse.Merge(m, src) -} -func (m *MsgSubmitEvidenceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitEvidenceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitEvidenceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitEvidenceResponse proto.InternalMessageInfo - -func (m *MsgSubmitEvidenceResponse) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func init() { - proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidence") - proto.RegisterType((*MsgSubmitEvidenceResponse)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") -} - -func init() { proto.RegisterFile("cosmos/evidence/v1beta1/tx.proto", fileDescriptor_3e3242cb23c956e0) } - -var fileDescriptor_3e3242cb23c956e0 = []byte{ - // 390 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, - 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, - 0xd0, 0x83, 0xa9, 0xd0, 0x83, 0xaa, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0xab, 0xd1, 0x07, - 0xb1, 0x20, 0xca, 0xa5, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xbc, 0xa4, 0xd2, - 0x34, 0xfd, 0xc4, 0xbc, 0x4a, 0x98, 0x14, 0xc4, 0xa4, 0x78, 0x88, 0x1e, 0xa8, 0xb1, 0x10, 0x29, - 0xa8, 0x25, 0xfa, 0xb9, 0xc5, 0xe9, 0xfa, 0x65, 0x86, 0x20, 0x0a, 0x2a, 0x21, 0x98, 0x98, 0x9b, - 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x77, 0x18, 0xb9, 0x04, 0x7d, 0x8b, 0xd3, 0x83, - 0x4b, 0x93, 0x72, 0x33, 0x4b, 0x5c, 0xa1, 0xae, 0x12, 0x32, 0xe3, 0xe2, 0x2c, 0x06, 0x8b, 0x94, - 0xa4, 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x49, 0x5c, 0xda, 0xa2, 0x2b, 0x02, 0xb5, - 0xc6, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb8, 0xa4, 0x28, 0x33, 0x2f, 0x3d, 0x08, 0xa1, - 0x54, 0x28, 0x8c, 0x8b, 0x03, 0xe6, 0x33, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x11, 0x3d, - 0x88, 0x17, 0xf4, 0x60, 0x5e, 0xd0, 0x73, 0xcc, 0xab, 0x74, 0x52, 0x39, 0xb5, 0x45, 0x57, 0x01, - 0x47, 0x50, 0xe8, 0xc1, 0x5c, 0x11, 0x04, 0x37, 0xcb, 0xca, 0xbc, 0x63, 0x81, 0x3c, 0xc3, 0x8b, - 0x05, 0xf2, 0x0c, 0x4d, 0xcf, 0x37, 0x68, 0x21, 0xec, 0xeb, 0x7a, 0xbe, 0x41, 0x4b, 0x06, 0x62, - 0x8c, 0x6e, 0x71, 0x4a, 0xb6, 0x3e, 0x86, 0x47, 0x94, 0xf4, 0xb9, 0x24, 0x31, 0x04, 0x83, 0x52, - 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x58, - 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0xa3, 0x3a, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x02, - 0x2e, 0x3e, 0xb4, 0x20, 0xd1, 0xd2, 0xc3, 0xe5, 0x5e, 0x0c, 0x0b, 0xa4, 0x8c, 0x88, 0x57, 0x0b, - 0x73, 0x8c, 0x14, 0x6b, 0xc3, 0xf3, 0x0d, 0x5a, 0x8c, 0x4e, 0xde, 0x2b, 0x1e, 0xc9, 0x31, 0x9e, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, - 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x34, 0xca, 0xf5, 0x91, 0xbc, 0x5f, 0x81, 0x48, 0x78, 0x25, 0x95, - 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x40, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x53, 0x46, - 0x2d, 0x75, 0x98, 0x02, 0x00, 0x00, -} - -func (this *MsgSubmitEvidenceResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgSubmitEvidenceResponse) - if !ok { - that2, ok := that.(MsgSubmitEvidenceResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Hash, that1.Hash) { - 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 { - // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - // counterfactual signing. - SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) { - out := new(MsgSubmitEvidenceResponse) - err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - // counterfactual signing. - SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) SubmitEvidence(ctx context.Context, req *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitEvidence not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_SubmitEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitEvidence) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitEvidence(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitEvidence(ctx, req.(*MsgSubmitEvidence)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.evidence.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitEvidence", - Handler: _Msg_SubmitEvidence_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/evidence/v1beta1/tx.proto", -} - -func (m *MsgSubmitEvidence) 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 *MsgSubmitEvidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Evidence != nil { - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Submitter) > 0 { - i -= len(m.Submitter) - copy(dAtA[i:], m.Submitter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Submitter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitEvidenceResponse) 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 *MsgSubmitEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitEvidenceResponse) 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 = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - 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 *MsgSubmitEvidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Submitter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Evidence != nil { - l = m.Evidence.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitEvidenceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTx(uint64(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 *MsgSubmitEvidence) 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: MsgSubmitEvidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitEvidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Submitter", 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.Submitter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", 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 m.Evidence == nil { - m.Evidence = &types.Any{} - } - if err := m.Evidence.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 *MsgSubmitEvidenceResponse) 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: MsgSubmitEvidenceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - 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 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/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go deleted file mode 100644 index 52ca7e6326c3..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/feegrant/feegrant.pb.go +++ /dev/null @@ -1,1349 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/feegrant/v1beta1/feegrant.proto - -package feegrant - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "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 - -// BasicAllowance implements Allowance with a one-time grant of coins -// that optionally expires. The grantee can use up to SpendLimit to cover fees. -type BasicAllowance struct { - // spend_limit specifies the maximum amount of coins that can be spent - // by this allowance and will be updated as coins are spent. If it is - // empty, there is no spend limit and any amount of coins can be spent. - SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` - // expiration specifies an optional time when this allowance expires - Expiration *time.Time `protobuf:"bytes,2,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` -} - -func (m *BasicAllowance) Reset() { *m = BasicAllowance{} } -func (m *BasicAllowance) String() string { return proto.CompactTextString(m) } -func (*BasicAllowance) ProtoMessage() {} -func (*BasicAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_7279582900c30aea, []int{0} -} -func (m *BasicAllowance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *BasicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BasicAllowance.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 *BasicAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_BasicAllowance.Merge(m, src) -} -func (m *BasicAllowance) XXX_Size() int { - return m.Size() -} -func (m *BasicAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_BasicAllowance.DiscardUnknown(m) -} - -var xxx_messageInfo_BasicAllowance proto.InternalMessageInfo - -func (m *BasicAllowance) GetSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.SpendLimit - } - return nil -} - -func (m *BasicAllowance) GetExpiration() *time.Time { - if m != nil { - return m.Expiration - } - return nil -} - -// PeriodicAllowance extends Allowance to allow for both a maximum cap, -// as well as a limit per time period. -type PeriodicAllowance struct { - // basic specifies a struct of `BasicAllowance` - Basic BasicAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"` - // period specifies the time duration in which period_spend_limit coins can - // be spent before that allowance is reset - Period time.Duration `protobuf:"bytes,2,opt,name=period,proto3,stdduration" json:"period"` - // period_spend_limit specifies the maximum number of coins that can be spent - // in the period - PeriodSpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=period_spend_limit,json=periodSpendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_spend_limit"` - // period_can_spend is the number of coins left to be spent before the period_reset time - PeriodCanSpend github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=period_can_spend,json=periodCanSpend,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_can_spend"` - // period_reset is the time at which this period resets and a new one begins, - // it is calculated from the start time of the first transaction after the - // last period ended - PeriodReset time.Time `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3,stdtime" json:"period_reset"` -} - -func (m *PeriodicAllowance) Reset() { *m = PeriodicAllowance{} } -func (m *PeriodicAllowance) String() string { return proto.CompactTextString(m) } -func (*PeriodicAllowance) ProtoMessage() {} -func (*PeriodicAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_7279582900c30aea, []int{1} -} -func (m *PeriodicAllowance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PeriodicAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PeriodicAllowance.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 *PeriodicAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_PeriodicAllowance.Merge(m, src) -} -func (m *PeriodicAllowance) XXX_Size() int { - return m.Size() -} -func (m *PeriodicAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_PeriodicAllowance.DiscardUnknown(m) -} - -var xxx_messageInfo_PeriodicAllowance proto.InternalMessageInfo - -func (m *PeriodicAllowance) GetBasic() BasicAllowance { - if m != nil { - return m.Basic - } - return BasicAllowance{} -} - -func (m *PeriodicAllowance) GetPeriod() time.Duration { - if m != nil { - return m.Period - } - return 0 -} - -func (m *PeriodicAllowance) GetPeriodSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.PeriodSpendLimit - } - return nil -} - -func (m *PeriodicAllowance) GetPeriodCanSpend() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.PeriodCanSpend - } - return nil -} - -func (m *PeriodicAllowance) GetPeriodReset() time.Time { - if m != nil { - return m.PeriodReset - } - return time.Time{} -} - -// AllowedMsgAllowance creates allowance only for specified message types. -type AllowedMsgAllowance struct { - // allowance can be any of basic and periodic fee allowance. - Allowance *types1.Any `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` - // allowed_messages are the messages for which the grantee has the access. - AllowedMessages []string `protobuf:"bytes,2,rep,name=allowed_messages,json=allowedMessages,proto3" json:"allowed_messages,omitempty"` -} - -func (m *AllowedMsgAllowance) Reset() { *m = AllowedMsgAllowance{} } -func (m *AllowedMsgAllowance) String() string { return proto.CompactTextString(m) } -func (*AllowedMsgAllowance) ProtoMessage() {} -func (*AllowedMsgAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_7279582900c30aea, []int{2} -} -func (m *AllowedMsgAllowance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AllowedMsgAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AllowedMsgAllowance.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 *AllowedMsgAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_AllowedMsgAllowance.Merge(m, src) -} -func (m *AllowedMsgAllowance) XXX_Size() int { - return m.Size() -} -func (m *AllowedMsgAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_AllowedMsgAllowance.DiscardUnknown(m) -} - -var xxx_messageInfo_AllowedMsgAllowance proto.InternalMessageInfo - -// Grant is stored in the KVStore to record a grant with full context -type Grant struct { - // granter is the address of the user granting an allowance of their funds. - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // grantee is the address of the user being granted an allowance of another user's funds. - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - // allowance can be any of basic, periodic, allowed fee allowance. - Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` -} - -func (m *Grant) Reset() { *m = Grant{} } -func (m *Grant) String() string { return proto.CompactTextString(m) } -func (*Grant) ProtoMessage() {} -func (*Grant) Descriptor() ([]byte, []int) { - return fileDescriptor_7279582900c30aea, []int{3} -} -func (m *Grant) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Grant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Grant.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 *Grant) XXX_Merge(src proto.Message) { - xxx_messageInfo_Grant.Merge(m, src) -} -func (m *Grant) XXX_Size() int { - return m.Size() -} -func (m *Grant) XXX_DiscardUnknown() { - xxx_messageInfo_Grant.DiscardUnknown(m) -} - -var xxx_messageInfo_Grant proto.InternalMessageInfo - -func (m *Grant) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *Grant) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func (m *Grant) GetAllowance() *types1.Any { - if m != nil { - return m.Allowance - } - return nil -} - -func init() { - proto.RegisterType((*BasicAllowance)(nil), "cosmos.feegrant.v1beta1.BasicAllowance") - proto.RegisterType((*PeriodicAllowance)(nil), "cosmos.feegrant.v1beta1.PeriodicAllowance") - proto.RegisterType((*AllowedMsgAllowance)(nil), "cosmos.feegrant.v1beta1.AllowedMsgAllowance") - proto.RegisterType((*Grant)(nil), "cosmos.feegrant.v1beta1.Grant") -} - -func init() { - proto.RegisterFile("cosmos/feegrant/v1beta1/feegrant.proto", fileDescriptor_7279582900c30aea) -} - -var fileDescriptor_7279582900c30aea = []byte{ - // 639 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x3f, 0x6f, 0xd3, 0x40, - 0x14, 0x8f, 0x9b, 0xb6, 0x28, 0x17, 0x28, 0xad, 0xa9, 0x84, 0x53, 0x21, 0xbb, 0x8a, 0x04, 0x4d, - 0x2b, 0xd5, 0x56, 0x8b, 0x58, 0x3a, 0x35, 0x2e, 0xa2, 0x80, 0x5a, 0xa9, 0x72, 0x99, 0x90, 0x50, - 0x74, 0xb6, 0xaf, 0xe6, 0x44, 0xec, 0x33, 0x3e, 0x17, 0x1a, 0x06, 0x66, 0xc4, 0x80, 0x32, 0x32, - 0x32, 0x22, 0xa6, 0x0e, 0xe5, 0x3b, 0x54, 0x0c, 0xa8, 0x62, 0x62, 0x22, 0x28, 0x19, 0x3a, 0xf3, - 0x0d, 0x90, 0xef, 0xce, 0x8e, 0x9b, 0x50, 0x68, 0x25, 0xba, 0x24, 0x77, 0xef, 0xde, 0xfb, 0xfd, - 0x79, 0xef, 0x45, 0x01, 0xb7, 0x1c, 0x42, 0x7d, 0x42, 0x8d, 0x1d, 0x84, 0xbc, 0x08, 0x06, 0xb1, - 0xf1, 0x62, 0xc9, 0x46, 0x31, 0x5c, 0xca, 0x02, 0x7a, 0x18, 0x91, 0x98, 0xc8, 0xd7, 0x79, 0x9e, - 0x9e, 0x85, 0x45, 0xde, 0xcc, 0xb4, 0x47, 0x3c, 0xc2, 0x72, 0x8c, 0xe4, 0xc4, 0xd3, 0x67, 0x2a, - 0x1e, 0x21, 0x5e, 0x13, 0x19, 0xec, 0x66, 0xef, 0xee, 0x18, 0x30, 0x68, 0xa5, 0x4f, 0x1c, 0xa9, - 0xc1, 0x6b, 0x04, 0x2c, 0x7f, 0x52, 0x85, 0x18, 0x1b, 0x52, 0x94, 0x09, 0x71, 0x08, 0x0e, 0xc4, - 0xfb, 0x14, 0xf4, 0x71, 0x40, 0x0c, 0xf6, 0x29, 0x42, 0xda, 0x20, 0x51, 0x8c, 0x7d, 0x44, 0x63, - 0xe8, 0x87, 0x29, 0xe6, 0x60, 0x82, 0xbb, 0x1b, 0xc1, 0x18, 0x13, 0x81, 0x59, 0x7d, 0x37, 0x02, - 0x26, 0x4c, 0x48, 0xb1, 0x53, 0x6f, 0x36, 0xc9, 0x4b, 0x18, 0x38, 0x48, 0x7e, 0x0e, 0xca, 0x34, - 0x44, 0x81, 0xdb, 0x68, 0x62, 0x1f, 0xc7, 0x8a, 0x34, 0x5b, 0xac, 0x95, 0x97, 0x2b, 0xba, 0x90, - 0x9a, 0x88, 0x4b, 0xdd, 0xeb, 0x6b, 0x04, 0x07, 0xe6, 0x9d, 0xc3, 0x1f, 0x5a, 0xe1, 0x53, 0x47, - 0xab, 0x79, 0x38, 0x7e, 0xba, 0x6b, 0xeb, 0x0e, 0xf1, 0x85, 0x2f, 0xf1, 0xb5, 0x48, 0xdd, 0x67, - 0x46, 0xdc, 0x0a, 0x11, 0x65, 0x05, 0xf4, 0xe3, 0xf1, 0xfe, 0x82, 0x64, 0x01, 0x46, 0xb2, 0x91, - 0x70, 0xc8, 0xab, 0x00, 0xa0, 0xbd, 0x10, 0x73, 0x65, 0xca, 0xc8, 0xac, 0x54, 0x2b, 0x2f, 0xcf, - 0xe8, 0x5c, 0xba, 0x9e, 0x4a, 0xd7, 0x1f, 0xa5, 0xde, 0xcc, 0xd1, 0x76, 0x47, 0x93, 0xac, 0x5c, - 0xcd, 0xca, 0xfa, 0x97, 0x83, 0xc5, 0x9b, 0xa7, 0x0c, 0x49, 0xbf, 0x87, 0x50, 0x66, 0xef, 0xc1, - 0xdb, 0xe3, 0xfd, 0x85, 0x4a, 0x4e, 0xd8, 0x49, 0xf7, 0xd5, 0xcf, 0xa3, 0x60, 0x6a, 0x0b, 0x45, - 0x98, 0xb8, 0xf9, 0x9e, 0xdc, 0x07, 0x63, 0x76, 0x92, 0xa7, 0x48, 0x4c, 0xdb, 0x9c, 0x7e, 0x1a, - 0xd5, 0x49, 0x34, 0xb3, 0x94, 0xf4, 0x86, 0xfb, 0xe5, 0x00, 0xf2, 0x2a, 0x18, 0x0f, 0x19, 0xbc, - 0xb0, 0x59, 0x19, 0xb2, 0x79, 0x57, 0x4c, 0xc8, 0xbc, 0x92, 0x14, 0xbf, 0xef, 0x68, 0x12, 0x07, - 0x10, 0x75, 0xf2, 0x6b, 0x20, 0xf3, 0x53, 0x23, 0x3f, 0xa6, 0xe2, 0x05, 0x8d, 0x69, 0x92, 0x73, - 0x6d, 0xf7, 0x87, 0xf5, 0x0a, 0x88, 0x58, 0xc3, 0x81, 0x01, 0xd7, 0xa0, 0x8c, 0x5e, 0x10, 0xfb, - 0x04, 0x67, 0x5a, 0x83, 0x01, 0x13, 0x20, 0x6f, 0x80, 0xcb, 0x82, 0x3b, 0x42, 0x14, 0xc5, 0xca, - 0xd8, 0x3f, 0x57, 0x85, 0x35, 0xb1, 0x9d, 0x35, 0xb1, 0xcc, 0xcb, 0xad, 0xa4, 0x7a, 0xe5, 0xe1, - 0xb9, 0x96, 0xe6, 0x46, 0x4e, 0xe8, 0xd0, 0x86, 0x54, 0x7f, 0x49, 0xe0, 0x1a, 0xbb, 0x21, 0x77, - 0x93, 0x7a, 0xfd, 0xcd, 0x79, 0x02, 0x4a, 0x30, 0xbd, 0x88, 0xed, 0x99, 0x1e, 0x92, 0x5b, 0x0f, - 0x5a, 0xe6, 0xfc, 0x99, 0xc5, 0x58, 0x7d, 0x44, 0x79, 0x1e, 0x4c, 0x42, 0xce, 0xda, 0xf0, 0x11, - 0xa5, 0xd0, 0x43, 0x54, 0x19, 0x99, 0x2d, 0xd6, 0x4a, 0xd6, 0x55, 0x11, 0xdf, 0x14, 0xe1, 0x95, - 0xad, 0x37, 0x1f, 0xb4, 0xc2, 0xb9, 0x1c, 0xab, 0x39, 0xc7, 0x7f, 0xf0, 0x56, 0xfd, 0x2a, 0x81, - 0xb1, 0xf5, 0x04, 0x42, 0x5e, 0x06, 0x97, 0x18, 0x16, 0x8a, 0x98, 0xc7, 0x92, 0xa9, 0x7c, 0x3b, - 0x58, 0x9c, 0x16, 0x44, 0x75, 0xd7, 0x8d, 0x10, 0xa5, 0xdb, 0x71, 0x84, 0x03, 0xcf, 0x4a, 0x13, - 0xfb, 0x35, 0x88, 0xfd, 0x14, 0xce, 0x50, 0x33, 0xd0, 0xcd, 0xe2, 0xff, 0xee, 0xa6, 0x59, 0x3f, - 0xec, 0xaa, 0xd2, 0x51, 0x57, 0x95, 0x7e, 0x76, 0x55, 0xa9, 0xdd, 0x53, 0x0b, 0x47, 0x3d, 0xb5, - 0xf0, 0xbd, 0xa7, 0x16, 0x1e, 0xcf, 0xfd, 0x75, 0x6f, 0xf7, 0xb2, 0xff, 0x0b, 0x7b, 0x9c, 0xc9, - 0xb8, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x3d, 0x09, 0x1d, 0x5a, 0x06, 0x00, 0x00, -} - -func (m *BasicAllowance) 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 *BasicAllowance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BasicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Expiration != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintFeegrant(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - } - if len(m.SpendLimit) > 0 { - for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PeriodicAllowance) 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 *PeriodicAllowance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PeriodicAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.PeriodReset, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintFeegrant(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x2a - if len(m.PeriodCanSpend) > 0 { - for iNdEx := len(m.PeriodCanSpend) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PeriodCanSpend[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.PeriodSpendLimit) > 0 { - for iNdEx := len(m.PeriodSpendLimit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PeriodSpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Period, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintFeegrant(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x12 - { - size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *AllowedMsgAllowance) 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 *AllowedMsgAllowance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AllowedMsgAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AllowedMessages) > 0 { - for iNdEx := len(m.AllowedMessages) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.AllowedMessages[iNdEx]) - copy(dAtA[i:], m.AllowedMessages[iNdEx]) - i = encodeVarintFeegrant(dAtA, i, uint64(len(m.AllowedMessages[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Allowance != nil { - { - size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Grant) 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 *Grant) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Grant) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Allowance != nil { - { - size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintFeegrant(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintFeegrant(dAtA []byte, offset int, v uint64) int { - offset -= sovFeegrant(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *BasicAllowance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.SpendLimit) > 0 { - for _, e := range m.SpendLimit { - l = e.Size() - n += 1 + l + sovFeegrant(uint64(l)) - } - } - if m.Expiration != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) - n += 1 + l + sovFeegrant(uint64(l)) - } - return n -} - -func (m *PeriodicAllowance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Basic.Size() - n += 1 + l + sovFeegrant(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Period) - n += 1 + l + sovFeegrant(uint64(l)) - if len(m.PeriodSpendLimit) > 0 { - for _, e := range m.PeriodSpendLimit { - l = e.Size() - n += 1 + l + sovFeegrant(uint64(l)) - } - } - if len(m.PeriodCanSpend) > 0 { - for _, e := range m.PeriodCanSpend { - l = e.Size() - n += 1 + l + sovFeegrant(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.PeriodReset) - n += 1 + l + sovFeegrant(uint64(l)) - return n -} - -func (m *AllowedMsgAllowance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Allowance != nil { - l = m.Allowance.Size() - n += 1 + l + sovFeegrant(uint64(l)) - } - if len(m.AllowedMessages) > 0 { - for _, s := range m.AllowedMessages { - l = len(s) - n += 1 + l + sovFeegrant(uint64(l)) - } - } - return n -} - -func (m *Grant) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovFeegrant(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovFeegrant(uint64(l)) - } - if m.Allowance != nil { - l = m.Allowance.Size() - n += 1 + l + sovFeegrant(uint64(l)) - } - return n -} - -func sovFeegrant(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozFeegrant(x uint64) (n int) { - return sovFeegrant(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *BasicAllowance) 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 ErrIntOverflowFeegrant - } - 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: BasicAllowance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BasicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpendLimit = append(m.SpendLimit, types.Coin{}) - if err := m.SpendLimit[len(m.SpendLimit)-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 Expiration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Expiration == nil { - m.Expiration = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFeegrant(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFeegrant - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PeriodicAllowance) 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 ErrIntOverflowFeegrant - } - 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: PeriodicAllowance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PeriodicAllowance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Period, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodSpendLimit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeriodSpendLimit = append(m.PeriodSpendLimit, types.Coin{}) - if err := m.PeriodSpendLimit[len(m.PeriodSpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodCanSpend", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeriodCanSpend = append(m.PeriodCanSpend, types.Coin{}) - if err := m.PeriodCanSpend[len(m.PeriodCanSpend)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeriodReset", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.PeriodReset, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFeegrant(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFeegrant - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *AllowedMsgAllowance) 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 ErrIntOverflowFeegrant - } - 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: AllowedMsgAllowance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AllowedMsgAllowance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Allowance == nil { - m.Allowance = &types1.Any{} - } - if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowedMessages", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - 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 ErrInvalidLengthFeegrant - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AllowedMessages = append(m.AllowedMessages, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFeegrant(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFeegrant - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Grant) 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 ErrIntOverflowFeegrant - } - 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: Grant: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Grant: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - 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 ErrInvalidLengthFeegrant - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - 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 ErrInvalidLengthFeegrant - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFeegrant - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthFeegrant - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthFeegrant - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Allowance == nil { - m.Allowance = &types1.Any{} - } - if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFeegrant(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFeegrant - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipFeegrant(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, ErrIntOverflowFeegrant - } - 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, ErrIntOverflowFeegrant - } - 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, ErrIntOverflowFeegrant - } - 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, ErrInvalidLengthFeegrant - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupFeegrant - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthFeegrant - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthFeegrant = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowFeegrant = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupFeegrant = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go deleted file mode 100644 index 2c00644c93f3..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/feegrant/genesis.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/feegrant/v1beta1/genesis.proto - -package feegrant - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState contains a set of fee allowances, persisted from the store -type GenesisState struct { - Allowances []Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_ac719d2d0954d1bf, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetAllowances() []Grant { - if m != nil { - return m.Allowances - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.feegrant.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/feegrant/v1beta1/genesis.proto", fileDescriptor_ac719d2d0954d1bf) -} - -var fileDescriptor_ac719d2d0954d1bf = []byte{ - // 219 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, - 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x12, 0x87, 0x28, 0xd3, 0x83, 0x29, 0xd3, 0x83, 0x2a, 0x93, 0x12, 0x49, 0xcf, 0x4f, - 0xcf, 0x07, 0xab, 0xd1, 0x07, 0xb1, 0x20, 0xca, 0xa5, 0xd4, 0x70, 0x99, 0x0a, 0xd7, 0x0f, 0x51, - 0x27, 0x98, 0x98, 0x9b, 0x99, 0x97, 0xaf, 0x0f, 0x26, 0x21, 0x42, 0x4a, 0x91, 0x5c, 0x3c, 0xee, - 0x10, 0xab, 0x83, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0x3c, 0xb9, 0xb8, 0x12, 0x73, 0x72, 0xf2, 0xcb, - 0x13, 0xf3, 0x92, 0x53, 0x8b, 0x25, 0x18, 0x15, 0x98, 0x35, 0xb8, 0x8d, 0xe4, 0xf4, 0x70, 0x38, - 0x47, 0xcf, 0x1d, 0xc4, 0x73, 0xe2, 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, - 0x41, 0x48, 0x9a, 0x9d, 0x1c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, - 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, - 0x3d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, 0xea, 0x74, 0x08, 0xa5, - 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x01, 0x77, 0x76, 0x12, 0x1b, 0xd8, 0x91, 0xc6, 0x80, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd4, 0x41, 0xa3, 0x2b, 0x37, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Allowances) > 0 { - for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Allowances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Allowances) > 0 { - for _, e := range m.Allowances { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowances", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Allowances = append(m.Allowances, Grant{}) - if err := m.Allowances[len(m.Allowances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go deleted file mode 100644 index e6bf83de5bbc..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.go +++ /dev/null @@ -1,1700 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/feegrant/v1beta1/query.proto - -package feegrant - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. -type QueryAllowanceRequest struct { - // granter is the address of the user granting an allowance of their funds. - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // grantee is the address of the user being granted an allowance of another user's funds. - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` -} - -func (m *QueryAllowanceRequest) Reset() { *m = QueryAllowanceRequest{} } -func (m *QueryAllowanceRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllowanceRequest) ProtoMessage() {} -func (*QueryAllowanceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{0} -} -func (m *QueryAllowanceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowanceRequest.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 *QueryAllowanceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowanceRequest.Merge(m, src) -} -func (m *QueryAllowanceRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowanceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowanceRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowanceRequest proto.InternalMessageInfo - -func (m *QueryAllowanceRequest) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *QueryAllowanceRequest) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. -type QueryAllowanceResponse struct { - // allowance is a allowance granted for grantee by granter. - Allowance *Grant `protobuf:"bytes,1,opt,name=allowance,proto3" json:"allowance,omitempty"` -} - -func (m *QueryAllowanceResponse) Reset() { *m = QueryAllowanceResponse{} } -func (m *QueryAllowanceResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllowanceResponse) ProtoMessage() {} -func (*QueryAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{1} -} -func (m *QueryAllowanceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowanceResponse.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 *QueryAllowanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowanceResponse.Merge(m, src) -} -func (m *QueryAllowanceResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowanceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowanceResponse proto.InternalMessageInfo - -func (m *QueryAllowanceResponse) GetAllowance() *Grant { - if m != nil { - return m.Allowance - } - return nil -} - -// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. -type QueryAllowancesRequest struct { - Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllowancesRequest) Reset() { *m = QueryAllowancesRequest{} } -func (m *QueryAllowancesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllowancesRequest) ProtoMessage() {} -func (*QueryAllowancesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{2} -} -func (m *QueryAllowancesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowancesRequest.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 *QueryAllowancesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowancesRequest.Merge(m, src) -} -func (m *QueryAllowancesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowancesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowancesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowancesRequest proto.InternalMessageInfo - -func (m *QueryAllowancesRequest) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func (m *QueryAllowancesRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. -type QueryAllowancesResponse struct { - // allowances are allowance's granted for grantee by granter. - Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllowancesResponse) Reset() { *m = QueryAllowancesResponse{} } -func (m *QueryAllowancesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllowancesResponse) ProtoMessage() {} -func (*QueryAllowancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{3} -} -func (m *QueryAllowancesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowancesResponse.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 *QueryAllowancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowancesResponse.Merge(m, src) -} -func (m *QueryAllowancesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowancesResponse proto.InternalMessageInfo - -func (m *QueryAllowancesResponse) GetAllowances() []*Grant { - if m != nil { - return m.Allowances - } - return nil -} - -func (m *QueryAllowancesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 -type QueryAllowancesByGranterRequest struct { - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // pagination defines an pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllowancesByGranterRequest) Reset() { *m = QueryAllowancesByGranterRequest{} } -func (m *QueryAllowancesByGranterRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllowancesByGranterRequest) ProtoMessage() {} -func (*QueryAllowancesByGranterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{4} -} -func (m *QueryAllowancesByGranterRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowancesByGranterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowancesByGranterRequest.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 *QueryAllowancesByGranterRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowancesByGranterRequest.Merge(m, src) -} -func (m *QueryAllowancesByGranterRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowancesByGranterRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowancesByGranterRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowancesByGranterRequest proto.InternalMessageInfo - -func (m *QueryAllowancesByGranterRequest) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *QueryAllowancesByGranterRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. -// -// Since: cosmos-sdk 0.46 -type QueryAllowancesByGranterResponse struct { - // allowances that have been issued by the granter. - Allowances []*Grant `protobuf:"bytes,1,rep,name=allowances,proto3" json:"allowances,omitempty"` - // pagination defines an pagination for the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryAllowancesByGranterResponse) Reset() { *m = QueryAllowancesByGranterResponse{} } -func (m *QueryAllowancesByGranterResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllowancesByGranterResponse) ProtoMessage() {} -func (*QueryAllowancesByGranterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_59efc303945de53f, []int{5} -} -func (m *QueryAllowancesByGranterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllowancesByGranterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllowancesByGranterResponse.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 *QueryAllowancesByGranterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllowancesByGranterResponse.Merge(m, src) -} -func (m *QueryAllowancesByGranterResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllowancesByGranterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllowancesByGranterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllowancesByGranterResponse proto.InternalMessageInfo - -func (m *QueryAllowancesByGranterResponse) GetAllowances() []*Grant { - if m != nil { - return m.Allowances - } - return nil -} - -func (m *QueryAllowancesByGranterResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -func init() { - proto.RegisterType((*QueryAllowanceRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowanceRequest") - proto.RegisterType((*QueryAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowanceResponse") - proto.RegisterType((*QueryAllowancesRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesRequest") - proto.RegisterType((*QueryAllowancesResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesResponse") - proto.RegisterType((*QueryAllowancesByGranterRequest)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest") - proto.RegisterType((*QueryAllowancesByGranterResponse)(nil), "cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse") -} - -func init() { - proto.RegisterFile("cosmos/feegrant/v1beta1/query.proto", fileDescriptor_59efc303945de53f) -} - -var fileDescriptor_59efc303945de53f = []byte{ - // 525 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x94, 0xbd, 0x8b, 0x13, 0x41, - 0x18, 0xc6, 0x33, 0xe7, 0x17, 0x79, 0xaf, 0x1b, 0x3f, 0x2e, 0x2e, 0xb2, 0x86, 0x15, 0xee, 0xfc, - 0x20, 0x3b, 0x26, 0xa2, 0x9c, 0x20, 0x07, 0x49, 0x61, 0x5a, 0x8d, 0x60, 0x61, 0x23, 0x93, 0xe4, - 0x75, 0x5d, 0xcc, 0xed, 0xe4, 0x76, 0x36, 0xea, 0x21, 0x87, 0xe0, 0x5f, 0x20, 0x68, 0x2b, 0x82, - 0x85, 0x8d, 0x96, 0xb6, 0xf6, 0x96, 0x87, 0x36, 0x96, 0x92, 0xf8, 0x87, 0x48, 0xe6, 0x63, 0x37, - 0xe6, 0xb2, 0x64, 0x51, 0x0b, 0xab, 0x64, 0x76, 0x9f, 0xe7, 0xdd, 0xdf, 0xf3, 0xbe, 0x33, 0x03, - 0xe7, 0x7a, 0x42, 0x6e, 0x0b, 0xc9, 0x1e, 0x20, 0x06, 0x31, 0x8f, 0x12, 0xf6, 0xb8, 0xde, 0xc5, - 0x84, 0xd7, 0xd9, 0xce, 0x08, 0xe3, 0x5d, 0x7f, 0x18, 0x8b, 0x44, 0xd0, 0x35, 0x2d, 0xf2, 0xad, - 0xc8, 0x37, 0x22, 0x67, 0x3d, 0xcf, 0x9d, 0x2a, 0x55, 0x01, 0xe7, 0xa2, 0xd1, 0x75, 0xb9, 0x44, - 0x5d, 0x39, 0x55, 0x0e, 0x79, 0x10, 0x46, 0x3c, 0x09, 0x45, 0x64, 0xb4, 0x67, 0x02, 0x21, 0x82, - 0x01, 0x32, 0x3e, 0x0c, 0x19, 0x8f, 0x22, 0x91, 0xa8, 0x97, 0xd2, 0xbc, 0x3d, 0xad, 0x2b, 0xdd, - 0x57, 0x2b, 0x66, 0xb8, 0xd4, 0xc2, 0x7b, 0x0e, 0x27, 0x6f, 0x4f, 0x4b, 0x37, 0x07, 0x03, 0xf1, - 0x84, 0x47, 0x3d, 0xec, 0xe0, 0xce, 0x08, 0x65, 0x42, 0x1b, 0x70, 0x4c, 0xc1, 0x60, 0x5c, 0x21, - 0x55, 0x72, 0xbe, 0xdc, 0xaa, 0x7c, 0xfd, 0x54, 0x3b, 0x61, 0xbc, 0xcd, 0x7e, 0x3f, 0x46, 0x29, - 0xef, 0x24, 0x71, 0x18, 0x05, 0x1d, 0x2b, 0xcc, 0x3c, 0x58, 0x59, 0x29, 0xe6, 0x41, 0xef, 0x2e, - 0x9c, 0x9a, 0x07, 0x90, 0x43, 0x11, 0x49, 0xa4, 0x37, 0xa0, 0xcc, 0xed, 0x43, 0xc5, 0xb0, 0xda, - 0x70, 0xfd, 0x9c, 0xa6, 0xfa, 0xed, 0xe9, 0xaa, 0x93, 0x19, 0xbc, 0xd7, 0x64, 0xbe, 0xb0, 0x3c, - 0x10, 0x0d, 0x8b, 0x46, 0x43, 0x7a, 0x13, 0x20, 0x6b, 0xba, 0x4a, 0xb7, 0xda, 0x58, 0xb7, 0x34, - 0xd3, 0x09, 0xf9, 0x7a, 0xf6, 0x96, 0xe7, 0x16, 0x0f, 0x6c, 0x2b, 0x3b, 0x33, 0x4e, 0xef, 0x1d, - 0x81, 0xb5, 0x03, 0x58, 0x26, 0xf0, 0x16, 0x40, 0xca, 0x2f, 0x2b, 0xa4, 0x7a, 0xa8, 0x40, 0xe2, - 0x19, 0x07, 0x6d, 0x2f, 0x60, 0xdc, 0x58, 0xca, 0xa8, 0x3f, 0xfe, 0x1b, 0xe4, 0x1b, 0x02, 0x67, - 0xe7, 0x20, 0x5b, 0xbb, 0x6d, 0x3d, 0xe4, 0xbf, 0xd9, 0x1f, 0xff, 0xaa, 0x89, 0x1f, 0x08, 0x54, - 0xf3, 0xf9, 0xfe, 0xb3, 0x6e, 0x36, 0xde, 0x1e, 0x86, 0x23, 0x8a, 0x96, 0x7e, 0x24, 0x50, 0x4e, - 0x91, 0xa9, 0x9f, 0x0b, 0xb3, 0xf0, 0x44, 0x3a, 0xac, 0xb0, 0x5e, 0x43, 0x78, 0x5b, 0x2f, 0xbe, - 0xfd, 0x7c, 0xb5, 0xb2, 0x49, 0xaf, 0xb1, 0xbc, 0x1b, 0x27, 0x8d, 0xcb, 0x9e, 0x99, 0x19, 0xed, - 0xd9, 0x7f, 0xb8, 0x47, 0xdf, 0x13, 0x80, 0xac, 0xc3, 0xb4, 0xe8, 0xf7, 0xed, 0x39, 0x73, 0x2e, - 0x17, 0x37, 0x18, 0xe2, 0xab, 0x8a, 0x98, 0xd1, 0xda, 0x72, 0x62, 0x39, 0x03, 0xfa, 0x99, 0xc0, - 0xf1, 0x05, 0x5b, 0x81, 0x6e, 0x16, 0x05, 0x98, 0xdf, 0xdd, 0xce, 0xf5, 0x3f, 0x70, 0x9a, 0x0c, - 0x75, 0x95, 0xe1, 0x12, 0xbd, 0x90, 0x9b, 0x21, 0x94, 0x72, 0x84, 0xfd, 0xac, 0xe5, 0xad, 0xe6, - 0x97, 0xb1, 0x4b, 0xf6, 0xc7, 0x2e, 0xf9, 0x31, 0x76, 0xc9, 0xcb, 0x89, 0x5b, 0xda, 0x9f, 0xb8, - 0xa5, 0xef, 0x13, 0xb7, 0x74, 0x6f, 0x23, 0x08, 0x93, 0x87, 0xa3, 0xae, 0xdf, 0x13, 0xdb, 0xb6, - 0x9c, 0xfe, 0xa9, 0xc9, 0xfe, 0x23, 0xf6, 0x34, 0xad, 0xdd, 0x3d, 0xaa, 0xae, 0xf3, 0x2b, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xde, 0x8f, 0xb5, 0x9b, 0x06, 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 { - // Allowance returns fee granted to the grantee by the granter. - Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. - Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) - // AllowancesByGranter returns all the grants given by an address - // - // Since: cosmos-sdk 0.46 - AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Allowance(ctx context.Context, in *QueryAllowanceRequest, opts ...grpc.CallOption) (*QueryAllowanceResponse, error) { - out := new(QueryAllowanceResponse) - err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/Allowance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Allowances(ctx context.Context, in *QueryAllowancesRequest, opts ...grpc.CallOption) (*QueryAllowancesResponse, error) { - out := new(QueryAllowancesResponse) - err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/Allowances", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) AllowancesByGranter(ctx context.Context, in *QueryAllowancesByGranterRequest, opts ...grpc.CallOption) (*QueryAllowancesByGranterResponse, error) { - out := new(QueryAllowancesByGranterResponse) - err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Allowance returns fee granted to the grantee by the granter. - Allowance(context.Context, *QueryAllowanceRequest) (*QueryAllowanceResponse, error) - // Allowances returns all the grants for address. - Allowances(context.Context, *QueryAllowancesRequest) (*QueryAllowancesResponse, error) - // AllowancesByGranter returns all the grants given by an address - // - // Since: cosmos-sdk 0.46 - AllowancesByGranter(context.Context, *QueryAllowancesByGranterRequest) (*QueryAllowancesByGranterResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Allowance(ctx context.Context, req *QueryAllowanceRequest) (*QueryAllowanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Allowance not implemented") -} -func (*UnimplementedQueryServer) Allowances(ctx context.Context, req *QueryAllowancesRequest) (*QueryAllowancesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Allowances not implemented") -} -func (*UnimplementedQueryServer) AllowancesByGranter(ctx context.Context, req *QueryAllowancesByGranterRequest) (*QueryAllowancesByGranterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllowancesByGranter not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Allowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllowanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Allowance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.feegrant.v1beta1.Query/Allowance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Allowance(ctx, req.(*QueryAllowanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Allowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllowancesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Allowances(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.feegrant.v1beta1.Query/Allowances", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Allowances(ctx, req.(*QueryAllowancesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_AllowancesByGranter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllowancesByGranterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AllowancesByGranter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllowancesByGranter(ctx, req.(*QueryAllowancesByGranterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.feegrant.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Allowance", - Handler: _Query_Allowance_Handler, - }, - { - MethodName: "Allowances", - Handler: _Query_Allowances_Handler, - }, - { - MethodName: "AllowancesByGranter", - Handler: _Query_AllowancesByGranter_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/feegrant/v1beta1/query.proto", -} - -func (m *QueryAllowanceRequest) 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 *QueryAllowanceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllowanceResponse) 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 *QueryAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Allowance != nil { - { - size, err := m.Allowance.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 *QueryAllowancesRequest) 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 *QueryAllowancesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowancesRequest) 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.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllowancesResponse) 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 *QueryAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowancesResponse) 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.Allowances) > 0 { - for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Allowances[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 *QueryAllowancesByGranterRequest) 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 *QueryAllowancesByGranterRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowancesByGranterRequest) 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.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllowancesByGranterResponse) 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 *QueryAllowancesByGranterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllowancesByGranterResponse) 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.Allowances) > 0 { - for iNdEx := len(m.Allowances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Allowances[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 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 *QueryAllowanceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllowanceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Allowance != nil { - l = m.Allowance.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllowancesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllowancesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Allowances) > 0 { - for _, e := range m.Allowances { - 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 *QueryAllowancesByGranterRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllowancesByGranterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Allowances) > 0 { - for _, e := range m.Allowances { - 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 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 *QueryAllowanceRequest) 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: QueryAllowanceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllowanceResponse) 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: QueryAllowanceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowance", 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.Allowance == nil { - m.Allowance = &Grant{} - } - if err := m.Allowance.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllowancesRequest) 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: QueryAllowancesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllowancesResponse) 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: QueryAllowancesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowances", 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.Allowances = append(m.Allowances, &Grant{}) - if err := m.Allowances[len(m.Allowances)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllowancesByGranterRequest) 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: QueryAllowancesByGranterRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowancesByGranterRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllowancesByGranterResponse) 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: QueryAllowancesByGranterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllowancesByGranterResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowances", 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.Allowances = append(m.Allowances, &Grant{}) - if err := m.Allowances[len(m.Allowances)-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) || (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/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go deleted file mode 100644 index a34118fd88a5..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/feegrant/query.pb.gw.go +++ /dev/null @@ -1,449 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/feegrant/v1beta1/query.proto - -/* -Package feegrant is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package feegrant - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Allowance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowanceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - msg, err := client.Allowance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Allowance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowanceRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - msg, err := server.Allowance(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Allowances_0 = &utilities.DoubleArray{Encoding: map[string]int{"grantee": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Allowances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Allowances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Allowances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowancesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["grantee"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") - } - - protoReq.Grantee, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowances_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Allowances(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_AllowancesByGranter_0 = &utilities.DoubleArray{Encoding: map[string]int{"granter": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_AllowancesByGranter_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowancesByGranterRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowancesByGranter_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.AllowancesByGranter(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllowancesByGranter_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllowancesByGranterRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["granter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") - } - - protoReq.Granter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowancesByGranter_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.AllowancesByGranter(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Allowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Allowance_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Allowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Allowances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllowancesByGranter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AllowancesByGranter_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllowancesByGranter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Allowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Allowance_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Allowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Allowances_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Allowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_AllowancesByGranter_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AllowancesByGranter_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AllowancesByGranter_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Allowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "feegrant", "v1beta1", "allowance", "granter", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Allowances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "feegrant", "v1beta1", "allowances", "grantee"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AllowancesByGranter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "feegrant", "v1beta1", "issued", "granter"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Allowance_0 = runtime.ForwardResponseMessage - - forward_Query_Allowances_0 = runtime.ForwardResponseMessage - - forward_Query_AllowancesByGranter_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go deleted file mode 100644 index 4b9ea6ad8a6f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/feegrant/tx.pb.go +++ /dev/null @@ -1,1043 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/feegrant/v1beta1/tx.proto - -package feegrant - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - 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 - -// MsgGrantAllowance adds permission for Grantee to spend up to Allowance -// of fees from the account of Granter. -type MsgGrantAllowance struct { - // granter is the address of the user granting an allowance of their funds. - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // grantee is the address of the user being granted an allowance of another user's funds. - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` - // allowance can be any of basic, periodic, allowed fee allowance. - Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` -} - -func (m *MsgGrantAllowance) Reset() { *m = MsgGrantAllowance{} } -func (m *MsgGrantAllowance) String() string { return proto.CompactTextString(m) } -func (*MsgGrantAllowance) ProtoMessage() {} -func (*MsgGrantAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_dd44ad7946dad783, []int{0} -} -func (m *MsgGrantAllowance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgGrantAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgGrantAllowance.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 *MsgGrantAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGrantAllowance.Merge(m, src) -} -func (m *MsgGrantAllowance) XXX_Size() int { - return m.Size() -} -func (m *MsgGrantAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGrantAllowance.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgGrantAllowance proto.InternalMessageInfo - -func (m *MsgGrantAllowance) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *MsgGrantAllowance) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -func (m *MsgGrantAllowance) GetAllowance() *types.Any { - if m != nil { - return m.Allowance - } - return nil -} - -// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. -type MsgGrantAllowanceResponse struct { -} - -func (m *MsgGrantAllowanceResponse) Reset() { *m = MsgGrantAllowanceResponse{} } -func (m *MsgGrantAllowanceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgGrantAllowanceResponse) ProtoMessage() {} -func (*MsgGrantAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd44ad7946dad783, []int{1} -} -func (m *MsgGrantAllowanceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgGrantAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgGrantAllowanceResponse.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 *MsgGrantAllowanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgGrantAllowanceResponse.Merge(m, src) -} -func (m *MsgGrantAllowanceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgGrantAllowanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgGrantAllowanceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgGrantAllowanceResponse proto.InternalMessageInfo - -// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. -type MsgRevokeAllowance struct { - // granter is the address of the user granting an allowance of their funds. - Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` - // grantee is the address of the user being granted an allowance of another user's funds. - Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` -} - -func (m *MsgRevokeAllowance) Reset() { *m = MsgRevokeAllowance{} } -func (m *MsgRevokeAllowance) String() string { return proto.CompactTextString(m) } -func (*MsgRevokeAllowance) ProtoMessage() {} -func (*MsgRevokeAllowance) Descriptor() ([]byte, []int) { - return fileDescriptor_dd44ad7946dad783, []int{2} -} -func (m *MsgRevokeAllowance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRevokeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRevokeAllowance.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 *MsgRevokeAllowance) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRevokeAllowance.Merge(m, src) -} -func (m *MsgRevokeAllowance) XXX_Size() int { - return m.Size() -} -func (m *MsgRevokeAllowance) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRevokeAllowance.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRevokeAllowance proto.InternalMessageInfo - -func (m *MsgRevokeAllowance) GetGranter() string { - if m != nil { - return m.Granter - } - return "" -} - -func (m *MsgRevokeAllowance) GetGrantee() string { - if m != nil { - return m.Grantee - } - return "" -} - -// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. -type MsgRevokeAllowanceResponse struct { -} - -func (m *MsgRevokeAllowanceResponse) Reset() { *m = MsgRevokeAllowanceResponse{} } -func (m *MsgRevokeAllowanceResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRevokeAllowanceResponse) ProtoMessage() {} -func (*MsgRevokeAllowanceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dd44ad7946dad783, []int{3} -} -func (m *MsgRevokeAllowanceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRevokeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRevokeAllowanceResponse.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 *MsgRevokeAllowanceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRevokeAllowanceResponse.Merge(m, src) -} -func (m *MsgRevokeAllowanceResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRevokeAllowanceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRevokeAllowanceResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRevokeAllowanceResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgGrantAllowance)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowance") - proto.RegisterType((*MsgGrantAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse") - proto.RegisterType((*MsgRevokeAllowance)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowance") - proto.RegisterType((*MsgRevokeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse") -} - -func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } - -var fileDescriptor_dd44ad7946dad783 = []byte{ - // 416 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, - 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, - 0xd0, 0x83, 0xa9, 0xd0, 0x83, 0xaa, 0x90, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, - 0x2b, 0x4b, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0x84, 0xe8, 0x91, 0x92, 0x84, 0xe8, 0x89, 0x07, - 0xf3, 0xf4, 0xa1, 0x06, 0x40, 0xa4, 0xa0, 0xc6, 0xe9, 0xe7, 0x16, 0xa7, 0xeb, 0x97, 0x19, 0x82, - 0x28, 0xa8, 0x84, 0x60, 0x62, 0x6e, 0x66, 0x5e, 0xbe, 0x3e, 0x98, 0x84, 0x08, 0x29, 0x75, 0x32, - 0x71, 0x09, 0xfa, 0x16, 0xa7, 0xbb, 0x83, 0xac, 0x75, 0xcc, 0xc9, 0xc9, 0x2f, 0x4f, 0xcc, 0x4b, - 0x4e, 0x15, 0x32, 0xe2, 0x62, 0x07, 0x3b, 0x24, 0xb5, 0x48, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, - 0x49, 0xe2, 0xd2, 0x16, 0x5d, 0x11, 0xa8, 0x25, 0x8e, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0xc1, - 0x25, 0x45, 0x99, 0x79, 0xe9, 0x41, 0x30, 0x85, 0x08, 0x3d, 0xa9, 0x12, 0x4c, 0xc4, 0xe9, 0x49, - 0x15, 0x8a, 0xe5, 0xe2, 0x4c, 0x84, 0x59, 0x2a, 0xc1, 0xac, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa2, - 0x07, 0xf1, 0xb3, 0x1e, 0xcc, 0xcf, 0x7a, 0x8e, 0x79, 0x95, 0x4e, 0x9a, 0xa7, 0xb6, 0xe8, 0xaa, - 0xe2, 0x08, 0x25, 0x3d, 0xb7, 0xd4, 0x54, 0xb8, 0xd3, 0x3d, 0x83, 0x10, 0x26, 0x5a, 0xe9, 0x36, - 0x3d, 0xdf, 0xa0, 0x05, 0x73, 0x60, 0xd7, 0xf3, 0x0d, 0x5a, 0x32, 0x10, 0x23, 0x74, 0x8b, 0x53, - 0xb2, 0xf5, 0x31, 0x7c, 0xad, 0x24, 0xcd, 0x25, 0x89, 0x21, 0x18, 0x94, 0x5a, 0x5c, 0x90, 0x9f, - 0x57, 0x9c, 0xaa, 0xb4, 0x86, 0x91, 0x4b, 0xc8, 0xb7, 0x38, 0x3d, 0x28, 0xb5, 0x2c, 0x3f, 0x3b, - 0x95, 0xee, 0x21, 0x65, 0xa5, 0x87, 0xee, 0x15, 0x59, 0x54, 0xaf, 0xa0, 0xb9, 0x4b, 0x49, 0x86, - 0x4b, 0x0a, 0x53, 0x14, 0xe6, 0x19, 0xa3, 0xcf, 0x8c, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0x05, - 0x5c, 0x7c, 0x68, 0x31, 0xaf, 0xa5, 0x87, 0x2b, 0x94, 0x31, 0x82, 0x46, 0xca, 0x88, 0x78, 0xb5, - 0x30, 0x9b, 0x85, 0x8a, 0xb9, 0xf8, 0xd1, 0x83, 0x50, 0x1b, 0x9f, 0x31, 0x68, 0x8a, 0xa5, 0x8c, - 0x49, 0x50, 0x0c, 0xb3, 0x54, 0x8a, 0xb5, 0xe1, 0xf9, 0x06, 0x2d, 0x46, 0x27, 0xc7, 0x13, 0x8f, - 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, - 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, - 0x4b, 0xce, 0xcf, 0x85, 0x66, 0x25, 0x7d, 0xa4, 0xe0, 0xad, 0x80, 0x67, 0xdd, 0x24, 0x36, 0x70, - 0xaa, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x31, 0x95, 0xae, 0xd4, 0x03, 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 { - // GrantAllowance grants fee allowance to the grantee on the granter's - // account with the provided expiration time. - GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error) - // RevokeAllowance revokes any fee allowance of granter's account that - // has been granted to the grantee. - RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) GrantAllowance(ctx context.Context, in *MsgGrantAllowance, opts ...grpc.CallOption) (*MsgGrantAllowanceResponse, error) { - out := new(MsgGrantAllowanceResponse) - err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RevokeAllowance(ctx context.Context, in *MsgRevokeAllowance, opts ...grpc.CallOption) (*MsgRevokeAllowanceResponse, error) { - out := new(MsgRevokeAllowanceResponse) - err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // GrantAllowance grants fee allowance to the grantee on the granter's - // account with the provided expiration time. - GrantAllowance(context.Context, *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error) - // RevokeAllowance revokes any fee allowance of granter's account that - // has been granted to the grantee. - RevokeAllowance(context.Context, *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) GrantAllowance(ctx context.Context, req *MsgGrantAllowance) (*MsgGrantAllowanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GrantAllowance not implemented") -} -func (*UnimplementedMsgServer) RevokeAllowance(ctx context.Context, req *MsgRevokeAllowance) (*MsgRevokeAllowanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RevokeAllowance not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_GrantAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgGrantAllowance) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).GrantAllowance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.feegrant.v1beta1.Msg/GrantAllowance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).GrantAllowance(ctx, req.(*MsgGrantAllowance)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RevokeAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRevokeAllowance) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RevokeAllowance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RevokeAllowance(ctx, req.(*MsgRevokeAllowance)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.feegrant.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GrantAllowance", - Handler: _Msg_GrantAllowance_Handler, - }, - { - MethodName: "RevokeAllowance", - Handler: _Msg_RevokeAllowance_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/feegrant/v1beta1/tx.proto", -} - -func (m *MsgGrantAllowance) 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 *MsgGrantAllowance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgGrantAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Allowance != nil { - { - size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgGrantAllowanceResponse) 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 *MsgGrantAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgGrantAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgRevokeAllowance) 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 *MsgRevokeAllowance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRevokeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Grantee) > 0 { - i -= len(m.Grantee) - copy(dAtA[i:], m.Grantee) - i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) - i-- - dAtA[i] = 0x12 - } - if len(m.Granter) > 0 { - i -= len(m.Granter) - copy(dAtA[i:], m.Granter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRevokeAllowanceResponse) 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 *MsgRevokeAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRevokeAllowanceResponse) 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 *MsgGrantAllowance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Allowance != nil { - l = m.Allowance.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgGrantAllowanceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgRevokeAllowance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Granter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Grantee) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRevokeAllowanceResponse) 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 *MsgGrantAllowance) 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: MsgGrantAllowance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGrantAllowance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Allowance", 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 m.Allowance == nil { - m.Allowance = &types.Any{} - } - if err := m.Allowance.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 *MsgGrantAllowanceResponse) 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: MsgGrantAllowanceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgGrantAllowanceResponse: 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 *MsgRevokeAllowance) 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: MsgRevokeAllowance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRevokeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Granter", 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.Granter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Grantee", 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.Grantee = string(dAtA[iNdEx:postIndex]) - 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 *MsgRevokeAllowanceResponse) 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: MsgRevokeAllowanceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRevokeAllowanceResponse: 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") -) diff --git a/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go deleted file mode 100644 index ca3ee3fed20f..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/genutil/types/genesis.pb.go +++ /dev/null @@ -1,331 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/genutil/v1beta1/genesis.proto - -package types - -import ( - encoding_json "encoding/json" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the raw genesis transaction in JSON. -type GenesisState struct { - // gen_txs defines the genesis transactions. - GenTxs []encoding_json.RawMessage `protobuf:"bytes,1,rep,name=gen_txs,json=genTxs,proto3,casttype=encoding/json.RawMessage" json:"gentxs"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_31771d25e8d8f90f, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetGenTxs() []encoding_json.RawMessage { - if m != nil { - return m.GenTxs - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.genutil.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("cosmos/genutil/v1beta1/genesis.proto", fileDescriptor_31771d25e8d8f90f) -} - -var fileDescriptor_31771d25e8d8f90f = []byte{ - // 244 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x4f, 0xcd, 0x2b, 0x2d, 0xc9, 0xcc, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, - 0x49, 0x34, 0x04, 0xf1, 0x53, 0x8b, 0x33, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xc4, - 0x20, 0xaa, 0xf4, 0xa0, 0xaa, 0xf4, 0xa0, 0xaa, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, - 0xf4, 0x41, 0x2c, 0x88, 0x6a, 0x29, 0xc1, 0xc4, 0xdc, 0xcc, 0xbc, 0x7c, 0x7d, 0x30, 0x09, 0x11, - 0x52, 0x8a, 0xe7, 0xe2, 0x71, 0x87, 0x98, 0x18, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xcf, 0xc5, - 0x9e, 0x9e, 0x9a, 0x17, 0x5f, 0x52, 0x51, 0x2c, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0xe3, 0x64, 0xf6, - 0xea, 0x9e, 0x3c, 0x5b, 0x7a, 0x6a, 0x5e, 0x49, 0x45, 0xf1, 0xaf, 0x7b, 0xf2, 0x12, 0xa9, 0x79, - 0xc9, 0xf9, 0x29, 0x99, 0x79, 0xe9, 0xfa, 0x59, 0xc5, 0xf9, 0x79, 0x7a, 0x41, 0x89, 0xe5, 0xbe, - 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x8b, 0x9e, 0x6f, 0xd0, 0x82, 0x2a, 0x5b, 0xf1, 0x7c, 0x83, - 0x16, 0x63, 0x10, 0x88, 0x13, 0x52, 0x51, 0xec, 0xe4, 0x76, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, - 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, - 0xc7, 0x72, 0x0c, 0x51, 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, - 0x50, 0xcf, 0x42, 0x28, 0xdd, 0xe2, 0x94, 0x6c, 0xfd, 0x0a, 0xb8, 0xcf, 0x4b, 0x2a, 0x0b, 0x52, - 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x4e, 0x6d, 0x9e, - 0x18, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.GenTxs) > 0 { - for iNdEx := len(m.GenTxs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.GenTxs[iNdEx]) - copy(dAtA[i:], m.GenTxs[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.GenTxs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.GenTxs) > 0 { - for _, b := range m.GenTxs { - l = len(b) - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GenTxs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GenTxs = append(m.GenTxs, make([]byte, postIndex-iNdEx)) - copy(m.GenTxs[len(m.GenTxs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go deleted file mode 100644 index dac10386d51d..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/genesis.pb.go +++ /dev/null @@ -1,754 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/genesis.proto - -package v1 - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the gov module's genesis state. -type GenesisState struct { - // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` - // deposits defines all the deposits present at genesis. - Deposits []*Deposit `protobuf:"bytes,2,rep,name=deposits,proto3" json:"deposits,omitempty"` - // votes defines all the votes present at genesis. - Votes []*Vote `protobuf:"bytes,3,rep,name=votes,proto3" json:"votes,omitempty"` - // proposals defines all the proposals present at genesis. - Proposals []*Proposal `protobuf:"bytes,4,rep,name=proposals,proto3" json:"proposals,omitempty"` - // Deprecated: Prefer to use `params` instead. - // deposit_params defines all the paramaters of related to deposit. - DepositParams *DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. - // Deprecated: Prefer to use `params` instead. - // voting_params defines all the paramaters of related to voting. - VotingParams *VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. - // Deprecated: Prefer to use `params` instead. - // tally_params defines all the paramaters of related to tally. - TallyParams *TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. - // params defines all the paramaters of x/gov module. - // - // Since: cosmos-sdk 0.47 - Params *Params `protobuf:"bytes,8,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_ef7cfd15e3ded621, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetStartingProposalId() uint64 { - if m != nil { - return m.StartingProposalId - } - return 0 -} - -func (m *GenesisState) GetDeposits() []*Deposit { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *GenesisState) GetVotes() []*Vote { - if m != nil { - return m.Votes - } - return nil -} - -func (m *GenesisState) GetProposals() []*Proposal { - if m != nil { - return m.Proposals - } - return nil -} - -// Deprecated: Do not use. -func (m *GenesisState) GetDepositParams() *DepositParams { - if m != nil { - return m.DepositParams - } - return nil -} - -// Deprecated: Do not use. -func (m *GenesisState) GetVotingParams() *VotingParams { - if m != nil { - return m.VotingParams - } - return nil -} - -// Deprecated: Do not use. -func (m *GenesisState) GetTallyParams() *TallyParams { - if m != nil { - return m.TallyParams - } - return nil -} - -func (m *GenesisState) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1.GenesisState") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/genesis.proto", fileDescriptor_ef7cfd15e3ded621) } - -var fileDescriptor_ef7cfd15e3ded621 = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4e, 0xfa, 0x40, - 0x14, 0xc5, 0x19, 0xbe, 0xfe, 0xfc, 0x07, 0x70, 0x31, 0x7e, 0xd0, 0x80, 0x69, 0x88, 0x2b, 0x8c, - 0xa1, 0x15, 0x8c, 0x0f, 0x20, 0xc1, 0x10, 0x77, 0xa4, 0x1a, 0x17, 0x6e, 0x48, 0xa1, 0x93, 0xda, - 0x08, 0xdc, 0xa6, 0x77, 0x9c, 0xc8, 0x5b, 0xf8, 0x58, 0x2e, 0xd9, 0xe9, 0xd2, 0xc0, 0x8b, 0x18, - 0x66, 0x5a, 0xc1, 0xea, 0x6a, 0x92, 0x7b, 0x7e, 0xe7, 0xcc, 0xc9, 0xcd, 0xa5, 0x8d, 0x09, 0xe0, - 0x0c, 0xd0, 0xf6, 0x41, 0xda, 0xb2, 0x63, 0xfb, 0x7c, 0xce, 0x31, 0x40, 0x2b, 0x8c, 0x40, 0x00, - 0xab, 0x6a, 0xd1, 0xf2, 0x41, 0x5a, 0xb2, 0x53, 0xaf, 0xa5, 0x58, 0x90, 0x9a, 0x3b, 0x79, 0xcf, - 0xd1, 0xca, 0x40, 0x3b, 0x6f, 0x85, 0x2b, 0x38, 0x3b, 0xa7, 0x07, 0x28, 0xdc, 0x48, 0x04, 0x73, - 0x7f, 0x14, 0x46, 0x10, 0x02, 0xba, 0xd3, 0x51, 0xe0, 0x19, 0xa4, 0x49, 0x5a, 0x79, 0x87, 0x25, - 0xda, 0x30, 0x96, 0x6e, 0x3c, 0xd6, 0xa5, 0x25, 0x8f, 0x87, 0x80, 0x81, 0x40, 0x23, 0xdb, 0xcc, - 0xb5, 0xca, 0xdd, 0x23, 0xeb, 0xc7, 0xef, 0x56, 0x5f, 0xcb, 0xce, 0x37, 0xc7, 0x4e, 0x69, 0x41, - 0x82, 0xe0, 0x68, 0xe4, 0x94, 0x61, 0x3f, 0x65, 0xb8, 0x07, 0xc1, 0x1d, 0x4d, 0xb0, 0x4b, 0xfa, - 0x3f, 0xe9, 0x81, 0x46, 0x5e, 0xe1, 0xb5, 0x14, 0x9e, 0x94, 0x71, 0xb6, 0x24, 0x1b, 0xd0, 0xbd, - 0xf8, 0xb7, 0x51, 0xe8, 0x46, 0xee, 0x0c, 0x8d, 0x42, 0x93, 0xb4, 0xca, 0xdd, 0xe3, 0xbf, 0xbb, - 0x0d, 0x15, 0xd3, 0xcb, 0x1a, 0xc4, 0xa9, 0x7a, 0xbb, 0x23, 0xd6, 0xa7, 0x55, 0x09, 0x7a, 0x1d, - 0x3a, 0xa7, 0xa8, 0x72, 0x1a, 0xbf, 0x2b, 0x6f, 0xd6, 0xb2, 0x8d, 0xa9, 0xc8, 0x9d, 0x09, 0xbb, - 0xa2, 0x15, 0xe1, 0x4e, 0xa7, 0x8b, 0x24, 0xe4, 0x9f, 0x0a, 0xa9, 0xa7, 0x42, 0xee, 0x36, 0xc8, - 0x4e, 0x46, 0x59, 0x6c, 0x07, 0xac, 0x4d, 0x8b, 0xb1, 0xb9, 0xa4, 0xcc, 0x87, 0xe9, 0x2d, 0x28, - 0xd1, 0x89, 0xa1, 0xde, 0xf5, 0xdb, 0xca, 0x24, 0xcb, 0x95, 0x49, 0x3e, 0x57, 0x26, 0x79, 0x5d, - 0x9b, 0x99, 0xe5, 0xda, 0xcc, 0x7c, 0xac, 0xcd, 0xcc, 0xc3, 0x99, 0x1f, 0x88, 0xc7, 0xe7, 0xb1, - 0x35, 0x81, 0x99, 0x1d, 0xdf, 0x85, 0x7e, 0xda, 0xe8, 0x3d, 0xd9, 0x2f, 0xea, 0x48, 0xc4, 0x22, - 0xe4, 0x68, 0xcb, 0xce, 0xb8, 0xa8, 0xee, 0xe4, 0xe2, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xb2, - 0x17, 0xb2, 0x6e, 0x02, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.TallyParams != nil { - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.VotingParams != nil { - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - if m.DepositParams != nil { - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.StartingProposalId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartingProposalId != 0 { - n += 1 + sovGenesis(uint64(m.StartingProposalId)) - } - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.DepositParams != nil { - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.VotingParams != nil { - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.TallyParams != nil { - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) - } - m.StartingProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deposits = append(m.Deposits, &Deposit{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, &Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposals = append(m.Proposals, &Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DepositParams == nil { - m.DepositParams = &DepositParams{} - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingParams == nil { - m.VotingParams = &VotingParams{} - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TallyParams == nil { - m.TallyParams = &TallyParams{} - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - 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 ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Params == nil { - m.Params = &Params{} - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go deleted file mode 100644 index 747eab5c4ca6..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/gov.pb.go +++ /dev/null @@ -1,3618 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/gov.proto - -package v1 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "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 - -// VoteOption enumerates the valid vote options for a given governance proposal. -type VoteOption int32 - -const ( - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VoteOption_VOTE_OPTION_UNSPECIFIED VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. - VoteOption_VOTE_OPTION_YES VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VoteOption_VOTE_OPTION_ABSTAIN VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - VoteOption_VOTE_OPTION_NO VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VoteOption_VOTE_OPTION_NO_WITH_VETO VoteOption = 4 -) - -var VoteOption_name = map[int32]string{ - 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", -} - -var VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, -} - -func (x VoteOption) String() string { - return proto.EnumName(VoteOption_name, int32(x)) -} - -func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} -} - -// ProposalStatus enumerates the valid statuses of a proposal. -type ProposalStatus int32 - -const ( - // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED ProposalStatus = 0 - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - ProposalStatus_PROPOSAL_STATUS_DEPOSIT_PERIOD ProposalStatus = 1 - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - ProposalStatus_PROPOSAL_STATUS_VOTING_PERIOD ProposalStatus = 2 - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - ProposalStatus_PROPOSAL_STATUS_PASSED ProposalStatus = 3 - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - ProposalStatus_PROPOSAL_STATUS_REJECTED ProposalStatus = 4 - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - ProposalStatus_PROPOSAL_STATUS_FAILED ProposalStatus = 5 -) - -var ProposalStatus_name = map[int32]string{ - 0: "PROPOSAL_STATUS_UNSPECIFIED", - 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", - 2: "PROPOSAL_STATUS_VOTING_PERIOD", - 3: "PROPOSAL_STATUS_PASSED", - 4: "PROPOSAL_STATUS_REJECTED", - 5: "PROPOSAL_STATUS_FAILED", -} - -var ProposalStatus_value = map[string]int32{ - "PROPOSAL_STATUS_UNSPECIFIED": 0, - "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, - "PROPOSAL_STATUS_VOTING_PERIOD": 2, - "PROPOSAL_STATUS_PASSED": 3, - "PROPOSAL_STATUS_REJECTED": 4, - "PROPOSAL_STATUS_FAILED": 5, -} - -func (x ProposalStatus) String() string { - return proto.EnumName(ProposalStatus_name, int32(x)) -} - -func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{1} -} - -// WeightedVoteOption defines a unit of vote for vote split. -type WeightedVoteOption struct { - // option defines the valid vote options, it must not contain duplicate vote options. - Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` - // weight is the vote weight associated with the vote option. - Weight string `protobuf:"bytes,2,opt,name=weight,proto3" json:"weight,omitempty"` -} - -func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } -func (m *WeightedVoteOption) String() string { return proto.CompactTextString(m) } -func (*WeightedVoteOption) ProtoMessage() {} -func (*WeightedVoteOption) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{0} -} -func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedVoteOption.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 *WeightedVoteOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedVoteOption.Merge(m, src) -} -func (m *WeightedVoteOption) XXX_Size() int { - return m.Size() -} -func (m *WeightedVoteOption) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo - -func (m *WeightedVoteOption) GetOption() VoteOption { - if m != nil { - return m.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -func (m *WeightedVoteOption) GetWeight() string { - if m != nil { - return m.Weight - } - return "" -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -type Deposit struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - // amount to be deposited by depositor. - Amount []types.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` -} - -func (m *Deposit) Reset() { *m = Deposit{} } -func (m *Deposit) String() string { return proto.CompactTextString(m) } -func (*Deposit) ProtoMessage() {} -func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{1} -} -func (m *Deposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Deposit.Merge(m, src) -} -func (m *Deposit) XXX_Size() int { - return m.Size() -} -func (m *Deposit) XXX_DiscardUnknown() { - xxx_messageInfo_Deposit.DiscardUnknown(m) -} - -var xxx_messageInfo_Deposit proto.InternalMessageInfo - -func (m *Deposit) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *Deposit) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *Deposit) GetAmount() []types.Coin { - if m != nil { - return m.Amount - } - return nil -} - -// Proposal defines the core field members of a governance proposal. -type Proposal struct { - // id defines the unique id of the proposal. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // messages are the arbitrary messages to be executed if the proposal passes. - Messages []*types1.Any `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"` - // status defines the proposal status. - Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"status,omitempty"` - // final_tally_result is the final tally result of the proposal. When - // querying a proposal via gRPC, this field is not populated until the - // proposal's voting period has ended. - FinalTallyResult *TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result,omitempty"` - // submit_time is the time of proposal submission. - SubmitTime *time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time,omitempty"` - // deposit_end_time is the end time for deposition. - DepositEndTime *time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time,omitempty"` - // total_deposit is the total deposit on the proposal. - TotalDeposit []types.Coin `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3" json:"total_deposit"` - // voting_start_time is the starting time to vote on a proposal. - VotingStartTime *time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time,omitempty"` - // voting_end_time is the end time of voting on a proposal. - VotingEndTime *time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time,omitempty"` - // metadata is any arbitrary metadata attached to the proposal. - Metadata string `protobuf:"bytes,10,opt,name=metadata,proto3" json:"metadata,omitempty"` - // title is the title of the proposal - // - // Since: cosmos-sdk 0.47 - Title string `protobuf:"bytes,11,opt,name=title,proto3" json:"title,omitempty"` - // summary is a short summary of the proposal - // - // Since: cosmos-sdk 0.47 - Summary string `protobuf:"bytes,12,opt,name=summary,proto3" json:"summary,omitempty"` - // Proposer is the address of the proposal sumbitter - // - // Since: cosmos-sdk 0.47 - Proposer string `protobuf:"bytes,13,opt,name=proposer,proto3" json:"proposer,omitempty"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{2} -} -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return m.Size() -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Proposal) GetMessages() []*types1.Any { - if m != nil { - return m.Messages - } - return nil -} - -func (m *Proposal) GetStatus() ProposalStatus { - if m != nil { - return m.Status - } - return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED -} - -func (m *Proposal) GetFinalTallyResult() *TallyResult { - if m != nil { - return m.FinalTallyResult - } - return nil -} - -func (m *Proposal) GetSubmitTime() *time.Time { - if m != nil { - return m.SubmitTime - } - return nil -} - -func (m *Proposal) GetDepositEndTime() *time.Time { - if m != nil { - return m.DepositEndTime - } - return nil -} - -func (m *Proposal) GetTotalDeposit() []types.Coin { - if m != nil { - return m.TotalDeposit - } - return nil -} - -func (m *Proposal) GetVotingStartTime() *time.Time { - if m != nil { - return m.VotingStartTime - } - return nil -} - -func (m *Proposal) GetVotingEndTime() *time.Time { - if m != nil { - return m.VotingEndTime - } - return nil -} - -func (m *Proposal) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -func (m *Proposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *Proposal) GetSummary() string { - if m != nil { - return m.Summary - } - return "" -} - -func (m *Proposal) GetProposer() string { - if m != nil { - return m.Proposer - } - return "" -} - -// TallyResult defines a standard tally for a governance proposal. -type TallyResult struct { - // yes_count is the number of yes votes on a proposal. - YesCount string `protobuf:"bytes,1,opt,name=yes_count,json=yesCount,proto3" json:"yes_count,omitempty"` - // abstain_count is the number of abstain votes on a proposal. - AbstainCount string `protobuf:"bytes,2,opt,name=abstain_count,json=abstainCount,proto3" json:"abstain_count,omitempty"` - // no_count is the number of no votes on a proposal. - NoCount string `protobuf:"bytes,3,opt,name=no_count,json=noCount,proto3" json:"no_count,omitempty"` - // no_with_veto_count is the number of no with veto votes on a proposal. - NoWithVetoCount string `protobuf:"bytes,4,opt,name=no_with_veto_count,json=noWithVetoCount,proto3" json:"no_with_veto_count,omitempty"` -} - -func (m *TallyResult) Reset() { *m = TallyResult{} } -func (m *TallyResult) String() string { return proto.CompactTextString(m) } -func (*TallyResult) ProtoMessage() {} -func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{3} -} -func (m *TallyResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyResult.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 *TallyResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyResult.Merge(m, src) -} -func (m *TallyResult) XXX_Size() int { - return m.Size() -} -func (m *TallyResult) XXX_DiscardUnknown() { - xxx_messageInfo_TallyResult.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyResult proto.InternalMessageInfo - -func (m *TallyResult) GetYesCount() string { - if m != nil { - return m.YesCount - } - return "" -} - -func (m *TallyResult) GetAbstainCount() string { - if m != nil { - return m.AbstainCount - } - return "" -} - -func (m *TallyResult) GetNoCount() string { - if m != nil { - return m.NoCount - } - return "" -} - -func (m *TallyResult) GetNoWithVetoCount() string { - if m != nil { - return m.NoWithVetoCount - } - return "" -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -type Vote struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter is the voter address of the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // options is the weighted vote options. - Options []*WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata to attached to the vote. - Metadata string `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{4} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} -func (m *Vote) XXX_Size() int { - return m.Size() -} -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *Vote) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *Vote) GetOptions() []*WeightedVoteOption { - if m != nil { - return m.Options - } - return nil -} - -func (m *Vote) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -// DepositParams defines the params for deposits on governance proposals. -type DepositParams struct { - // Minimum deposit for a proposal to enter voting period. - MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit,omitempty"` - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` -} - -func (m *DepositParams) Reset() { *m = DepositParams{} } -func (m *DepositParams) String() string { return proto.CompactTextString(m) } -func (*DepositParams) ProtoMessage() {} -func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{5} -} -func (m *DepositParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DepositParams.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 *DepositParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_DepositParams.Merge(m, src) -} -func (m *DepositParams) XXX_Size() int { - return m.Size() -} -func (m *DepositParams) XXX_DiscardUnknown() { - xxx_messageInfo_DepositParams.DiscardUnknown(m) -} - -var xxx_messageInfo_DepositParams proto.InternalMessageInfo - -func (m *DepositParams) GetMinDeposit() []types.Coin { - if m != nil { - return m.MinDeposit - } - return nil -} - -func (m *DepositParams) GetMaxDepositPeriod() *time.Duration { - if m != nil { - return m.MaxDepositPeriod - } - return nil -} - -// VotingParams defines the params for voting on governance proposals. -type VotingParams struct { - // Duration of the voting period. - VotingPeriod *time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` -} - -func (m *VotingParams) Reset() { *m = VotingParams{} } -func (m *VotingParams) String() string { return proto.CompactTextString(m) } -func (*VotingParams) ProtoMessage() {} -func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{6} -} -func (m *VotingParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VotingParams.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 *VotingParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VotingParams.Merge(m, src) -} -func (m *VotingParams) XXX_Size() int { - return m.Size() -} -func (m *VotingParams) XXX_DiscardUnknown() { - xxx_messageInfo_VotingParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VotingParams proto.InternalMessageInfo - -func (m *VotingParams) GetVotingPeriod() *time.Duration { - if m != nil { - return m.VotingPeriod - } - return nil -} - -// TallyParams defines the params for tallying votes on governance proposals. -type TallyParams struct { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - Quorum string `protobuf:"bytes,1,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold string `protobuf:"bytes,2,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold string `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` -} - -func (m *TallyParams) Reset() { *m = TallyParams{} } -func (m *TallyParams) String() string { return proto.CompactTextString(m) } -func (*TallyParams) ProtoMessage() {} -func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{7} -} -func (m *TallyParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyParams.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 *TallyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyParams.Merge(m, src) -} -func (m *TallyParams) XXX_Size() int { - return m.Size() -} -func (m *TallyParams) XXX_DiscardUnknown() { - xxx_messageInfo_TallyParams.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyParams proto.InternalMessageInfo - -func (m *TallyParams) GetQuorum() string { - if m != nil { - return m.Quorum - } - return "" -} - -func (m *TallyParams) GetThreshold() string { - if m != nil { - return m.Threshold - } - return "" -} - -func (m *TallyParams) GetVetoThreshold() string { - if m != nil { - return m.VetoThreshold - } - return "" -} - -// Params defines the parameters for the x/gov module. -// -// Since: cosmos-sdk 0.47 -type Params struct { - // Minimum deposit for a proposal to enter voting period. - MinDeposit []types.Coin `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3" json:"min_deposit"` - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - MaxDepositPeriod *time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` - // Duration of the voting period. - VotingPeriod *time.Duration `protobuf:"bytes,3,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - Quorum string `protobuf:"bytes,4,opt,name=quorum,proto3" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold string `protobuf:"bytes,5,opt,name=threshold,proto3" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold string `protobuf:"bytes,6,opt,name=veto_threshold,json=vetoThreshold,proto3" json:"veto_threshold,omitempty"` - // The ratio representing the proportion of the deposit value that must be paid at proposal submission. - MinInitialDepositRatio string `protobuf:"bytes,7,opt,name=min_initial_deposit_ratio,json=minInitialDepositRatio,proto3" json:"min_initial_deposit_ratio,omitempty"` - // burn deposits if a proposal does not meet quorum - BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` - // burn deposits if the proposal does not enter voting period - BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` - // burn deposits if quorum with vote type no_veto is met - BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,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_e05cb1c0d030febb, []int{8} -} -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) GetMinDeposit() []types.Coin { - if m != nil { - return m.MinDeposit - } - return nil -} - -func (m *Params) GetMaxDepositPeriod() *time.Duration { - if m != nil { - return m.MaxDepositPeriod - } - return nil -} - -func (m *Params) GetVotingPeriod() *time.Duration { - if m != nil { - return m.VotingPeriod - } - return nil -} - -func (m *Params) GetQuorum() string { - if m != nil { - return m.Quorum - } - return "" -} - -func (m *Params) GetThreshold() string { - if m != nil { - return m.Threshold - } - return "" -} - -func (m *Params) GetVetoThreshold() string { - if m != nil { - return m.VetoThreshold - } - return "" -} - -func (m *Params) GetMinInitialDepositRatio() string { - if m != nil { - return m.MinInitialDepositRatio - } - return "" -} - -func (m *Params) GetBurnVoteQuorum() bool { - if m != nil { - return m.BurnVoteQuorum - } - return false -} - -func (m *Params) GetBurnProposalDepositPrevote() bool { - if m != nil { - return m.BurnProposalDepositPrevote - } - return false -} - -func (m *Params) GetBurnVoteVeto() bool { - if m != nil { - return m.BurnVoteVeto - } - return false -} - -func init() { - proto.RegisterEnum("cosmos.gov.v1.VoteOption", VoteOption_name, VoteOption_value) - proto.RegisterEnum("cosmos.gov.v1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") - proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1.Deposit") - proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") - proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1.TallyResult") - proto.RegisterType((*Vote)(nil), "cosmos.gov.v1.Vote") - proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") - proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1.VotingParams") - proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1.TallyParams") - proto.RegisterType((*Params)(nil), "cosmos.gov.v1.Params") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } - -var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1276 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x73, 0xd3, 0xc6, - 0x17, 0x8f, 0x6c, 0xd9, 0x71, 0x9e, 0x63, 0x47, 0x2c, 0xf9, 0x82, 0x12, 0x88, 0x1d, 0x3c, 0x0c, - 0x93, 0x2f, 0x3f, 0xec, 0x6f, 0xe0, 0x4b, 0x2f, 0xf4, 0xe2, 0xc4, 0xa2, 0x88, 0xa1, 0xb1, 0x2b, - 0x8b, 0x30, 0xf4, 0xa2, 0x91, 0xa3, 0xc5, 0xd9, 0xa9, 0xa5, 0x75, 0xa5, 0xb5, 0xc1, 0x7f, 0x42, - 0x6f, 0x1c, 0x3b, 0x3d, 0xf5, 0xd8, 0x63, 0x0f, 0x4c, 0xef, 0xbd, 0x71, 0x6a, 0x19, 0x2e, 0x6d, - 0x2f, 0xb4, 0x03, 0x87, 0xce, 0xf0, 0x57, 0x74, 0x76, 0xb5, 0xb2, 0x1d, 0xc7, 0x9d, 0x04, 0x2e, - 0xb1, 0xf4, 0xde, 0xe7, 0xf3, 0xde, 0xdb, 0xf7, 0x6b, 0x15, 0x38, 0x7f, 0x40, 0x23, 0x9f, 0x46, - 0xb5, 0x2e, 0x1d, 0xd6, 0x86, 0xdb, 0xfc, 0xa7, 0xda, 0x0f, 0x29, 0xa3, 0xa8, 0x10, 0x2b, 0xaa, - 0x5c, 0x32, 0xdc, 0x5e, 0x2f, 0x49, 0x5c, 0xc7, 0x8d, 0x70, 0x6d, 0xb8, 0xdd, 0xc1, 0xcc, 0xdd, - 0xae, 0x1d, 0x50, 0x12, 0xc4, 0xf0, 0xf5, 0xd5, 0x2e, 0xed, 0x52, 0xf1, 0x58, 0xe3, 0x4f, 0x52, - 0x5a, 0xee, 0x52, 0xda, 0xed, 0xe1, 0x9a, 0x78, 0xeb, 0x0c, 0x9e, 0xd4, 0x18, 0xf1, 0x71, 0xc4, - 0x5c, 0xbf, 0x2f, 0x01, 0x6b, 0xb3, 0x00, 0x37, 0x18, 0x49, 0x55, 0x69, 0x56, 0xe5, 0x0d, 0x42, - 0x97, 0x11, 0x9a, 0x78, 0x5c, 0x8b, 0x23, 0x72, 0x62, 0xa7, 0x32, 0xda, 0x58, 0x75, 0xc6, 0xf5, - 0x49, 0x40, 0x6b, 0xe2, 0x6f, 0x2c, 0xaa, 0x50, 0x40, 0x8f, 0x30, 0xe9, 0x1e, 0x32, 0xec, 0xed, - 0x53, 0x86, 0x9b, 0x7d, 0x6e, 0x09, 0x6d, 0x43, 0x96, 0x8a, 0x27, 0x5d, 0xd9, 0x54, 0xb6, 0x8a, - 0x37, 0xd7, 0xaa, 0x47, 0x4e, 0x5d, 0x9d, 0x40, 0x2d, 0x09, 0x44, 0x57, 0x20, 0xfb, 0x54, 0x18, - 0xd2, 0x53, 0x9b, 0xca, 0xd6, 0xd2, 0x4e, 0xf1, 0xf5, 0x8b, 0x1b, 0x20, 0x59, 0x0d, 0x7c, 0x60, - 0x49, 0x6d, 0xe5, 0x7b, 0x05, 0x16, 0x1b, 0xb8, 0x4f, 0x23, 0xc2, 0x50, 0x19, 0xf2, 0xfd, 0x90, - 0xf6, 0x69, 0xe4, 0xf6, 0x1c, 0xe2, 0x09, 0x5f, 0xaa, 0x05, 0x89, 0xc8, 0xf4, 0xd0, 0x27, 0xb0, - 0xe4, 0xc5, 0x58, 0x1a, 0x4a, 0xbb, 0xfa, 0xeb, 0x17, 0x37, 0x56, 0xa5, 0xdd, 0xba, 0xe7, 0x85, - 0x38, 0x8a, 0xda, 0x2c, 0x24, 0x41, 0xd7, 0x9a, 0x40, 0xd1, 0xa7, 0x90, 0x75, 0x7d, 0x3a, 0x08, - 0x98, 0x9e, 0xde, 0x4c, 0x6f, 0xe5, 0x27, 0xf1, 0xf3, 0x32, 0x55, 0x65, 0x99, 0xaa, 0xbb, 0x94, - 0x04, 0x3b, 0x4b, 0x2f, 0xdf, 0x94, 0x17, 0x7e, 0xf8, 0xfb, 0xc7, 0xab, 0x8a, 0x25, 0x39, 0x95, - 0x9f, 0x33, 0x90, 0x6b, 0xc9, 0x20, 0x50, 0x11, 0x52, 0xe3, 0xd0, 0x52, 0xc4, 0x43, 0xff, 0x83, - 0x9c, 0x8f, 0xa3, 0xc8, 0xed, 0xe2, 0x48, 0x4f, 0x09, 0xe3, 0xab, 0xd5, 0xb8, 0x22, 0xd5, 0xa4, - 0x22, 0xd5, 0x7a, 0x30, 0xb2, 0xc6, 0x28, 0x74, 0x1b, 0xb2, 0x11, 0x73, 0xd9, 0x20, 0xd2, 0xd3, - 0x22, 0x99, 0x1b, 0x33, 0xc9, 0x4c, 0x5c, 0xb5, 0x05, 0xc8, 0x92, 0x60, 0x74, 0x0f, 0xd0, 0x13, - 0x12, 0xb8, 0x3d, 0x87, 0xb9, 0xbd, 0xde, 0xc8, 0x09, 0x71, 0x34, 0xe8, 0x31, 0x5d, 0xdd, 0x54, - 0xb6, 0xf2, 0x37, 0xd7, 0x67, 0x4c, 0xd8, 0x1c, 0x62, 0x09, 0x84, 0xa5, 0x09, 0xd6, 0x94, 0x04, - 0xd5, 0x21, 0x1f, 0x0d, 0x3a, 0x3e, 0x61, 0x0e, 0x6f, 0x33, 0x3d, 0x23, 0x4d, 0xcc, 0x46, 0x6d, - 0x27, 0x3d, 0xb8, 0xa3, 0x3e, 0xff, 0xb3, 0xac, 0x58, 0x10, 0x93, 0xb8, 0x18, 0xdd, 0x07, 0x4d, - 0x66, 0xd7, 0xc1, 0x81, 0x17, 0xdb, 0xc9, 0x9e, 0xd2, 0x4e, 0x51, 0x32, 0x8d, 0xc0, 0x13, 0xb6, - 0x4c, 0x28, 0x30, 0xca, 0xdc, 0x9e, 0x23, 0xe5, 0xfa, 0xe2, 0x07, 0xd4, 0x68, 0x59, 0x50, 0x93, - 0x06, 0x7a, 0x00, 0x67, 0x86, 0x94, 0x91, 0xa0, 0xeb, 0x44, 0xcc, 0x0d, 0xe5, 0xf9, 0x72, 0xa7, - 0x8c, 0x6b, 0x25, 0xa6, 0xb6, 0x39, 0x53, 0x04, 0x76, 0x0f, 0xa4, 0x68, 0x72, 0xc6, 0xa5, 0x53, - 0xda, 0x2a, 0xc4, 0xc4, 0xe4, 0x88, 0xeb, 0xbc, 0x49, 0x98, 0xeb, 0xb9, 0xcc, 0xd5, 0x81, 0xb7, - 0xad, 0x35, 0x7e, 0x47, 0xab, 0x90, 0x61, 0x84, 0xf5, 0xb0, 0x9e, 0x17, 0x8a, 0xf8, 0x05, 0xe9, - 0xb0, 0x18, 0x0d, 0x7c, 0xdf, 0x0d, 0x47, 0xfa, 0xb2, 0x90, 0x27, 0xaf, 0xe8, 0xff, 0x90, 0x8b, - 0x27, 0x02, 0x87, 0x7a, 0xe1, 0x84, 0x11, 0x18, 0x23, 0x2b, 0xbf, 0x29, 0x90, 0x9f, 0xee, 0x81, - 0x6b, 0xb0, 0x34, 0xc2, 0x91, 0x73, 0x20, 0x86, 0x42, 0x39, 0x36, 0xa1, 0x66, 0xc0, 0xac, 0xdc, - 0x08, 0x47, 0xbb, 0x5c, 0x8f, 0x6e, 0x41, 0xc1, 0xed, 0x44, 0xcc, 0x25, 0x81, 0x24, 0xa4, 0xe6, - 0x12, 0x96, 0x25, 0x28, 0x26, 0xfd, 0x17, 0x72, 0x01, 0x95, 0xf8, 0xf4, 0x5c, 0xfc, 0x62, 0x40, - 0x63, 0xe8, 0x1d, 0x40, 0x01, 0x75, 0x9e, 0x12, 0x76, 0xe8, 0x0c, 0x31, 0x4b, 0x48, 0xea, 0x5c, - 0xd2, 0x4a, 0x40, 0x1f, 0x11, 0x76, 0xb8, 0x8f, 0x59, 0x4c, 0xae, 0xfc, 0xa4, 0x80, 0xca, 0xf7, - 0xcf, 0xc9, 0xdb, 0xa3, 0x0a, 0x99, 0x21, 0x65, 0xf8, 0xe4, 0xcd, 0x11, 0xc3, 0xd0, 0x1d, 0x58, - 0x8c, 0x97, 0x59, 0xa4, 0xab, 0xa2, 0x25, 0x2f, 0xcd, 0x8c, 0xd9, 0xf1, 0x4d, 0x69, 0x25, 0x8c, - 0x23, 0x25, 0xcf, 0x1c, 0x2d, 0xf9, 0x7d, 0x35, 0x97, 0xd6, 0xd4, 0xca, 0x1f, 0x0a, 0x14, 0x64, - 0xe3, 0xb6, 0xdc, 0xd0, 0xf5, 0x23, 0xf4, 0x18, 0xf2, 0x3e, 0x09, 0xc6, 0x73, 0xa0, 0x9c, 0x34, - 0x07, 0x1b, 0x7c, 0x0e, 0xde, 0xbf, 0x29, 0xff, 0x67, 0x8a, 0x75, 0x9d, 0xfa, 0x84, 0x61, 0xbf, - 0xcf, 0x46, 0x16, 0xf8, 0x24, 0x48, 0x26, 0xc3, 0x07, 0xe4, 0xbb, 0xcf, 0x12, 0x90, 0xd3, 0xc7, - 0x21, 0xa1, 0x9e, 0x48, 0x04, 0xf7, 0x30, 0xdb, 0xce, 0x0d, 0x79, 0x85, 0xec, 0x5c, 0x7e, 0xff, - 0xa6, 0x7c, 0xf1, 0x38, 0x71, 0xe2, 0xe4, 0x5b, 0xde, 0xed, 0x9a, 0xef, 0x3e, 0x4b, 0x4e, 0x22, - 0xf4, 0x15, 0x1b, 0x96, 0xf7, 0xc5, 0x04, 0xc8, 0x93, 0x35, 0x40, 0x4e, 0x44, 0xe2, 0x59, 0x39, - 0xc9, 0xb3, 0x2a, 0x2c, 0x2f, 0xc7, 0x2c, 0x69, 0xf5, 0xbb, 0xa4, 0x89, 0xa5, 0xd5, 0x2b, 0x90, - 0xfd, 0x7a, 0x40, 0xc3, 0x81, 0x3f, 0xa7, 0x83, 0xc5, 0x1d, 0x13, 0x6b, 0xd1, 0x75, 0x58, 0x62, - 0x87, 0x21, 0x8e, 0x0e, 0x69, 0xcf, 0xfb, 0x97, 0xeb, 0x68, 0x02, 0x40, 0xb7, 0xa1, 0x28, 0xba, - 0x70, 0x42, 0x49, 0xcf, 0xa5, 0x14, 0x38, 0xca, 0x4e, 0x40, 0x95, 0x5f, 0x55, 0xc8, 0xca, 0xb8, - 0x8c, 0x0f, 0xac, 0xe3, 0xd4, 0x3e, 0x9b, 0xae, 0xd9, 0xe7, 0x1f, 0x57, 0x33, 0x75, 0x7e, 0x4d, - 0x8e, 0xd7, 0x20, 0xfd, 0x11, 0x35, 0x98, 0xca, 0xb9, 0x7a, 0xfa, 0x9c, 0x67, 0x3e, 0x3c, 0xe7, - 0xd9, 0x53, 0xe4, 0x1c, 0x99, 0xb0, 0xc6, 0x13, 0x4d, 0x02, 0xc2, 0xc8, 0xe4, 0x02, 0x71, 0x44, - 0xf8, 0xfa, 0xe2, 0x5c, 0x0b, 0xe7, 0x7c, 0x12, 0x98, 0x31, 0x5e, 0xa6, 0xc7, 0xe2, 0x68, 0xb4, - 0x05, 0x5a, 0x67, 0x10, 0x06, 0x0e, 0x1f, 0x7d, 0x47, 0x9e, 0x90, 0xaf, 0xd7, 0x9c, 0x55, 0xe4, - 0x72, 0x3e, 0xe2, 0x5f, 0xc4, 0x27, 0xab, 0xc3, 0x86, 0x40, 0x8e, 0x97, 0xcd, 0xb8, 0x40, 0x21, - 0xe6, 0x6c, 0xbd, 0x28, 0x68, 0xeb, 0x1c, 0x94, 0xdc, 0xe5, 0x49, 0x25, 0x62, 0x04, 0xba, 0x0c, - 0xc5, 0x89, 0x33, 0x7e, 0x24, 0x7d, 0x45, 0x70, 0x96, 0x13, 0x57, 0x7c, 0xbd, 0x5d, 0xfd, 0x46, - 0x01, 0x98, 0xfa, 0x08, 0xbb, 0x00, 0xe7, 0xf7, 0x9b, 0xb6, 0xe1, 0x34, 0x5b, 0xb6, 0xd9, 0xdc, - 0x73, 0x1e, 0xee, 0xb5, 0x5b, 0xc6, 0xae, 0x79, 0xd7, 0x34, 0x1a, 0xda, 0x02, 0x3a, 0x0b, 0x2b, - 0xd3, 0xca, 0xc7, 0x46, 0x5b, 0x53, 0xd0, 0x79, 0x38, 0x3b, 0x2d, 0xac, 0xef, 0xb4, 0xed, 0xba, - 0xb9, 0xa7, 0xa5, 0x10, 0x82, 0xe2, 0xb4, 0x62, 0xaf, 0xa9, 0xa5, 0xd1, 0x45, 0xd0, 0x8f, 0xca, - 0x9c, 0x47, 0xa6, 0x7d, 0xcf, 0xd9, 0x37, 0xec, 0xa6, 0xa6, 0x5e, 0xfd, 0x45, 0x81, 0xe2, 0xd1, - 0x0f, 0x13, 0x54, 0x86, 0x0b, 0x2d, 0xab, 0xd9, 0x6a, 0xb6, 0xeb, 0x0f, 0x9c, 0xb6, 0x5d, 0xb7, - 0x1f, 0xb6, 0x67, 0x62, 0xaa, 0x40, 0x69, 0x16, 0xd0, 0x30, 0x5a, 0xcd, 0xb6, 0x69, 0x3b, 0x2d, - 0xc3, 0x32, 0x9b, 0x0d, 0x4d, 0x41, 0x97, 0x60, 0x63, 0x16, 0xb3, 0xdf, 0xb4, 0xcd, 0xbd, 0xcf, - 0x12, 0x48, 0x0a, 0xad, 0xc3, 0xb9, 0x59, 0x48, 0xab, 0xde, 0x6e, 0x1b, 0x8d, 0x38, 0xe8, 0x59, - 0x9d, 0x65, 0xdc, 0x37, 0x76, 0x6d, 0xa3, 0xa1, 0xa9, 0xf3, 0x98, 0x77, 0xeb, 0xe6, 0x03, 0xa3, - 0xa1, 0x65, 0x76, 0x8c, 0x97, 0x6f, 0x4b, 0xca, 0xab, 0xb7, 0x25, 0xe5, 0xaf, 0xb7, 0x25, 0xe5, - 0xf9, 0xbb, 0xd2, 0xc2, 0xab, 0x77, 0xa5, 0x85, 0xdf, 0xdf, 0x95, 0x16, 0xbe, 0xbc, 0xd6, 0x25, - 0xec, 0x70, 0xd0, 0xa9, 0x1e, 0x50, 0x5f, 0x7e, 0x2e, 0xcb, 0x9f, 0x1b, 0x91, 0xf7, 0x55, 0xed, - 0x99, 0xf8, 0x17, 0x80, 0x8d, 0xfa, 0x38, 0xe2, 0xdf, 0xf7, 0x59, 0x31, 0x35, 0xb7, 0xfe, 0x09, - 0x00, 0x00, 0xff, 0xff, 0xbc, 0x24, 0x6f, 0xb5, 0x20, 0x0c, 0x00, 0x00, -} - -func (m *WeightedVoteOption) 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 *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Weight) > 0 { - i -= len(m.Weight) - copy(dAtA[i:], m.Weight) - i = encodeVarintGov(dAtA, i, uint64(len(m.Weight))) - i-- - dAtA[i] = 0x12 - } - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Deposit) 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 = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintGov(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x6a - } - if len(m.Summary) > 0 { - i -= len(m.Summary) - copy(dAtA[i:], m.Summary) - i = encodeVarintGov(dAtA, i, uint64(len(m.Summary))) - i-- - dAtA[i] = 0x62 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0x5a - } - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintGov(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x52 - } - if m.VotingEndTime != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.VotingEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingEndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGov(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x4a - } - if m.VotingStartTime != nil { - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.VotingStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingStartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintGov(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x42 - } - if len(m.TotalDeposit) > 0 { - for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.DepositEndTime != nil { - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.DepositEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DepositEndTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintGov(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x32 - } - if m.SubmitTime != nil { - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.SubmitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SubmitTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintGov(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - } - if m.FinalTallyResult != nil { - { - size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Status != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x18 - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Id != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TallyResult) 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 *TallyResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.NoWithVetoCount) > 0 { - i -= len(m.NoWithVetoCount) - copy(dAtA[i:], m.NoWithVetoCount) - i = encodeVarintGov(dAtA, i, uint64(len(m.NoWithVetoCount))) - i-- - dAtA[i] = 0x22 - } - if len(m.NoCount) > 0 { - i -= len(m.NoCount) - copy(dAtA[i:], m.NoCount) - i = encodeVarintGov(dAtA, i, uint64(len(m.NoCount))) - i-- - dAtA[i] = 0x1a - } - if len(m.AbstainCount) > 0 { - i -= len(m.AbstainCount) - copy(dAtA[i:], m.AbstainCount) - i = encodeVarintGov(dAtA, i, uint64(len(m.AbstainCount))) - i-- - dAtA[i] = 0x12 - } - if len(m.YesCount) > 0 { - i -= len(m.YesCount) - copy(dAtA[i:], m.YesCount) - i = encodeVarintGov(dAtA, i, uint64(len(m.YesCount))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintGov(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x2a - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DepositParams) 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 *DepositParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxDepositPeriod != nil { - n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintGov(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x12 - } - if len(m.MinDeposit) > 0 { - for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VotingParams) 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 *VotingParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VotingPeriod != nil { - n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintGov(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TallyParams) 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 *TallyParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.VetoThreshold) > 0 { - i -= len(m.VetoThreshold) - copy(dAtA[i:], m.VetoThreshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) - i-- - dAtA[i] = 0x1a - } - if len(m.Threshold) > 0 { - i -= len(m.Threshold) - copy(dAtA[i:], m.Threshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) - i-- - dAtA[i] = 0x12 - } - if len(m.Quorum) > 0 { - i -= len(m.Quorum) - copy(dAtA[i:], m.Quorum) - i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) - 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.BurnVoteVeto { - i-- - if m.BurnVoteVeto { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x78 - } - if m.BurnProposalDepositPrevote { - i-- - if m.BurnProposalDepositPrevote { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 - } - if m.BurnVoteQuorum { - i-- - if m.BurnVoteQuorum { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x68 - } - if len(m.MinInitialDepositRatio) > 0 { - i -= len(m.MinInitialDepositRatio) - copy(dAtA[i:], m.MinInitialDepositRatio) - i = encodeVarintGov(dAtA, i, uint64(len(m.MinInitialDepositRatio))) - i-- - dAtA[i] = 0x3a - } - if len(m.VetoThreshold) > 0 { - i -= len(m.VetoThreshold) - copy(dAtA[i:], m.VetoThreshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.VetoThreshold))) - i-- - dAtA[i] = 0x32 - } - if len(m.Threshold) > 0 { - i -= len(m.Threshold) - copy(dAtA[i:], m.Threshold) - i = encodeVarintGov(dAtA, i, uint64(len(m.Threshold))) - i-- - dAtA[i] = 0x2a - } - if len(m.Quorum) > 0 { - i -= len(m.Quorum) - copy(dAtA[i:], m.Quorum) - i = encodeVarintGov(dAtA, i, uint64(len(m.Quorum))) - i-- - dAtA[i] = 0x22 - } - if m.VotingPeriod != nil { - n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintGov(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x1a - } - if m.MaxDepositPeriod != nil { - n9, err9 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintGov(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x12 - } - if len(m.MinDeposit) > 0 { - for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WeightedVoteOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - l = len(m.Weight) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Deposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovGov(uint64(m.Id)) - } - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.Status != 0 { - n += 1 + sovGov(uint64(m.Status)) - } - if m.FinalTallyResult != nil { - l = m.FinalTallyResult.Size() - n += 1 + l + sovGov(uint64(l)) - } - if m.SubmitTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.SubmitTime) - n += 1 + l + sovGov(uint64(l)) - } - if m.DepositEndTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.DepositEndTime) - n += 1 + l + sovGov(uint64(l)) - } - if len(m.TotalDeposit) > 0 { - for _, e := range m.TotalDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.VotingStartTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingStartTime) - n += 1 + l + sovGov(uint64(l)) - } - if m.VotingEndTime != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.VotingEndTime) - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Summary) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *TallyResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.YesCount) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.AbstainCount) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.NoCount) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.NoWithVetoCount) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *DepositParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MinDeposit) > 0 { - for _, e := range m.MinDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.MaxDepositPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod) - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *VotingParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VotingPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod) - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *TallyParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Quorum) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Threshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.VetoThreshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MinDeposit) > 0 { - for _, e := range m.MinDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - if m.MaxDepositPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.MaxDepositPeriod) - n += 1 + l + sovGov(uint64(l)) - } - if m.VotingPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.VotingPeriod) - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Quorum) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Threshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.VetoThreshold) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.MinInitialDepositRatio) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if m.BurnVoteQuorum { - n += 2 - } - if m.BurnProposalDepositPrevote { - n += 2 - } - if m.BurnVoteVeto { - n += 2 - } - return n -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WeightedVoteOption) 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 ErrIntOverflowGov - } - 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: WeightedVoteOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Weight = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Deposit) 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 ErrIntOverflowGov - } - 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: Deposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = 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 ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - 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 := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Proposal) 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 ErrIntOverflowGov - } - 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: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Messages = append(m.Messages, &types1.Any{}) - if err := m.Messages[len(m.Messages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.FinalTallyResult == nil { - m.FinalTallyResult = &TallyResult{} - } - if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SubmitTime == nil { - m.SubmitTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.DepositEndTime == nil { - m.DepositEndTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TotalDeposit = append(m.TotalDeposit, types.Coin{}) - if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingStartTime == nil { - m.VotingStartTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingEndTime == nil { - m.VotingEndTime = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - 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 ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Summary = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TallyResult) 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 ErrIntOverflowGov - } - 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: TallyResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field YesCount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.YesCount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AbstainCount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AbstainCount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoCount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NoCount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoWithVetoCount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NoWithVetoCount = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Vote) 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 ErrIntOverflowGov - } - 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: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, &WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DepositParams) 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 ErrIntOverflowGov - } - 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: DepositParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MinDeposit = append(m.MinDeposit, types.Coin{}) - if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MaxDepositPeriod == nil { - m.MaxDepositPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VotingParams) 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 ErrIntOverflowGov - } - 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: VotingParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingPeriod == nil { - m.VotingPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TallyParams) 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 ErrIntOverflowGov - } - 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: TallyParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Quorum = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Threshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VetoThreshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - 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 ErrIntOverflowGov - } - 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 MinDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MinDeposit = append(m.MinDeposit, types.Coin{}) - if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MaxDepositPeriod == nil { - m.MaxDepositPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VotingPeriod == nil { - m.VotingPeriod = new(time.Duration) - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Quorum = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Threshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VetoThreshold = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinInitialDepositRatio", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MinInitialDepositRatio = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteQuorum", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BurnVoteQuorum = bool(v != 0) - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnProposalDepositPrevote", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BurnProposalDepositPrevote = bool(v != 0) - case 15: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BurnVoteVeto", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.BurnVoteVeto = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGov(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, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go deleted file mode 100644 index 12e9a222efd5..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.go +++ /dev/null @@ -1,4036 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/query.proto - -package v1 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -type QueryProposalRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } -func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProposalRequest) ProtoMessage() {} -func (*QueryProposalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{0} -} -func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalRequest.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 *QueryProposalRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalRequest.Merge(m, src) -} -func (m *QueryProposalRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo - -func (m *QueryProposalRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -type QueryProposalResponse struct { - // proposal is the requested governance proposal. - Proposal *Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` -} - -func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } -func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProposalResponse) ProtoMessage() {} -func (*QueryProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{1} -} -func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalResponse.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 *QueryProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalResponse.Merge(m, src) -} -func (m *QueryProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo - -func (m *QueryProposalResponse) GetProposal() *Proposal { - if m != nil { - return m.Proposal - } - return nil -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -type QueryProposalsRequest struct { - // proposal_status defines the status of the proposals. - ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1.ProposalStatus" json:"proposal_status,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } -func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProposalsRequest) ProtoMessage() {} -func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{2} -} -func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalsRequest.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 *QueryProposalsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalsRequest.Merge(m, src) -} -func (m *QueryProposalsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo - -func (m *QueryProposalsRequest) GetProposalStatus() ProposalStatus { - if m != nil { - return m.ProposalStatus - } - return ProposalStatus_PROPOSAL_STATUS_UNSPECIFIED -} - -func (m *QueryProposalsRequest) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *QueryProposalsRequest) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *QueryProposalsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -type QueryProposalsResponse struct { - // proposals defines all the requested governance proposals. - Proposals []*Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} } -func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProposalsResponse) ProtoMessage() {} -func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{3} -} -func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalsResponse.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 *QueryProposalsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalsResponse.Merge(m, src) -} -func (m *QueryProposalsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo - -func (m *QueryProposalsResponse) GetProposals() []*Proposal { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *QueryProposalsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -type QueryVoteRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` -} - -func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } -func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVoteRequest) ProtoMessage() {} -func (*QueryVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{4} -} -func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVoteRequest.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 *QueryVoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVoteRequest.Merge(m, src) -} -func (m *QueryVoteRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo - -func (m *QueryVoteRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryVoteRequest) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -type QueryVoteResponse struct { - // vote defines the queried vote. - Vote *Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` -} - -func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } -func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVoteResponse) ProtoMessage() {} -func (*QueryVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{5} -} -func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVoteResponse.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 *QueryVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVoteResponse.Merge(m, src) -} -func (m *QueryVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo - -func (m *QueryVoteResponse) GetVote() *Vote { - if m != nil { - return m.Vote - } - return nil -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -type QueryVotesRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } -func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVotesRequest) ProtoMessage() {} -func (*QueryVotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{6} -} -func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVotesRequest.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 *QueryVotesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVotesRequest.Merge(m, src) -} -func (m *QueryVotesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVotesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo - -func (m *QueryVotesRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryVotesRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -type QueryVotesResponse struct { - // votes defines the queried votes. - Votes []*Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } -func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVotesResponse) ProtoMessage() {} -func (*QueryVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{7} -} -func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVotesResponse.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 *QueryVotesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVotesResponse.Merge(m, src) -} -func (m *QueryVotesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVotesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo - -func (m *QueryVotesResponse) GetVotes() []*Vote { - if m != nil { - return m.Votes - } - return nil -} - -func (m *QueryVotesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` -} - -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_46a436d1109b50d0, []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 - -func (m *QueryParamsRequest) GetParamsType() string { - if m != nil { - return m.ParamsType - } - return "" -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // Deprecated: Prefer to use `params` instead. - // voting_params defines the parameters related to voting. - VotingParams *VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params,omitempty"` // Deprecated: Do not use. - // Deprecated: Prefer to use `params` instead. - // deposit_params defines the parameters related to deposit. - DepositParams *DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params,omitempty"` // Deprecated: Do not use. - // Deprecated: Prefer to use `params` instead. - // tally_params defines the parameters related to tally. - TallyParams *TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params,omitempty"` // Deprecated: Do not use. - // params defines all the paramaters of x/gov module. - // - // Since: cosmos-sdk 0.47 - Params *Params `protobuf:"bytes,4,opt,name=params,proto3" json:"params,omitempty"` -} - -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_46a436d1109b50d0, []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 - -// Deprecated: Do not use. -func (m *QueryParamsResponse) GetVotingParams() *VotingParams { - if m != nil { - return m.VotingParams - } - return nil -} - -// Deprecated: Do not use. -func (m *QueryParamsResponse) GetDepositParams() *DepositParams { - if m != nil { - return m.DepositParams - } - return nil -} - -// Deprecated: Do not use. -func (m *QueryParamsResponse) GetTallyParams() *TallyParams { - if m != nil { - return m.TallyParams - } - return nil -} - -func (m *QueryParamsResponse) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -type QueryDepositRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` -} - -func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } -func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDepositRequest) ProtoMessage() {} -func (*QueryDepositRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{10} -} -func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositRequest.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 *QueryDepositRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositRequest.Merge(m, src) -} -func (m *QueryDepositRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo - -func (m *QueryDepositRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryDepositRequest) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -type QueryDepositResponse struct { - // deposit defines the requested deposit. - Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` -} - -func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } -func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDepositResponse) ProtoMessage() {} -func (*QueryDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{11} -} -func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositResponse.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 *QueryDepositResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositResponse.Merge(m, src) -} -func (m *QueryDepositResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo - -func (m *QueryDepositResponse) GetDeposit() *Deposit { - if m != nil { - return m.Deposit - } - return nil -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -type QueryDepositsRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } -func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDepositsRequest) ProtoMessage() {} -func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{12} -} -func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositsRequest.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 *QueryDepositsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositsRequest.Merge(m, src) -} -func (m *QueryDepositsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositsRequest proto.InternalMessageInfo - -func (m *QueryDepositsRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -type QueryDepositsResponse struct { - // deposits defines the requested deposits. - Deposits []*Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } -func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDepositsResponse) ProtoMessage() {} -func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{13} -} -func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositsResponse.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 *QueryDepositsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositsResponse.Merge(m, src) -} -func (m *QueryDepositsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo - -func (m *QueryDepositsResponse) GetDeposits() []*Deposit { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *QueryDepositsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -type QueryTallyResultRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest{} } -func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTallyResultRequest) ProtoMessage() {} -func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{14} -} -func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTallyResultRequest.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 *QueryTallyResultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTallyResultRequest.Merge(m, src) -} -func (m *QueryTallyResultRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTallyResultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTallyResultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTallyResultRequest proto.InternalMessageInfo - -func (m *QueryTallyResultRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -type QueryTallyResultResponse struct { - // tally defines the requested tally. - Tally *TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally,omitempty"` -} - -func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } -func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTallyResultResponse) ProtoMessage() {} -func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_46a436d1109b50d0, []int{15} -} -func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTallyResultResponse.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 *QueryTallyResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) -} -func (m *QueryTallyResultResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo - -func (m *QueryTallyResultResponse) GetTally() *TallyResult { - if m != nil { - return m.Tally - } - return nil -} - -func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } - -var fileDescriptor_46a436d1109b50d0 = []byte{ - // 964 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xdc, 0x54, - 0x14, 0x8e, 0x27, 0x8f, 0xce, 0x9c, 0x34, 0x01, 0x4e, 0x1f, 0x19, 0x4c, 0x99, 0x06, 0x87, 0x26, - 0x81, 0x12, 0x5f, 0x26, 0x7d, 0x49, 0x50, 0x16, 0x0d, 0x25, 0x05, 0x89, 0x45, 0x98, 0x56, 0x2c, - 0xd8, 0x44, 0x4e, 0xc6, 0x32, 0x16, 0x13, 0x5f, 0x77, 0xee, 0x9d, 0x11, 0x21, 0x8d, 0x90, 0x2a, - 0x21, 0x58, 0x01, 0x12, 0x15, 0xf0, 0x43, 0xf8, 0x11, 0x2c, 0x2b, 0xd8, 0x20, 0x56, 0x28, 0xe1, - 0x87, 0x20, 0xdf, 0x7b, 0xec, 0xb1, 0x1d, 0x8f, 0x33, 0x53, 0x55, 0xac, 0x22, 0xdf, 0xfb, 0x9d, - 0xef, 0x7c, 0xe7, 0x79, 0x33, 0xf0, 0xf2, 0x2e, 0x17, 0x7b, 0x5c, 0x30, 0x8f, 0xf7, 0x59, 0xbf, - 0xc9, 0x1e, 0xf6, 0xdc, 0xee, 0xbe, 0x1d, 0x76, 0xb9, 0xe4, 0x38, 0xa7, 0xaf, 0x6c, 0x8f, 0xf7, - 0xed, 0x7e, 0xd3, 0x7c, 0x93, 0x90, 0x3b, 0x8e, 0x70, 0x35, 0x8e, 0xf5, 0x9b, 0x3b, 0xae, 0x74, - 0x9a, 0x2c, 0x74, 0x3c, 0x3f, 0x70, 0xa4, 0xcf, 0x03, 0x6d, 0x6a, 0x5e, 0xf2, 0x38, 0xf7, 0x3a, - 0x2e, 0x73, 0x42, 0x9f, 0x39, 0x41, 0xc0, 0xa5, 0xba, 0x14, 0x74, 0xbb, 0x90, 0xf5, 0x19, 0xf1, - 0xeb, 0x0b, 0x12, 0xb3, 0xad, 0xbe, 0x18, 0xb9, 0x57, 0x1f, 0xd6, 0x2d, 0x38, 0xff, 0x49, 0xe4, - 0x73, 0xab, 0xcb, 0x43, 0x2e, 0x9c, 0x4e, 0xcb, 0x7d, 0xd8, 0x73, 0x85, 0xc4, 0xcb, 0x30, 0x1b, - 0xd2, 0xd1, 0xb6, 0xdf, 0xae, 0x1b, 0x8b, 0xc6, 0xea, 0x54, 0x0b, 0xe2, 0xa3, 0x8f, 0xda, 0xd6, - 0xc7, 0x70, 0x21, 0x67, 0x28, 0x42, 0x1e, 0x08, 0x17, 0xaf, 0x41, 0x35, 0x86, 0x29, 0xb3, 0xd9, - 0xf5, 0x05, 0x3b, 0x13, 0xb1, 0x9d, 0x98, 0x24, 0x40, 0xeb, 0x87, 0x4a, 0x8e, 0x4e, 0xc4, 0x42, - 0x36, 0xe1, 0x85, 0x44, 0x88, 0x90, 0x8e, 0xec, 0x09, 0xc5, 0x3a, 0xbf, 0xfe, 0xea, 0x10, 0xd6, - 0xfb, 0x0a, 0xd4, 0x9a, 0x0f, 0x33, 0xdf, 0x68, 0xc3, 0x74, 0x9f, 0x4b, 0xb7, 0x5b, 0xaf, 0x2c, - 0x1a, 0xab, 0xb5, 0x8d, 0xfa, 0x1f, 0xbf, 0xad, 0x9d, 0x27, 0x82, 0x3b, 0xed, 0x76, 0xd7, 0x15, - 0xe2, 0xbe, 0xec, 0xfa, 0x81, 0xd7, 0xd2, 0x30, 0xbc, 0x09, 0xb5, 0xb6, 0x1b, 0x72, 0xe1, 0x4b, - 0xde, 0xad, 0x4f, 0x9e, 0x62, 0x33, 0x80, 0xe2, 0x26, 0xc0, 0xa0, 0x6c, 0xf5, 0x29, 0x95, 0x80, - 0xe5, 0x58, 0x6a, 0x54, 0x63, 0x5b, 0xf7, 0x02, 0xd5, 0xd8, 0xde, 0x72, 0x3c, 0x97, 0x62, 0x6d, - 0xa5, 0x2c, 0xad, 0x5f, 0x0d, 0xb8, 0x98, 0xcf, 0x08, 0x65, 0xf8, 0x06, 0xd4, 0xe2, 0xe0, 0xa2, - 0x64, 0x4c, 0x96, 0xa5, 0x78, 0x80, 0xc4, 0x7b, 0x19, 0x65, 0x15, 0xa5, 0x6c, 0xe5, 0x54, 0x65, - 0xda, 0x67, 0x46, 0xda, 0x2e, 0xbc, 0xa8, 0x94, 0x7d, 0xca, 0xa5, 0x3b, 0x6a, 0xbf, 0x8c, 0x9b, - 0x7f, 0xeb, 0x36, 0xbc, 0x94, 0x72, 0x42, 0x91, 0xaf, 0xc0, 0x54, 0x74, 0x4b, 0x7d, 0x75, 0x2e, - 0x17, 0xb4, 0x82, 0x2a, 0x80, 0xf5, 0x28, 0x65, 0x2d, 0x46, 0xd6, 0xb8, 0x59, 0x90, 0xa1, 0x67, - 0xa9, 0xdd, 0x77, 0x06, 0x60, 0xda, 0x3d, 0xa9, 0x7f, 0x43, 0xa7, 0x20, 0xae, 0x59, 0xa1, 0x7c, - 0x8d, 0x78, 0x7e, 0xb5, 0xba, 0x41, 0x4a, 0xb6, 0x9c, 0xae, 0xb3, 0x97, 0xc9, 0x84, 0x3a, 0xd8, - 0x96, 0xfb, 0xa1, 0x4e, 0x67, 0x2d, 0x32, 0x8b, 0x8e, 0x1e, 0xec, 0x87, 0xae, 0xf5, 0x73, 0x05, - 0xce, 0x65, 0xec, 0x28, 0x84, 0xbb, 0x30, 0xd7, 0xe7, 0xd2, 0x0f, 0xbc, 0x6d, 0x0d, 0xa6, 0x4a, - 0xbc, 0x72, 0x32, 0x14, 0x3f, 0xf0, 0xb4, 0xed, 0x46, 0xa5, 0x6e, 0xb4, 0xce, 0xf6, 0x53, 0x27, - 0x78, 0x0f, 0xe6, 0x69, 0x60, 0x62, 0x1a, 0x1d, 0xe1, 0xa5, 0x1c, 0xcd, 0x5d, 0x0d, 0x4a, 0xf1, - 0xcc, 0xb5, 0xd3, 0x47, 0x78, 0x07, 0xce, 0x4a, 0xa7, 0xd3, 0xd9, 0x8f, 0x69, 0x26, 0x15, 0x8d, - 0x99, 0xa3, 0x79, 0x10, 0x41, 0x52, 0x24, 0xb3, 0x72, 0x70, 0x80, 0x6b, 0x30, 0x43, 0xc6, 0x7a, - 0x56, 0x2f, 0xe4, 0x27, 0x49, 0x27, 0x80, 0x40, 0x56, 0x40, 0x79, 0x21, 0x69, 0x23, 0xb7, 0x56, - 0x66, 0x9d, 0x54, 0x46, 0x5e, 0x27, 0xd6, 0x87, 0xb4, 0x9f, 0x13, 0x7f, 0x54, 0x88, 0xb7, 0xe1, - 0x0c, 0x81, 0xa8, 0x04, 0x17, 0x8b, 0x73, 0xd7, 0x8a, 0x61, 0xd6, 0xd7, 0x59, 0xa6, 0xff, 0x7f, - 0x2a, 0x9e, 0x18, 0xb4, 0xe3, 0x07, 0x0a, 0x28, 0x98, 0x75, 0xa8, 0x92, 0xca, 0x78, 0x36, 0x86, - 0x45, 0x93, 0xe0, 0x9e, 0xdf, 0x84, 0xbc, 0x03, 0x0b, 0x4a, 0x95, 0xea, 0x92, 0x96, 0x2b, 0x7a, - 0x1d, 0x39, 0xc6, 0x23, 0x58, 0x3f, 0x69, 0x9b, 0x54, 0x68, 0x5a, 0xf5, 0x19, 0xd5, 0xa7, 0xb0, - 0x29, 0xc9, 0x44, 0x03, 0xd7, 0xff, 0xae, 0xc2, 0xb4, 0xa2, 0xc3, 0x6f, 0x0c, 0xa8, 0xc6, 0x2b, - 0x1c, 0x97, 0x72, 0x96, 0x45, 0xef, 0xb5, 0xf9, 0x7a, 0x39, 0x48, 0x6b, 0xb2, 0xec, 0xc7, 0x7f, - 0xfe, 0xfb, 0x53, 0x65, 0x15, 0x97, 0x59, 0xf6, 0x5f, 0x85, 0xe4, 0x91, 0x60, 0x07, 0xa9, 0x80, - 0x0f, 0xf1, 0x2b, 0xa8, 0x25, 0xcf, 0x0f, 0x96, 0xba, 0x88, 0xdb, 0xc9, 0xbc, 0x72, 0x0a, 0x8a, - 0x94, 0x2c, 0x2a, 0x25, 0x26, 0xd6, 0x87, 0x29, 0xc1, 0x6f, 0x0d, 0x98, 0x8a, 0x56, 0x22, 0x5e, - 0x2e, 0x62, 0x4c, 0xbd, 0x3d, 0xe6, 0xe2, 0x70, 0x00, 0x79, 0xbb, 0xad, 0xbc, 0xdd, 0xc4, 0xeb, - 0xa3, 0xc5, 0xcd, 0xd4, 0x12, 0x66, 0x07, 0xea, 0x25, 0x3a, 0xc4, 0xc7, 0x06, 0x4c, 0xab, 0x4d, - 0x8e, 0x43, 0x3d, 0x25, 0xe1, 0xbf, 0x56, 0x82, 0x20, 0x31, 0xd7, 0x95, 0x18, 0x1b, 0xdf, 0x1a, - 0x47, 0x0c, 0x3e, 0x82, 0x19, 0xda, 0x58, 0x85, 0x2e, 0x32, 0xfb, 0xdd, 0xb4, 0xca, 0x20, 0x24, - 0xe3, 0xaa, 0x92, 0x71, 0x05, 0x97, 0xf2, 0x32, 0x14, 0x8c, 0x1d, 0xa4, 0x1e, 0x88, 0x43, 0xfc, - 0xc5, 0x80, 0x33, 0x34, 0x83, 0x58, 0x48, 0x9e, 0xdd, 0x87, 0xe6, 0x52, 0x29, 0x86, 0x14, 0xbc, - 0xaf, 0x14, 0xbc, 0x87, 0xef, 0x8e, 0x98, 0x88, 0x78, 0xf6, 0xd9, 0x41, 0xb2, 0x1f, 0x0f, 0xf1, - 0x7b, 0x03, 0xaa, 0xf1, 0x42, 0xc1, 0x32, 0xb7, 0xa2, 0x74, 0x54, 0xf2, 0x3b, 0xc9, 0xba, 0xa5, - 0xc4, 0x35, 0x91, 0x8d, 0x29, 0x0e, 0x9f, 0x18, 0x30, 0x9b, 0x1a, 0x6e, 0x5c, 0x2e, 0x72, 0x77, - 0x72, 0xd9, 0x98, 0x2b, 0xa7, 0xe2, 0x9e, 0xb1, 0x7f, 0xd4, 0x72, 0xd9, 0xf8, 0xe0, 0xf7, 0xa3, - 0x86, 0xf1, 0xf4, 0xa8, 0x61, 0xfc, 0x73, 0xd4, 0x30, 0x7e, 0x3c, 0x6e, 0x4c, 0x3c, 0x3d, 0x6e, - 0x4c, 0xfc, 0x75, 0xdc, 0x98, 0xf8, 0xec, 0xaa, 0xe7, 0xcb, 0xcf, 0x7b, 0x3b, 0xf6, 0x2e, 0xdf, - 0x8b, 0x19, 0xf5, 0x9f, 0x35, 0xd1, 0xfe, 0x82, 0x7d, 0xa9, 0xe8, 0xa3, 0x2e, 0x10, 0xd1, 0xef, - 0x92, 0x19, 0xf5, 0xb3, 0xe1, 0xda, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xe4, 0xf6, 0xe9, - 0xe0, 0x0c, 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 { - // Proposal queries proposal details based on ProposalID. - Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { - out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { - out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Proposals", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { - out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { - out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Votes", 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, "/cosmos.gov.v1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { - out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { - out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/Deposits", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { - out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/TallyResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Proposal queries proposal details based on ProposalID. - Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") -} -func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") -} -func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") -} -func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") -} -func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") -} -func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Proposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposals(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Proposals", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVotesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Votes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Votes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) - } - 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: "/cosmos.gov.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_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/Deposits", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTallyResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TallyResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Query/TallyResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Proposal", - Handler: _Query_Proposal_Handler, - }, - { - MethodName: "Proposals", - Handler: _Query_Proposals_Handler, - }, - { - MethodName: "Vote", - Handler: _Query_Vote_Handler, - }, - { - MethodName: "Votes", - Handler: _Query_Votes_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Deposit", - Handler: _Query_Deposit_Handler, - }, - { - MethodName: "Deposits", - Handler: _Query_Deposits_Handler, - }, - { - MethodName: "TallyResult", - Handler: _Query_TallyResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1/query.proto", -} - -func (m *QueryProposalRequest) 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 *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryProposalResponse) 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 *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proposal != nil { - { - size, err := m.Proposal.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 *QueryProposalsRequest) 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 *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalsRequest) 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] = 0x22 - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x1a - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalStatus != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryProposalsResponse) 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 *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalsResponse) 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.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[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 *QueryVoteRequest) 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 *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryVoteResponse) 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 *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Vote != nil { - { - size, err := m.Vote.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 *QueryVotesRequest) 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 *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVotesRequest) 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 m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryVotesResponse) 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 *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVotesResponse) 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.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[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 *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 - if len(m.ParamsType) > 0 { - i -= len(m.ParamsType) - copy(dAtA[i:], m.ParamsType) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) - i-- - dAtA[i] = 0xa - } - 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 - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.TallyParams != nil { - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.DepositParams != nil { - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.VotingParams != nil { - { - size, err := m.VotingParams.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 *QueryDepositRequest) 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 *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDepositResponse) 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 *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Deposit != nil { - { - size, err := m.Deposit.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 *QueryDepositsRequest) 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 *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositsRequest) 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 m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDepositsResponse) 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 *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositsResponse) 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.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[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 *QueryTallyResultRequest) 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 *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryTallyResultResponse) 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 *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Tally != nil { - { - size, err := m.Tally.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 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 *QueryProposalRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - return n -} - -func (m *QueryProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProposalsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalStatus != 0 { - n += 1 + sovQuery(uint64(m.ProposalStatus)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProposalsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - 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 *QueryVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVotesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVotesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Votes) > 0 { - for _, e := range m.Votes { - 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 *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ParamsType) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VotingParams != nil { - l = m.VotingParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.DepositParams != nil { - l = m.DepositParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.TallyParams != nil { - l = m.TallyParams.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Deposit != nil { - l = m.Deposit.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - 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 *QueryTallyResultRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - return n -} - -func (m *QueryTallyResultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Tally != nil { - l = m.Tally.Size() - n += 1 + l + sovQuery(uint64(l)) - } - 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 *QueryProposalRequest) 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: QueryProposalRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalResponse) 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: QueryProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", 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.Proposal == nil { - m.Proposal = &Proposal{} - } - if err := m.Proposal.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalsRequest) 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: QueryProposalsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) - } - m.ProposalStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalStatus |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalsResponse) 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: QueryProposalsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", 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.Proposals = append(m.Proposals, &Proposal{}) - if err := m.Proposals[len(m.Proposals)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVoteRequest) 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: QueryVoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVoteResponse) 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: QueryVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", 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.Vote == nil { - m.Vote = &Vote{} - } - if err := m.Vote.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVotesRequest) 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: QueryVotesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVotesResponse) 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: QueryVotesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", 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.Votes = append(m.Votes, &Vote{}) - if err := m.Votes[len(m.Votes)-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) || (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 { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", 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.ParamsType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 VotingParams", 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.VotingParams == nil { - m.VotingParams = &VotingParams{} - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", 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.DepositParams == nil { - m.DepositParams = &DepositParams{} - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", 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.TallyParams == nil { - m.TallyParams = &TallyParams{} - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - 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 m.Params == nil { - m.Params = &Params{} - } - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositRequest) 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: QueryDepositRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositResponse) 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: QueryDepositResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposit", 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.Deposit == nil { - m.Deposit = &Deposit{} - } - if err := m.Deposit.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositsRequest) 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: QueryDepositsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositsResponse) 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: QueryDepositsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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.Deposits = append(m.Deposits, &Deposit{}) - if err := m.Deposits[len(m.Deposits)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTallyResultRequest) 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: QueryTallyResultRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTallyResultResponse) 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: QueryTallyResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tally", 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.Tally == nil { - m.Tally = &TallyResult{} - } - if err := m.Tally.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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go deleted file mode 100644 index 18bdf04d96c7..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/query.pb.gw.go +++ /dev/null @@ -1,958 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/gov/v1/query.proto - -/* -Package v1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package v1 - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.Proposal(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Proposals(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := server.Vote(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Votes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := server.Deposit(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Deposits(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.TallyResult(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Proposal_0 = runtime.ForwardResponseMessage - - forward_Query_Proposals_0 = runtime.ForwardResponseMessage - - forward_Query_Vote_0 = runtime.ForwardResponseMessage - - forward_Query_Votes_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Deposit_0 = runtime.ForwardResponseMessage - - forward_Query_Deposits_0 = runtime.ForwardResponseMessage - - forward_Query_TallyResult_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go deleted file mode 100644 index 4a27b2077ef6..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1/tx.pb.go +++ /dev/null @@ -1,3054 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1/tx.proto - -package v1 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "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 - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -type MsgSubmitProposal struct { - // messages are the arbitrary messages to be executed if proposal passes. - Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` - // initial_deposit is the deposit value that must be paid at proposal submission. - InitialDeposit []types1.Coin `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit"` - // proposer is the account address of the proposer. - Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` - // metadata is any arbitrary metadata attached to the proposal. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` - // title is the title of the proposal. - // - // Since: cosmos-sdk 0.47 - Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` - // summary is the summary of the proposal - // - // Since: cosmos-sdk 0.47 - Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` -} - -func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } -func (m *MsgSubmitProposal) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProposal) ProtoMessage() {} -func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{0} -} -func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposal.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 *MsgSubmitProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposal.Merge(m, src) -} -func (m *MsgSubmitProposal) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposal) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo - -func (m *MsgSubmitProposal) GetMessages() []*types.Any { - if m != nil { - return m.Messages - } - return nil -} - -func (m *MsgSubmitProposal) GetInitialDeposit() []types1.Coin { - if m != nil { - return m.InitialDeposit - } - return nil -} - -func (m *MsgSubmitProposal) GetProposer() string { - if m != nil { - return m.Proposer - } - return "" -} - -func (m *MsgSubmitProposal) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -func (m *MsgSubmitProposal) GetTitle() string { - if m != nil { - return m.Title - } - return "" -} - -func (m *MsgSubmitProposal) GetSummary() string { - if m != nil { - return m.Summary - } - return "" -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -type MsgSubmitProposalResponse struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } -func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProposalResponse) ProtoMessage() {} -func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{1} -} -func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) -} -func (m *MsgSubmitProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo - -func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// MsgExecLegacyContent is used to wrap the legacy content field into a message. -// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. -type MsgExecLegacyContent struct { - // content is the proposal's content. - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - // authority must be the gov module address. - Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (m *MsgExecLegacyContent) Reset() { *m = MsgExecLegacyContent{} } -func (m *MsgExecLegacyContent) String() string { return proto.CompactTextString(m) } -func (*MsgExecLegacyContent) ProtoMessage() {} -func (*MsgExecLegacyContent) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{2} -} -func (m *MsgExecLegacyContent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecLegacyContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecLegacyContent.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 *MsgExecLegacyContent) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecLegacyContent.Merge(m, src) -} -func (m *MsgExecLegacyContent) XXX_Size() int { - return m.Size() -} -func (m *MsgExecLegacyContent) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecLegacyContent.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecLegacyContent proto.InternalMessageInfo - -func (m *MsgExecLegacyContent) GetContent() *types.Any { - if m != nil { - return m.Content - } - return nil -} - -func (m *MsgExecLegacyContent) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. -type MsgExecLegacyContentResponse struct { -} - -func (m *MsgExecLegacyContentResponse) Reset() { *m = MsgExecLegacyContentResponse{} } -func (m *MsgExecLegacyContentResponse) String() string { return proto.CompactTextString(m) } -func (*MsgExecLegacyContentResponse) ProtoMessage() {} -func (*MsgExecLegacyContentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{3} -} -func (m *MsgExecLegacyContentResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgExecLegacyContentResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgExecLegacyContentResponse.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 *MsgExecLegacyContentResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgExecLegacyContentResponse.Merge(m, src) -} -func (m *MsgExecLegacyContentResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgExecLegacyContentResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgExecLegacyContentResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgExecLegacyContentResponse proto.InternalMessageInfo - -// MsgVote defines a message to cast a vote. -type MsgVote struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // option defines the vote option. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1.VoteOption" json:"option,omitempty"` - // metadata is any arbitrary metadata attached to the Vote. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *MsgVote) Reset() { *m = MsgVote{} } -func (m *MsgVote) String() string { return proto.CompactTextString(m) } -func (*MsgVote) ProtoMessage() {} -func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{4} -} -func (m *MsgVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVote.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 *MsgVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVote.Merge(m, src) -} -func (m *MsgVote) XXX_Size() int { - return m.Size() -} -func (m *MsgVote) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVote.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVote proto.InternalMessageInfo - -func (m *MsgVote) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgVote) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *MsgVote) GetOption() VoteOption { - if m != nil { - return m.Option - } - return VoteOption_VOTE_OPTION_UNSPECIFIED -} - -func (m *MsgVote) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -// MsgVoteResponse defines the Msg/Vote response type. -type MsgVoteResponse struct { -} - -func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } -func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteResponse) ProtoMessage() {} -func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{5} -} -func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteResponse.Merge(m, src) -} -func (m *MsgVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo - -// MsgVoteWeighted defines a message to cast a vote. -type MsgVoteWeighted struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // options defines the weighted vote options. - Options []*WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` - // metadata is any arbitrary metadata attached to the VoteWeighted. - Metadata string `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } -func (m *MsgVoteWeighted) String() string { return proto.CompactTextString(m) } -func (*MsgVoteWeighted) ProtoMessage() {} -func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{6} -} -func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeighted.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 *MsgVoteWeighted) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeighted.Merge(m, src) -} -func (m *MsgVoteWeighted) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeighted) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeighted.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo - -func (m *MsgVoteWeighted) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgVoteWeighted) GetVoter() string { - if m != nil { - return m.Voter - } - return "" -} - -func (m *MsgVoteWeighted) GetOptions() []*WeightedVoteOption { - if m != nil { - return m.Options - } - return nil -} - -func (m *MsgVoteWeighted) GetMetadata() string { - if m != nil { - return m.Metadata - } - return "" -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -type MsgVoteWeightedResponse struct { -} - -func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse{} } -func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteWeightedResponse) ProtoMessage() {} -func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{7} -} -func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeightedResponse.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 *MsgVoteWeightedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeightedResponse.Merge(m, src) -} -func (m *MsgVoteWeightedResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeightedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -type MsgDeposit struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - // amount to be deposited by depositor. - Amount []types1.Coin `protobuf:"bytes,3,rep,name=amount,proto3" json:"amount"` -} - -func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } -func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } -func (*MsgDeposit) ProtoMessage() {} -func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{8} -} -func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDeposit.Merge(m, src) -} -func (m *MsgDeposit) XXX_Size() int { - return m.Size() -} -func (m *MsgDeposit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDeposit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo - -func (m *MsgDeposit) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *MsgDeposit) GetDepositor() string { - if m != nil { - return m.Depositor - } - return "" -} - -func (m *MsgDeposit) GetAmount() []types1.Coin { - if m != nil { - return m.Amount - } - return nil -} - -// MsgDepositResponse defines the Msg/Deposit response type. -type MsgDepositResponse struct { -} - -func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } -func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } -func (*MsgDepositResponse) ProtoMessage() {} -func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9ff8f4a63b6fc9a9, []int{9} -} -func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDepositResponse.Merge(m, src) -} -func (m *MsgDepositResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgDepositResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo - -// MsgUpdateParams is the Msg/UpdateParams request type. -// -// Since: cosmos-sdk 0.47 -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 x/gov 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_9ff8f4a63b6fc9a9, []int{10} -} -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. -// -// Since: cosmos-sdk 0.47 -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_9ff8f4a63b6fc9a9, []int{11} -} -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((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgExecLegacyContent)(nil), "cosmos.gov.v1.MsgExecLegacyContent") - proto.RegisterType((*MsgExecLegacyContentResponse)(nil), "cosmos.gov.v1.MsgExecLegacyContentResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1.MsgDepositResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "cosmos.gov.v1.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.gov.v1.MsgUpdateParamsResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } - -var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 908 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0xe6, 0x87, 0xdd, 0xbc, 0x40, 0xaa, 0x8c, 0xdc, 0x76, 0xbd, 0x2a, 0x9b, 0x74, 0x8b, - 0x50, 0x94, 0x90, 0x5d, 0x1c, 0x68, 0x85, 0x4c, 0x85, 0x54, 0x97, 0x0a, 0x21, 0x61, 0xa8, 0x5c, - 0x51, 0x24, 0x84, 0x14, 0x8d, 0xbd, 0xc3, 0x64, 0x45, 0x76, 0x67, 0xb5, 0x33, 0xb6, 0xe2, 0x1b, - 0xe2, 0xd8, 0x13, 0x7f, 0x06, 0xc7, 0x1c, 0x7a, 0xeb, 0x3f, 0x50, 0x38, 0x55, 0x9c, 0x38, 0x55, - 0x28, 0x11, 0x44, 0xe2, 0x9f, 0x00, 0xcd, 0x8f, 0x5d, 0xff, 0x58, 0xc7, 0xa9, 0x38, 0x70, 0xb1, - 0x76, 0xbe, 0xf7, 0xbd, 0x37, 0xef, 0xfb, 0xf6, 0xcd, 0xac, 0xe1, 0x7a, 0x8f, 0xf1, 0x98, 0xf1, - 0x80, 0xb2, 0x41, 0x30, 0x68, 0x04, 0xe2, 0xd8, 0x4f, 0x33, 0x26, 0x18, 0x7a, 0x53, 0xe3, 0x3e, - 0x65, 0x03, 0x7f, 0xd0, 0x70, 0x5c, 0x43, 0xeb, 0x62, 0x4e, 0x82, 0x41, 0xa3, 0x4b, 0x04, 0x6e, - 0x04, 0x3d, 0x16, 0x25, 0x9a, 0xee, 0xdc, 0x98, 0x2c, 0x23, 0xb3, 0x74, 0xa0, 0x46, 0x19, 0x65, - 0xea, 0x31, 0x90, 0x4f, 0x06, 0xad, 0x6b, 0xfa, 0x81, 0x0e, 0x98, 0xad, 0x4c, 0x88, 0x32, 0x46, - 0x8f, 0x48, 0xa0, 0x56, 0xdd, 0xfe, 0x77, 0x01, 0x4e, 0x86, 0x53, 0x9b, 0xc4, 0x9c, 0xca, 0x4d, - 0x62, 0x4e, 0x4d, 0x60, 0x03, 0xc7, 0x51, 0xc2, 0x02, 0xf5, 0xab, 0x21, 0xef, 0x97, 0x45, 0xd8, - 0x68, 0x73, 0xfa, 0xb8, 0xdf, 0x8d, 0x23, 0xf1, 0x28, 0x63, 0x29, 0xe3, 0xf8, 0x08, 0xbd, 0x07, - 0x57, 0x62, 0xc2, 0x39, 0xa6, 0x84, 0xdb, 0xd6, 0xd6, 0xd2, 0xf6, 0xda, 0x7e, 0xcd, 0xd7, 0xfb, - 0xf9, 0xf9, 0x7e, 0xfe, 0xfd, 0x64, 0xd8, 0x29, 0x58, 0xa8, 0x0d, 0x57, 0xa3, 0x24, 0x12, 0x11, - 0x3e, 0x3a, 0x08, 0x49, 0xca, 0x78, 0x24, 0xec, 0x45, 0x95, 0x58, 0xf7, 0x4d, 0xdb, 0xd2, 0x12, - 0xdf, 0x58, 0xe2, 0x3f, 0x60, 0x51, 0xd2, 0x5a, 0x7d, 0xf1, 0x6a, 0x73, 0xe1, 0xe7, 0xf3, 0x93, - 0x1d, 0xab, 0xb3, 0x6e, 0x92, 0x3f, 0xd1, 0xb9, 0xe8, 0x03, 0xb8, 0x92, 0xaa, 0x66, 0x48, 0x66, - 0x2f, 0x6d, 0x59, 0xdb, 0xab, 0x2d, 0xfb, 0xb7, 0x67, 0x7b, 0x35, 0x53, 0xea, 0x7e, 0x18, 0x66, - 0x84, 0xf3, 0xc7, 0x22, 0x8b, 0x12, 0xda, 0x29, 0x98, 0xc8, 0x91, 0x6d, 0x0b, 0x1c, 0x62, 0x81, - 0xed, 0x65, 0x99, 0xd5, 0x29, 0xd6, 0xa8, 0x06, 0x2b, 0x22, 0x12, 0x47, 0xc4, 0x5e, 0x51, 0x01, - 0xbd, 0x40, 0x36, 0x54, 0x79, 0x3f, 0x8e, 0x71, 0x36, 0xb4, 0x2b, 0x0a, 0xcf, 0x97, 0xcd, 0xc6, - 0x8f, 0xe7, 0x27, 0x3b, 0x45, 0xe9, 0xa7, 0xe7, 0x27, 0x3b, 0x9b, 0x7a, 0xf7, 0x3d, 0x1e, 0x7e, - 0x2f, 0x6d, 0x2d, 0xb9, 0xe6, 0xdd, 0x83, 0x7a, 0x09, 0xec, 0x10, 0x9e, 0xb2, 0x84, 0x13, 0xb4, - 0x09, 0x6b, 0xa9, 0xc1, 0x0e, 0xa2, 0xd0, 0xb6, 0xb6, 0xac, 0xed, 0xe5, 0x0e, 0xe4, 0xd0, 0x67, - 0xa1, 0xf7, 0xdc, 0x82, 0x5a, 0x9b, 0xd3, 0x87, 0xc7, 0xa4, 0xf7, 0x39, 0xa1, 0xb8, 0x37, 0x7c, - 0xc0, 0x12, 0x41, 0x12, 0x81, 0xbe, 0x80, 0x6a, 0x4f, 0x3f, 0xaa, 0xac, 0x0b, 0xde, 0x45, 0xcb, - 0xfd, 0xf5, 0xd9, 0x9e, 0x33, 0x31, 0x8d, 0xb9, 0xd5, 0x2a, 0xb7, 0x93, 0x17, 0x41, 0x37, 0x61, - 0x15, 0xf7, 0xc5, 0x21, 0xcb, 0x22, 0x31, 0xb4, 0x17, 0x95, 0xea, 0x11, 0xd0, 0xbc, 0x23, 0x75, - 0x8f, 0xd6, 0x52, 0xb8, 0x57, 0x12, 0x5e, 0x6a, 0xd2, 0x73, 0xe1, 0xe6, 0x2c, 0x3c, 0x97, 0xef, - 0xfd, 0x69, 0x41, 0xb5, 0xcd, 0xe9, 0x13, 0x26, 0x08, 0xba, 0x33, 0xc3, 0x8a, 0x56, 0xed, 0xef, - 0x57, 0x9b, 0xe3, 0xb0, 0x9e, 0x8b, 0x31, 0x83, 0x90, 0x0f, 0x2b, 0x03, 0x26, 0x48, 0xa6, 0x7b, - 0x9e, 0x33, 0x10, 0x9a, 0x86, 0x1a, 0x50, 0x61, 0xa9, 0x88, 0x58, 0xa2, 0x26, 0x68, 0x7d, 0x34, - 0x89, 0xda, 0x1d, 0x5f, 0xf6, 0xf2, 0xa5, 0x22, 0x74, 0x0c, 0x71, 0xde, 0x00, 0x35, 0xdf, 0x96, - 0xc6, 0xe8, 0xd2, 0xd2, 0x94, 0x6b, 0x25, 0x53, 0x64, 0x3d, 0x6f, 0x03, 0xae, 0x9a, 0xc7, 0x42, - 0xfa, 0x3f, 0x56, 0x81, 0x7d, 0x4d, 0x22, 0x7a, 0x28, 0x48, 0xf8, 0x7f, 0x59, 0xf0, 0x11, 0x54, - 0xb5, 0x32, 0x6e, 0x2f, 0xa9, 0xd3, 0x78, 0x6b, 0xca, 0x83, 0xbc, 0xa1, 0x31, 0x2f, 0xf2, 0x8c, - 0xb9, 0x66, 0xbc, 0x3b, 0x69, 0xc6, 0x5b, 0x33, 0xcd, 0xc8, 0x8b, 0x7b, 0x75, 0xb8, 0x31, 0x05, - 0x15, 0xe6, 0xfc, 0x65, 0x01, 0xb4, 0x39, 0xcd, 0xcf, 0xfd, 0x7f, 0xf4, 0xe5, 0x2e, 0xac, 0x9a, - 0x5b, 0x87, 0x5d, 0xee, 0xcd, 0x88, 0x8a, 0xee, 0x41, 0x05, 0xc7, 0xac, 0x9f, 0x08, 0x63, 0xcf, - 0xeb, 0x5d, 0x56, 0x26, 0xa7, 0xb9, 0xab, 0x8e, 0x4a, 0x51, 0x4d, 0x1a, 0x61, 0x97, 0x8c, 0x30, - 0xca, 0xbc, 0x1a, 0xa0, 0xd1, 0xaa, 0x90, 0xff, 0x5c, 0xcf, 0xc6, 0x57, 0x69, 0x88, 0x05, 0x79, - 0x84, 0x33, 0x1c, 0x73, 0x29, 0x66, 0x74, 0x3e, 0xad, 0xcb, 0xc4, 0x14, 0x54, 0xf4, 0x21, 0x54, - 0x52, 0x55, 0x41, 0x39, 0xb0, 0xb6, 0x7f, 0x6d, 0xea, 0x5d, 0xeb, 0xf2, 0x13, 0x42, 0x34, 0xbf, - 0x79, 0xb7, 0x7c, 0xe6, 0x6f, 0x8f, 0x09, 0x39, 0xce, 0x3f, 0x57, 0x53, 0x9d, 0x9a, 0xf7, 0x3a, - 0x0e, 0xe5, 0xc2, 0xf6, 0x9f, 0x2e, 0xc3, 0x52, 0x9b, 0x53, 0xf4, 0x2d, 0xac, 0x4f, 0x7d, 0x5b, - 0xb6, 0xa6, 0xda, 0x2a, 0x5d, 0x99, 0xce, 0xf6, 0x65, 0x8c, 0xe2, 0x52, 0x25, 0xb0, 0x51, 0xbe, - 0x2f, 0x6f, 0x97, 0xd3, 0x4b, 0x24, 0x67, 0xf7, 0x35, 0x48, 0xc5, 0x36, 0x1f, 0xc3, 0xb2, 0xba, - 0xb8, 0xae, 0x97, 0x93, 0x24, 0xee, 0xb8, 0xb3, 0xf1, 0x22, 0xff, 0x09, 0xbc, 0x31, 0x71, 0xfa, - 0x2f, 0xe0, 0xe7, 0x71, 0xe7, 0x9d, 0xf9, 0xf1, 0xa2, 0xee, 0xa7, 0x50, 0xcd, 0x0f, 0x4e, 0xbd, - 0x9c, 0x62, 0x42, 0xce, 0xad, 0x0b, 0x43, 0xe3, 0x0d, 0x4e, 0x8c, 0xe0, 0x8c, 0x06, 0xc7, 0xe3, - 0xb3, 0x1a, 0x9c, 0x35, 0x05, 0xce, 0xca, 0x0f, 0x72, 0xce, 0x5a, 0x0f, 0x5f, 0x9c, 0xba, 0xd6, - 0xcb, 0x53, 0xd7, 0xfa, 0xe3, 0xd4, 0xb5, 0x7e, 0x3a, 0x73, 0x17, 0x5e, 0x9e, 0xb9, 0x0b, 0xbf, - 0x9f, 0xb9, 0x0b, 0xdf, 0xec, 0xd2, 0x48, 0x1c, 0xf6, 0xbb, 0x7e, 0x8f, 0xc5, 0xe6, 0xef, 0x4d, - 0x50, 0x1a, 0x3c, 0x31, 0x4c, 0x09, 0x97, 0x7f, 0xa6, 0x2a, 0xea, 0x7b, 0xf7, 0xfe, 0xbf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0xc2, 0x00, 0x8f, 0x53, 0x8c, 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 - -// 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 { - // SubmitProposal defines a method to create new proposal given the messages. - SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) - // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - // to execute a legacy content-based proposal. - ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) - // UpdateParams defines a governance operation for updating the x/gov module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - 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) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { - out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/SubmitProposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ExecLegacyContent(ctx context.Context, in *MsgExecLegacyContent, opts ...grpc.CallOption) (*MsgExecLegacyContentResponse, error) { - out := new(MsgExecLegacyContentResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/ExecLegacyContent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { - out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { - out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/VoteWeighted", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { - out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/Deposit", 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, "/cosmos.gov.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 { - // SubmitProposal defines a method to create new proposal given the messages. - SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) - // ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - // to execute a legacy content-based proposal. - ExecLegacyContent(context.Context, *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) - // UpdateParams defines a governance operation for updating the x/gov module - // parameters. The authority is defined in the keeper. - // - // Since: cosmos-sdk 0.47 - UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") -} -func (*UnimplementedMsgServer) ExecLegacyContent(ctx context.Context, req *MsgExecLegacyContent) (*MsgExecLegacyContentResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecLegacyContent not implemented") -} -func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") -} -func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VoteWeighted not implemented") -} -func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit 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_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/SubmitProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ExecLegacyContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgExecLegacyContent) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ExecLegacyContent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/ExecLegacyContent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ExecLegacyContent(ctx, req.(*MsgExecLegacyContent)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVoteWeighted) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).VoteWeighted(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/VoteWeighted", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDeposit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1.Msg/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) - } - 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: "/cosmos.gov.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: "cosmos.gov.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitProposal", - Handler: _Msg_SubmitProposal_Handler, - }, - { - MethodName: "ExecLegacyContent", - Handler: _Msg_ExecLegacyContent_Handler, - }, - { - MethodName: "Vote", - Handler: _Msg_Vote_Handler, - }, - { - MethodName: "VoteWeighted", - Handler: _Msg_VoteWeighted_Handler, - }, - { - MethodName: "Deposit", - Handler: _Msg_Deposit_Handler, - }, - { - MethodName: "UpdateParams", - Handler: _Msg_UpdateParams_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1/tx.proto", -} - -func (m *MsgSubmitProposal) 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 *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Summary) > 0 { - i -= len(m.Summary) - copy(dAtA[i:], m.Summary) - i = encodeVarintTx(dAtA, i, uint64(len(m.Summary))) - i-- - dAtA[i] = 0x32 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0x2a - } - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x22 - } - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x1a - } - if len(m.InitialDeposit) > 0 { - for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Messages) > 0 { - for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgExecLegacyContent) 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 *MsgExecLegacyContent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecLegacyContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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] = 0x12 - } - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgExecLegacyContentResponse) 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 *MsgExecLegacyContentResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgExecLegacyContentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgVote) 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 *MsgVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x22 - } - if m.Option != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeighted) 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 *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x22 - } - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[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.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeightedResponse) 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 *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDeposit) 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.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - 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 *MsgSubmitProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Messages) > 0 { - for _, e := range m.Messages { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - if len(m.InitialDeposit) > 0 { - for _, e := range m.InitialDeposit { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Title) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Summary) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - return n -} - -func (m *MsgExecLegacyContent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgExecLegacyContentResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovTx(uint64(m.Option)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgVoteWeighted) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgVoteWeightedResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Depositor) - 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 *MsgDepositResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - 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 *MsgSubmitProposal) 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: MsgSubmitProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Messages", 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.Messages = append(m.Messages, &types.Any{}) - if err := m.Messages[len(m.Messages)-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 InitialDeposit", 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.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) - if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - 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 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.Title = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Summary", 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.Summary = string(dAtA[iNdEx:postIndex]) - 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 *MsgSubmitProposalResponse) 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: MsgSubmitProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(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 *MsgExecLegacyContent) 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: MsgExecLegacyContent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecLegacyContent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", 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 m.Content == nil { - m.Content = &types.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - 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 - 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 *MsgExecLegacyContentResponse) 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: MsgExecLegacyContentResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgExecLegacyContentResponse: 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 *MsgVote) 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: MsgVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) - 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 *MsgVoteResponse) 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: MsgVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteResponse: 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 *MsgVoteWeighted) 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: MsgVoteWeighted: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, &WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) - 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 *MsgVoteWeightedResponse) 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: MsgVoteWeightedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeightedResponse: 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 *MsgDeposit) 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: MsgDeposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = 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, types1.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 *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositResponse: 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 *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) || (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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go deleted file mode 100644 index d40095e9828a..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/genesis.pb.go +++ /dev/null @@ -1,669 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/genesis.proto - -package v1beta1 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the gov module's genesis state. -type GenesisState struct { - // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty"` - // deposits defines all the deposits present at genesis. - Deposits Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` - // votes defines all the votes present at genesis. - Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` - // proposals defines all the proposals present at genesis. - Proposals Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the parameters of related to deposit. - DepositParams DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` - // params defines all the parameters of related to voting. - VotingParams VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` - // params defines all the parameters of related to tally. - TallyParams TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_43cd825e0fa7a627, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetStartingProposalId() uint64 { - if m != nil { - return m.StartingProposalId - } - return 0 -} - -func (m *GenesisState) GetDeposits() Deposits { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *GenesisState) GetVotes() Votes { - if m != nil { - return m.Votes - } - return nil -} - -func (m *GenesisState) GetProposals() Proposals { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *GenesisState) GetDepositParams() DepositParams { - if m != nil { - return m.DepositParams - } - return DepositParams{} -} - -func (m *GenesisState) GetVotingParams() VotingParams { - if m != nil { - return m.VotingParams - } - return VotingParams{} -} - -func (m *GenesisState) GetTallyParams() TallyParams { - if m != nil { - return m.TallyParams - } - return TallyParams{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.gov.v1beta1.GenesisState") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/genesis.proto", fileDescriptor_43cd825e0fa7a627) } - -var fileDescriptor_43cd825e0fa7a627 = []byte{ - // 409 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0xd2, 0x4d, 0x6e, 0xda, 0x40, - 0x14, 0x07, 0x70, 0xbb, 0x7c, 0x14, 0x06, 0xa8, 0xd4, 0x11, 0xad, 0x2c, 0x8a, 0x8c, 0xdb, 0x15, - 0xaa, 0x54, 0x1b, 0xe8, 0x0d, 0xac, 0x4a, 0x55, 0x2b, 0x25, 0x42, 0x10, 0x65, 0x91, 0x0d, 0x1a, - 0xf0, 0xc8, 0xb1, 0x82, 0x79, 0x96, 0x67, 0x62, 0x85, 0x5b, 0xe4, 0x04, 0x59, 0x47, 0x59, 0xe5, - 0x18, 0x2c, 0x59, 0x66, 0x95, 0x44, 0xb0, 0xc8, 0x35, 0x22, 0xcf, 0x8c, 0x13, 0x24, 0x9c, 0x6c, - 0xfc, 0xf1, 0xde, 0xdf, 0x3f, 0xcf, 0x8c, 0x1e, 0xb2, 0x66, 0xc0, 0x42, 0x60, 0x8e, 0x0f, 0x89, - 0x93, 0xf4, 0xa7, 0x94, 0x93, 0xbe, 0xe3, 0xd3, 0x05, 0x65, 0x01, 0xb3, 0xa3, 0x18, 0x38, 0x60, - 0x2c, 0x13, 0xb6, 0x0f, 0x89, 0xad, 0x12, 0xad, 0xa6, 0x0f, 0x3e, 0x88, 0xb6, 0x93, 0x3e, 0xc9, - 0x64, 0xab, 0x9d, 0x67, 0x41, 0xa2, 0xba, 0x9f, 0x49, 0x18, 0x2c, 0xc0, 0x11, 0x57, 0x59, 0xfa, - 0x71, 0x55, 0x44, 0xf5, 0xbf, 0xf2, 0x67, 0x63, 0x4e, 0x38, 0xc5, 0x3d, 0xd4, 0x64, 0x9c, 0xc4, - 0x3c, 0x58, 0xf8, 0x93, 0x28, 0x86, 0x08, 0x18, 0x99, 0x4f, 0x02, 0xcf, 0xd0, 0x2d, 0xbd, 0x5b, - 0x1c, 0xe1, 0xac, 0x37, 0x54, 0xad, 0x7f, 0x1e, 0x3e, 0x44, 0x15, 0x8f, 0x46, 0xc0, 0x02, 0xce, - 0x8c, 0x0f, 0x56, 0xa1, 0x5b, 0x1b, 0x7c, 0xb3, 0xf7, 0x17, 0x6c, 0xff, 0x91, 0x19, 0xf7, 0xcb, - 0xea, 0xbe, 0xa3, 0xdd, 0x3c, 0x74, 0x2a, 0xaa, 0xc0, 0xae, 0x9f, 0x6e, 0x7f, 0xea, 0xa3, 0x17, - 0x03, 0xbb, 0xa8, 0x94, 0x00, 0xa7, 0xcc, 0x28, 0x08, 0xcc, 0xc8, 0xc3, 0x8e, 0x81, 0x53, 0x17, - 0x2b, 0xa9, 0x94, 0xbe, 0x29, 0x46, 0x7e, 0x8a, 0x47, 0xa8, 0x9a, 0x2d, 0x9e, 0x19, 0x45, 0xe1, - 0xb4, 0xf3, 0x9c, 0x6c, 0x1b, 0xee, 0x57, 0x65, 0x55, 0xb3, 0x8a, 0xf2, 0x5e, 0x19, 0x3c, 0x46, - 0x9f, 0xd4, 0x1a, 0x27, 0x11, 0x89, 0x49, 0xc8, 0x8c, 0x92, 0xa5, 0x77, 0x6b, 0x83, 0xef, 0xef, - 0xec, 0x76, 0x28, 0x82, 0x6e, 0x35, 0xd5, 0x25, 0xd8, 0xf0, 0x76, 0x3b, 0x78, 0x88, 0x1a, 0x09, - 0xc8, 0xc3, 0x96, 0x66, 0x59, 0x98, 0xd6, 0x1b, 0x9b, 0x4e, 0x4f, 0x7e, 0x8f, 0xac, 0x27, 0x3b, - 0x0d, 0x7c, 0x80, 0xea, 0x9c, 0xcc, 0xe7, 0xcb, 0x0c, 0xfc, 0x28, 0xc0, 0x4e, 0x1e, 0x78, 0x94, - 0xe6, 0xf6, 0xbd, 0x1a, 0xdf, 0xa9, 0xff, 0x5f, 0x6d, 0x4c, 0x7d, 0xbd, 0x31, 0xf5, 0xc7, 0x8d, - 0xa9, 0x5f, 0x6e, 0x4d, 0x6d, 0xbd, 0x35, 0xb5, 0xbb, 0xad, 0xa9, 0x9d, 0xf4, 0xfc, 0x80, 0x9f, - 0x9e, 0x4f, 0xed, 0x19, 0x84, 0x8e, 0x1a, 0x3b, 0x79, 0xfb, 0xc5, 0xbc, 0x33, 0xe7, 0x42, 0xcc, - 0x20, 0x5f, 0x46, 0x94, 0x65, 0x93, 0x38, 0x2d, 0x8b, 0x99, 0xfb, 0xfd, 0x1c, 0x00, 0x00, 0xff, - 0xff, 0xcb, 0x8b, 0x44, 0x6f, 0xf2, 0x02, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.StartingProposalId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartingProposalId != 0 { - n += 1 + sovGenesis(uint64(m.StartingProposalId)) - } - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) - } - m.StartingProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deposits = append(m.Deposits, Deposit{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposals = append(m.Proposals, Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go deleted file mode 100644 index ce00989f4c3e..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/gov.pb.go +++ /dev/null @@ -1,2852 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/gov.proto - -package v1beta1 - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "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 - -// VoteOption enumerates the valid vote options for a given governance proposal. -type VoteOption int32 - -const ( - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - OptionEmpty VoteOption = 0 - // VOTE_OPTION_YES defines a yes vote option. - OptionYes VoteOption = 1 - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - OptionAbstain VoteOption = 2 - // VOTE_OPTION_NO defines a no vote option. - OptionNo VoteOption = 3 - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - OptionNoWithVeto VoteOption = 4 -) - -var VoteOption_name = map[int32]string{ - 0: "VOTE_OPTION_UNSPECIFIED", - 1: "VOTE_OPTION_YES", - 2: "VOTE_OPTION_ABSTAIN", - 3: "VOTE_OPTION_NO", - 4: "VOTE_OPTION_NO_WITH_VETO", -} - -var VoteOption_value = map[string]int32{ - "VOTE_OPTION_UNSPECIFIED": 0, - "VOTE_OPTION_YES": 1, - "VOTE_OPTION_ABSTAIN": 2, - "VOTE_OPTION_NO": 3, - "VOTE_OPTION_NO_WITH_VETO": 4, -} - -func (x VoteOption) String() string { - return proto.EnumName(VoteOption_name, int32(x)) -} - -func (VoteOption) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{0} -} - -// ProposalStatus enumerates the valid statuses of a proposal. -type ProposalStatus int32 - -const ( - // PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. - StatusNil ProposalStatus = 0 - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - StatusDepositPeriod ProposalStatus = 1 - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - StatusVotingPeriod ProposalStatus = 2 - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - StatusPassed ProposalStatus = 3 - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - StatusRejected ProposalStatus = 4 - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - StatusFailed ProposalStatus = 5 -) - -var ProposalStatus_name = map[int32]string{ - 0: "PROPOSAL_STATUS_UNSPECIFIED", - 1: "PROPOSAL_STATUS_DEPOSIT_PERIOD", - 2: "PROPOSAL_STATUS_VOTING_PERIOD", - 3: "PROPOSAL_STATUS_PASSED", - 4: "PROPOSAL_STATUS_REJECTED", - 5: "PROPOSAL_STATUS_FAILED", -} - -var ProposalStatus_value = map[string]int32{ - "PROPOSAL_STATUS_UNSPECIFIED": 0, - "PROPOSAL_STATUS_DEPOSIT_PERIOD": 1, - "PROPOSAL_STATUS_VOTING_PERIOD": 2, - "PROPOSAL_STATUS_PASSED": 3, - "PROPOSAL_STATUS_REJECTED": 4, - "PROPOSAL_STATUS_FAILED": 5, -} - -func (x ProposalStatus) String() string { - return proto.EnumName(ProposalStatus_name, int32(x)) -} - -func (ProposalStatus) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{1} -} - -// WeightedVoteOption defines a unit of vote for vote split. -// -// Since: cosmos-sdk 0.43 -type WeightedVoteOption struct { - // option defines the valid vote options, it must not contain duplicate vote options. - Option VoteOption `protobuf:"varint,1,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` - // weight is the vote weight associated with the vote option. - Weight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"weight"` -} - -func (m *WeightedVoteOption) Reset() { *m = WeightedVoteOption{} } -func (*WeightedVoteOption) ProtoMessage() {} -func (*WeightedVoteOption) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{0} -} -func (m *WeightedVoteOption) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *WeightedVoteOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WeightedVoteOption.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 *WeightedVoteOption) XXX_Merge(src proto.Message) { - xxx_messageInfo_WeightedVoteOption.Merge(m, src) -} -func (m *WeightedVoteOption) XXX_Size() int { - return m.Size() -} -func (m *WeightedVoteOption) XXX_DiscardUnknown() { - xxx_messageInfo_WeightedVoteOption.DiscardUnknown(m) -} - -var xxx_messageInfo_WeightedVoteOption proto.InternalMessageInfo - -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval. -type TextProposal struct { - // title of the proposal. - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - // description associated with the proposal. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *TextProposal) Reset() { *m = TextProposal{} } -func (*TextProposal) ProtoMessage() {} -func (*TextProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{1} -} -func (m *TextProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TextProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TextProposal.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 *TextProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_TextProposal.Merge(m, src) -} -func (m *TextProposal) XXX_Size() int { - return m.Size() -} -func (m *TextProposal) XXX_DiscardUnknown() { - xxx_messageInfo_TextProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_TextProposal proto.InternalMessageInfo - -// Deposit defines an amount deposited by an account address to an active -// proposal. -type Deposit struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - // amount to be deposited by depositor. - Amount 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 *Deposit) Reset() { *m = Deposit{} } -func (*Deposit) ProtoMessage() {} -func (*Deposit) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{2} -} -func (m *Deposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Deposit.Merge(m, src) -} -func (m *Deposit) XXX_Size() int { - return m.Size() -} -func (m *Deposit) XXX_DiscardUnknown() { - xxx_messageInfo_Deposit.DiscardUnknown(m) -} - -var xxx_messageInfo_Deposit proto.InternalMessageInfo - -// Proposal defines the core field members of a governance proposal. -type Proposal struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // content is the proposal's content. - Content *types1.Any `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` - // status defines the proposal status. - Status ProposalStatus `protobuf:"varint,3,opt,name=status,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"status,omitempty"` - // final_tally_result is the final tally result of the proposal. When - // querying a proposal via gRPC, this field is not populated until the - // proposal's voting period has ended. - FinalTallyResult TallyResult `protobuf:"bytes,4,opt,name=final_tally_result,json=finalTallyResult,proto3" json:"final_tally_result"` - // submit_time is the time of proposal submission. - SubmitTime time.Time `protobuf:"bytes,5,opt,name=submit_time,json=submitTime,proto3,stdtime" json:"submit_time"` - // deposit_end_time is the end time for deposition. - DepositEndTime time.Time `protobuf:"bytes,6,opt,name=deposit_end_time,json=depositEndTime,proto3,stdtime" json:"deposit_end_time"` - // total_deposit is the total deposit on the proposal. - TotalDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=total_deposit,json=totalDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_deposit"` - // voting_start_time is the starting time to vote on a proposal. - VotingStartTime time.Time `protobuf:"bytes,8,opt,name=voting_start_time,json=votingStartTime,proto3,stdtime" json:"voting_start_time"` - // voting_end_time is the end time of voting on a proposal. - VotingEndTime time.Time `protobuf:"bytes,9,opt,name=voting_end_time,json=votingEndTime,proto3,stdtime" json:"voting_end_time"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{3} -} -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.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 *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} -func (m *Proposal) XXX_Size() int { - return m.Size() -} -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -// TallyResult defines a standard tally for a governance proposal. -type TallyResult struct { - // yes is the number of yes votes on a proposal. - Yes github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=yes,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"yes"` - // abstain is the number of abstain votes on a proposal. - Abstain github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=abstain,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"abstain"` - // no is the number of no votes on a proposal. - No github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=no,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no"` - // no_with_veto is the number of no with veto votes on a proposal. - NoWithVeto github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=no_with_veto,json=noWithVeto,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"no_with_veto"` -} - -func (m *TallyResult) Reset() { *m = TallyResult{} } -func (*TallyResult) ProtoMessage() {} -func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{4} -} -func (m *TallyResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyResult.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 *TallyResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyResult.Merge(m, src) -} -func (m *TallyResult) XXX_Size() int { - return m.Size() -} -func (m *TallyResult) XXX_DiscardUnknown() { - xxx_messageInfo_TallyResult.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyResult proto.InternalMessageInfo - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -type Vote struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"id"` - // voter is the voter address of the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // Deprecated: Prefer to use `options` instead. This field is set in queries - // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. - // options is the weighted vote options. - // - // Since: cosmos-sdk 0.43 - Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{5} -} -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.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 *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} -func (m *Vote) XXX_Size() int { - return m.Size() -} -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -// DepositParams defines the params for deposits on governance proposals. -type DepositParams struct { - // Minimum deposit for a proposal to enter voting period. - MinDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=min_deposit,json=minDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"min_deposit,omitempty"` - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - MaxDepositPeriod time.Duration `protobuf:"bytes,2,opt,name=max_deposit_period,json=maxDepositPeriod,proto3,stdduration" json:"max_deposit_period,omitempty"` -} - -func (m *DepositParams) Reset() { *m = DepositParams{} } -func (*DepositParams) ProtoMessage() {} -func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{6} -} -func (m *DepositParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DepositParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DepositParams.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 *DepositParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_DepositParams.Merge(m, src) -} -func (m *DepositParams) XXX_Size() int { - return m.Size() -} -func (m *DepositParams) XXX_DiscardUnknown() { - xxx_messageInfo_DepositParams.DiscardUnknown(m) -} - -var xxx_messageInfo_DepositParams proto.InternalMessageInfo - -// VotingParams defines the params for voting on governance proposals. -type VotingParams struct { - // Duration of the voting period. - VotingPeriod time.Duration `protobuf:"bytes,1,opt,name=voting_period,json=votingPeriod,proto3,stdduration" json:"voting_period,omitempty"` -} - -func (m *VotingParams) Reset() { *m = VotingParams{} } -func (*VotingParams) ProtoMessage() {} -func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{7} -} -func (m *VotingParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *VotingParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VotingParams.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 *VotingParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VotingParams.Merge(m, src) -} -func (m *VotingParams) XXX_Size() int { - return m.Size() -} -func (m *VotingParams) XXX_DiscardUnknown() { - xxx_messageInfo_VotingParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VotingParams proto.InternalMessageInfo - -// TallyParams defines the params for tallying votes on governance proposals. -type TallyParams struct { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - Quorum github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=quorum,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"quorum,omitempty"` - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - Threshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=threshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"threshold,omitempty"` - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - VetoThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=veto_threshold,json=vetoThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"veto_threshold,omitempty"` -} - -func (m *TallyParams) Reset() { *m = TallyParams{} } -func (*TallyParams) ProtoMessage() {} -func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_6e82113c1a9a4b7c, []int{8} -} -func (m *TallyParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TallyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TallyParams.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 *TallyParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_TallyParams.Merge(m, src) -} -func (m *TallyParams) XXX_Size() int { - return m.Size() -} -func (m *TallyParams) XXX_DiscardUnknown() { - xxx_messageInfo_TallyParams.DiscardUnknown(m) -} - -var xxx_messageInfo_TallyParams proto.InternalMessageInfo - -func init() { - proto.RegisterEnum("cosmos.gov.v1beta1.VoteOption", VoteOption_name, VoteOption_value) - proto.RegisterEnum("cosmos.gov.v1beta1.ProposalStatus", ProposalStatus_name, ProposalStatus_value) - proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1beta1.WeightedVoteOption") - proto.RegisterType((*TextProposal)(nil), "cosmos.gov.v1beta1.TextProposal") - proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1beta1.Deposit") - proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1beta1.Proposal") - proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1beta1.TallyResult") - proto.RegisterType((*Vote)(nil), "cosmos.gov.v1beta1.Vote") - proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1beta1.DepositParams") - proto.RegisterType((*VotingParams)(nil), "cosmos.gov.v1beta1.VotingParams") - proto.RegisterType((*TallyParams)(nil), "cosmos.gov.v1beta1.TallyParams") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } - -var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1401 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x13, 0x47, - 0x14, 0xf6, 0xda, 0xce, 0xaf, 0xb1, 0x13, 0x96, 0x21, 0x25, 0xce, 0x96, 0xee, 0xae, 0x5c, 0x09, - 0x45, 0x11, 0x71, 0x20, 0xa8, 0x48, 0x4d, 0xab, 0x4a, 0x36, 0x5e, 0x5a, 0x53, 0x64, 0xbb, 0xeb, - 0xc5, 0x14, 0x0e, 0x5d, 0x6d, 0xbc, 0x83, 0xb3, 0xad, 0x77, 0xc7, 0x78, 0xc7, 0x21, 0xb9, 0xf5, - 0xd2, 0x0a, 0xf9, 0xc4, 0x91, 0x8b, 0x25, 0x44, 0x2f, 0x55, 0x4f, 0x1c, 0xf8, 0x07, 0x7a, 0x43, - 0x55, 0x0f, 0x88, 0x43, 0x45, 0x7b, 0x08, 0x25, 0x48, 0x85, 0xf2, 0x47, 0x54, 0xd5, 0xce, 0xcc, - 0xc6, 0x1b, 0x27, 0x22, 0xb8, 0xa8, 0x97, 0x64, 0x3d, 0xef, 0x7b, 0xdf, 0xf7, 0xde, 0xf3, 0x7b, - 0x6f, 0xc7, 0xe0, 0x44, 0x03, 0xfb, 0x2e, 0xf6, 0x97, 0x9b, 0x78, 0x63, 0x79, 0xe3, 0xcc, 0x1a, - 0x22, 0xd6, 0x99, 0xe0, 0x39, 0xd7, 0xee, 0x60, 0x82, 0x21, 0x64, 0xd6, 0x5c, 0x70, 0xc2, 0xad, - 0x92, 0xcc, 0x3d, 0xd6, 0x2c, 0x1f, 0xed, 0xba, 0x34, 0xb0, 0xe3, 0x31, 0x1f, 0x69, 0xb6, 0x89, - 0x9b, 0x98, 0x3e, 0x2e, 0x07, 0x4f, 0xfc, 0x54, 0x69, 0x62, 0xdc, 0x6c, 0xa1, 0x65, 0xfa, 0x69, - 0xad, 0x7b, 0x7d, 0x99, 0x38, 0x2e, 0xf2, 0x89, 0xe5, 0xb6, 0x39, 0x60, 0x7e, 0x18, 0x60, 0x79, - 0x5b, 0xdc, 0x24, 0x0f, 0x9b, 0xec, 0x6e, 0xc7, 0x22, 0x0e, 0x0e, 0x15, 0xe7, 0x59, 0x44, 0x26, - 0x13, 0xe5, 0x21, 0x33, 0xd3, 0x51, 0xcb, 0x75, 0x3c, 0xbc, 0x4c, 0xff, 0xb2, 0xa3, 0xec, 0x3d, - 0x01, 0xc0, 0x2b, 0xc8, 0x69, 0xae, 0x13, 0x64, 0xd7, 0x31, 0x41, 0x95, 0x76, 0x40, 0x05, 0xcf, - 0x81, 0x71, 0x4c, 0x9f, 0x32, 0x82, 0x2a, 0x2c, 0xcc, 0xac, 0xc8, 0xb9, 0xfd, 0xb9, 0xe7, 0x06, - 0x78, 0x9d, 0xa3, 0xa1, 0x01, 0xc6, 0x6f, 0x52, 0xb6, 0x4c, 0x5c, 0x15, 0x16, 0xa6, 0x0a, 0x1f, - 0x3f, 0xdc, 0x56, 0x62, 0x7f, 0x6c, 0x2b, 0x27, 0x9b, 0x0e, 0x59, 0xef, 0xae, 0xe5, 0x1a, 0xd8, - 0xe5, 0x21, 0xf1, 0x7f, 0x4b, 0xbe, 0xfd, 0xcd, 0x32, 0xd9, 0x6a, 0x23, 0x3f, 0x57, 0x44, 0x8d, - 0xc7, 0x0f, 0x96, 0x00, 0x17, 0x2a, 0xa2, 0x86, 0xce, 0xb9, 0xb2, 0xdf, 0x0b, 0x20, 0x6d, 0xa0, - 0x4d, 0x52, 0xed, 0xe0, 0x36, 0xf6, 0xad, 0x16, 0x9c, 0x05, 0x63, 0xc4, 0x21, 0x2d, 0x44, 0xa3, - 0x9b, 0xd2, 0xd9, 0x07, 0xa8, 0x82, 0x94, 0x8d, 0xfc, 0x46, 0xc7, 0x61, 0x91, 0xd3, 0x08, 0xf4, - 0xe8, 0xd1, 0xea, 0x27, 0x2f, 0xef, 0x2a, 0xc2, 0x2f, 0x0f, 0x96, 0xa4, 0x03, 0xb2, 0x39, 0x8f, - 0x3d, 0x82, 0x3c, 0xd2, 0x7b, 0x71, 0x7f, 0x71, 0x2e, 0x12, 0x5b, 0x54, 0x37, 0xfb, 0x9b, 0x00, - 0x26, 0x8a, 0xa8, 0x8d, 0x7d, 0x87, 0x40, 0x05, 0xa4, 0xda, 0xfc, 0xdc, 0x74, 0x6c, 0x1a, 0x49, - 0x52, 0x07, 0xe1, 0x51, 0xc9, 0x86, 0xe7, 0xc0, 0x94, 0xcd, 0xb0, 0xb8, 0xc3, 0xcb, 0x91, 0x79, - 0xfc, 0x60, 0x69, 0x96, 0x6b, 0xe7, 0x6d, 0xbb, 0x83, 0x7c, 0xbf, 0x46, 0x3a, 0x8e, 0xd7, 0xd4, - 0x07, 0x50, 0xb8, 0x0e, 0xc6, 0x2d, 0x17, 0x77, 0x3d, 0x92, 0x49, 0xa8, 0x89, 0x85, 0xd4, 0xca, - 0x7c, 0x58, 0xfb, 0xa0, 0xc7, 0x22, 0xe1, 0x3a, 0x5e, 0xe1, 0x83, 0xa0, 0xbc, 0x3f, 0x3d, 0x55, - 0x16, 0xde, 0xa0, 0xbc, 0x81, 0x83, 0xff, 0xe3, 0x8b, 0xfb, 0x8b, 0x82, 0xce, 0xf9, 0x57, 0x27, - 0x6f, 0xdd, 0x55, 0x62, 0x2f, 0xef, 0x2a, 0xb1, 0xec, 0xef, 0x63, 0x60, 0x72, 0xb7, 0xba, 0x87, - 0x66, 0x56, 0x06, 0x13, 0x0d, 0x56, 0x2d, 0x9a, 0x57, 0x6a, 0x65, 0x36, 0xc7, 0x9a, 0x32, 0x17, - 0x36, 0x65, 0x2e, 0xef, 0x6d, 0x15, 0xe4, 0xd7, 0x57, 0x5a, 0x0f, 0x49, 0xe0, 0x2a, 0x18, 0xf7, - 0x89, 0x45, 0xba, 0x7e, 0x26, 0x41, 0xbb, 0x2d, 0x7b, 0x50, 0xb7, 0x85, 0xe1, 0xd5, 0x28, 0x52, - 0xe7, 0x1e, 0xf0, 0x4b, 0x00, 0xaf, 0x3b, 0x9e, 0xd5, 0x32, 0x89, 0xd5, 0x6a, 0x6d, 0x99, 0x1d, - 0xe4, 0x77, 0x5b, 0x24, 0x93, 0xa4, 0x61, 0x29, 0x07, 0xf1, 0x18, 0x01, 0x4e, 0xa7, 0xb0, 0xc2, - 0x54, 0x50, 0x3f, 0x56, 0x13, 0x91, 0xb2, 0x44, 0x8c, 0xf0, 0x22, 0x48, 0xf9, 0xdd, 0x35, 0xd7, - 0x21, 0x66, 0x30, 0x9d, 0x99, 0x31, 0x4a, 0x29, 0xed, 0xcb, 0xd4, 0x08, 0x47, 0xb7, 0x30, 0x1d, - 0xb0, 0xdd, 0x7e, 0xaa, 0x08, 0x8c, 0x11, 0x30, 0xef, 0xc0, 0x0e, 0x6b, 0x40, 0xe4, 0x5f, 0xb0, - 0x89, 0x3c, 0x9b, 0x11, 0x8e, 0x8f, 0x4a, 0x38, 0xc3, 0x29, 0x34, 0xcf, 0xa6, 0xa4, 0x5d, 0x30, - 0x4d, 0x30, 0xb1, 0x5a, 0x26, 0x3f, 0xcf, 0x4c, 0xfc, 0x4f, 0xfd, 0x92, 0xa6, 0x32, 0x61, 0xe3, - 0x5f, 0x06, 0x47, 0x37, 0x30, 0x71, 0xbc, 0xa6, 0xe9, 0x13, 0xab, 0xc3, 0xab, 0x33, 0x39, 0x6a, - 0x32, 0x47, 0x18, 0x47, 0x2d, 0xa0, 0xa0, 0xd9, 0x7c, 0x01, 0xf8, 0xd1, 0xa0, 0x42, 0x53, 0xa3, - 0x92, 0x4e, 0x33, 0x06, 0x5e, 0xa0, 0xd5, 0x64, 0x30, 0xee, 0xd9, 0xbf, 0xe3, 0x20, 0x15, 0xfd, - 0x5e, 0xcb, 0x20, 0xb1, 0x85, 0x7c, 0xb6, 0x3a, 0x46, 0x5a, 0x50, 0x25, 0x8f, 0x44, 0x16, 0x54, - 0xc9, 0x23, 0x7a, 0x40, 0x04, 0xeb, 0x60, 0xc2, 0x5a, 0xf3, 0x89, 0xe5, 0x78, 0xff, 0x61, 0xe9, - 0xed, 0xe7, 0x0c, 0xc9, 0xe0, 0x25, 0x10, 0xf7, 0x30, 0x9d, 0x88, 0xb7, 0xa5, 0x8c, 0x7b, 0x18, - 0x7e, 0x05, 0xd2, 0x1e, 0x36, 0x6f, 0x3a, 0x64, 0xdd, 0xdc, 0x40, 0x04, 0xd3, 0x09, 0x79, 0x5b, - 0x5e, 0xe0, 0xe1, 0x2b, 0x0e, 0x59, 0xaf, 0x23, 0x82, 0x79, 0xad, 0xff, 0x11, 0x40, 0x32, 0x78, - 0x2d, 0xc0, 0xb3, 0x07, 0xec, 0x90, 0x02, 0x7c, 0xb5, 0xad, 0xc4, 0x1d, 0xfb, 0xde, 0x8b, 0xfb, - 0x8b, 0x71, 0xc7, 0xe6, 0x53, 0x12, 0xd9, 0x2b, 0x39, 0x30, 0xb6, 0x81, 0x09, 0x3a, 0x7c, 0x5b, - 0x32, 0x58, 0xb0, 0x37, 0xf8, 0x5b, 0x2a, 0xf1, 0x26, 0x6f, 0xa9, 0x42, 0x3c, 0x23, 0xec, 0xbe, - 0xa9, 0x3e, 0x07, 0x13, 0xec, 0xc9, 0xcf, 0x24, 0xe9, 0xd8, 0x9c, 0x3c, 0xc8, 0x79, 0xff, 0xab, - 0x31, 0xba, 0x33, 0x42, 0x86, 0xd5, 0xc9, 0x3b, 0xe1, 0x22, 0xed, 0xc5, 0xc1, 0x34, 0x1f, 0x94, - 0xaa, 0xd5, 0xb1, 0x5c, 0x1f, 0x7e, 0x27, 0x80, 0x94, 0xeb, 0x78, 0xbb, 0x43, 0x2a, 0x1c, 0x36, - 0xa4, 0xa5, 0x40, 0xe0, 0xd5, 0xb6, 0xf2, 0x4e, 0xc4, 0xeb, 0x14, 0x76, 0x1d, 0x82, 0xdc, 0x36, - 0xd9, 0x1a, 0x65, 0x7a, 0x75, 0xe0, 0x3a, 0x5e, 0x38, 0xb6, 0x37, 0x00, 0x74, 0xad, 0xcd, 0x90, - 0xd0, 0x6c, 0xa3, 0x8e, 0x83, 0x6d, 0xbe, 0xbf, 0xe7, 0xf7, 0x8d, 0x58, 0x91, 0x5f, 0x2a, 0x0a, - 0x0b, 0x3c, 0x9a, 0x13, 0xfb, 0x9d, 0x07, 0x41, 0xdd, 0x79, 0xaa, 0x08, 0xba, 0xe8, 0x5a, 0x9b, - 0x61, 0xea, 0xd4, 0x9e, 0xf5, 0x41, 0xba, 0x4e, 0x07, 0x92, 0x97, 0xa2, 0x01, 0xf8, 0x80, 0x86, - 0xea, 0xc2, 0x61, 0xea, 0xef, 0x73, 0xf5, 0xb9, 0x3d, 0x7e, 0x43, 0xc2, 0x69, 0x66, 0xe4, 0xa2, - 0x3f, 0x87, 0xe3, 0xce, 0x45, 0xaf, 0x81, 0xf1, 0x1b, 0x5d, 0xdc, 0xe9, 0xba, 0x54, 0x2d, 0x5d, - 0x28, 0x8c, 0x76, 0x25, 0x79, 0xb5, 0xad, 0x88, 0xcc, 0x7f, 0xa0, 0xaa, 0x73, 0x46, 0xd8, 0x00, - 0x53, 0x64, 0xbd, 0x83, 0xfc, 0x75, 0xdc, 0x62, 0xa5, 0x4c, 0x17, 0xb4, 0x91, 0xe9, 0x8f, 0xed, - 0x52, 0x44, 0x14, 0x06, 0xbc, 0xf0, 0x06, 0x98, 0x09, 0x26, 0xd6, 0x1c, 0x28, 0x25, 0xa8, 0xd2, - 0xc5, 0x91, 0x95, 0x32, 0x7b, 0x79, 0x22, 0x72, 0xd3, 0x81, 0xc5, 0x08, 0x0d, 0x8b, 0x7f, 0x09, - 0x00, 0x44, 0x6e, 0x83, 0xa7, 0xc0, 0x5c, 0xbd, 0x62, 0x68, 0x66, 0xa5, 0x6a, 0x94, 0x2a, 0x65, - 0xf3, 0x72, 0xb9, 0x56, 0xd5, 0xce, 0x97, 0x2e, 0x94, 0xb4, 0xa2, 0x18, 0x93, 0x8e, 0xf4, 0xfa, - 0x6a, 0x8a, 0x01, 0xb5, 0x80, 0x0b, 0x66, 0xc1, 0x91, 0x28, 0xfa, 0xaa, 0x56, 0x13, 0x05, 0x69, - 0xba, 0xd7, 0x57, 0xa7, 0x18, 0xea, 0x2a, 0xf2, 0xe1, 0x22, 0x38, 0x16, 0xc5, 0xe4, 0x0b, 0x35, - 0x23, 0x5f, 0x2a, 0x8b, 0x71, 0xe9, 0x68, 0xaf, 0xaf, 0x4e, 0x33, 0x5c, 0x9e, 0xef, 0x41, 0x15, - 0xcc, 0x44, 0xb1, 0xe5, 0x8a, 0x98, 0x90, 0xd2, 0xbd, 0xbe, 0x3a, 0xc9, 0x60, 0x65, 0x0c, 0x57, - 0x40, 0x66, 0x2f, 0xc2, 0xbc, 0x52, 0x32, 0x3e, 0x33, 0xeb, 0x9a, 0x51, 0x11, 0x93, 0xd2, 0x6c, - 0xaf, 0xaf, 0x8a, 0x21, 0x36, 0xdc, 0x57, 0x52, 0xf2, 0xd6, 0x0f, 0x72, 0x6c, 0xf1, 0xd7, 0x38, - 0x98, 0xd9, 0x7b, 0xb1, 0x80, 0x39, 0xf0, 0x6e, 0x55, 0xaf, 0x54, 0x2b, 0xb5, 0xfc, 0x25, 0xb3, - 0x66, 0xe4, 0x8d, 0xcb, 0xb5, 0xa1, 0x84, 0x69, 0x2a, 0x0c, 0x5c, 0x76, 0x5a, 0xf0, 0x23, 0x20, - 0x0f, 0xe3, 0x8b, 0x5a, 0xb5, 0x52, 0x2b, 0x19, 0x66, 0x55, 0xd3, 0x4b, 0x95, 0xa2, 0x28, 0x48, - 0x73, 0xbd, 0xbe, 0x7a, 0x8c, 0xb9, 0xec, 0x99, 0x10, 0xf8, 0x21, 0x78, 0x6f, 0xd8, 0xb9, 0x5e, - 0x31, 0x4a, 0xe5, 0x4f, 0x43, 0xdf, 0xb8, 0x74, 0xbc, 0xd7, 0x57, 0x21, 0xf3, 0xad, 0x47, 0xfa, - 0x1c, 0x9e, 0x02, 0xc7, 0x87, 0x5d, 0xab, 0xf9, 0x5a, 0x4d, 0x2b, 0x8a, 0x09, 0x49, 0xec, 0xf5, - 0xd5, 0x34, 0xf3, 0xa9, 0x5a, 0xbe, 0x8f, 0x6c, 0x78, 0x1a, 0x64, 0x86, 0xd1, 0xba, 0x76, 0x51, - 0x3b, 0x6f, 0x68, 0x45, 0x31, 0x29, 0xc1, 0x5e, 0x5f, 0x9d, 0xe1, 0x17, 0x2b, 0xf4, 0x35, 0x6a, - 0x10, 0x74, 0x20, 0xff, 0x85, 0x7c, 0xe9, 0x92, 0x56, 0x14, 0xc7, 0xa2, 0xfc, 0x17, 0x2c, 0xa7, - 0x85, 0x6c, 0x56, 0xce, 0x42, 0xfd, 0xe1, 0x33, 0x39, 0xf6, 0xe4, 0x99, 0x1c, 0xfb, 0x76, 0x47, - 0x8e, 0x3d, 0xdc, 0x91, 0x85, 0x47, 0x3b, 0xb2, 0xf0, 0xe7, 0x8e, 0x2c, 0xdc, 0x7e, 0x2e, 0xc7, - 0x1e, 0x3d, 0x97, 0x63, 0x4f, 0x9e, 0xcb, 0xb1, 0x6b, 0xa7, 0x5f, 0xdb, 0xb0, 0x9b, 0xf4, 0xd7, - 0x17, 0x6d, 0xdb, 0xf0, 0x07, 0xd5, 0xda, 0x38, 0xdd, 0x0c, 0x67, 0xff, 0x0d, 0x00, 0x00, 0xff, - 0xff, 0x4a, 0x3c, 0x8e, 0x3e, 0xa0, 0x0d, 0x00, 0x00, -} - -func (this *TextProposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TextProposal) - if !ok { - that2, ok := that.(TextProposal) - 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 *Proposal) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Proposal) - if !ok { - that2, ok := that.(Proposal) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ProposalId != that1.ProposalId { - return false - } - if !this.Content.Equal(that1.Content) { - return false - } - if this.Status != that1.Status { - return false - } - if !this.FinalTallyResult.Equal(&that1.FinalTallyResult) { - return false - } - if !this.SubmitTime.Equal(that1.SubmitTime) { - return false - } - if !this.DepositEndTime.Equal(that1.DepositEndTime) { - return false - } - if len(this.TotalDeposit) != len(that1.TotalDeposit) { - return false - } - for i := range this.TotalDeposit { - if !this.TotalDeposit[i].Equal(&that1.TotalDeposit[i]) { - return false - } - } - if !this.VotingStartTime.Equal(that1.VotingStartTime) { - return false - } - if !this.VotingEndTime.Equal(that1.VotingEndTime) { - return false - } - return true -} -func (this *TallyResult) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*TallyResult) - if !ok { - that2, ok := that.(TallyResult) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Yes.Equal(that1.Yes) { - return false - } - if !this.Abstain.Equal(that1.Abstain) { - return false - } - if !this.No.Equal(that1.No) { - return false - } - if !this.NoWithVeto.Equal(that1.NoWithVeto) { - return false - } - return true -} -func (m *WeightedVoteOption) 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 *WeightedVoteOption) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WeightedVoteOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.Weight.Size() - i -= size - if _, err := m.Weight.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TextProposal) 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 *TextProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TextProposal) 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 = encodeVarintGov(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 = encodeVarintGov(dAtA, i, uint64(len(m.Title))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Deposit) 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 = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintGov(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) 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 *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.VotingEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingEndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintGov(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x4a - n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.VotingStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingStartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintGov(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x42 - if len(m.TotalDeposit) > 0 { - for iNdEx := len(m.TotalDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TotalDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.DepositEndTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DepositEndTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintGov(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x32 - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.SubmitTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SubmitTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintGov(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - { - size, err := m.FinalTallyResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Status != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x18 - } - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TallyResult) 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 *TallyResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.NoWithVeto.Size() - i -= size - if _, err := m.NoWithVeto.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size := m.No.Size() - i -= size - if _, err := m.No.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.Abstain.Size() - i -= size - if _, err := m.Abstain.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Yes.Size() - i -= size - if _, err := m.Yes.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DepositParams) 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 *DepositParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DepositParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n7, err7 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.MaxDepositPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxDepositPeriod):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintGov(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x12 - if len(m.MinDeposit) > 0 { - for iNdEx := len(m.MinDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MinDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VotingParams) 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 *VotingParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VotingParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n8, err8 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.VotingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.VotingPeriod):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintGov(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TallyParams) 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 *TallyParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TallyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size := m.VetoThreshold.Size() - i -= size - if _, err := m.VetoThreshold.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size := m.Threshold.Size() - i -= size - if _, err := m.Threshold.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.Quorum.Size() - i -= size - if _, err := m.Quorum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintGov(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *WeightedVoteOption) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - l = m.Weight.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *TextProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Title) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - return n -} - -func (m *Deposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if len(m.Amount) > 0 { - for _, e := range m.Amount { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovGov(uint64(l)) - } - if m.Status != 0 { - n += 1 + sovGov(uint64(m.Status)) - } - l = m.FinalTallyResult.Size() - n += 1 + l + sovGov(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.SubmitTime) - n += 1 + l + sovGov(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.DepositEndTime) - n += 1 + l + sovGov(uint64(l)) - if len(m.TotalDeposit) > 0 { - for _, e := range m.TotalDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingStartTime) - n += 1 + l + sovGov(uint64(l)) - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.VotingEndTime) - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *TallyResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Yes.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.Abstain.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.No.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.NoWithVeto.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - return n -} - -func (m *DepositParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.MinDeposit) > 0 { - for _, e := range m.MinDeposit { - l = e.Size() - n += 1 + l + sovGov(uint64(l)) - } - } - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.MaxDepositPeriod) - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *VotingParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.VotingPeriod) - n += 1 + l + sovGov(uint64(l)) - return n -} - -func (m *TallyParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Quorum.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.Threshold.Size() - n += 1 + l + sovGov(uint64(l)) - l = m.VetoThreshold.Size() - n += 1 + l + sovGov(uint64(l)) - return n -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGov(x uint64) (n int) { - return sovGov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *WeightedVoteOption) 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 ErrIntOverflowGov - } - 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: WeightedVoteOption: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WeightedVoteOption: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Weight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TextProposal) 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 ErrIntOverflowGov - } - 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: TextProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TextProposal: 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 ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - 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 ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Deposit) 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 ErrIntOverflowGov - } - 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: Deposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Depositor = 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 ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - 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 := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Proposal) 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 ErrIntOverflowGov - } - 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: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Content == nil { - m.Content = &types1.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FinalTallyResult", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.FinalTallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmitTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.SubmitTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.DepositEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TotalDeposit = append(m.TotalDeposit, types.Coin{}) - if err := m.TotalDeposit[len(m.TotalDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingStartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.VotingStartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingEndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.VotingEndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TallyResult) 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 ErrIntOverflowGov - } - 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: TallyResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TallyResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Yes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Yes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Abstain", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Abstain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field No", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.No.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoWithVeto", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.NoWithVeto.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Vote) 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 ErrIntOverflowGov - } - 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: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Options = append(m.Options, WeightedVoteOption{}) - if err := m.Options[len(m.Options)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DepositParams) 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 ErrIntOverflowGov - } - 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: DepositParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DepositParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinDeposit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MinDeposit = append(m.MinDeposit, types.Coin{}) - if err := m.MinDeposit[len(m.MinDeposit)-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 MaxDepositPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.MaxDepositPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *VotingParams) 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 ErrIntOverflowGov - } - 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: VotingParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VotingParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPeriod", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.VotingPeriod, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TallyParams) 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 ErrIntOverflowGov - } - 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: TallyParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TallyParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Quorum.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Threshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VetoThreshold", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VetoThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGov(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, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrIntOverflowGov - } - 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, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go deleted file mode 100644 index 39597345ced4..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.go +++ /dev/null @@ -1,3866 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/query.proto - -package v1beta1 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "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 - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -type QueryProposalRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *QueryProposalRequest) Reset() { *m = QueryProposalRequest{} } -func (m *QueryProposalRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProposalRequest) ProtoMessage() {} -func (*QueryProposalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{0} -} -func (m *QueryProposalRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalRequest.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 *QueryProposalRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalRequest.Merge(m, src) -} -func (m *QueryProposalRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalRequest proto.InternalMessageInfo - -func (m *QueryProposalRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -type QueryProposalResponse struct { - Proposal Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` -} - -func (m *QueryProposalResponse) Reset() { *m = QueryProposalResponse{} } -func (m *QueryProposalResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProposalResponse) ProtoMessage() {} -func (*QueryProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{1} -} -func (m *QueryProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalResponse.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 *QueryProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalResponse.Merge(m, src) -} -func (m *QueryProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalResponse proto.InternalMessageInfo - -func (m *QueryProposalResponse) GetProposal() Proposal { - if m != nil { - return m.Proposal - } - return Proposal{} -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -type QueryProposalsRequest struct { - // proposal_status defines the status of the proposals. - ProposalStatus ProposalStatus `protobuf:"varint,1,opt,name=proposal_status,json=proposalStatus,proto3,enum=cosmos.gov.v1beta1.ProposalStatus" json:"proposal_status,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,3,opt,name=depositor,proto3" json:"depositor,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,4,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryProposalsRequest) Reset() { *m = QueryProposalsRequest{} } -func (m *QueryProposalsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryProposalsRequest) ProtoMessage() {} -func (*QueryProposalsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{2} -} -func (m *QueryProposalsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalsRequest.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 *QueryProposalsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalsRequest.Merge(m, src) -} -func (m *QueryProposalsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalsRequest proto.InternalMessageInfo - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -type QueryProposalsResponse struct { - // proposals defines all the requested governance proposals. - Proposals []Proposal `protobuf:"bytes,1,rep,name=proposals,proto3" json:"proposals"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryProposalsResponse) Reset() { *m = QueryProposalsResponse{} } -func (m *QueryProposalsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryProposalsResponse) ProtoMessage() {} -func (*QueryProposalsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{3} -} -func (m *QueryProposalsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryProposalsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryProposalsResponse.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 *QueryProposalsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryProposalsResponse.Merge(m, src) -} -func (m *QueryProposalsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryProposalsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryProposalsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryProposalsResponse proto.InternalMessageInfo - -func (m *QueryProposalsResponse) GetProposals() []Proposal { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *QueryProposalsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -type QueryVoteRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter defines the voter address for the proposals. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` -} - -func (m *QueryVoteRequest) Reset() { *m = QueryVoteRequest{} } -func (m *QueryVoteRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVoteRequest) ProtoMessage() {} -func (*QueryVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{4} -} -func (m *QueryVoteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVoteRequest.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 *QueryVoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVoteRequest.Merge(m, src) -} -func (m *QueryVoteRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVoteRequest proto.InternalMessageInfo - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -type QueryVoteResponse struct { - // vote defines the queried vote. - Vote Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` -} - -func (m *QueryVoteResponse) Reset() { *m = QueryVoteResponse{} } -func (m *QueryVoteResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVoteResponse) ProtoMessage() {} -func (*QueryVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{5} -} -func (m *QueryVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVoteResponse.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 *QueryVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVoteResponse.Merge(m, src) -} -func (m *QueryVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVoteResponse proto.InternalMessageInfo - -func (m *QueryVoteResponse) GetVote() Vote { - if m != nil { - return m.Vote - } - return Vote{} -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -type QueryVotesRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVotesRequest) Reset() { *m = QueryVotesRequest{} } -func (m *QueryVotesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryVotesRequest) ProtoMessage() {} -func (*QueryVotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{6} -} -func (m *QueryVotesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVotesRequest.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 *QueryVotesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVotesRequest.Merge(m, src) -} -func (m *QueryVotesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryVotesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVotesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVotesRequest proto.InternalMessageInfo - -func (m *QueryVotesRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryVotesRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -type QueryVotesResponse struct { - // votes defines the queried votes. - Votes []Vote `protobuf:"bytes,1,rep,name=votes,proto3" json:"votes"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryVotesResponse) Reset() { *m = QueryVotesResponse{} } -func (m *QueryVotesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryVotesResponse) ProtoMessage() {} -func (*QueryVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{7} -} -func (m *QueryVotesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryVotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryVotesResponse.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 *QueryVotesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryVotesResponse.Merge(m, src) -} -func (m *QueryVotesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryVotesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryVotesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryVotesResponse proto.InternalMessageInfo - -func (m *QueryVotesResponse) GetVotes() []Vote { - if m != nil { - return m.Votes - } - return nil -} - -func (m *QueryVotesResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -type QueryParamsRequest struct { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - ParamsType string `protobuf:"bytes,1,opt,name=params_type,json=paramsType,proto3" json:"params_type,omitempty"` -} - -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_e35c0d133e91c0a2, []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 - -func (m *QueryParamsRequest) GetParamsType() string { - if m != nil { - return m.ParamsType - } - return "" -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // voting_params defines the parameters related to voting. - VotingParams VotingParams `protobuf:"bytes,1,opt,name=voting_params,json=votingParams,proto3" json:"voting_params"` - // deposit_params defines the parameters related to deposit. - DepositParams DepositParams `protobuf:"bytes,2,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params"` - // tally_params defines the parameters related to tally. - TallyParams TallyParams `protobuf:"bytes,3,opt,name=tally_params,json=tallyParams,proto3" json:"tally_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_e35c0d133e91c0a2, []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) GetVotingParams() VotingParams { - if m != nil { - return m.VotingParams - } - return VotingParams{} -} - -func (m *QueryParamsResponse) GetDepositParams() DepositParams { - if m != nil { - return m.DepositParams - } - return DepositParams{} -} - -func (m *QueryParamsResponse) GetTallyParams() TallyParams { - if m != nil { - return m.TallyParams - } - return TallyParams{} -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -type QueryDepositRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` -} - -func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } -func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDepositRequest) ProtoMessage() {} -func (*QueryDepositRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{10} -} -func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositRequest.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 *QueryDepositRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositRequest.Merge(m, src) -} -func (m *QueryDepositRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -type QueryDepositResponse struct { - // deposit defines the requested deposit. - Deposit Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit"` -} - -func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } -func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDepositResponse) ProtoMessage() {} -func (*QueryDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{11} -} -func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositResponse.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 *QueryDepositResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositResponse.Merge(m, src) -} -func (m *QueryDepositResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo - -func (m *QueryDepositResponse) GetDeposit() Deposit { - if m != nil { - return m.Deposit - } - return Deposit{} -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -type QueryDepositsRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDepositsRequest) Reset() { *m = QueryDepositsRequest{} } -func (m *QueryDepositsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryDepositsRequest) ProtoMessage() {} -func (*QueryDepositsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{12} -} -func (m *QueryDepositsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositsRequest.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 *QueryDepositsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositsRequest.Merge(m, src) -} -func (m *QueryDepositsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositsRequest proto.InternalMessageInfo - -func (m *QueryDepositsRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *QueryDepositsRequest) GetPagination() *query.PageRequest { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -type QueryDepositsResponse struct { - // deposits defines the requested deposits. - Deposits []Deposit `protobuf:"bytes,1,rep,name=deposits,proto3" json:"deposits"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDepositsResponse) Reset() { *m = QueryDepositsResponse{} } -func (m *QueryDepositsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryDepositsResponse) ProtoMessage() {} -func (*QueryDepositsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{13} -} -func (m *QueryDepositsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDepositsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDepositsResponse.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 *QueryDepositsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDepositsResponse.Merge(m, src) -} -func (m *QueryDepositsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryDepositsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDepositsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDepositsResponse proto.InternalMessageInfo - -func (m *QueryDepositsResponse) GetDeposits() []Deposit { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *QueryDepositsResponse) GetPagination() *query.PageResponse { - if m != nil { - return m.Pagination - } - return nil -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -type QueryTallyResultRequest struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *QueryTallyResultRequest) Reset() { *m = QueryTallyResultRequest{} } -func (m *QueryTallyResultRequest) String() string { return proto.CompactTextString(m) } -func (*QueryTallyResultRequest) ProtoMessage() {} -func (*QueryTallyResultRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{14} -} -func (m *QueryTallyResultRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTallyResultRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTallyResultRequest.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 *QueryTallyResultRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTallyResultRequest.Merge(m, src) -} -func (m *QueryTallyResultRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryTallyResultRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTallyResultRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTallyResultRequest proto.InternalMessageInfo - -func (m *QueryTallyResultRequest) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -type QueryTallyResultResponse struct { - // tally defines the requested tally. - Tally TallyResult `protobuf:"bytes,1,opt,name=tally,proto3" json:"tally"` -} - -func (m *QueryTallyResultResponse) Reset() { *m = QueryTallyResultResponse{} } -func (m *QueryTallyResultResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTallyResultResponse) ProtoMessage() {} -func (*QueryTallyResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e35c0d133e91c0a2, []int{15} -} -func (m *QueryTallyResultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTallyResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTallyResultResponse.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 *QueryTallyResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTallyResultResponse.Merge(m, src) -} -func (m *QueryTallyResultResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTallyResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTallyResultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTallyResultResponse proto.InternalMessageInfo - -func (m *QueryTallyResultResponse) GetTally() TallyResult { - if m != nil { - return m.Tally - } - return TallyResult{} -} - -func init() { - proto.RegisterType((*QueryProposalRequest)(nil), "cosmos.gov.v1beta1.QueryProposalRequest") - proto.RegisterType((*QueryProposalResponse)(nil), "cosmos.gov.v1beta1.QueryProposalResponse") - proto.RegisterType((*QueryProposalsRequest)(nil), "cosmos.gov.v1beta1.QueryProposalsRequest") - proto.RegisterType((*QueryProposalsResponse)(nil), "cosmos.gov.v1beta1.QueryProposalsResponse") - proto.RegisterType((*QueryVoteRequest)(nil), "cosmos.gov.v1beta1.QueryVoteRequest") - proto.RegisterType((*QueryVoteResponse)(nil), "cosmos.gov.v1beta1.QueryVoteResponse") - proto.RegisterType((*QueryVotesRequest)(nil), "cosmos.gov.v1beta1.QueryVotesRequest") - proto.RegisterType((*QueryVotesResponse)(nil), "cosmos.gov.v1beta1.QueryVotesResponse") - proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.gov.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.gov.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryDepositRequest)(nil), "cosmos.gov.v1beta1.QueryDepositRequest") - proto.RegisterType((*QueryDepositResponse)(nil), "cosmos.gov.v1beta1.QueryDepositResponse") - proto.RegisterType((*QueryDepositsRequest)(nil), "cosmos.gov.v1beta1.QueryDepositsRequest") - proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1beta1.QueryDepositsResponse") - proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1beta1.QueryTallyResultRequest") - proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1beta1.QueryTallyResultResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/query.proto", fileDescriptor_e35c0d133e91c0a2) } - -var fileDescriptor_e35c0d133e91c0a2 = []byte{ - // 1014 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0x38, 0x49, 0x6b, 0xbf, 0xb4, 0x81, 0x3e, 0x02, 0x18, 0x53, 0xec, 0xb0, 0xa2, 0xad, - 0x49, 0x89, 0xb7, 0x49, 0xa0, 0x55, 0x0a, 0x87, 0xd6, 0x40, 0xf9, 0x96, 0x82, 0x53, 0x21, 0x84, - 0x90, 0xa2, 0x4d, 0xbd, 0x5a, 0x56, 0xd8, 0x3b, 0xdb, 0x9d, 0xb1, 0xd5, 0x28, 0x44, 0x48, 0x9c, - 0x40, 0xbd, 0x80, 0x40, 0x88, 0x0b, 0xa8, 0x12, 0x08, 0xf5, 0xc8, 0x81, 0x3f, 0xa2, 0xc7, 0x0a, - 0x38, 0x70, 0x42, 0x28, 0x41, 0x82, 0x3f, 0x03, 0xed, 0x7c, 0xac, 0x77, 0xe3, 0x75, 0x76, 0x5d, - 0x2a, 0x2e, 0x89, 0x33, 0xf3, 0xfb, 0xbd, 0xf7, 0x7b, 0x1f, 0xf3, 0x9e, 0x03, 0xb5, 0x6b, 0x94, - 0xf5, 0x28, 0x33, 0x1d, 0x3a, 0x30, 0x07, 0xcb, 0x5b, 0x36, 0xb7, 0x96, 0xcd, 0xeb, 0x7d, 0x3b, - 0xd8, 0x6e, 0xfa, 0x01, 0xe5, 0x14, 0x51, 0xde, 0x37, 0x1d, 0x3a, 0x68, 0xaa, 0xfb, 0xea, 0xa2, - 0xe2, 0x6c, 0x59, 0xcc, 0x96, 0xe0, 0x88, 0xea, 0x5b, 0x8e, 0xeb, 0x59, 0xdc, 0xa5, 0x9e, 0xe4, - 0x57, 0xe7, 0x1d, 0xea, 0x50, 0xf1, 0xd1, 0x0c, 0x3f, 0xa9, 0xd3, 0x93, 0x0e, 0xa5, 0x4e, 0xd7, - 0x36, 0x2d, 0xdf, 0x35, 0x2d, 0xcf, 0xa3, 0x5c, 0x50, 0x98, 0xbe, 0x4d, 0xd1, 0x14, 0xfa, 0x97, - 0xb7, 0x8f, 0xc9, 0xdb, 0x4d, 0x69, 0x54, 0xc9, 0x93, 0x57, 0x27, 0xac, 0x9e, 0xeb, 0x51, 0x53, - 0xfc, 0x94, 0x47, 0xc6, 0x05, 0x98, 0x7f, 0x3b, 0x54, 0xb8, 0x1e, 0x50, 0x9f, 0x32, 0xab, 0xdb, - 0xb6, 0xaf, 0xf7, 0x6d, 0xc6, 0xb1, 0x0e, 0xb3, 0xbe, 0x3a, 0xda, 0x74, 0x3b, 0x15, 0xb2, 0x40, - 0x1a, 0xd3, 0x6d, 0xd0, 0x47, 0xaf, 0x75, 0x8c, 0xf7, 0xe1, 0xe1, 0x03, 0x44, 0xe6, 0x53, 0x8f, - 0xd9, 0xf8, 0x22, 0x94, 0x34, 0x4c, 0xd0, 0x66, 0x57, 0x4e, 0x36, 0x47, 0x93, 0xd4, 0xd4, 0xbc, - 0x56, 0xf9, 0xce, 0x1f, 0xf5, 0xc2, 0xed, 0xbf, 0x7f, 0x5a, 0x24, 0xed, 0x88, 0x68, 0x7c, 0x57, - 0x3c, 0x60, 0x9e, 0x69, 0x61, 0x6f, 0xc0, 0x03, 0x91, 0x30, 0xc6, 0x2d, 0xde, 0x67, 0xc2, 0xcb, - 0xdc, 0x8a, 0x71, 0x98, 0x97, 0x0d, 0x81, 0x6c, 0xcf, 0xf9, 0x89, 0xbf, 0xb1, 0x09, 0x33, 0x03, - 0xca, 0xed, 0xa0, 0x52, 0x5c, 0x20, 0x8d, 0x72, 0xab, 0xf2, 0xcb, 0xcf, 0x4b, 0xf3, 0xca, 0xca, - 0xe5, 0x4e, 0x27, 0xb0, 0x19, 0xdb, 0xe0, 0x81, 0xeb, 0x39, 0x6d, 0x09, 0xc3, 0xf3, 0x50, 0xee, - 0xd8, 0x3e, 0x65, 0x2e, 0xa7, 0x41, 0x65, 0x2a, 0x83, 0x33, 0x84, 0xe2, 0x15, 0x80, 0x61, 0xe5, - 0x2b, 0xd3, 0x22, 0x2b, 0xa7, 0xb5, 0xde, 0xb0, 0x4d, 0x9a, 0xb2, 0xa7, 0x22, 0xd9, 0x96, 0x63, - 0xab, 0x80, 0xdb, 0x31, 0xe6, 0xc5, 0xd2, 0xa7, 0xb7, 0xea, 0x85, 0x7f, 0x6e, 0xd5, 0x0b, 0xc6, - 0x6d, 0x02, 0x8f, 0x1c, 0x4c, 0x90, 0x2a, 0xc0, 0xcb, 0x50, 0xd6, 0x61, 0x86, 0xb9, 0x99, 0x9a, - 0xa4, 0x02, 0x43, 0x26, 0xbe, 0x92, 0xd0, 0x5c, 0x14, 0x9a, 0xcf, 0x64, 0x6a, 0x96, 0x1a, 0xe2, - 0xa2, 0x8d, 0x1e, 0x3c, 0x28, 0x94, 0xbe, 0x43, 0xb9, 0x9d, 0xb7, 0xbd, 0x26, 0xad, 0x4c, 0x2c, - 0x33, 0x6f, 0xc2, 0x89, 0x98, 0x3b, 0x95, 0x93, 0x0b, 0x30, 0x1d, 0xe2, 0x54, 0x43, 0x56, 0xd2, - 0xd2, 0x11, 0xe2, 0xe3, 0xa9, 0x10, 0x04, 0xe3, 0xa3, 0x98, 0x35, 0x96, 0x5b, 0xfd, 0x95, 0x94, - 0xdc, 0xdd, 0x43, 0xbd, 0x8d, 0x6f, 0x08, 0x60, 0xdc, 0xbd, 0x8a, 0x66, 0x4d, 0x26, 0x47, 0x57, - 0x37, 0x57, 0x38, 0x92, 0x71, 0xff, 0xaa, 0xfa, 0x9c, 0x52, 0xb6, 0x6e, 0x05, 0x56, 0x2f, 0x91, - 0x19, 0x71, 0xb0, 0xc9, 0xb7, 0x7d, 0x99, 0xee, 0x72, 0x48, 0x0b, 0x8f, 0xae, 0x6e, 0xfb, 0xb6, - 0x71, 0xb3, 0x08, 0x0f, 0x25, 0x78, 0x2a, 0xa4, 0x75, 0x38, 0x3e, 0xa0, 0xdc, 0xf5, 0x9c, 0x4d, - 0x09, 0x56, 0x95, 0x5a, 0x18, 0x13, 0x9a, 0xeb, 0x39, 0xd2, 0x40, 0x3c, 0xc4, 0x63, 0x83, 0xd8, - 0x05, 0x6e, 0xc0, 0x9c, 0x7a, 0x80, 0xda, 0xa4, 0x8c, 0xf6, 0xc9, 0x34, 0x93, 0x2f, 0x49, 0xe4, - 0xa8, 0xcd, 0xe3, 0x9d, 0xf8, 0x0d, 0xbe, 0x05, 0xc7, 0xb8, 0xd5, 0xed, 0x6e, 0x6b, 0x93, 0x53, - 0xc2, 0x64, 0x3d, 0xcd, 0xe4, 0xd5, 0x10, 0x37, 0x6a, 0x70, 0x96, 0x0f, 0xcf, 0x8d, 0x1b, 0x2a, - 0x19, 0xca, 0x7d, 0xee, 0xfe, 0x4a, 0xcc, 0xa1, 0x62, 0xee, 0x39, 0x14, 0x7b, 0x25, 0xef, 0xaa, - 0xb9, 0x1f, 0x79, 0x56, 0x75, 0xb8, 0x04, 0x47, 0x15, 0x5c, 0x55, 0xe0, 0xf1, 0x43, 0xd2, 0x15, - 0x8f, 0x4b, 0xd3, 0x8c, 0x8f, 0x93, 0x96, 0xff, 0xff, 0x47, 0xf3, 0x03, 0x51, 0xbb, 0x63, 0xa8, - 0x40, 0x05, 0xd7, 0x82, 0x92, 0x52, 0xa9, 0x9f, 0x4e, 0xde, 0xe8, 0x22, 0xde, 0xfd, 0x7b, 0x40, - 0x17, 0xe1, 0x51, 0xa1, 0x52, 0xf4, 0x49, 0xdb, 0x66, 0xfd, 0x2e, 0x9f, 0x60, 0xf9, 0x56, 0x46, - 0xb9, 0x51, 0x05, 0x67, 0x44, 0x8b, 0xa9, 0xfa, 0x8d, 0xef, 0x4d, 0xc9, 0x4b, 0xcc, 0x08, 0x41, - 0x5c, 0xf9, 0xad, 0x0c, 0x33, 0xc2, 0x3c, 0x7e, 0x45, 0xa0, 0xa4, 0xd7, 0x04, 0x36, 0xd2, 0x2c, - 0xa5, 0x7d, 0x79, 0xa8, 0x3e, 0x9d, 0x03, 0x29, 0xd5, 0x1a, 0xab, 0x9f, 0xfc, 0xfa, 0xd7, 0x97, - 0xc5, 0x25, 0x3c, 0x6b, 0xa6, 0x7c, 0xa9, 0x89, 0x96, 0x91, 0xb9, 0x13, 0xcb, 0xc7, 0x2e, 0x7e, - 0x46, 0xa0, 0x1c, 0xed, 0x3d, 0xcc, 0xf6, 0xa6, 0x7b, 0xb0, 0xba, 0x98, 0x07, 0xaa, 0x94, 0x9d, - 0x12, 0xca, 0xea, 0xf8, 0xc4, 0xa1, 0xca, 0xf0, 0x6b, 0x02, 0xd3, 0xe1, 0xac, 0xc5, 0xa7, 0xc6, - 0xda, 0x8e, 0x2d, 0xbe, 0xea, 0xa9, 0x0c, 0x94, 0x72, 0x7e, 0x59, 0x38, 0x7f, 0x1e, 0xd7, 0x26, - 0x48, 0x8b, 0x29, 0x26, 0xbc, 0xb9, 0x23, 0x16, 0xe2, 0x2e, 0x7e, 0x41, 0x60, 0x46, 0xac, 0x0d, - 0x3c, 0xdc, 0x67, 0x94, 0x9c, 0xd3, 0x59, 0x30, 0xa5, 0x6d, 0x4d, 0x68, 0x5b, 0xc5, 0xe5, 0x89, - 0xb5, 0xe1, 0x4d, 0x02, 0x47, 0xd4, 0x24, 0x1d, 0xef, 0x2d, 0xb1, 0x51, 0xaa, 0x67, 0x32, 0x71, - 0x4a, 0xd6, 0x39, 0x21, 0x6b, 0x11, 0x1b, 0xa9, 0xb2, 0x04, 0xd6, 0xdc, 0x89, 0x2d, 0xa7, 0x5d, - 0xfc, 0x91, 0xc0, 0x51, 0xf5, 0xd6, 0x71, 0xbc, 0x9b, 0xe4, 0x6c, 0xae, 0x36, 0xb2, 0x81, 0x4a, - 0xd0, 0xab, 0x42, 0x50, 0x0b, 0x2f, 0x4d, 0x92, 0x27, 0x3d, 0x67, 0xcc, 0x9d, 0x68, 0x6a, 0xef, - 0xe2, 0xb7, 0x04, 0x4a, 0x7a, 0x98, 0x61, 0xa6, 0x00, 0x96, 0xfd, 0x0c, 0x0f, 0x4e, 0x46, 0xe3, - 0x05, 0xa1, 0xf5, 0x3c, 0x3e, 0x7b, 0x2f, 0x5a, 0xf1, 0x7b, 0x02, 0xb3, 0xb1, 0x91, 0x82, 0x67, - 0xc7, 0x3a, 0x1e, 0x1d, 0x76, 0xd5, 0x67, 0xf2, 0x81, 0xff, 0x4b, 0xf3, 0x89, 0xb1, 0xd6, 0x7a, - 0xfd, 0xce, 0x5e, 0x8d, 0xdc, 0xdd, 0xab, 0x91, 0x3f, 0xf7, 0x6a, 0xe4, 0xf3, 0xfd, 0x5a, 0xe1, - 0xee, 0x7e, 0xad, 0xf0, 0xfb, 0x7e, 0xad, 0xf0, 0xde, 0x39, 0xc7, 0xe5, 0x1f, 0xf4, 0xb7, 0x9a, - 0xd7, 0x68, 0x4f, 0x9b, 0x95, 0xbf, 0x96, 0x58, 0xe7, 0x43, 0xf3, 0x86, 0xf0, 0x11, 0xb6, 0x0c, - 0xd3, 0x9e, 0xb6, 0x8e, 0x88, 0xff, 0x9e, 0x56, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x10, 0xb6, - 0xa8, 0x92, 0x1f, 0x0e, 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 { - // Proposal queries proposal details based on ProposalID. - Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Proposal(ctx context.Context, in *QueryProposalRequest, opts ...grpc.CallOption) (*QueryProposalResponse, error) { - out := new(QueryProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Proposals(ctx context.Context, in *QueryProposalsRequest, opts ...grpc.CallOption) (*QueryProposalsResponse, error) { - out := new(QueryProposalsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Proposals", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) { - out := new(QueryVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) { - out := new(QueryVotesResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Votes", 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, "/cosmos.gov.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { - out := new(QueryDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) { - out := new(QueryDepositsResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/Deposits", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) { - out := new(QueryTallyResultResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Query/TallyResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Proposal queries proposal details based on ProposalID. - Proposal(context.Context, *QueryProposalRequest) (*QueryProposalResponse, error) - // Proposals queries all proposals based on given status. - Proposals(context.Context, *QueryProposalsRequest) (*QueryProposalsResponse, error) - // Vote queries voted information based on proposalID, voterAddr. - Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) - // Votes queries votes of a given proposal. - Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) - // Params queries all parameters of the gov module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - // Deposit queries single deposit information based proposalID, depositAddr. - Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) - // Deposits queries all deposits of a single proposal. - Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) - // TallyResult queries the tally of a proposal vote. - TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Proposal(ctx context.Context, req *QueryProposalRequest) (*QueryProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposal not implemented") -} -func (*UnimplementedQueryServer) Proposals(ctx context.Context, req *QueryProposalsRequest) (*QueryProposalsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Proposals not implemented") -} -func (*UnimplementedQueryServer) Vote(ctx context.Context, req *QueryVoteRequest) (*QueryVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") -} -func (*UnimplementedQueryServer) Votes(ctx context.Context, req *QueryVotesRequest) (*QueryVotesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Votes not implemented") -} -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} -func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") -} -func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDepositsRequest) (*QueryDepositsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposits not implemented") -} -func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Proposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Proposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposal(ctx, req.(*QueryProposalRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Proposals_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryProposalsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Proposals(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Proposals", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Proposals(ctx, req.(*QueryProposalsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVoteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Vote(ctx, req.(*QueryVoteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Votes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryVotesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Votes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Votes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Votes(ctx, req.(*QueryVotesRequest)) - } - 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: "/cosmos.gov.v1beta1.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_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Deposits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDepositsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Deposits(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/Deposits", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Deposits(ctx, req.(*QueryDepositsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTallyResultRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).TallyResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Query/TallyResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TallyResult(ctx, req.(*QueryTallyResultRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Proposal", - Handler: _Query_Proposal_Handler, - }, - { - MethodName: "Proposals", - Handler: _Query_Proposals_Handler, - }, - { - MethodName: "Vote", - Handler: _Query_Vote_Handler, - }, - { - MethodName: "Votes", - Handler: _Query_Votes_Handler, - }, - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "Deposit", - Handler: _Query_Deposit_Handler, - }, - { - MethodName: "Deposits", - Handler: _Query_Deposits_Handler, - }, - { - MethodName: "TallyResult", - Handler: _Query_TallyResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1beta1/query.proto", -} - -func (m *QueryProposalRequest) 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 *QueryProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryProposalResponse) 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 *QueryProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proposal.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 *QueryProposalsRequest) 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 *QueryProposalsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalsRequest) 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] = 0x22 - } - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x1a - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalStatus != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalStatus)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryProposalsResponse) 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 *QueryProposalsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryProposalsResponse) 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.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[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 *QueryVoteRequest) 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 *QueryVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryVoteResponse) 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 *QueryVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Vote.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 *QueryVotesRequest) 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 *QueryVotesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVotesRequest) 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 m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryVotesResponse) 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 *QueryVotesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryVotesResponse) 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.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[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 *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 - if len(m.ParamsType) > 0 { - i -= len(m.ParamsType) - copy(dAtA[i:], m.ParamsType) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ParamsType))) - i-- - dAtA[i] = 0xa - } - 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.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.VotingParams.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 *QueryDepositRequest) 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 *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDepositResponse) 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 *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Deposit.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 *QueryDepositsRequest) 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 *QueryDepositsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositsRequest) 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 m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryDepositsResponse) 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 *QueryDepositsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDepositsResponse) 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.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[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 *QueryTallyResultRequest) 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 *QueryTallyResultRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTallyResultRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryTallyResultResponse) 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 *QueryTallyResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Tally.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 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 *QueryProposalRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - return n -} - -func (m *QueryProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proposal.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryProposalsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalStatus != 0 { - n += 1 + sovQuery(uint64(m.ProposalStatus)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryProposalsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - 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 *QueryVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Vote.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryVotesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryVotesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Votes) > 0 { - for _, e := range m.Votes { - 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 *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ParamsType) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.VotingParams.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.DepositParams.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.TallyParams.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDepositRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - l = len(m.Depositor) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Deposit.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryDepositsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryDepositsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - 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 *QueryTallyResultRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovQuery(uint64(m.ProposalId)) - } - return n -} - -func (m *QueryTallyResultResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Tally.Size() - n += 1 + l + sovQuery(uint64(l)) - 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 *QueryProposalRequest) 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: QueryProposalRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalResponse) 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: QueryProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", 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.Proposal.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalsRequest) 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: QueryProposalsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalStatus", wireType) - } - m.ProposalStatus = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalStatus |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryProposalsResponse) 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: QueryProposalsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryProposalsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", 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.Proposals = append(m.Proposals, Proposal{}) - if err := m.Proposals[len(m.Proposals)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVoteRequest) 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: QueryVoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVoteResponse) 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: QueryVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", 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.Vote.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVotesRequest) 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: QueryVotesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryVotesResponse) 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: QueryVotesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryVotesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", 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.Votes = append(m.Votes, Vote{}) - if err := m.Votes[len(m.Votes)-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) || (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 { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamsType", 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.ParamsType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (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 VotingParams", 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.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", 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.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", 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.TallyParams.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositRequest) 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: QueryDepositRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositResponse) 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: QueryDepositResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposit", 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.Deposit.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositsRequest) 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: QueryDepositsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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.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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryDepositsResponse) 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: QueryDepositsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDepositsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", 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.Deposits = append(m.Deposits, Deposit{}) - if err := m.Deposits[len(m.Deposits)-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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTallyResultRequest) 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: QueryTallyResultRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryTallyResultResponse) 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: QueryTallyResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTallyResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tally", 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.Tally.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) || (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/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go deleted file mode 100644 index 57e602beadfa..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/query.pb.gw.go +++ /dev/null @@ -1,958 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: cosmos/gov/v1beta1/query.proto - -/* -Package v1beta1 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package v1beta1 - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.Proposal(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposal_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.Proposal(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Proposals_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Proposals(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Proposals_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryProposalsRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Proposals_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Proposals(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := client.Vote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Vote_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVoteRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["voter"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "voter") - } - - protoReq.Voter, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "voter", err) - } - - msg, err := server.Vote(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Votes_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Votes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Votes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryVotesRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Votes_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Votes(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["params_type"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "params_type") - } - - protoReq.ParamsType, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "params_type", err) - } - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - val, ok = pathParams["depositor"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "depositor") - } - - protoReq.Depositor, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "depositor", err) - } - - msg, err := server.Deposit(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Deposits_0 = &utilities.DoubleArray{Encoding: map[string]int{"proposal_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Deposits(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Deposits_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDepositsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Deposits_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Deposits(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := client.TallyResult(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTallyResultRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["proposal_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") - } - - protoReq.ProposalId, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) - } - - msg, err := server.TallyResult(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposal_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Proposals_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Vote_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Votes_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Deposits_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_TallyResult_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Proposal_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposal_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposal_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Proposals_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Proposals_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Proposals_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Vote_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Vote_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Vote_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Votes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Votes_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Votes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposit_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Deposits_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Deposits_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Deposits_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_TallyResult_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_TallyResult_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_TallyResult_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Proposal_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Proposals_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "gov", "v1beta1", "proposals"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Vote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "votes", "voter"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Votes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "votes"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "gov", "v1beta1", "params", "params_type"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "deposits", "depositor"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1beta1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Proposal_0 = runtime.ForwardResponseMessage - - forward_Query_Proposals_0 = runtime.ForwardResponseMessage - - forward_Query_Vote_0 = runtime.ForwardResponseMessage - - forward_Query_Votes_0 = runtime.ForwardResponseMessage - - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Deposit_0 = runtime.ForwardResponseMessage - - forward_Query_Deposits_0 = runtime.ForwardResponseMessage - - forward_Query_TallyResult_0 = runtime.ForwardResponseMessage -) diff --git a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go b/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go deleted file mode 100644 index bba3fa870ee2..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1/tx.pb.go +++ /dev/null @@ -1,1908 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/gov/v1beta1/tx.proto - -package v1beta1 - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/cosmos/cosmos-sdk/types" - _ "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 - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -type MsgSubmitProposal struct { - // content is the proposal's content. - Content *types.Any `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` - // initial_deposit is the deposit value that must be paid at proposal submission. - InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` - // proposer is the account address of the proposer. - Proposer string `protobuf:"bytes,3,opt,name=proposer,proto3" json:"proposer,omitempty"` -} - -func (m *MsgSubmitProposal) Reset() { *m = MsgSubmitProposal{} } -func (*MsgSubmitProposal) ProtoMessage() {} -func (*MsgSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{0} -} -func (m *MsgSubmitProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposal.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 *MsgSubmitProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposal.Merge(m, src) -} -func (m *MsgSubmitProposal) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposal) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -type MsgSubmitProposalResponse struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` -} - -func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } -func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitProposalResponse) ProtoMessage() {} -func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{1} -} -func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) -} -func (m *MsgSubmitProposalResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo - -func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// MsgVote defines a message to cast a vote. -type MsgVote struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // option defines the vote option. - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` -} - -func (m *MsgVote) Reset() { *m = MsgVote{} } -func (*MsgVote) ProtoMessage() {} -func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{2} -} -func (m *MsgVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVote.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 *MsgVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVote.Merge(m, src) -} -func (m *MsgVote) XXX_Size() int { - return m.Size() -} -func (m *MsgVote) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVote.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVote proto.InternalMessageInfo - -// MsgVoteResponse defines the Msg/Vote response type. -type MsgVoteResponse struct { -} - -func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } -func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteResponse) ProtoMessage() {} -func (*MsgVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{3} -} -func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteResponse.Merge(m, src) -} -func (m *MsgVoteResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -type MsgVoteWeighted struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - // voter is the voter address for the proposal. - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // options defines the weighted vote options. - Options []WeightedVoteOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options"` -} - -func (m *MsgVoteWeighted) Reset() { *m = MsgVoteWeighted{} } -func (*MsgVoteWeighted) ProtoMessage() {} -func (*MsgVoteWeighted) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{4} -} -func (m *MsgVoteWeighted) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeighted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeighted.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 *MsgVoteWeighted) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeighted.Merge(m, src) -} -func (m *MsgVoteWeighted) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeighted) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeighted.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeighted proto.InternalMessageInfo - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -type MsgVoteWeightedResponse struct { -} - -func (m *MsgVoteWeightedResponse) Reset() { *m = MsgVoteWeightedResponse{} } -func (m *MsgVoteWeightedResponse) String() string { return proto.CompactTextString(m) } -func (*MsgVoteWeightedResponse) ProtoMessage() {} -func (*MsgVoteWeightedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{5} -} -func (m *MsgVoteWeightedResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgVoteWeightedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgVoteWeightedResponse.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 *MsgVoteWeightedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgVoteWeightedResponse.Merge(m, src) -} -func (m *MsgVoteWeightedResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgVoteWeightedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgVoteWeightedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgVoteWeightedResponse proto.InternalMessageInfo - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -type MsgDeposit struct { - // proposal_id defines the unique id of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id"` - // depositor defines the deposit addresses from the proposals. - Depositor string `protobuf:"bytes,2,opt,name=depositor,proto3" json:"depositor,omitempty"` - // amount to be deposited by depositor. - Amount 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 *MsgDeposit) Reset() { *m = MsgDeposit{} } -func (*MsgDeposit) ProtoMessage() {} -func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{6} -} -func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDeposit.Merge(m, src) -} -func (m *MsgDeposit) XXX_Size() int { - return m.Size() -} -func (m *MsgDeposit) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDeposit.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo - -// MsgDepositResponse defines the Msg/Deposit response type. -type MsgDepositResponse struct { -} - -func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } -func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } -func (*MsgDepositResponse) ProtoMessage() {} -func (*MsgDepositResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{7} -} -func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgDepositResponse.Merge(m, src) -} -func (m *MsgDepositResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgDepositResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") - proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") - proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") - proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") - proto.RegisterType((*MsgVoteWeighted)(nil), "cosmos.gov.v1beta1.MsgVoteWeighted") - proto.RegisterType((*MsgVoteWeightedResponse)(nil), "cosmos.gov.v1beta1.MsgVoteWeightedResponse") - proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") - proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") -} - -func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } - -var fileDescriptor_3c053992595e3dce = []byte{ - // 743 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x3f, 0x6f, 0xd3, 0x4e, - 0x18, 0xc7, 0xed, 0xa4, 0x6d, 0x7e, 0xbd, 0xfe, 0xd4, 0xaa, 0x56, 0x50, 0x13, 0xb7, 0x72, 0x22, - 0x23, 0xaa, 0xa8, 0x28, 0x36, 0x09, 0xb4, 0x82, 0x0c, 0x48, 0x0d, 0x0c, 0xfc, 0x51, 0xf8, 0x93, - 0x4a, 0x20, 0xb1, 0x14, 0x27, 0xbe, 0x5e, 0x2d, 0x1a, 0x9f, 0x95, 0xbb, 0x44, 0xcd, 0x56, 0x31, - 0x21, 0x26, 0x46, 0x36, 0x3a, 0x22, 0xa6, 0x0e, 0x7d, 0x0b, 0x48, 0x15, 0x53, 0x85, 0x18, 0x18, - 0x50, 0x41, 0xed, 0x50, 0xc4, 0xca, 0x1b, 0x40, 0xf6, 0xdd, 0x39, 0x69, 0xe3, 0xa6, 0xa5, 0x62, - 0x89, 0xed, 0xe7, 0xfb, 0x7c, 0x9f, 0xc7, 0xf7, 0xf1, 0x3d, 0x39, 0x30, 0x5d, 0xc7, 0xa4, 0x81, - 0x89, 0x89, 0x70, 0xdb, 0x6c, 0x17, 0x6a, 0x90, 0x5a, 0x05, 0x93, 0xae, 0x1b, 0x5e, 0x13, 0x53, - 0xac, 0x28, 0x4c, 0x34, 0x10, 0x6e, 0x1b, 0x5c, 0x54, 0x35, 0x6e, 0xa8, 0x59, 0x04, 0x86, 0x8e, - 0x3a, 0x76, 0x5c, 0xe6, 0x51, 0x67, 0x22, 0x0a, 0xfa, 0x7e, 0xa6, 0xa6, 0x99, 0xba, 0x1c, 0x3c, - 0x99, 0xbc, 0x3c, 0x93, 0x92, 0x08, 0x23, 0xcc, 0xe2, 0xfe, 0x9d, 0x30, 0x20, 0x8c, 0xd1, 0x1a, - 0x34, 0x83, 0xa7, 0x5a, 0x6b, 0xc5, 0xb4, 0xdc, 0x0e, 0x97, 0xa6, 0x78, 0xa7, 0x06, 0x41, 0x66, - 0xbb, 0xe0, 0x5f, 0xb8, 0x30, 0x69, 0x35, 0x1c, 0x17, 0x9b, 0xc1, 0x2f, 0x0b, 0xe9, 0x5f, 0x62, - 0x60, 0xb2, 0x42, 0xd0, 0x52, 0xab, 0xd6, 0x70, 0xe8, 0xa3, 0x26, 0xf6, 0x30, 0xb1, 0xd6, 0x94, - 0x07, 0x20, 0x51, 0xc7, 0x2e, 0x85, 0x2e, 0x4d, 0xc9, 0x59, 0x39, 0x37, 0x56, 0x4c, 0x1a, 0xac, - 0x9d, 0x21, 0xda, 0x19, 0x8b, 0x6e, 0xa7, 0xac, 0x7d, 0xda, 0xce, 0xab, 0xfd, 0x28, 0x8c, 0x5b, - 0xcc, 0x5b, 0x15, 0x45, 0x94, 0x0e, 0x98, 0x70, 0x5c, 0x87, 0x3a, 0xd6, 0xda, 0xb2, 0x0d, 0x3d, - 0x4c, 0x1c, 0x9a, 0x8a, 0x65, 0xe3, 0xb9, 0xb1, 0x62, 0xda, 0xe0, 0x76, 0x9f, 0x5a, 0x8f, 0xdf, - 0x71, 0xcb, 0xf3, 0x3b, 0x7b, 0x19, 0xe9, 0xc3, 0xf7, 0x4c, 0x0e, 0x39, 0x74, 0xb5, 0x55, 0x33, - 0xea, 0xb8, 0xc1, 0xb9, 0xf0, 0x4b, 0x9e, 0xd8, 0x2f, 0x4c, 0xda, 0xf1, 0x20, 0x09, 0x0c, 0xe4, - 0xfd, 0xe1, 0xd6, 0x9c, 0x5c, 0x1d, 0xe7, 0x8d, 0x6e, 0xb3, 0x3e, 0xca, 0x35, 0xf0, 0x9f, 0x17, - 0x2c, 0x0b, 0x36, 0x53, 0xf1, 0xac, 0x9c, 0x1b, 0x2d, 0xa7, 0x3e, 0x6f, 0xe7, 0x93, 0xbc, 0xed, - 0xa2, 0x6d, 0x37, 0x21, 0x21, 0x4b, 0xb4, 0xe9, 0xb8, 0xa8, 0x1a, 0x66, 0x96, 0x6e, 0xbe, 0xda, - 0xcc, 0x48, 0x6f, 0x37, 0x33, 0xd2, 0xcf, 0xcd, 0x8c, 0xb4, 0xf1, 0x2d, 0x2b, 0xbd, 0x3c, 0xdc, - 0x9a, 0x0b, 0xe5, 0xd7, 0x87, 0x5b, 0x73, 0x33, 0x3d, 0x2f, 0xd1, 0x07, 0x50, 0xaf, 0x82, 0x74, - 0x5f, 0xb0, 0x0a, 0x89, 0x87, 0x5d, 0x02, 0x95, 0x79, 0x30, 0xe6, 0xf1, 0xd8, 0xb2, 0x63, 0x07, - 0x84, 0x87, 0xca, 0xc9, 0x5f, 0x7b, 0x99, 0xde, 0x30, 0x5b, 0x0d, 0x10, 0x91, 0xbb, 0xb6, 0xfe, - 0x51, 0x06, 0x89, 0x0a, 0x41, 0x4f, 0x30, 0x85, 0x4a, 0x26, 0xa2, 0x44, 0x6f, 0xb2, 0x62, 0x80, - 0xe1, 0x36, 0xa6, 0xb0, 0x99, 0x8a, 0x9d, 0xb2, 0x66, 0x96, 0xa6, 0x2c, 0x80, 0x11, 0xec, 0x51, - 0x07, 0xbb, 0x01, 0xa4, 0xf1, 0xa2, 0x66, 0x44, 0x7c, 0x57, 0xbf, 0xf5, 0xc3, 0x20, 0xab, 0xca, - 0xb3, 0x4b, 0x85, 0x28, 0x50, 0xac, 0xa6, 0x4f, 0x49, 0x39, 0x4a, 0xc9, 0x2f, 0xa0, 0x4f, 0x82, - 0x09, 0x7e, 0x2b, 0x88, 0xe8, 0x1b, 0xb1, 0x30, 0xf6, 0x14, 0x3a, 0x68, 0x95, 0x42, 0xfb, 0x9c, - 0x94, 0xfe, 0x7a, 0xe1, 0xf7, 0x41, 0x82, 0x2d, 0x85, 0xa4, 0xe2, 0xc1, 0x96, 0x9c, 0x8d, 0x5a, - 0xb9, 0x78, 0xab, 0x2e, 0x81, 0xf2, 0xa8, 0xbf, 0x3f, 0x59, 0x7f, 0x51, 0xa1, 0x74, 0x63, 0x30, - 0x0d, 0xb5, 0x9f, 0x86, 0x28, 0xac, 0xa7, 0xc1, 0xd4, 0xb1, 0x50, 0x48, 0xe7, 0x5d, 0x0c, 0x80, - 0x0a, 0x41, 0x62, 0x47, 0x9f, 0x13, 0xcc, 0x02, 0x18, 0xe5, 0xb3, 0x87, 0x4f, 0x87, 0xd3, 0x4d, - 0x55, 0x56, 0xc1, 0x88, 0xd5, 0xc0, 0x2d, 0x97, 0x72, 0x3e, 0xff, 0x7e, 0x64, 0x79, 0xfd, 0xd2, - 0xf5, 0x28, 0x7a, 0xdd, 0x37, 0xf1, 0x09, 0x5e, 0x38, 0x4a, 0x90, 0x23, 0xd1, 0x93, 0x40, 0xe9, - 0x3e, 0x09, 0x6e, 0xc5, 0xdf, 0x31, 0x10, 0xaf, 0x10, 0xa4, 0xac, 0x80, 0xf1, 0x63, 0xff, 0x6f, - 0x97, 0xa2, 0xbe, 0x71, 0xdf, 0xc0, 0xaa, 0xf9, 0x33, 0xa5, 0x85, 0x73, 0x7d, 0x07, 0x0c, 0x05, - 0xc3, 0x39, 0x7d, 0x82, 0xcd, 0x17, 0xd5, 0x8b, 0x03, 0xc4, 0xb0, 0xd2, 0x73, 0xf0, 0xff, 0x91, - 0x59, 0x18, 0x64, 0x12, 0x49, 0xea, 0xe5, 0x33, 0x24, 0x85, 0x1d, 0x1e, 0x83, 0x84, 0xd8, 0x4f, - 0xda, 0x09, 0x3e, 0xae, 0xab, 0xb3, 0x83, 0x75, 0x51, 0x52, 0x1d, 0xde, 0xf0, 0xbf, 0x66, 0xf9, - 0xde, 0xce, 0xbe, 0x26, 0xef, 0xee, 0x6b, 0xf2, 0x8f, 0x7d, 0x4d, 0x7e, 0x73, 0xa0, 0x49, 0xbb, - 0x07, 0x9a, 0xf4, 0xf5, 0x40, 0x93, 0x9e, 0x5d, 0x19, 0xb8, 0x2d, 0xd6, 0x83, 0x93, 0x31, 0xd8, - 0x1c, 0xe2, 0x7c, 0xac, 0x8d, 0x04, 0xc7, 0xcd, 0xd5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2c, - 0x40, 0xe3, 0x51, 0x8d, 0x07, 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 { - // SubmitProposal defines a method to create new proposal given a content. - SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { - out := new(MsgSubmitProposalResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/SubmitProposal", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { - out := new(MsgVoteResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Vote", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) VoteWeighted(ctx context.Context, in *MsgVoteWeighted, opts ...grpc.CallOption) (*MsgVoteWeightedResponse, error) { - out := new(MsgVoteWeightedResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/VoteWeighted", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { - out := new(MsgDepositResponse) - err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Deposit", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // SubmitProposal defines a method to create new proposal given a content. - SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) - // Vote defines a method to add a vote on a specific proposal. - Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - VoteWeighted(context.Context, *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) - // Deposit defines a method to add deposit on a specific proposal. - Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") -} -func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") -} -func (*UnimplementedMsgServer) VoteWeighted(ctx context.Context, req *MsgVoteWeighted) (*MsgVoteWeightedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method VoteWeighted not implemented") -} -func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitProposal) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitProposal(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/SubmitProposal", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVote) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Vote(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/Vote", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_VoteWeighted_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgVoteWeighted) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).VoteWeighted(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/VoteWeighted", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).VoteWeighted(ctx, req.(*MsgVoteWeighted)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDeposit) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Deposit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.gov.v1beta1.Msg/Deposit", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "cosmos.gov.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitProposal", - Handler: _Msg_SubmitProposal_Handler, - }, - { - MethodName: "Vote", - Handler: _Msg_Vote_Handler, - }, - { - MethodName: "VoteWeighted", - Handler: _Msg_VoteWeighted_Handler, - }, - { - MethodName: "Deposit", - Handler: _Msg_Deposit_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "cosmos/gov/v1beta1/tx.proto", -} - -func (m *MsgSubmitProposal) 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 *MsgSubmitProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Proposer) > 0 { - i -= len(m.Proposer) - copy(dAtA[i:], m.Proposer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) - i-- - dAtA[i] = 0x1a - } - if len(m.InitialDeposit) > 0 { - for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Content != nil { - { - size, err := m.Content.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVote) 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 *MsgVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Option != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeighted) 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 *MsgVoteWeighted) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeighted) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Options) > 0 { - for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Options[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.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintTx(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgVoteWeightedResponse) 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 *MsgVoteWeightedResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgVoteWeightedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDeposit) 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.Depositor) > 0 { - i -= len(m.Depositor) - copy(dAtA[i:], m.Depositor) - i = encodeVarintTx(dAtA, i, uint64(len(m.Depositor))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgDepositResponse) 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 *MsgSubmitProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Content != nil { - l = m.Content.Size() - n += 1 + l + sovTx(uint64(l)) - } - if len(m.InitialDeposit) > 0 { - for _, e := range m.InitialDeposit { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.Proposer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - return n -} - -func (m *MsgVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovTx(uint64(m.Option)) - } - return n -} - -func (m *MsgVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgVoteWeighted) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Options) > 0 { - for _, e := range m.Options { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - return n -} - -func (m *MsgVoteWeightedResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgDeposit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovTx(uint64(m.ProposalId)) - } - l = len(m.Depositor) - 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 *MsgDepositResponse) 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 *MsgSubmitProposal) 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: MsgSubmitProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Content", 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 m.Content == nil { - m.Content = &types.Any{} - } - if err := m.Content.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", 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.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) - if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", 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.Proposer = string(dAtA[iNdEx:postIndex]) - 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 *MsgSubmitProposalResponse) 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: MsgSubmitProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(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 *MsgVote) 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: MsgVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= VoteOption(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 *MsgVoteResponse) 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: MsgVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteResponse: 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 *MsgVoteWeighted) 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: MsgVoteWeighted: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeighted: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", 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.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Options", 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.Options = append(m.Options, WeightedVoteOption{}) - if err := m.Options[len(m.Options)-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 *MsgVoteWeightedResponse) 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: MsgVoteWeightedResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgVoteWeightedResponse: 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 *MsgDeposit) 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: MsgDeposit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Depositor", 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.Depositor = 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, types1.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 *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgDepositResponse: 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") -) diff --git a/github.com/cosmos/cosmos-sdk/x/group/events.pb.go b/github.com/cosmos/cosmos-sdk/x/group/events.pb.go deleted file mode 100644 index dc869b695c66..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/group/events.pb.go +++ /dev/null @@ -1,1992 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/group/v1/events.proto - -package group - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// EventCreateGroup is an event emitted when a group is created. -type EventCreateGroup struct { - // group_id is the unique ID of the group. - GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` -} - -func (m *EventCreateGroup) Reset() { *m = EventCreateGroup{} } -func (m *EventCreateGroup) String() string { return proto.CompactTextString(m) } -func (*EventCreateGroup) ProtoMessage() {} -func (*EventCreateGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{0} -} -func (m *EventCreateGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventCreateGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventCreateGroup.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 *EventCreateGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventCreateGroup.Merge(m, src) -} -func (m *EventCreateGroup) XXX_Size() int { - return m.Size() -} -func (m *EventCreateGroup) XXX_DiscardUnknown() { - xxx_messageInfo_EventCreateGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_EventCreateGroup proto.InternalMessageInfo - -func (m *EventCreateGroup) GetGroupId() uint64 { - if m != nil { - return m.GroupId - } - return 0 -} - -// EventUpdateGroup is an event emitted when a group is updated. -type EventUpdateGroup struct { - // group_id is the unique ID of the group. - GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` -} - -func (m *EventUpdateGroup) Reset() { *m = EventUpdateGroup{} } -func (m *EventUpdateGroup) String() string { return proto.CompactTextString(m) } -func (*EventUpdateGroup) ProtoMessage() {} -func (*EventUpdateGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{1} -} -func (m *EventUpdateGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventUpdateGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventUpdateGroup.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 *EventUpdateGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventUpdateGroup.Merge(m, src) -} -func (m *EventUpdateGroup) XXX_Size() int { - return m.Size() -} -func (m *EventUpdateGroup) XXX_DiscardUnknown() { - xxx_messageInfo_EventUpdateGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_EventUpdateGroup proto.InternalMessageInfo - -func (m *EventUpdateGroup) GetGroupId() uint64 { - if m != nil { - return m.GroupId - } - return 0 -} - -// EventCreateGroupPolicy is an event emitted when a group policy is created. -type EventCreateGroupPolicy struct { - // address is the account address of the group policy. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventCreateGroupPolicy) Reset() { *m = EventCreateGroupPolicy{} } -func (m *EventCreateGroupPolicy) String() string { return proto.CompactTextString(m) } -func (*EventCreateGroupPolicy) ProtoMessage() {} -func (*EventCreateGroupPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{2} -} -func (m *EventCreateGroupPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventCreateGroupPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventCreateGroupPolicy.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 *EventCreateGroupPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventCreateGroupPolicy.Merge(m, src) -} -func (m *EventCreateGroupPolicy) XXX_Size() int { - return m.Size() -} -func (m *EventCreateGroupPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_EventCreateGroupPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_EventCreateGroupPolicy proto.InternalMessageInfo - -func (m *EventCreateGroupPolicy) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// EventUpdateGroupPolicy is an event emitted when a group policy is updated. -type EventUpdateGroupPolicy struct { - // address is the account address of the group policy. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventUpdateGroupPolicy) Reset() { *m = EventUpdateGroupPolicy{} } -func (m *EventUpdateGroupPolicy) String() string { return proto.CompactTextString(m) } -func (*EventUpdateGroupPolicy) ProtoMessage() {} -func (*EventUpdateGroupPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{3} -} -func (m *EventUpdateGroupPolicy) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventUpdateGroupPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventUpdateGroupPolicy.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 *EventUpdateGroupPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventUpdateGroupPolicy.Merge(m, src) -} -func (m *EventUpdateGroupPolicy) XXX_Size() int { - return m.Size() -} -func (m *EventUpdateGroupPolicy) XXX_DiscardUnknown() { - xxx_messageInfo_EventUpdateGroupPolicy.DiscardUnknown(m) -} - -var xxx_messageInfo_EventUpdateGroupPolicy proto.InternalMessageInfo - -func (m *EventUpdateGroupPolicy) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// EventSubmitProposal is an event emitted when a proposal is created. -type EventSubmitProposal struct { - // proposal_id is the unique ID of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *EventSubmitProposal) Reset() { *m = EventSubmitProposal{} } -func (m *EventSubmitProposal) String() string { return proto.CompactTextString(m) } -func (*EventSubmitProposal) ProtoMessage() {} -func (*EventSubmitProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{4} -} -func (m *EventSubmitProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventSubmitProposal.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 *EventSubmitProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventSubmitProposal.Merge(m, src) -} -func (m *EventSubmitProposal) XXX_Size() int { - return m.Size() -} -func (m *EventSubmitProposal) XXX_DiscardUnknown() { - xxx_messageInfo_EventSubmitProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_EventSubmitProposal proto.InternalMessageInfo - -func (m *EventSubmitProposal) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// EventWithdrawProposal is an event emitted when a proposal is withdrawn. -type EventWithdrawProposal struct { - // proposal_id is the unique ID of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *EventWithdrawProposal) Reset() { *m = EventWithdrawProposal{} } -func (m *EventWithdrawProposal) String() string { return proto.CompactTextString(m) } -func (*EventWithdrawProposal) ProtoMessage() {} -func (*EventWithdrawProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{5} -} -func (m *EventWithdrawProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventWithdrawProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventWithdrawProposal.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 *EventWithdrawProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventWithdrawProposal.Merge(m, src) -} -func (m *EventWithdrawProposal) XXX_Size() int { - return m.Size() -} -func (m *EventWithdrawProposal) XXX_DiscardUnknown() { - xxx_messageInfo_EventWithdrawProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_EventWithdrawProposal proto.InternalMessageInfo - -func (m *EventWithdrawProposal) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// EventVote is an event emitted when a voter votes on a proposal. -type EventVote struct { - // proposal_id is the unique ID of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` -} - -func (m *EventVote) Reset() { *m = EventVote{} } -func (m *EventVote) String() string { return proto.CompactTextString(m) } -func (*EventVote) ProtoMessage() {} -func (*EventVote) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{6} -} -func (m *EventVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventVote.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 *EventVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventVote.Merge(m, src) -} -func (m *EventVote) XXX_Size() int { - return m.Size() -} -func (m *EventVote) XXX_DiscardUnknown() { - xxx_messageInfo_EventVote.DiscardUnknown(m) -} - -var xxx_messageInfo_EventVote proto.InternalMessageInfo - -func (m *EventVote) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -// EventExec is an event emitted when a proposal is executed. -type EventExec struct { - // proposal_id is the unique ID of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // result is the proposal execution result. - Result ProposalExecutorResult `protobuf:"varint,2,opt,name=result,proto3,enum=cosmos.group.v1.ProposalExecutorResult" json:"result,omitempty"` - // logs contains error logs in case the execution result is FAILURE. - Logs string `protobuf:"bytes,3,opt,name=logs,proto3" json:"logs,omitempty"` -} - -func (m *EventExec) Reset() { *m = EventExec{} } -func (m *EventExec) String() string { return proto.CompactTextString(m) } -func (*EventExec) ProtoMessage() {} -func (*EventExec) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{7} -} -func (m *EventExec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventExec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventExec.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 *EventExec) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventExec.Merge(m, src) -} -func (m *EventExec) XXX_Size() int { - return m.Size() -} -func (m *EventExec) XXX_DiscardUnknown() { - xxx_messageInfo_EventExec.DiscardUnknown(m) -} - -var xxx_messageInfo_EventExec proto.InternalMessageInfo - -func (m *EventExec) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *EventExec) GetResult() ProposalExecutorResult { - if m != nil { - return m.Result - } - return PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED -} - -func (m *EventExec) GetLogs() string { - if m != nil { - return m.Logs - } - return "" -} - -// EventLeaveGroup is an event emitted when group member leaves the group. -type EventLeaveGroup struct { - // group_id is the unique ID of the group. - GroupId uint64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - // address is the account address of the group member. - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *EventLeaveGroup) Reset() { *m = EventLeaveGroup{} } -func (m *EventLeaveGroup) String() string { return proto.CompactTextString(m) } -func (*EventLeaveGroup) ProtoMessage() {} -func (*EventLeaveGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{8} -} -func (m *EventLeaveGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventLeaveGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventLeaveGroup.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 *EventLeaveGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventLeaveGroup.Merge(m, src) -} -func (m *EventLeaveGroup) XXX_Size() int { - return m.Size() -} -func (m *EventLeaveGroup) XXX_DiscardUnknown() { - xxx_messageInfo_EventLeaveGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_EventLeaveGroup proto.InternalMessageInfo - -func (m *EventLeaveGroup) GetGroupId() uint64 { - if m != nil { - return m.GroupId - } - return 0 -} - -func (m *EventLeaveGroup) GetAddress() string { - if m != nil { - return m.Address - } - return "" -} - -// EventProposalPruned is an event emitted when a proposal is pruned. -type EventProposalPruned struct { - // proposal_id is the unique ID of the proposal. - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` - // status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). - Status ProposalStatus `protobuf:"varint,2,opt,name=status,proto3,enum=cosmos.group.v1.ProposalStatus" json:"status,omitempty"` - // tally_result is the proposal tally result (when applicable). - TallyResult *TallyResult `protobuf:"bytes,3,opt,name=tally_result,json=tallyResult,proto3" json:"tally_result,omitempty"` -} - -func (m *EventProposalPruned) Reset() { *m = EventProposalPruned{} } -func (m *EventProposalPruned) String() string { return proto.CompactTextString(m) } -func (*EventProposalPruned) ProtoMessage() {} -func (*EventProposalPruned) Descriptor() ([]byte, []int) { - return fileDescriptor_e8d753981546f032, []int{9} -} -func (m *EventProposalPruned) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventProposalPruned) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventProposalPruned.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 *EventProposalPruned) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventProposalPruned.Merge(m, src) -} -func (m *EventProposalPruned) XXX_Size() int { - return m.Size() -} -func (m *EventProposalPruned) XXX_DiscardUnknown() { - xxx_messageInfo_EventProposalPruned.DiscardUnknown(m) -} - -var xxx_messageInfo_EventProposalPruned proto.InternalMessageInfo - -func (m *EventProposalPruned) GetProposalId() uint64 { - if m != nil { - return m.ProposalId - } - return 0 -} - -func (m *EventProposalPruned) GetStatus() ProposalStatus { - if m != nil { - return m.Status - } - return PROPOSAL_STATUS_UNSPECIFIED -} - -func (m *EventProposalPruned) GetTallyResult() *TallyResult { - if m != nil { - return m.TallyResult - } - return nil -} - -func init() { - proto.RegisterType((*EventCreateGroup)(nil), "cosmos.group.v1.EventCreateGroup") - proto.RegisterType((*EventUpdateGroup)(nil), "cosmos.group.v1.EventUpdateGroup") - proto.RegisterType((*EventCreateGroupPolicy)(nil), "cosmos.group.v1.EventCreateGroupPolicy") - proto.RegisterType((*EventUpdateGroupPolicy)(nil), "cosmos.group.v1.EventUpdateGroupPolicy") - proto.RegisterType((*EventSubmitProposal)(nil), "cosmos.group.v1.EventSubmitProposal") - proto.RegisterType((*EventWithdrawProposal)(nil), "cosmos.group.v1.EventWithdrawProposal") - proto.RegisterType((*EventVote)(nil), "cosmos.group.v1.EventVote") - proto.RegisterType((*EventExec)(nil), "cosmos.group.v1.EventExec") - proto.RegisterType((*EventLeaveGroup)(nil), "cosmos.group.v1.EventLeaveGroup") - proto.RegisterType((*EventProposalPruned)(nil), "cosmos.group.v1.EventProposalPruned") -} - -func init() { proto.RegisterFile("cosmos/group/v1/events.proto", fileDescriptor_e8d753981546f032) } - -var fileDescriptor_e8d753981546f032 = []byte{ - // 442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4f, 0xef, 0xd2, 0x30, - 0x18, 0xc7, 0xe9, 0x4f, 0x02, 0x52, 0x8c, 0x98, 0xfa, 0x27, 0x03, 0xc9, 0x20, 0xc4, 0x44, 0x0e, - 0xb2, 0x05, 0x4c, 0xd4, 0x93, 0x44, 0x0c, 0x31, 0x24, 0x1c, 0xc8, 0xf0, 0x4f, 0xe2, 0x05, 0xc7, - 0xda, 0x8c, 0xc5, 0x41, 0x97, 0xb6, 0x9b, 0x70, 0xf4, 0x1d, 0xf8, 0x52, 0x3c, 0xf8, 0x22, 0x3c, - 0x12, 0x4f, 0x1e, 0x0d, 0xbc, 0x11, 0xb3, 0xae, 0x03, 0x82, 0x31, 0x23, 0xf9, 0x9d, 0x68, 0xfb, - 0xfd, 0x7c, 0xbf, 0x3c, 0x4f, 0x9f, 0x15, 0xd6, 0x1d, 0xca, 0x97, 0x94, 0x9b, 0x2e, 0xa3, 0x61, - 0x60, 0x46, 0x5d, 0x93, 0x44, 0x64, 0x25, 0xb8, 0x11, 0x30, 0x2a, 0x28, 0xaa, 0x24, 0xaa, 0x21, - 0x55, 0x23, 0xea, 0xd6, 0xaa, 0xc9, 0xc1, 0x4c, 0xca, 0xa6, 0x52, 0xe5, 0xa6, 0xf6, 0xf0, 0x3c, - 0x49, 0x6c, 0x02, 0xa2, 0xc4, 0x56, 0x07, 0xde, 0x19, 0xc6, 0xc1, 0xaf, 0x19, 0xb1, 0x05, 0x79, - 0x13, 0x23, 0xa8, 0x0a, 0x6f, 0x4a, 0x76, 0xe6, 0x61, 0x0d, 0x34, 0x41, 0x3b, 0x6f, 0x15, 0xe5, - 0x7e, 0x84, 0x0f, 0xf8, 0xbb, 0x00, 0x5f, 0x82, 0x8f, 0xe1, 0x83, 0xf3, 0xf4, 0x09, 0xf5, 0x3d, - 0x67, 0x83, 0x7a, 0xb0, 0x68, 0x63, 0xcc, 0x08, 0xe7, 0xd2, 0x53, 0x1a, 0x68, 0xbf, 0x7e, 0x74, - 0xee, 0xa9, 0xba, 0x5f, 0x25, 0xca, 0x54, 0x30, 0x6f, 0xe5, 0x5a, 0x29, 0x78, 0x48, 0x3b, 0xf9, - 0xf3, 0x6b, 0xa4, 0x3d, 0x83, 0x77, 0x65, 0xda, 0x34, 0x9c, 0x2f, 0x3d, 0x31, 0x61, 0x34, 0xa0, - 0xdc, 0xf6, 0x51, 0x03, 0x96, 0x03, 0xb5, 0x3e, 0x36, 0x04, 0xd3, 0xa3, 0x11, 0x6e, 0xbd, 0x80, - 0xf7, 0xa5, 0xef, 0x83, 0x27, 0x16, 0x98, 0xd9, 0x5f, 0x2e, 0x77, 0x3e, 0x81, 0x25, 0xe9, 0x7c, - 0x4f, 0x05, 0xc9, 0xa6, 0xbf, 0x02, 0x85, 0x0f, 0xd7, 0xc4, 0xc9, 0xc4, 0x51, 0x1f, 0x16, 0x18, - 0xe1, 0xa1, 0x2f, 0xb4, 0xab, 0x26, 0x68, 0xdf, 0xee, 0x3d, 0x36, 0xce, 0x3e, 0x11, 0x23, 0x2d, - 0x34, 0xce, 0x0b, 0x05, 0x65, 0x96, 0xc4, 0x2d, 0x65, 0x43, 0x08, 0xe6, 0x7d, 0xea, 0x72, 0xed, - 0x46, 0x7c, 0x81, 0x96, 0x5c, 0xb7, 0x3e, 0xc1, 0x8a, 0x2c, 0x61, 0x4c, 0xec, 0x28, 0x73, 0xda, - 0xa7, 0x53, 0xb8, 0xba, 0x74, 0x0a, 0xdf, 0x81, 0x1a, 0x43, 0x5a, 0xdd, 0x84, 0x85, 0x2b, 0x82, - 0xb3, 0xfb, 0x7d, 0x0e, 0x0b, 0x5c, 0xd8, 0x22, 0xe4, 0xaa, 0xdf, 0xc6, 0x7f, 0xfb, 0x9d, 0x4a, - 0xcc, 0x52, 0x38, 0xea, 0xc3, 0x5b, 0xc2, 0xf6, 0xfd, 0xcd, 0x4c, 0x5d, 0x57, 0xdc, 0x6f, 0xb9, - 0x57, 0xff, 0xc7, 0xfe, 0x36, 0x86, 0xd4, 0x1d, 0x95, 0xc5, 0x71, 0x33, 0x78, 0xf9, 0x73, 0xa7, - 0x83, 0xed, 0x4e, 0x07, 0x7f, 0x76, 0x3a, 0xf8, 0xb6, 0xd7, 0x73, 0xdb, 0xbd, 0x9e, 0xfb, 0xbd, - 0xd7, 0x73, 0x1f, 0x1f, 0xb9, 0x9e, 0x58, 0x84, 0x73, 0xc3, 0xa1, 0x4b, 0xf5, 0x04, 0xd5, 0x4f, - 0x87, 0xe3, 0xcf, 0xe6, 0x3a, 0x79, 0x81, 0xf3, 0x82, 0x7c, 0x79, 0x4f, 0xff, 0x06, 0x00, 0x00, - 0xff, 0xff, 0xa5, 0x1a, 0x1c, 0xb9, 0xe2, 0x03, 0x00, 0x00, -} - -func (m *EventCreateGroup) 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 *EventCreateGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventCreateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.GroupId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventUpdateGroup) 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 *EventUpdateGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventUpdateGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.GroupId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventCreateGroupPolicy) 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 *EventCreateGroupPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventCreateGroupPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventUpdateGroupPolicy) 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 *EventUpdateGroupPolicy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventUpdateGroupPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EventSubmitProposal) 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 *EventSubmitProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventWithdrawProposal) 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 *EventWithdrawProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventWithdrawProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventVote) 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 *EventVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposalId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventExec) 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 *EventExec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventExec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Logs) > 0 { - i -= len(m.Logs) - copy(dAtA[i:], m.Logs) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Logs))) - i-- - dAtA[i] = 0x1a - } - if m.Result != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x10 - } - if m.ProposalId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventLeaveGroup) 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 *EventLeaveGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventLeaveGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0x12 - } - if m.GroupId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.GroupId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EventProposalPruned) 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 *EventProposalPruned) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventProposalPruned) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TallyResult != nil { - { - size, err := m.TallyResult.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Status != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x10 - } - if m.ProposalId != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.ProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventCreateGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GroupId != 0 { - n += 1 + sovEvents(uint64(m.GroupId)) - } - return n -} - -func (m *EventUpdateGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GroupId != 0 { - n += 1 + sovEvents(uint64(m.GroupId)) - } - return n -} - -func (m *EventCreateGroupPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventUpdateGroupPolicy) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventSubmitProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovEvents(uint64(m.ProposalId)) - } - return n -} - -func (m *EventWithdrawProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovEvents(uint64(m.ProposalId)) - } - return n -} - -func (m *EventVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovEvents(uint64(m.ProposalId)) - } - return n -} - -func (m *EventExec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovEvents(uint64(m.ProposalId)) - } - if m.Result != 0 { - n += 1 + sovEvents(uint64(m.Result)) - } - l = len(m.Logs) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventLeaveGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GroupId != 0 { - n += 1 + sovEvents(uint64(m.GroupId)) - } - l = len(m.Address) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func (m *EventProposalPruned) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovEvents(uint64(m.ProposalId)) - } - if m.Status != 0 { - n += 1 + sovEvents(uint64(m.Status)) - } - if m.TallyResult != nil { - l = m.TallyResult.Size() - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventCreateGroup) 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 ErrIntOverflowEvents - } - 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: EventCreateGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventCreateGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) - } - m.GroupId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GroupId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventUpdateGroup) 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 ErrIntOverflowEvents - } - 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: EventUpdateGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventUpdateGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) - } - m.GroupId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GroupId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventCreateGroupPolicy) 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 ErrIntOverflowEvents - } - 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: EventCreateGroupPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventCreateGroupPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventUpdateGroupPolicy) 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 ErrIntOverflowEvents - } - 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: EventUpdateGroupPolicy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventUpdateGroupPolicy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventSubmitProposal) 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 ErrIntOverflowEvents - } - 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: EventSubmitProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventWithdrawProposal) 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 ErrIntOverflowEvents - } - 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: EventWithdrawProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventWithdrawProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventVote) 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 ErrIntOverflowEvents - } - 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: EventVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventExec) 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 ErrIntOverflowEvents - } - 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: EventExec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventExec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= ProposalExecutorResult(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Logs = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventLeaveGroup) 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 ErrIntOverflowEvents - } - 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: EventLeaveGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventLeaveGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupId", wireType) - } - m.GroupId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GroupId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *EventProposalPruned) 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 ErrIntOverflowEvents - } - 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: EventProposalPruned: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventProposalPruned: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= ProposalStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyResult", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TallyResult == nil { - m.TallyResult = &TallyResult{} - } - if err := m.TallyResult.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go b/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go deleted file mode 100644 index 274fa9a447c5..000000000000 --- a/github.com/cosmos/cosmos-sdk/x/group/genesis.pb.go +++ /dev/null @@ -1,702 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/group/v1/genesis.proto - -package group - -import ( - fmt "fmt" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the group module's genesis state. -type GenesisState struct { - // group_seq is the group table orm.Sequence, - // it is used to get the next group ID. - GroupSeq uint64 `protobuf:"varint,1,opt,name=group_seq,json=groupSeq,proto3" json:"group_seq,omitempty"` - // groups is the list of groups info. - Groups []*GroupInfo `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` - // group_members is the list of groups members. - GroupMembers []*GroupMember `protobuf:"bytes,3,rep,name=group_members,json=groupMembers,proto3" json:"group_members,omitempty"` - // group_policy_seq is the group policy table orm.Sequence, - // it is used to generate the next group policy account address. - GroupPolicySeq uint64 `protobuf:"varint,4,opt,name=group_policy_seq,json=groupPolicySeq,proto3" json:"group_policy_seq,omitempty"` - // group_policies is the list of group policies info. - GroupPolicies []*GroupPolicyInfo `protobuf:"bytes,5,rep,name=group_policies,json=groupPolicies,proto3" json:"group_policies,omitempty"` - // proposal_seq is the proposal table orm.Sequence, - // it is used to get the next proposal ID. - ProposalSeq uint64 `protobuf:"varint,6,opt,name=proposal_seq,json=proposalSeq,proto3" json:"proposal_seq,omitempty"` - // proposals is the list of proposals. - Proposals []*Proposal `protobuf:"bytes,7,rep,name=proposals,proto3" json:"proposals,omitempty"` - // votes is the list of votes. - Votes []*Vote `protobuf:"bytes,8,rep,name=votes,proto3" json:"votes,omitempty"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_cc6105fe3ef99f06, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetGroupSeq() uint64 { - if m != nil { - return m.GroupSeq - } - return 0 -} - -func (m *GenesisState) GetGroups() []*GroupInfo { - if m != nil { - return m.Groups - } - return nil -} - -func (m *GenesisState) GetGroupMembers() []*GroupMember { - if m != nil { - return m.GroupMembers - } - return nil -} - -func (m *GenesisState) GetGroupPolicySeq() uint64 { - if m != nil { - return m.GroupPolicySeq - } - return 0 -} - -func (m *GenesisState) GetGroupPolicies() []*GroupPolicyInfo { - if m != nil { - return m.GroupPolicies - } - return nil -} - -func (m *GenesisState) GetProposalSeq() uint64 { - if m != nil { - return m.ProposalSeq - } - return 0 -} - -func (m *GenesisState) GetProposals() []*Proposal { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *GenesisState) GetVotes() []*Vote { - if m != nil { - return m.Votes - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "cosmos.group.v1.GenesisState") -} - -func init() { proto.RegisterFile("cosmos/group/v1/genesis.proto", fileDescriptor_cc6105fe3ef99f06) } - -var fileDescriptor_cc6105fe3ef99f06 = []byte{ - // 341 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xcf, 0x4e, 0xfa, 0x40, - 0x10, 0xc7, 0xe9, 0x8f, 0x3f, 0x3f, 0x58, 0xfe, 0x68, 0x36, 0x31, 0xa9, 0xa0, 0x0d, 0x1a, 0x0f, - 0x24, 0xc6, 0x36, 0xe0, 0xc1, 0x9b, 0x89, 0x5e, 0x88, 0x07, 0x13, 0x52, 0x12, 0x0f, 0x5e, 0x0c, - 0xe0, 0x58, 0x1b, 0x29, 0x53, 0x3a, 0x0b, 0x91, 0xb7, 0xf0, 0x09, 0x7c, 0x1e, 0x8f, 0x1c, 0x3d, - 0x1a, 0x78, 0x11, 0xc3, 0x6c, 0x49, 0x0d, 0x70, 0xda, 0xdd, 0xd9, 0xcf, 0x77, 0x3e, 0x93, 0x8c, - 0x38, 0x1e, 0x20, 0x05, 0x48, 0x8e, 0x17, 0xe1, 0x24, 0x74, 0xa6, 0x4d, 0xc7, 0x83, 0x11, 0x90, - 0x4f, 0x76, 0x18, 0xa1, 0x42, 0xb9, 0xa7, 0xbf, 0x6d, 0xfe, 0xb6, 0xa7, 0xcd, 0x6a, 0x6d, 0x93, - 0x57, 0xb3, 0x10, 0x62, 0xfa, 0xf4, 0x33, 0x2d, 0x4a, 0x6d, 0x9d, 0xef, 0xaa, 0x9e, 0x02, 0x59, - 0x13, 0x05, 0x06, 0x9f, 0x08, 0xc6, 0xa6, 0x51, 0x37, 0x1a, 0x19, 0x37, 0xcf, 0x85, 0x2e, 0x8c, - 0x65, 0x4b, 0xe4, 0xf8, 0x4e, 0xe6, 0xbf, 0x7a, 0xba, 0x51, 0x6c, 0x55, 0xed, 0x0d, 0x99, 0xdd, - 0x5e, 0x5d, 0xee, 0x46, 0x2f, 0xe8, 0xc6, 0xa4, 0xbc, 0x11, 0x65, 0xdd, 0x30, 0x80, 0xa0, 0x0f, - 0x11, 0x99, 0x69, 0x8e, 0x1e, 0xed, 0x8e, 0xde, 0x33, 0xe4, 0x96, 0xbc, 0xe4, 0x41, 0xb2, 0x21, - 0xf6, 0x75, 0x8b, 0x10, 0x87, 0xfe, 0x60, 0xc6, 0xa3, 0x65, 0x78, 0xb4, 0x0a, 0xd7, 0x3b, 0x5c, - 0x5e, 0x0d, 0xd8, 0x16, 0x95, 0x3f, 0xa4, 0x0f, 0x64, 0x66, 0xd9, 0x56, 0xdf, 0x6d, 0xd3, 0x41, - 0x1e, 0xb7, 0x9c, 0x74, 0xf2, 0x81, 0xe4, 0x89, 0x28, 0x85, 0x11, 0x86, 0x48, 0xbd, 0x21, 0xeb, - 0x72, 0xac, 0x2b, 0xae, 0x6b, 0x2b, 0xd7, 0x95, 0x28, 0xac, 0x9f, 0x64, 0xfe, 0x67, 0xcd, 0xe1, - 0x96, 0xa6, 0x13, 0x13, 0x6e, 0xc2, 0xca, 0x73, 0x91, 0x9d, 0xa2, 0x02, 0x32, 0xf3, 0x1c, 0x3a, - 0xd8, 0x0a, 0x3d, 0xa0, 0x02, 0x57, 0x33, 0xb7, 0xd7, 0x5f, 0x0b, 0xcb, 0x98, 0x2f, 0x2c, 0xe3, - 0x67, 0x61, 0x19, 0x1f, 0x4b, 0x2b, 0x35, 0x5f, 0x5a, 0xa9, 0xef, 0xa5, 0x95, 0x7a, 0x3c, 0xf3, - 0x7c, 0xf5, 0x3a, 0xe9, 0xdb, 0x03, 0x0c, 0x9c, 0x78, 0xc5, 0xfa, 0xb8, 0xa0, 0xe7, 0x37, 0xe7, - 0x5d, 0xef, 0xbb, 0x9f, 0xe3, 0x3d, 0x5f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x99, 0x5b, 0x30, - 0xc4, 0x36, 0x02, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - } - if m.ProposalSeq != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.ProposalSeq)) - i-- - dAtA[i] = 0x30 - } - if len(m.GroupPolicies) > 0 { - for iNdEx := len(m.GroupPolicies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GroupPolicies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if m.GroupPolicySeq != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.GroupPolicySeq)) - i-- - dAtA[i] = 0x20 - } - if len(m.GroupMembers) > 0 { - for iNdEx := len(m.GroupMembers) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.GroupMembers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Groups) > 0 { - for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.GroupSeq != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.GroupSeq)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.GroupSeq != 0 { - n += 1 + sovGenesis(uint64(m.GroupSeq)) - } - if len(m.Groups) > 0 { - for _, e := range m.Groups { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.GroupMembers) > 0 { - for _, e := range m.GroupMembers { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.GroupPolicySeq != 0 { - n += 1 + sovGenesis(uint64(m.GroupPolicySeq)) - } - if len(m.GroupPolicies) > 0 { - for _, e := range m.GroupPolicies { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if m.ProposalSeq != 0 { - n += 1 + sovGenesis(uint64(m.ProposalSeq)) - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupSeq", wireType) - } - m.GroupSeq = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GroupSeq |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Groups = append(m.Groups, &GroupInfo{}) - if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupMembers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GroupMembers = append(m.GroupMembers, &GroupMember{}) - if err := m.GroupMembers[len(m.GroupMembers)-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 GroupPolicySeq", wireType) - } - m.GroupPolicySeq = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GroupPolicySeq |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GroupPolicies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GroupPolicies = append(m.GroupPolicies, &GroupPolicyInfo{}) - if err := m.GroupPolicies[len(m.GroupPolicies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalSeq", wireType) - } - m.ProposalSeq = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalSeq |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposals = append(m.Proposals, &Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, &Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) From 2ff0df593d32c54f893cec2dae9b6352dcda83d5 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 30 Nov 2023 16:27:13 +0100 Subject: [PATCH 17/31] Update x/staking/keeper/msg_server.go Co-authored-by: Marius Poke --- x/staking/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index f3086fdc3f66..e2d43b2747be 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -606,7 +606,7 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M ctx.EventManager().EmitEvent( sdk.NewEvent( - "cancel_unbonding_delegation", + types.EventTypeCancelUnbondingDelegation, sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), From 85a701ba566d5d54ddef2a5e9d8fc91f43c7b502 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 30 Nov 2023 16:28:08 +0100 Subject: [PATCH 18/31] Update x/staking/keeper/msg_server.go Co-authored-by: Marius Poke --- x/staking/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index e2d43b2747be..a33c6a0b6ae4 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -610,7 +610,7 @@ func (k msgServer) CancelUnbondingDelegation(goCtx context.Context, msg *types.M sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()), sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress), - sdk.NewAttribute("creation_height", strconv.FormatInt(msg.CreationHeight, 10)), + sdk.NewAttribute(types.AttributeKeyCreationHeight, strconv.FormatInt(msg.CreationHeight, 10)), ), ) From a1ab1e4516b5d82c4cc4bb31970af5c29621f748 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 30 Nov 2023 18:42:11 +0100 Subject: [PATCH 19/31] add go.work and fix silent errors --- .gitignore | 1 + runtime/app.go | 7 ++-- tests/e2e/staking/grpc.go | 4 +-- tests/e2e/staking/suite.go | 4 +-- ...te_TestGRPCParams-20231129173630-9882.fail | 32 ------------------- x/staking/keeper/grpc_query.go | 2 +- x/staking/keeper/liquid_stake.go | 6 ++-- x/staking/keeper/msg_server.go | 3 +- x/staking/simulation/operations.go | 5 +-- 9 files changed, 19 insertions(+), 45 deletions(-) delete mode 100644 tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail diff --git a/.gitignore b/.gitignore index a99e8990f39c..c3230d7a9382 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.swm *.swn *.pyc +*.fail # private files private[.-]* diff --git a/runtime/app.go b/runtime/app.go index b5cfcc54cecb..e6053385e498 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -121,9 +121,10 @@ func (a *App) Load(loadLatest bool) error { a.SetEndBlocker(a.EndBlocker) } - if len(a.config.OrderMigrations) != 0 { - a.ModuleManager.SetOrderMigrations(a.config.OrderMigrations...) - } + // TODO LSM refactor fix this + // if len(a.config.OrderMigrations) != 0 { + // a.ModuleManager.SetOrderMigrations(a.config.OrderMigrations...) + // } if loadLatest { if err := a.LoadLatestVersion(); err != nil { diff --git a/tests/e2e/staking/grpc.go b/tests/e2e/staking/grpc.go index 95ce9775bff6..8d0942f8e653 100644 --- a/tests/e2e/staking/grpc.go +++ b/tests/e2e/staking/grpc.go @@ -148,7 +148,7 @@ func (s *E2ETestSuite) TestGRPCQueryValidatorDelegations() { &types.QueryValidatorDelegationsResponse{}, &types.QueryValidatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{Total: 1}, }, @@ -398,7 +398,7 @@ func (s *E2ETestSuite) TestGRPCQueryDelegatorDelegations() { &types.QueryDelegatorDelegationsResponse{}, &types.QueryDelegatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{Total: 1}, }, diff --git a/tests/e2e/staking/suite.go b/tests/e2e/staking/suite.go index 03ccfb656748..e55b578acaa7 100644 --- a/tests/e2e/staking/suite.go +++ b/tests/e2e/staking/suite.go @@ -440,7 +440,7 @@ func (s *E2ETestSuite) TestGetCmdQueryDelegations() { &types.QueryDelegatorDelegationsResponse{}, &types.QueryDelegatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{}, }, @@ -496,7 +496,7 @@ func (s *E2ETestSuite) TestGetCmdQueryValidatorDelegations() { &types.QueryValidatorDelegationsResponse{}, &types.QueryValidatorDelegationsResponse{ DelegationResponses: types.DelegationResponses{ - types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), + types.NewDelegationResp(val.Address, val.ValAddress, sdk.NewDecFromInt(cli.DefaultTokens), false, sdk.NewCoin(sdk.DefaultBondDenom, cli.DefaultTokens)), }, Pagination: &query.PageResponse{}, }, diff --git a/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail b/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail deleted file mode 100644 index 8bc1d174a96a..000000000000 --- a/tests/integration/staking/keeper/testdata/rapid/TestDeterministicTestSuite_TestGRPCParams/TestDeterministicTestSuite_TestGRPCParams-20231129173630-9882.fail +++ /dev/null @@ -1,32 +0,0 @@ -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw bond-denom: "A--" -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw duration: 1701275790 -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw max-validators: 0x1 -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw max-entries: 0x1 -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw historical-entries: 0x1 -# 2023/11/29 17:36:30 TestDeterministicTestSuite/TestGRPCParams [rapid] draw commission: 0 -# -v0.4.8#11887775898083181920 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 -0x0 \ No newline at end of file diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index e4ba090779fe..889922a6bf25 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -551,7 +551,7 @@ func DelegationToDelegationResponse(ctx sdk.Context, k *Keeper, del types.Delega delegatorAddress, del.GetValidatorAddr(), del.Shares, - false, + del.ValidatorBond, sdk.NewCoin(k.BondDenom(ctx), val.TokensFromShares(del.Shares).TruncateInt()), ), nil } diff --git a/x/staking/keeper/liquid_stake.go b/x/staking/keeper/liquid_stake.go index b9b5280bd17c..64c44e4cd35d 100644 --- a/x/staking/keeper/liquid_stake.go +++ b/x/staking/keeper/liquid_stake.go @@ -3,6 +3,8 @@ package keeper import ( "time" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -74,8 +76,8 @@ func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens sdk.I } // Calculate the percentage of stake that is liquid - updatedLiquidStaked := liquidStakedAmount.Add(tokens).ToLegacyDec() - liquidStakePercent := updatedLiquidStaked.Quo(totalStakedAmount.ToLegacyDec()) + updatedLiquidStaked := math.LegacyNewDec(liquidStakedAmount.Add(tokens).Int64()) + liquidStakePercent := updatedLiquidStaked.Quo(math.LegacyNewDec(totalStakedAmount.Int64())) return liquidStakePercent.GT(liquidStakingCap) } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index a33c6a0b6ae4..843c120a41a3 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -6,6 +6,7 @@ import ( "strconv" "time" + "cosmossdk.io/math" "github.com/armon/go-metrics" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" @@ -854,7 +855,7 @@ func (k msgServer) RedeemTokensForShares(goCtx context.Context, msg *types.MsgRe // Similar to undelegations, if the account is attempting to tokenize the full delegation, // but there's a precision error due to the decimal to int conversion, round up to the // full decimal amount before modifying the delegation - shares := shareToken.Amount.ToLegacyDec() + shares := math.LegacyNewDec(shareToken.Amount.Int64()) if shareToken.Amount.Equal(delegation.Shares.TruncateInt()) { shares = delegation.Shares } diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index b4cd0fa11a06..ccf37a8b2233 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -4,6 +4,7 @@ import ( "fmt" "math/rand" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil" @@ -808,11 +809,11 @@ func SimulateMsgTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k *k // check that tokenization would not exceed global cap params := k.GetParams(ctx) - totalStaked := k.TotalBondedTokens(ctx).ToLegacyDec() + totalStaked := math.LegacyNewDec(k.TotalBondedTokens(ctx).Int64()) if totalStaked.IsZero() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "cannot happened - no validators bonded if stake is 0.0"), nil, nil // skip } - totalLiquidStaked := k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt).ToLegacyDec() + totalLiquidStaked := math.LegacyNewDec(k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt).Int64()) liquidStakedPercent := totalLiquidStaked.Quo(totalStaked) if liquidStakedPercent.GT(params.GlobalLiquidStakingCap) { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "global liquid staking cap exceeded"), nil, nil From 47b3871f0a6e27c2db6cdbfab370e99f2c975a39 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Fri, 1 Dec 2023 15:51:17 +0100 Subject: [PATCH 20/31] address comments --- tests/e2e/staking/suite.go | 2 +- x/staking/keeper/grpc_query.go | 128 ++++++++++++++++++++++++----- x/staking/simulation/operations.go | 25 +++--- 3 files changed, 122 insertions(+), 33 deletions(-) diff --git a/tests/e2e/staking/suite.go b/tests/e2e/staking/suite.go index e55b578acaa7..dff54520f9cf 100644 --- a/tests/e2e/staking/suite.go +++ b/tests/e2e/staking/suite.go @@ -82,7 +82,7 @@ func (s *E2ETestSuite) SetupSuite() { // tokenize shares twice (once for the transfer and one for the redeem) for i := 1; i <= 2; i++ { - MsgTokenizeSharesExec( + out, err := MsgTokenizeSharesExec( val.ClientCtx, val.Address, val.ValAddress, diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index 889922a6bf25..a8b6d31a07ce 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -4,7 +4,6 @@ import ( "context" "strings" - "cosmossdk.io/math" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -616,8 +615,16 @@ func RedelegationsToRedelegationResponses(ctx sdk.Context, k *Keeper, redels typ // Query for individual tokenize share record information by share by id func (k Querier) TokenizeShareRecordById(c context.Context, req *types.QueryTokenizeShareRecordByIdRequest) (*types.QueryTokenizeShareRecordByIdResponse, error) { //nolint:revive // fixing this would require changing the .proto files, so we might as well leave it alone - record := types.TokenizeShareRecord{} - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + record, err := k.GetTokenizeShareRecord(ctx, req.Id) + if err != nil { + return nil, err + } + return &types.QueryTokenizeShareRecordByIdResponse{ Record: record, }, nil @@ -625,8 +632,16 @@ func (k Querier) TokenizeShareRecordById(c context.Context, req *types.QueryToke // Query for individual tokenize share record information by share denom func (k Querier) TokenizeShareRecordByDenom(c context.Context, req *types.QueryTokenizeShareRecordByDenomRequest) (*types.QueryTokenizeShareRecordByDenomResponse, error) { - record := types.TokenizeShareRecord{} - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + record, err := k.GetTokenizeShareRecordByDenom(ctx, req.Denom) + if err != nil { + return nil, err + } + return &types.QueryTokenizeShareRecordByDenomResponse{ Record: record, }, nil @@ -634,8 +649,17 @@ func (k Querier) TokenizeShareRecordByDenom(c context.Context, req *types.QueryT // Query tokenize share records by address func (k Querier) TokenizeShareRecordsOwned(c context.Context, req *types.QueryTokenizeShareRecordsOwnedRequest) (*types.QueryTokenizeShareRecordsOwnedResponse, error) { - records := []types.TokenizeShareRecord{} - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) + owner, err := sdk.AccAddressFromBech32(req.Owner) + if err != nil { + return nil, err + } + records := k.GetTokenizeShareRecordsByOwner(ctx, owner) + return &types.QueryTokenizeShareRecordsOwnedResponse{ Records: records, }, nil @@ -643,27 +667,77 @@ func (k Querier) TokenizeShareRecordsOwned(c context.Context, req *types.QueryTo // Query for all tokenize share records func (k Querier) AllTokenizeShareRecords(c context.Context, req *types.QueryAllTokenizeShareRecordsRequest) (*types.QueryAllTokenizeShareRecordsResponse, error) { - records := []types.TokenizeShareRecord{} - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + + var records []types.TokenizeShareRecord + + store := ctx.KVStore(k.storeKey) + valStore := prefix.NewStore(store, types.TokenizeShareRecordPrefix) + pageRes, err := query.FilteredPaginate(valStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + var tokenizeShareRecord types.TokenizeShareRecord + if err := k.cdc.Unmarshal(value, &tokenizeShareRecord); err != nil { + return false, err + } + + if accumulate { + records = append(records, tokenizeShareRecord) + } + return true, nil + }) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + return &types.QueryAllTokenizeShareRecordsResponse{ Records: records, - Pagination: nil, + Pagination: pageRes, }, nil } // Query for last tokenize share record id func (k Querier) LastTokenizeShareRecordId(c context.Context, req *types.QueryLastTokenizeShareRecordIdRequest) (*types.QueryLastTokenizeShareRecordIdResponse, error) { //nolint:revive // fixing this would require changing the .proto files, so we might as well leave it alone - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(c) return &types.QueryLastTokenizeShareRecordIdResponse{ - Id: 0, + Id: k.GetLastTokenizeShareRecordID(ctx), }, nil } // Query for total tokenized staked assets func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTotalTokenizeSharedAssetsRequest) (*types.QueryTotalTokenizeSharedAssetsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } ctx := sdk.UnwrapSDKContext(c) - totalTokenizeShared := math.Int{} - // TODO add LSM logic + records := k.GetAllTokenizeShareRecords(ctx) + totalTokenizeShared := sdk.ZeroInt() + + for _, record := range records { + moduleAcc := record.GetModuleAddress() + valAddr, err := sdk.ValAddressFromBech32(record.Validator) + if err != nil { + return nil, err + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegation, found := k.GetDelegation(ctx, moduleAcc, valAddr) + if !found { + return nil, types.ErrNoDelegation + } + + tokens := validator.TokensFromShares(delegation.Shares) + totalTokenizeShared = totalTokenizeShared.Add(tokens.RoundInt()) + } return &types.QueryTotalTokenizeSharedAssetsResponse{ Value: sdk.NewCoin(k.BondDenom(ctx), totalTokenizeShared), }, nil @@ -673,17 +747,33 @@ func (k Querier) TotalTokenizeSharedAssets(c context.Context, req *types.QueryTo // Liquid staked tokens are either tokenized delegations or delegations // owned by a module account func (k Querier) TotalLiquidStaked(c context.Context, req *types.QueryTotalLiquidStaked) (*types.QueryTotalLiquidStakedResponse, error) { - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + totalLiquidStaked := k.GetTotalLiquidStakedTokens(ctx).String() return &types.QueryTotalLiquidStakedResponse{ - Tokens: "", + Tokens: totalLiquidStaked, }, nil } // Query status of an account's tokenize share lock func (k Querier) TokenizeShareLockInfo(c context.Context, req *types.QueryTokenizeShareLockInfo) (*types.QueryTokenizeShareLockInfoResponse, error) { - // TODO add LSM logic + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + + address := sdk.MustAccAddressFromBech32(req.Address) + status, completionTime := k.GetTokenizeSharesLock(ctx, address) + + timeString := "" + if !completionTime.IsZero() { + timeString = completionTime.String() + } + return &types.QueryTokenizeShareLockInfoResponse{ - Status: "", - ExpirationTime: "", + Status: status.String(), + ExpirationTime: timeString, }, nil } diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index ccf37a8b2233..68680096243b 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -21,19 +21,18 @@ import ( // //nolint:gosec // these are not hardcoded credentials const ( - DefaultWeightMsgCreateValidator int = 100 - DefaultWeightMsgEditValidator int = 5 - DefaultWeightMsgDelegate int = 100 - DefaultWeightMsgUndelegate int = 100 - DefaultWeightMsgBeginRedelegate int = 100 - DefaultWeightMsgCancelUnbondingDelegation int = 100 - DefaultWeightMsgValidatorBond int = 100 - DefaultWeightMsgTokenizeShares int = 25 - DefaultWeightMsgRedeemTokensforShares int = 25 - DefaultWeightMsgTransferTokenizeShareRecord int = 5 - DefaultWeightMsgEnableTokenizeShares int = 1 - DefaultWeightMsgDisableTokenizeShares int = 1 - DefaultWeightMsgWithdrawAllTokenizeShareRecordReward int = 50 + DefaultWeightMsgCreateValidator int = 100 + DefaultWeightMsgEditValidator int = 5 + DefaultWeightMsgDelegate int = 100 + DefaultWeightMsgUndelegate int = 100 + DefaultWeightMsgBeginRedelegate int = 100 + DefaultWeightMsgCancelUnbondingDelegation int = 100 + DefaultWeightMsgValidatorBond int = 100 + DefaultWeightMsgTokenizeShares int = 25 + DefaultWeightMsgRedeemTokensforShares int = 25 + DefaultWeightMsgTransferTokenizeShareRecord int = 5 + DefaultWeightMsgEnableTokenizeShares int = 1 + DefaultWeightMsgDisableTokenizeShares int = 1 OpWeightMsgCreateValidator = "op_weight_msg_create_validator" OpWeightMsgEditValidator = "op_weight_msg_edit_validator" From 39bffa166888cc8ca12ba4cdbe0783199628fc4e Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Mon, 4 Dec 2023 10:14:36 +0100 Subject: [PATCH 21/31] refactor staking msg_server_tests.go - distrib hooks cause them to fail --- .../integration/staking/keeper/common_test.go | 4 +- .../staking/keeper/msg_server_test.go | 2765 +++++++++-------- x/staking/keeper/liquid_stake.go | 7 +- x/staking/keeper/liquid_stake_test.go | 38 +- x/staking/keeper/msg_server.go | 3 +- x/staking/simulation/operations.go | 5 +- 6 files changed, 1468 insertions(+), 1354 deletions(-) diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index f6169b9d44c1..ffb77c3afc7b 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -89,8 +89,8 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers return addrs, valAddrs, vals } -func delegateCoinsFromAccount(ctx sdk.Context, app *simapp.SimApp, addr sdk.AccAddress, amount sdk.Int, val types.Validator) error { - _, err := app.StakingKeeper.Delegate(ctx, addr, amount, types.Unbonded, val, true) +func delegateCoinsFromAccount(ctx sdk.Context, sk keeper.Keeper, addr sdk.AccAddress, amount sdk.Int, val types.ValidatorI) error { + _, err := sk.Delegate(ctx, addr, amount, types.Unbonded, val.(types.Validator), true) return err } diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 76ac622175f7..6fb777e73fa6 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -1,16 +1,29 @@ package keeper_test import ( + "fmt" "testing" "time" + "cosmossdk.io/simapp" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - - "cosmossdk.io/simapp" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" + "github.com/cosmos/cosmos-sdk/types/address" + accountKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + distribkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/testutil" "github.com/cosmos/cosmos-sdk/x/staking/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/stretchr/testify/require" ) @@ -25,7 +38,7 @@ func TestCancelUnbondingDelegation(t *testing.T) { notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 5) - require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) + require.NoError(t, banktestutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) moduleBalance := app.BankKeeper.GetBalance(ctx, notBondedPool.GetAddress(), app.StakingKeeper.BondDenom(ctx)) @@ -149,572 +162,589 @@ func TestCancelUnbondingDelegation(t *testing.T) { // TODO refactor LSM test func TestTokenizeSharesAndRedeemTokens(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // liquidStakingCapStrict := sdk.ZeroDec() - // liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") - // liquidStakingCapDisabled := sdk.OneDec() - - // validatorBondStrict := sdk.OneDec() - // validatorBondConservative := sdk.NewDec(10) - // validatorBondDisabled := sdk.NewDec(-1) - - // testCases := []struct { - // name string - // vestingAmount sdk.Int - // delegationAmount sdk.Int - // tokenizeShareAmount sdk.Int - // redeemAmount sdk.Int - // targetVestingDelAfterShare sdk.Int - // targetVestingDelAfterRedeem sdk.Int - // globalLiquidStakingCap sdk.Dec - // slashFactor sdk.Dec - // validatorLiquidStakingCap sdk.Dec - // validatorBondFactor sdk.Dec - // validatorBondDelegation bool - // validatorBondDelegatorIndex int - // delegatorIsLSTP bool - // expTokenizeErr bool - // expRedeemErr bool - // prevAccountDelegationExists bool - // recordAccountDelegationExists bool - // }{ - // { - // name: "full amount tokenize and redeem", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: false, - // recordAccountDelegationExists: false, - // }, - // { - // name: "full amount tokenize and partial redeem", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: false, - // recordAccountDelegationExists: true, - // }, - // { - // name: "partial amount tokenize and full redeem", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // recordAccountDelegationExists: false, - // }, - // { - // name: "tokenize and redeem with slash", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.MustNewDecFromStr("0.1"), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: false, - // recordAccountDelegationExists: true, - // }, - // { - // name: "over tokenize", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 30), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: true, - // expRedeemErr: false, - // }, - // { - // name: "over redeem", - // vestingAmount: sdk.NewInt(0), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 40), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: true, - // }, - // { - // name: "vesting account tokenize share failure", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: true, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "vesting account tokenize share success", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: false, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "try tokenize share for a validator-bond delegation", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondConservative, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 1, - // expTokenizeErr: true, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "strict validator-bond - tokenization fails", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondStrict, - // validatorBondDelegation: false, - // expTokenizeErr: true, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "conservative validator-bond - successful tokenization", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondConservative, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "strict global liquid staking cap - tokenization fails", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapStrict, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: true, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "conservative global liquid staking cap - successful tokenization", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapConservative, - // validatorLiquidStakingCap: liquidStakingCapDisabled, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "strict validator liquid staking cap - tokenization fails", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapStrict, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: true, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "conservative validator liquid staking cap - successful tokenization", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapDisabled, - // validatorLiquidStakingCap: liquidStakingCapConservative, - // validatorBondFactor: validatorBondDisabled, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "all caps set conservatively - successful tokenize share", - // vestingAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapConservative, - // validatorLiquidStakingCap: liquidStakingCapConservative, - // validatorBondFactor: validatorBondConservative, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // { - // name: "delegator is a liquid staking provider - accounting should not update", - // vestingAmount: sdk.ZeroInt(), - // delegationAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 20), - // tokenizeShareAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // redeemAmount: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterShare: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // targetVestingDelAfterRedeem: app.StakingKeeper.TokensFromConsensusPower(ctx, 10), - // slashFactor: sdk.ZeroDec(), - // globalLiquidStakingCap: liquidStakingCapConservative, - // validatorLiquidStakingCap: liquidStakingCapConservative, - // validatorBondFactor: validatorBondConservative, - // delegatorIsLSTP: true, - // validatorBondDelegation: true, - // validatorBondDelegatorIndex: 0, - // expTokenizeErr: false, - // expRedeemErr: false, - // prevAccountDelegationExists: true, - // }, - // } - - // for _, tc := range testCases { - // t.Run(tc.name, func(t *testing.T) { - // addrs := simtestutil.AddTestAddrs(app.BankKeeper, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - // addrAcc1, addrAcc2 := addrs[0], addrs[1] - // addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) - - // // Create ICA module account - // icaAccountAddress := createICAAccount(app, ctx) - - // // Fund module account - // delegationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.delegationAmount) - // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) - // require.NoError(t, err) - // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) - // require.NoError(t, err) - - // // set the delegator address depending on whether the delegator should be a liquid staking provider - // delegatorAccount := addrAcc2 - // if tc.delegatorIsLSTP { - // delegatorAccount = icaAccountAddress - // } - - // // set validator bond factor and global liquid staking cap - // params := app.StakingKeeper.GetParams(ctx) - // params.ValidatorBondFactor = tc.validatorBondFactor - // params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap - // params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap - // app.StakingKeeper.SetParams(ctx, params) - - // // set the total liquid staked tokens - // app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.ZeroInt()) - - // if !tc.vestingAmount.IsZero() { - // // create vesting account - // pubkey := secp256k1.GenPrivKey().PubKey() - // baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) - // initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) - // baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) - // delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) - // app.AccountKeeper.SetAccount(ctx, delayedVestingAccount) - // } - - // pubKeys := simtestutil.CreateTestPubKeys(2) - // pk1, pk2 := pubKeys[0], pubKeys[1] - - // // Create Validators and Delegation - // val1 := stakingtypes.NewValidator(addrVal1, pk1, stakingtypes.Description{}) - // val1.Status = sdkstaking.Bonded - // app.StakingKeeper.SetValidator(ctx, val1) - // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) - // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) - // require.NoError(t, err) - - // val2 := stakingtypes.NewValidator(addrVal2, pk2, stakingtypes.Description{}) - // val2.Status = sdkstaking.Bonded - // app.StakingKeeper.SetValidator(ctx, val2) - // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) - // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) - // require.NoError(t, err) - - // // Delegate from both the main delegator as well as a random account so there is a - // // non-zero delegation after redemption - // err = delegateCoinsFromAccount(ctx, app, delegatorAccount, tc.delegationAmount, val1) - // require.NoError(t, err) - - // // apply TM updates - // applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) - - // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // require.True(t, found, "delegation not found after delegate") - - // lastRecordID := app.StakingKeeper.GetLastTokenizeShareRecordID(ctx) - // oldValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - // if tc.validatorBondDelegation { - // err := delegateCoinsFromAccount(ctx, app, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) - // require.NoError(t, err) - // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - // DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), - // ValidatorAddress: addrVal1.String(), - // }) - // require.NoError(t, err) - // } - - // resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - // DelegatorAddress: delegatorAccount.String(), - // ValidatorAddress: addrVal1.String(), - // Amount: sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), - // TokenizedShareOwner: delegatorAccount.String(), - // }) - // if tc.expTokenizeErr { - // require.Error(t, err) - // return - // } - // require.NoError(t, err) - - // // check last record id increase - // require.Equal(t, lastRecordID+1, app.StakingKeeper.GetLastTokenizeShareRecordID(ctx)) - - // // ensure validator's total tokens is consistent - // newValidator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // require.Equal(t, oldValidator.Tokens, newValidator.Tokens) - - // // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased - // totalLiquidTokensAfterTokenization := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) - // validatorLiquidSharesAfterTokenization := newValidator.LiquidShares - // if !tc.delegatorIsLSTP { - // require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") - // require.Equal(t, tc.tokenizeShareAmount.String(), validatorLiquidSharesAfterTokenization.TruncateInt().String(), "validator liquid shares after tokenization") - // } else { - // require.True(t, totalLiquidTokensAfterTokenization.IsZero(), "zero liquid tokens after tokenization") - // require.True(t, validatorLiquidSharesAfterTokenization.IsZero(), "zero liquid validator shares after tokenization") - // } - - // if tc.vestingAmount.IsPositive() { - // acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) - // vestingAcc := acc.(vesting.VestingAccount) - // require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) - // } - - // if tc.prevAccountDelegationExists { - // _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // require.True(t, found, "delegation found after partial tokenize share") - // } else { - // _, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // require.False(t, found, "delegation found after full tokenize share") - // } - - // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) - // require.Equal(t, resp.Amount, shareToken) - // _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found, true, "validator not found") - - // records := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - // require.Len(t, records, 1) - // delegation, found := app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - // require.True(t, found, "delegation not found from tokenize share module account after tokenize share") - - // // slash before redeem - // slashedTokens := sdk.ZeroInt() - // redeemedShares := tc.redeemAmount - // redeemedTokens := tc.redeemAmount - // if tc.slashFactor.IsPositive() { - // consAddr, err := val1.GetConsAddr() - // require.NoError(t, err) - // ctx = ctx.WithBlockHeight(100) - // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // power := app.StakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) - // app.StakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor, 0) - // slashedTokens = sdk.NewDecFromInt(val1.Tokens).Mul(tc.slashFactor).TruncateInt() - - // val1, _ := app.StakingKeeper.GetValidator(ctx, addrVal1) - // redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() - // } - - // // get deletagor balance and delegation - // bondDenomAmountBefore := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) - // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // if !found { - // delegation = types.Delegation{Shares: sdk.ZeroDec()} - // } - // delAmountBefore := val1.TokensFromShares(delegation.Shares) - // oldValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - - // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - // DelegatorAddress: delegatorAccount.String(), - // Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), - // }) - // if tc.expRedeemErr { - // require.Error(t, err) - // return - // } - // require.NoError(t, err) - - // // ensure validator's total tokens is consistent - // newValidator, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // require.Equal(t, oldValidator.Tokens, newValidator.Tokens) - - // // if the delegator was not a liuqid staking provider, check that the total liquid staked - // // and liquid shares decreased - // totalLiquidTokensAfterRedemption := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx) - // validatorLiquidSharesAfterRedemption := newValidator.LiquidShares - // expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) - // expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) - // if !tc.delegatorIsLSTP { - // require.Equal(t, expectedLiquidTokens.String(), totalLiquidTokensAfterRedemption.String(), "total liquid tokens after redemption") - // require.Equal(t, expectedLiquidShares.String(), validatorLiquidSharesAfterRedemption.String(), "validator liquid shares after tokenization") - // } else { - // require.True(t, totalLiquidTokensAfterRedemption.IsZero(), "zero liquid tokens after redemption") - // require.True(t, validatorLiquidSharesAfterRedemption.IsZero(), "zero liquid validator shares after redemption") - // } - - // if tc.vestingAmount.IsPositive() { - // acc := app.AccountKeeper.GetAccount(ctx, addrAcc2) - // vestingAcc := acc.(vesting.VestingAccount) - // require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(app.StakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) - // } - - // expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) - // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // require.True(t, found, "delegation not found after redeem tokens") - // require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) - // require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) - // require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") - - // // check delegator balance is not changed - // bondDenomAmountAfter := app.BankKeeper.GetBalance(ctx, delegatorAccount, app.StakingKeeper.BondDenom(ctx)) - // require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) - - // // get delegation amount is changed correctly - // val1, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // delegation, found = app.StakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) - // if !found { - // delegation = types.Delegation{Shares: sdk.ZeroDec()} - // } - // delAmountAfter := val1.TokensFromShares(delegation.Shares) - // require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) - - // shareToken = app.BankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) - // require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) - // _, found = app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found, true, "validator not found") - - // if tc.recordAccountDelegationExists { - // _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - // require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") - - // records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - // require.Len(t, records, 1) - // } else { - // _, found = app.StakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) - // require.False(t, found, "delegation found from tokenize share module account after redeem full amount") - - // records = app.StakingKeeper.GetAllTokenizeShareRecords(ctx) - // require.Len(t, records, 0) - // } - // }) - // } + var ( + accountKeeper accountKeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + distrKeeper distribkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &bankKeeper, + &distrKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + liquidStakingCapStrict := sdk.ZeroDec() + liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") + liquidStakingCapDisabled := sdk.OneDec() + + validatorBondStrict := sdk.OneDec() + validatorBondConservative := sdk.NewDec(10) + validatorBondDisabled := sdk.NewDec(-1) + + testCases := []struct { + name string + vestingAmount sdk.Int + delegationAmount sdk.Int + tokenizeShareAmount sdk.Int + redeemAmount sdk.Int + targetVestingDelAfterShare sdk.Int + targetVestingDelAfterRedeem sdk.Int + globalLiquidStakingCap sdk.Dec + slashFactor sdk.Dec + validatorLiquidStakingCap sdk.Dec + validatorBondFactor sdk.Dec + validatorBondDelegation bool + validatorBondDelegatorIndex int + delegatorIsLSTP bool + expTokenizeErr bool + expRedeemErr bool + prevAccountDelegationExists bool + recordAccountDelegationExists bool + }{ + { + name: "full amount tokenize and redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: false, + }, + { + name: "full amount tokenize and partial redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: true, + }, + { + name: "partial amount tokenize and full redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + recordAccountDelegationExists: false, + }, + { + name: "tokenize and redeem with slash", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.MustNewDecFromStr("0.1"), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: false, + recordAccountDelegationExists: true, + }, + { + name: "over tokenize", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 30), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + }, + { + name: "over redeem", + vestingAmount: sdk.NewInt(0), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 40), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: true, + }, + { + name: "vesting account tokenize share failure", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "vesting account tokenize share success", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: false, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "try tokenize share for a validator-bond delegation", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 1, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict validator-bond - tokenization fails", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondStrict, + validatorBondDelegation: false, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative validator-bond - successful tokenization", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict global liquid staking cap - tokenization fails", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapStrict, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative global liquid staking cap - successful tokenization", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapDisabled, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "strict validator liquid staking cap - tokenization fails", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapStrict, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: true, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "conservative validator liquid staking cap - successful tokenization", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapDisabled, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondDisabled, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "all caps set conservatively - successful tokenize share", + vestingAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondConservative, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + { + name: "delegator is a liquid staking provider - accounting should not update", + vestingAmount: sdk.ZeroInt(), + delegationAmount: stakingKeeper.TokensFromConsensusPower(ctx, 20), + tokenizeShareAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + redeemAmount: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterShare: stakingKeeper.TokensFromConsensusPower(ctx, 10), + targetVestingDelAfterRedeem: stakingKeeper.TokensFromConsensusPower(ctx, 10), + slashFactor: sdk.ZeroDec(), + globalLiquidStakingCap: liquidStakingCapConservative, + validatorLiquidStakingCap: liquidStakingCapConservative, + validatorBondFactor: validatorBondConservative, + delegatorIsLSTP: true, + validatorBondDelegation: true, + validatorBondDelegatorIndex: 0, + expTokenizeErr: false, + expRedeemErr: false, + prevAccountDelegationExists: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // reset store for each tc + cc, _ := ctx.CacheContext() + + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, cc, 2, stakingKeeper.TokensFromConsensusPower(cc, 10000)) + addrAcc1, addrAcc2 := addrs[0], addrs[1] + addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) + + // Create ICA module account + icaAccountAddress := createICAAccount(cc, accountKeeper) + + // Fund module account + delegationCoin := sdk.NewCoin(stakingKeeper.BondDenom(cc), tc.delegationAmount) + err := bankKeeper.MintCoins(cc, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) + require.NoError(t, err) + err = bankKeeper.SendCoinsFromModuleToAccount(cc, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) + require.NoError(t, err) + + // set the delegator address depending on whether the delegator should be a liquid staking provider + delegatorAccount := addrAcc2 + if tc.delegatorIsLSTP { + delegatorAccount = icaAccountAddress + } + + // set validator bond factor and global liquid staking cap + params := stakingKeeper.GetParams(cc) + params.ValidatorBondFactor = tc.validatorBondFactor + params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap + params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap + stakingKeeper.SetParams(cc, params) + + // set the total liquid staked tokens + stakingKeeper.SetTotalLiquidStakedTokens(cc, sdk.ZeroInt()) + + if !tc.vestingAmount.IsZero() { + // create vesting account + pubkey := secp256k1.GenPrivKey().PubKey() + baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) + initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) + baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, cc.BlockTime().Unix()+86400*365) + delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) + accountKeeper.SetAccount(cc, delayedVestingAccount) + } + + pubKeys := simtestutil.CreateTestPubKeys(2) + pk1, pk2 := pubKeys[0], pubKeys[1] + + // Create Validators and Delegation + tstaking := testutil.NewHelper(t, cc, stakingKeeper) + + tstaking.CreateValidator(addrVal1, pk1, sdk.NewInt(100), true) + tstaking.CreateValidator(addrVal2, pk2, sdk.NewInt(100), true) + + // end block to bond validator and start new block + staking.EndBlocker(cc, stakingKeeper) + cc = cc.WithBlockHeight(cc.BlockHeight() + 1) + tstaking.Ctx = cc + + // fetch validators + val1 := stakingKeeper.Validator(cc, addrVal1) + // val2 := stakingKeeper.Validator(cc, addrVal2) + + // Delegate from both the main delegator as well as a random account so there is a + // non-zero delegation after redemption + err = delegateCoinsFromAccount(cc, *stakingKeeper, delegatorAccount, tc.delegationAmount, val1) + require.NoError(t, err) + + // apply TM updates + applyValidatorSetUpdates(t, cc, stakingKeeper, -1) + + _, found := stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + require.True(t, found, "delegation not found after delegate") + + lastRecordID := stakingKeeper.GetLastTokenizeShareRecordID(cc) + oldValidator, found := stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + if tc.validatorBondDelegation { + err := delegateCoinsFromAccount(cc, *stakingKeeper, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) + require.NoError(t, err) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(cc), &types.MsgValidatorBond{ + DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), + ValidatorAddress: addrVal1.String(), + }) + require.NoError(t, err) + } + + resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(cc), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAccount.String(), + ValidatorAddress: addrVal1.String(), + Amount: sdk.NewCoin(stakingKeeper.BondDenom(cc), tc.tokenizeShareAmount), + TokenizedShareOwner: delegatorAccount.String(), + }) + if tc.expTokenizeErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // check last record id increase + require.Equal(t, lastRecordID+1, stakingKeeper.GetLastTokenizeShareRecordID(cc)) + + // ensure validator's total tokens is consistent + newValidator, found := stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased + totalLiquidTokensAfterTokenization := stakingKeeper.GetTotalLiquidStakedTokens(cc) + validatorLiquidSharesAfterTokenization := newValidator.LiquidShares + if !tc.delegatorIsLSTP { + require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") + require.Equal(t, tc.tokenizeShareAmount.String(), validatorLiquidSharesAfterTokenization.TruncateInt().String(), "validator liquid shares after tokenization") + } else { + require.True(t, totalLiquidTokensAfterTokenization.IsZero(), "zero liquid tokens after tokenization") + require.True(t, validatorLiquidSharesAfterTokenization.IsZero(), "zero liquid validator shares after tokenization") + } + + if tc.vestingAmount.IsPositive() { + acc := accountKeeper.GetAccount(cc, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(cc)).String(), tc.targetVestingDelAfterShare.String()) + } + + if tc.prevAccountDelegationExists { + _, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + require.True(t, found, "delegation found after partial tokenize share") + } else { + _, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + require.False(t, found, "delegation found after full tokenize share") + } + + shareToken := bankKeeper.GetBalance(cc, delegatorAccount, resp.Amount.Denom) + require.Equal(t, resp.Amount, shareToken) + _, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found, true, "validator not found") + + records := stakingKeeper.GetAllTokenizeShareRecords(cc) + require.Len(t, records, 1) + delegation, found := stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after tokenize share") + + // slash before redeem + slashedTokens := sdk.ZeroInt() + redeemedShares := tc.redeemAmount + redeemedTokens := tc.redeemAmount + if tc.slashFactor.IsPositive() { + consAddr, err := val1.GetConsAddr() + require.NoError(t, err) + cc = cc.WithBlockHeight(100) + val1, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + power := stakingKeeper.TokensToConsensusPower(cc, val1.(types.Validator).Tokens) + stakingKeeper.Slash(cc, consAddr, 10, power, tc.slashFactor) + slashedTokens = sdk.NewDecFromInt(val1.(types.Validator).Tokens).Mul(tc.slashFactor).TruncateInt() + + val1, _ := stakingKeeper.GetValidator(cc, addrVal1) + redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() + } + + // get deletagor balance and delegation + bondDenomAmountBefore := bankKeeper.GetBalance(cc, delegatorAccount, stakingKeeper.BondDenom(cc)) + val1, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountBefore := val1.TokensFromShares(delegation.Shares) + oldValidator, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(cc), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAccount.String(), + Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), + }) + if tc.expRedeemErr { + require.Error(t, err) + return + } + require.NoError(t, err) + + // ensure validator's total tokens is consistent + newValidator, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + require.Equal(t, oldValidator.Tokens, newValidator.Tokens) + + // if the delegator was not a liquid staking provider, check that the total liquid staked + // and liquid shares decreased + totalLiquidTokensAfterRedemption := stakingKeeper.GetTotalLiquidStakedTokens(cc) + validatorLiquidSharesAfterRedemption := newValidator.LiquidShares + expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) + expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) + if !tc.delegatorIsLSTP { + require.Equal(t, expectedLiquidTokens.String(), totalLiquidTokensAfterRedemption.String(), "total liquid tokens after redemption") + require.Equal(t, expectedLiquidShares.String(), validatorLiquidSharesAfterRedemption.String(), "validator liquid shares after tokenization") + } else { + require.True(t, totalLiquidTokensAfterRedemption.IsZero(), "zero liquid tokens after redemption") + require.True(t, validatorLiquidSharesAfterRedemption.IsZero(), "zero liquid validator shares after redemption") + } + + if tc.vestingAmount.IsPositive() { + acc := accountKeeper.GetAccount(cc, addrAcc2) + vestingAcc := acc.(vesting.VestingAccount) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(cc)).String(), tc.targetVestingDelAfterRedeem.String()) + } + + expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) + delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + require.True(t, found, "delegation not found after redeem tokens") + require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) + require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) + require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") + + // check delegator balance is not changed + bondDenomAmountAfter := bankKeeper.GetBalance(cc, delegatorAccount, stakingKeeper.BondDenom(cc)) + require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) + + // get delegation amount is changed correctly + val1, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found) + delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + if !found { + delegation = types.Delegation{Shares: sdk.ZeroDec()} + } + delAmountAfter := val1.TokensFromShares(delegation.Shares) + require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) + + shareToken = bankKeeper.GetBalance(cc, delegatorAccount, resp.Amount.Denom) + require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) + _, found = stakingKeeper.GetValidator(cc, addrVal1) + require.True(t, found, true, "validator not found") + + if tc.recordAccountDelegationExists { + _, found = stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") + + records = stakingKeeper.GetAllTokenizeShareRecords(cc) + require.Len(t, records, 1) + } else { + _, found = stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + require.False(t, found, "delegation found from tokenize share module account after redeem full amount") + + records = stakingKeeper.GetAllTokenizeShareRecords(cc) + require.Len(t, records, 0) + } + }) + } } // TODO refactor LSM test @@ -722,26 +752,28 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { // Helper function to setup a delegator and validator for the Tokenize/Redeem conversion tests func setupTestTokenizeAndRedeemConversion( t *testing.T, - app *simapp.SimApp, + sk keeper.Keeper, + bk bankkeeper.Keeper, ctx sdk.Context, ) (delAddress sdk.AccAddress, valAddress sdk.ValAddress) { - // addresses := simapp.AddTestAddrs(app, ctx, 2, sdk.NewInt(1_000_000)) - // pubKeys := simapp.CreateTestPubKeys(1) + addresses := simtestutil.AddTestAddrs(bk, sk, ctx, 2, sdk.NewInt(1_000_000)) + + pubKeys := simtestutil.CreateTestPubKeys(1) - // delegatorAddress := addresses[0] - // validatorAddress := sdk.ValAddress(addresses[1]) + delegatorAddress := addresses[0] + validatorAddress := sdk.ValAddress(addresses[1]) - // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) - // validator.DelegatorShares = sdk.NewDec(1_000_000) - // validator.Tokens = sdk.NewInt(1_000_000) - // validator.LiquidShares = sdk.NewDec(0) - // validator.Status = types.Bonded + validator, err := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + require.NoError(t, err) + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.LiquidShares = sdk.NewDec(0) + validator.Status = types.Bonded - // app.StakingKeeper.SetValidator(ctx, validator) - // app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) + sk.SetValidator(ctx, validator) + sk.SetValidatorByConsAddr(ctx, validator) - // return delegatorAddress, validatorAddress - return + return delegatorAddress, validatorAddress } // TODO refactor LSM test @@ -749,15 +781,15 @@ func setupTestTokenizeAndRedeemConversion( // Simulate a slash by decrementing the validator's tokens // We'll do this in a way such that the exchange rate is not an even integer // and the shares associated with a delegation will have a long decimal -func simulateSlashWithImprecision(t *testing.T, app *simapp.SimApp, ctx sdk.Context, valAddress sdk.ValAddress) { - // validator, found := app.StakingKeeper.GetValidator(ctx, valAddress) - // require.True(t, found) +func simulateSlashWithImprecision(t *testing.T, sk keeper.Keeper, ctx sdk.Context, valAddress sdk.ValAddress) { + validator, found := sk.GetValidator(ctx, valAddress) + require.True(t, found) - // slashMagnitude := sdk.MustNewDecFromStr("0.1111111111") - // slashTokens := validator.Tokens.ToDec().Mul(slashMagnitude).TruncateInt() - // validator.Tokens = validator.Tokens.Sub(slashTokens) + slashMagnitude := sdk.MustNewDecFromStr("0.1111111111") + slashTokens := sdk.NewDecFromInt(validator.Tokens).Mul(slashMagnitude).TruncateInt() + validator.Tokens = validator.Tokens.Sub(slashTokens) - // app.StakingKeeper.SetValidator(ctx, validator) + sk.SetValidator(ctx, validator) } // TODO refactor LSM test @@ -766,61 +798,71 @@ func simulateSlashWithImprecision(t *testing.T, app *simapp.SimApp, ctx sdk.Cont // Note, in this example, there 2 tokens are lost during the decimal to int conversion // during the unbonding step within tokenization and redemption func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) - - // // slash the validator - // simulateSlashWithImprecision(t, app, ctx, validatorAddress) - // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found) - - // // Delegate and confirm the delegation record was created - // delegateAmount := sdk.NewInt(1000) - // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // }) - // require.NoError(t, err, "no error expected when delegating") - - // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found, "delegation should have been found") - - // // Tokenize the full delegation amount - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // TokenizedShareOwner: delegatorAddress.String(), - // }) - // require.NoError(t, err, "no error expected when tokenizing") - - // // Confirm the number of shareTokens equals the number of shares truncated - // // Note: 1 token is lost during unbonding due to rounding - // shareDenom := validatorAddress.String() + "/1" - // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - // expectedShareTokens := delegation.Shares.TruncateInt().Int64() - 1 // 1 token was lost during unbonding - // require.Equal(t, expectedShareTokens, shareToken.Amount.Int64(), "share token amount") + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) - // // Redeem the share tokens - // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - // DelegatorAddress: delegatorAddress.String(), - // Amount: shareToken, - // }) - // require.NoError(t, err, "no error expected when redeeming") - - // // Confirm (almost) the full delegation was recovered - minus the 2 tokens from the precision error - // // (1 occurs during tokenization, and 1 occurs during redemption) - // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found) - - // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - // expectedDelegationTokens := delegateAmount.Int64() - 2 - // require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) + + // slash the validator + simulateSlashWithImprecision(t, *stakingKeeper, ctx, validatorAddress) + validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + delegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Tokenize the full delegation amount + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // Confirm the number of shareTokens equals the number of shares truncated + // Note: 1 token is lost during unbonding due to rounding + shareDenom := validatorAddress.String() + "/1" + shareToken := bankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens := delegation.Shares.TruncateInt().Int64() - 1 // 1 token was lost during unbonding + require.Equal(t, expectedShareTokens, shareToken.Amount.Int64(), "share token amount") + + // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm (almost) the full delegation was recovered - minus the 2 tokens from the precision error + // (1 occurs during tokenization, and 1 occurs during redemption) + newDelegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + expectedDelegationTokens := delegateAmount.Int64() - 2 + require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } // TODO refactor LSM test @@ -830,64 +872,74 @@ func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within tokenization func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) - - // // Delegate and confirm the delegation record was created - // delegateAmount := sdk.NewInt(1000) - // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // }) - // require.NoError(t, err, "no error expected when delegating") - - // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found, "delegation should have been found") - - // // slash the validator - // simulateSlashWithImprecision(t, app, ctx, validatorAddress) - // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found) - - // // Tokenize the new amount after the slash - // delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt() - // tokenizationCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmountAfterSlash) - - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: tokenizationCoin, - // TokenizedShareOwner: delegatorAddress.String(), - // }) - // require.NoError(t, err, "no error expected when tokenizing") - - // // The number of share tokens should line up with the **new** number of shares associated - // // with the original delegated amount - // // Note: 1 token is lost during unbonding due to rounding - // shareDenom := validatorAddress.String() + "/1" - // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - // expectedShareTokens, err := validator.SharesFromTokens(tokenizationCoin.Amount) - // require.Equal(t, expectedShareTokens.TruncateInt().Int64()-1, shareToken.Amount.Int64(), "share token amount") - - // // // Redeem the share tokens - // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - // DelegatorAddress: delegatorAddress.String(), - // Amount: shareToken, - // }) - // require.NoError(t, err, "no error expected when redeeming") - - // // Confirm the full tokenization amount was recovered - minus the 1 token from the precision error - // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found) - - // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - // expectedDelegationTokens := delegationAmountAfterSlash.Int64() - 1 - // require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + _, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // slash the validator + simulateSlashWithImprecision(t, *stakingKeeper, ctx, validatorAddress) + validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Tokenize the new amount after the slash + delegationAmountAfterSlash := validator.TokensFromShares(sdk.NewDecFromInt(delegateAmount)).TruncateInt() + tokenizationCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegationAmountAfterSlash) + + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: tokenizationCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // The number of share tokens should line up with the **new** number of shares associated + // with the original delegated amount + // Note: 1 token is lost during unbonding due to rounding + shareDenom := validatorAddress.String() + "/1" + shareToken := bankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens, err := validator.SharesFromTokens(tokenizationCoin.Amount) + require.Equal(t, expectedShareTokens.TruncateInt().Int64()-1, shareToken.Amount.Int64(), "share token amount") + + // // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm the full tokenization amount was recovered - minus the 1 token from the precision error + newDelegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + expectedDelegationTokens := delegationAmountAfterSlash.Int64() - 1 + require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } // TODO refactor LSM test @@ -897,566 +949,629 @@ func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within redemption func TestTokenizeAndRedeemConversion_SlashBeforeRedemptino(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, app, ctx) - - // // Delegate and confirm the delegation record was created - // delegateAmount := sdk.NewInt(1000) - // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // }) - // require.NoError(t, err, "no error expected when delegating") - - // _, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found, "delegation should have been found") - - // // Tokenize the full delegation amount - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // TokenizedShareOwner: delegatorAddress.String(), - // }) - // require.NoError(t, err, "no error expected when tokenizing") - - // // The number of share tokens should line up 1:1 with the number of issued shares - // // Since the validator has not been slashed, the shares also line up 1;1 - // // with the original delegation amount - // shareDenom := validatorAddress.String() + "/1" - // shareToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) - // expectedShareTokens := delegateAmount - // require.Equal(t, expectedShareTokens.Int64(), shareToken.Amount.Int64(), "share token amount") - - // // slash the validator - // simulateSlashWithImprecision(t, app, ctx, validatorAddress) - // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found) + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) - // // Redeem the share tokens - // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ - // DelegatorAddress: delegatorAddress.String(), - // Amount: shareToken, - // }) - // require.NoError(t, err, "no error expected when redeeming") - - // // Confirm the original delegation, minus the slash, was recovered - // // There's an additional 1 token lost from precision error during unbonding - // delegationAmountAfterSlash := validator.TokensFromShares(delegateAmount.ToDec()).TruncateInt().Int64() - // newDelegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found) - - // endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() - // require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) + + // Delegate and confirm the delegation record was created + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + }) + require.NoError(t, err, "no error expected when delegating") + + _, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Tokenize the full delegation amount + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + TokenizedShareOwner: delegatorAddress.String(), + }) + require.NoError(t, err, "no error expected when tokenizing") + + // The number of share tokens should line up 1:1 with the number of issued shares + // Since the validator has not been slashed, the shares also line up 1;1 + // with the original delegation amount + shareDenom := validatorAddress.String() + "/1" + shareToken := bankKeeper.GetBalance(ctx, delegatorAddress, shareDenom) + expectedShareTokens := delegateAmount + require.Equal(t, expectedShareTokens.Int64(), shareToken.Amount.Int64(), "share token amount") + + // slash the validator + simulateSlashWithImprecision(t, *stakingKeeper, ctx, validatorAddress) + validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found) + + // Redeem the share tokens + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + Amount: shareToken, + }) + require.NoError(t, err, "no error expected when redeeming") + + // Confirm the original delegation, minus the slash, was recovered + // There's an additional 1 token lost from precision error during unbonding + delegationAmountAfterSlash := validator.TokensFromShares(sdk.NewDecFromInt(delegateAmount)).TruncateInt().Int64() + newDelegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found) + + endDelegationTokens := validator.TokensFromShares(newDelegation.Shares).TruncateInt().Int64() + require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") } // TODO refactor LSM test func TestTransferTokenizeShareRecord(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // addrs := simapp.AddTestAddrs(app, ctx, 3, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - // addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] - // addrVal := sdk.ValAddress(valAcc) - - // pubKeys := simapp.CreateTestPubKeys(1) - // pk := pubKeys[0] - - // val := stakingtypes.NewValidator(addrVal, pk, stakingtypes.Description{}) - // app.StakingKeeper.SetValidator(ctx, val) - // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val) - - // // apply TM updates - // applyValidatorSetUpdates(t, ctx, app.StakingKeeper, -1) - - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // err := app.StakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ - // Id: 1, - // Owner: addrAcc1.String(), - // ModuleAccount: "module_account", - // Validator: val.String(), - // }) - // require.NoError(t, err) - - // _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ - // TokenizeShareRecordId: 1, - // Sender: addrAcc1.String(), - // NewOwner: addrAcc2.String(), - // }) - // require.NoError(t, err) - - // record, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 1) - // require.NoError(t, err) - // require.Equal(t, record.Owner, addrAcc2.String()) - - // records := app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) - // require.Len(t, records, 0) - // records = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) - // require.Len(t, records, 1) + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 3, stakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] + addrVal := sdk.ValAddress(valAcc) + + pubKeys := simtestutil.CreateTestPubKeys(1) + pk := pubKeys[0] + + val, err := stakingtypes.NewValidator(addrVal, pk, stakingtypes.Description{}) + require.NoError(t, err) + + stakingKeeper.SetValidator(ctx, val) + stakingKeeper.SetValidatorByPowerIndex(ctx, val) + + // apply TM updates + applyValidatorSetUpdates(t, ctx, stakingKeeper, -1) + + err = stakingKeeper.AddTokenizeShareRecord(ctx, types.TokenizeShareRecord{ + Id: 1, + Owner: addrAcc1.String(), + ModuleAccount: "module_account", + Validator: val.String(), + }) + require.NoError(t, err) + + _, err = msgServer.TransferTokenizeShareRecord(sdk.WrapSDKContext(ctx), &types.MsgTransferTokenizeShareRecord{ + TokenizeShareRecordId: 1, + Sender: addrAcc1.String(), + NewOwner: addrAcc2.String(), + }) + require.NoError(t, err) + + record, err := stakingKeeper.GetTokenizeShareRecord(ctx, 1) + require.NoError(t, err) + require.Equal(t, record.Owner, addrAcc2.String()) + + records := stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc1) + require.Len(t, records, 0) + records = stakingKeeper.GetTokenizeShareRecordsByOwner(ctx, addrAcc2) + require.Len(t, records, 1) } // TODO refactor LSM test func TestValidatorBond(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // testCases := []struct { - // name string - // createValidator bool - // createDelegation bool - // alreadyValidatorBond bool - // delegatorIsLSTP bool - // expectedErr error - // }{ - // { - // name: "successful validator bond", - // createValidator: true, - // createDelegation: true, - // alreadyValidatorBond: false, - // delegatorIsLSTP: false, - // }, - // { - // name: "successful with existing validator bond", - // createValidator: true, - // createDelegation: true, - // alreadyValidatorBond: true, - // delegatorIsLSTP: false, - // }, - // { - // name: "validator does not not exist", - // createValidator: false, - // createDelegation: false, - // alreadyValidatorBond: false, - // delegatorIsLSTP: false, - // expectedErr: sdkstaking.ErrNoValidatorFound, - // }, - // { - // name: "delegation not exist case", - // createValidator: true, - // createDelegation: false, - // alreadyValidatorBond: false, - // delegatorIsLSTP: false, - // expectedErr: sdkstaking.ErrNoDelegation, - // }, - // { - // name: "delegator is a liquid staking provider", - // createValidator: true, - // createDelegation: true, - // alreadyValidatorBond: false, - // delegatorIsLSTP: true, - // expectedErr: types.ErrValidatorBondNotAllowedFromModuleAccount, - // }, - // } - - // for _, tc := range testCases { - // t.Run(tc.name, func(t *testing.T) { - // _, app, ctx = createTestInput() - - // pubKeys := simapp.CreateTestPubKeys(2) - // validatorPubKey := pubKeys[0] - // delegatorPubKey := pubKeys[1] - - // delegatorAddress := sdk.AccAddress(delegatorPubKey.Address()) - // validatorAddress := sdk.ValAddress(validatorPubKey.Address()) - // icaAccountAddress := createICAAccount(app, ctx) - - // // Set the delegator address to either be a user account or an ICA account depending on the test case - // if tc.delegatorIsLSTP { - // delegatorAddress = icaAccountAddress - // } - - // // Fund the delegator - // delegationAmount := app.StakingKeeper.TokensFromConsensusPower(ctx, 20) - // coins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegationAmount)) - - // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) - // require.NoError(t, err, "no error expected when minting") - - // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) - // require.NoError(t, err, "no error expected when funding account") - - // // Create Validator and delegation - // if tc.createValidator { - // validator := stakingtypes.NewValidator(validatorAddress, validatorPubKey, stakingtypes.Description{}) - // validator.Status = sdkstaking.Bonded - // app.StakingKeeper.SetValidator(ctx, validator) - // app.StakingKeeper.SetValidatorByPowerIndex(ctx, validator) - // err = app.StakingKeeper.SetValidatorByConsAddr(ctx, validator) - // require.NoError(t, err) - - // // Optionally create the delegation, depending on the test case - // if tc.createDelegation { - // _, err = app.StakingKeeper.Delegate(ctx, delegatorAddress, delegationAmount, sdkstaking.Unbonded, validator, true) - // require.NoError(t, err, "no error expected when delegating") - - // // Optionally, convert the delegation into a validator bond - // if tc.alreadyValidatorBond { - // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found, "delegation should have been found") - - // delegation.ValidatorBond = true - // app.StakingKeeper.SetDelegation(ctx, delegation) - // } - // } - // } - - // // Call ValidatorBond - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // }) - - // if tc.expectedErr != nil { - // require.ErrorContains(t, err, tc.expectedErr.Error()) - // } else { - // require.NoError(t, err, "no error expected from validator bond transaction") - - // // check validator bond true - // delegation, found := app.StakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) - // require.True(t, found, "delegation should have been found after validator bond") - // require.True(t, delegation.ValidatorBond, "delegation should be marked as a validator bond") - - // // check validator bond shares - // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found, "validator should have been found after validator bond") - - // if tc.alreadyValidatorBond { - // require.True(t, validator.ValidatorBondShares.IsZero(), "validator bond shares should still be zero") - // } else { - // require.Equal(t, delegation.Shares.String(), validator.ValidatorBondShares.String(), - // "validator total shares should have increased") - // } - // } - // }) - // } + + testCases := []struct { + name string + createValidator bool + createDelegation bool + alreadyValidatorBond bool + delegatorIsLSTP bool + expectedErr error + }{ + { + name: "successful validator bond", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + }, + { + name: "successful with existing validator bond", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: true, + delegatorIsLSTP: false, + }, + { + name: "validator does not not exist", + createValidator: false, + createDelegation: false, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + expectedErr: stakingtypes.ErrNoValidatorFound, + }, + { + name: "delegation not exist case", + createValidator: true, + createDelegation: false, + alreadyValidatorBond: false, + delegatorIsLSTP: false, + expectedErr: stakingtypes.ErrNoDelegation, + }, + { + name: "delegator is a liquid staking provider", + createValidator: true, + createDelegation: true, + alreadyValidatorBond: false, + delegatorIsLSTP: true, + expectedErr: types.ErrValidatorBondNotAllowedFromModuleAccount, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + var ( + accountKeeper accountKeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + pubKeys := simtestutil.CreateTestPubKeys(2) + + validatorPubKey := pubKeys[0] + delegatorPubKey := pubKeys[1] + + delegatorAddress := sdk.AccAddress(delegatorPubKey.Address()) + validatorAddress := sdk.ValAddress(validatorPubKey.Address()) + icaAccountAddress := createICAAccount(ctx, accountKeeper) + + // Set the delegator address to either be a user account or an ICA account depending on the test case + if tc.delegatorIsLSTP { + delegatorAddress = icaAccountAddress + } + + // Fund the delegator + delegationAmount := stakingKeeper.TokensFromConsensusPower(ctx, 20) + coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegationAmount)) + + err = bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + require.NoError(t, err, "no error expected when minting") + + err = bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) + require.NoError(t, err, "no error expected when funding account") + + // Create Validator and delegation + if tc.createValidator { + validator, err := stakingtypes.NewValidator(validatorAddress, validatorPubKey, stakingtypes.Description{}) + require.NoError(t, err) + validator.Status = stakingtypes.Bonded + stakingKeeper.SetValidator(ctx, validator) + stakingKeeper.SetValidatorByPowerIndex(ctx, validator) + err = stakingKeeper.SetValidatorByConsAddr(ctx, validator) + require.NoError(t, err) + + // Optionally create the delegation, depending on the test case + if tc.createDelegation { + _, err = stakingKeeper.Delegate(ctx, delegatorAddress, delegationAmount, stakingtypes.Unbonded, validator, true) + require.NoError(t, err, "no error expected when delegating") + + // Optionally, convert the delegation into a validator bond + if tc.alreadyValidatorBond { + delegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + delegation.ValidatorBond = true + stakingKeeper.SetDelegation(ctx, delegation) + } + } + } + + // Call ValidatorBond + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + }) + + if tc.expectedErr != nil { + require.ErrorContains(t, err, tc.expectedErr.Error()) + } else { + require.NoError(t, err, "no error expected from validator bond transaction") + + // check validator bond true + delegation, found := stakingKeeper.GetDelegation(ctx, delegatorAddress, validatorAddress) + require.True(t, found, "delegation should have been found after validator bond") + require.True(t, delegation.ValidatorBond, "delegation should be marked as a validator bond") + + // check validator bond shares + validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found after validator bond") + + if tc.alreadyValidatorBond { + require.True(t, validator.ValidatorBondShares.IsZero(), "validator bond shares should still be zero") + } else { + require.Equal(t, delegation.Shares.String(), validator.ValidatorBondShares.String(), + "validator total shares should have increased") + } + } + }) + } } // TODO refactor LSM test func TestChangeValidatorBond(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { - // validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found, "validator should have been found") - // require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") - // } - - // // Create a delegator and 3 validators - // addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1_000_000)) - // pubKeys := simapp.CreateTestPubKeys(4) - - // validatorAPubKey := pubKeys[1] - // validatorBPubKey := pubKeys[2] - // validatorCPubKey := pubKeys[3] - - // delegatorAddress := addresses[0] - // validatorAAddress := sdk.ValAddress(validatorAPubKey.Address()) - // validatorBAddress := sdk.ValAddress(validatorBPubKey.Address()) - // validatorCAddress := sdk.ValAddress(validatorCPubKey.Address()) - - // validatorA := stakingtypes.NewValidator(validatorAAddress, validatorAPubKey, stakingtypes.Description{}) - // validatorB := stakingtypes.NewValidator(validatorBAddress, validatorBPubKey, stakingtypes.Description{}) - // validatorC := stakingtypes.NewValidator(validatorCAddress, validatorCPubKey, stakingtypes.Description{}) - - // validatorA.Tokens = sdk.NewInt(1_000_000) - // validatorB.Tokens = sdk.NewInt(1_000_000) - // validatorC.Tokens = sdk.NewInt(1_000_000) - // validatorA.DelegatorShares = sdk.NewDec(1_000_000) - // validatorB.DelegatorShares = sdk.NewDec(1_000_000) - // validatorC.DelegatorShares = sdk.NewDec(1_000_000) - - // app.StakingKeeper.SetValidator(ctx, validatorA) - // app.StakingKeeper.SetValidator(ctx, validatorB) - // app.StakingKeeper.SetValidator(ctx, validatorC) - - // // The test will go through Delegate/Redelegate/Undelegate messages with the following - // delegation1Amount := sdk.NewInt(1000) - // delegation2Amount := sdk.NewInt(1000) - // redelegateAmount := sdk.NewInt(500) - // undelegateAmount := sdk.NewInt(500) - - // delegate1Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation1Amount) - // delegate2Coin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegation2Amount) - // redelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), redelegateAmount) - // undelegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), undelegateAmount) - - // // Delegate to validator's A and C - validator bond shares should not change - // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAAddress.String(), - // Amount: delegate1Coin, - // }) - // require.NoError(t, err, "no error expected during first delegation") - - // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorCAddress.String(), - // Amount: delegate1Coin, - // }) - // require.NoError(t, err, "no error expected during first delegation") - - // checkValidatorBondShares(validatorAAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, sdk.ZeroInt()) - - // // Flag the the delegations to validator A and C validator bond's - // // Their bond shares should increase - // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAAddress.String(), - // }) - // require.NoError(t, err, "no error expected during validator bond") - - // _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorCAddress.String(), - // }) - // require.NoError(t, err, "no error expected during validator bond") - - // checkValidatorBondShares(validatorAAddress, delegation1Amount) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // // Delegate more to validator A - it should increase the validator bond shares - // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAAddress.String(), - // Amount: delegate2Coin, - // }) - // require.NoError(t, err, "no error expected during second delegation") - - // checkValidatorBondShares(validatorAAddress, delegation1Amount.Add(delegation2Amount)) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // // Redelegate partially from A to B (where A is a validator bond and B is not) - // // It should remove the bond shares from A, and B's validator bond shares should not change - // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorSrcAddress: validatorAAddress.String(), - // ValidatorDstAddress: validatorBAddress.String(), - // Amount: redelegateCoin, - // }) - // require.NoError(t, err, "no error expected during redelegation") - - // expectedBondSharesA := delegation1Amount.Add(delegation2Amount).Sub(redelegateAmount) - // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, delegation1Amount) - - // // Now redelegate from B to C (where B is not a validator bond, but C is) - // // Validator B's bond shares should remain at zero, but C's bond shares should increase - // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorSrcAddress: validatorBAddress.String(), - // ValidatorDstAddress: validatorCAddress.String(), - // Amount: redelegateCoin, - // }) - // require.NoError(t, err, "no error expected during redelegation") - - // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, delegation1Amount.Add(redelegateAmount)) - - // // Redelegate partially from A to C (where C is a validator bond delegation) - // // It should remove the bond shares from A, and increase the bond shares on validator C - // _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorSrcAddress: validatorAAddress.String(), - // ValidatorDstAddress: validatorCAddress.String(), - // Amount: redelegateCoin, - // }) - // require.NoError(t, err, "no error expected during redelegation") - - // expectedBondSharesA = expectedBondSharesA.Sub(redelegateAmount) - // expectedBondSharesC := delegation1Amount.Add(redelegateAmount).Add(redelegateAmount) - // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, expectedBondSharesC) - - // // Undelegate from validator A - it should remove shares - // _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAAddress.String(), - // Amount: undelegateCoin, - // }) - // require.NoError(t, err, "no error expected during undelegation") - - // expectedBondSharesA = expectedBondSharesA.Sub(undelegateAmount) - // checkValidatorBondShares(validatorAAddress, expectedBondSharesA) - // checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) - // checkValidatorBondShares(validatorCAddress, expectedBondSharesC) + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { + validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") + } + + // Create a delegator and 3 validators + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 4, sdk.NewInt(1_000_000)) + pubKeys := simtestutil.CreateTestPubKeys(4) + + validatorAPubKey := pubKeys[1] + validatorBPubKey := pubKeys[2] + validatorCPubKey := pubKeys[3] + + delegatorAddress := addresses[0] + validatorAAddress := sdk.ValAddress(validatorAPubKey.Address()) + validatorBAddress := sdk.ValAddress(validatorBPubKey.Address()) + validatorCAddress := sdk.ValAddress(validatorCPubKey.Address()) + + validatorA, err := stakingtypes.NewValidator(validatorAAddress, validatorAPubKey, stakingtypes.Description{}) + require.NoError(t, err) + validatorB, err := stakingtypes.NewValidator(validatorBAddress, validatorBPubKey, stakingtypes.Description{}) + require.NoError(t, err) + validatorC, err := stakingtypes.NewValidator(validatorCAddress, validatorCPubKey, stakingtypes.Description{}) + require.NoError(t, err) + + validatorA.Tokens = sdk.NewInt(1_000_000) + validatorB.Tokens = sdk.NewInt(1_000_000) + validatorC.Tokens = sdk.NewInt(1_000_000) + validatorA.DelegatorShares = sdk.NewDec(1_000_000) + validatorB.DelegatorShares = sdk.NewDec(1_000_000) + validatorC.DelegatorShares = sdk.NewDec(1_000_000) + + stakingKeeper.SetValidator(ctx, validatorA) + stakingKeeper.SetValidator(ctx, validatorB) + stakingKeeper.SetValidator(ctx, validatorC) + + // The test will go through Delegate/Redelegate/Undelegate messages with the following + delegation1Amount := sdk.NewInt(1000) + delegation2Amount := sdk.NewInt(1000) + redelegateAmount := sdk.NewInt(500) + undelegateAmount := sdk.NewInt(500) + + delegate1Coin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegation1Amount) + delegate2Coin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegation2Amount) + redelegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), redelegateAmount) + undelegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), undelegateAmount) + + // Delegate to validator's A and C - validator bond shares should not change + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: delegate1Coin, + }) + require.NoError(t, err, "no error expected during first delegation") + + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorCAddress.String(), + Amount: delegate1Coin, + }) + require.NoError(t, err, "no error expected during first delegation") + + checkValidatorBondShares(validatorAAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, sdk.ZeroInt()) + + // Flag the the delegations to validator A and C validator bond's + // Their bond shares should increase + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + }) + require.NoError(t, err, "no error expected during validator bond") + + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorCAddress.String(), + }) + require.NoError(t, err, "no error expected during validator bond") + + checkValidatorBondShares(validatorAAddress, delegation1Amount) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Delegate more to validator A - it should increase the validator bond shares + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: delegate2Coin, + }) + require.NoError(t, err, "no error expected during second delegation") + + checkValidatorBondShares(validatorAAddress, delegation1Amount.Add(delegation2Amount)) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Redelegate partially from A to B (where A is a validator bond and B is not) + // It should remove the bond shares from A, and B's validator bond shares should not change + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorAAddress.String(), + ValidatorDstAddress: validatorBAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + expectedBondSharesA := delegation1Amount.Add(delegation2Amount).Sub(redelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount) + + // Now redelegate from B to C (where B is not a validator bond, but C is) + // Validator B's bond shares should remain at zero, but C's bond shares should increase + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorBAddress.String(), + ValidatorDstAddress: validatorCAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, delegation1Amount.Add(redelegateAmount)) + + // Redelegate partially from A to C (where C is a validator bond delegation) + // It should remove the bond shares from A, and increase the bond shares on validator C + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorSrcAddress: validatorAAddress.String(), + ValidatorDstAddress: validatorCAddress.String(), + Amount: redelegateCoin, + }) + require.NoError(t, err, "no error expected during redelegation") + + expectedBondSharesA = expectedBondSharesA.Sub(redelegateAmount) + expectedBondSharesC := delegation1Amount.Add(redelegateAmount).Add(redelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, expectedBondSharesC) + + // Undelegate from validator A - it should remove shares + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAAddress.String(), + Amount: undelegateCoin, + }) + require.NoError(t, err, "no error expected during undelegation") + + expectedBondSharesA = expectedBondSharesA.Sub(undelegateAmount) + checkValidatorBondShares(validatorAAddress, expectedBondSharesA) + checkValidatorBondShares(validatorBAddress, sdk.ZeroInt()) + checkValidatorBondShares(validatorCAddress, expectedBondSharesC) } // TODO refactor LSM test func TestEnableDisableTokenizeShares(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - // // Create a delegator and validator - // stakeAmount := sdk.NewInt(1000) - // stakeToken := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), stakeAmount) - - // addresses := simapp.AddTestAddrs(app, ctx, 2, stakeAmount) - // delegatorAddress := addresses[0] - - // pubKeys := simapp.CreateTestPubKeys(1) - // validatorAddress := sdk.ValAddress(addresses[1]) - // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) - - // validator.DelegatorShares = sdk.NewDec(1_000_000) - // validator.Tokens = sdk.NewInt(1_000_000) - // validator.Status = types.Bonded - // app.StakingKeeper.SetValidator(ctx, validator) - - // // Fix block time and set unbonding period to 1 day - // blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - // ctx = ctx.WithBlockTime(blockTime) - - // unbondingPeriod := time.Hour * 24 - // params := app.StakingKeeper.GetParams(ctx) - // params.UnbondingTime = unbondingPeriod - // app.StakingKeeper.SetParams(ctx, params) - // unlockTime := blockTime.Add(unbondingPeriod) - - // // Build test messages (some of which will be reused) - // delegateMsg := types.MsgDelegate{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: stakeToken, - // } - // tokenizeMsg := types.MsgTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: stakeToken, - // TokenizedShareOwner: delegatorAddress.String(), - // } - // redeemMsg := types.MsgRedeemTokensForShares{ - // DelegatorAddress: delegatorAddress.String(), - // } - // disableMsg := types.MsgDisableTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // } - // enableMsg := types.MsgEnableTokenizeShares{ - // DelegatorAddress: delegatorAddress.String(), - // } - - // // Delegate normally - // _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) - // require.NoError(t, err, "no error expected when delegating") - - // // Tokenize shares - it should succeed - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - // require.NoError(t, err, "no error expected when tokenizing shares for the first time") - - // liquidToken := app.BankKeeper.GetBalance(ctx, delegatorAddress, validatorAddress.String()+"/1") - // require.Equal(t, stakeAmount.Int64(), liquidToken.Amount.Int64(), "user received token after tokenizing share") - - // // Redeem to remove all tokenized shares - // redeemMsg.Amount = liquidToken - // _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &redeemMsg) - // require.NoError(t, err, "no error expected when redeeming") - - // // Attempt to enable tokenizing shares when there is no lock in place, it should error - // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - // require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyEnabledForAccount) - - // // Attempt to disable when no lock is in place, it should succeed - // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - // require.NoError(t, err, "no error expected when disabling tokenization") - - // // Disabling again while the lock is already in place, should error - // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - // require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyDisabledForAccount) - - // // Attempt to tokenize, it should fail since tokenization is disabled - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - // require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) - - // // Now enable tokenization - // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - // require.NoError(t, err, "no error expected when enabling tokenization") - - // // Attempt to tokenize again, it should still fail since the unbonding period has - // // not passed and the lock is still active - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - // require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) - // require.ErrorContains(t, err, fmt.Sprintf("tokenization will be allowed at %s", - // blockTime.Add(unbondingPeriod))) - - // // Confirm the unlock is queued - // authorizations := app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) - // require.Equal(t, []string{delegatorAddress.String()}, authorizations.Addresses, - // "pending tokenize share authorizations") - - // // Disable tokenization again - it should remove the pending record from the queue - // _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) - // require.NoError(t, err, "no error expected when re-enabling tokenization") - - // authorizations = app.StakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) - // require.Empty(t, authorizations.Addresses, "there should be no pending authorizations in the queue") - - // // Enable one more time - // _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) - // require.NoError(t, err, "no error expected when enabling tokenization again") - - // // Increment the block time by the unbonding period and remove the expired locks - // ctx = ctx.WithBlockTime(unlockTime) - // app.StakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) - - // // Attempt to tokenize again, it should succeed this time since the lock has expired - // _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) - // require.NoError(t, err, "no error expected when tokenizing after lock has expired") + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + // Create a delegator and validator + stakeAmount := sdk.NewInt(1000) + stakeToken := sdk.NewCoin(stakingKeeper.BondDenom(ctx), stakeAmount) + + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, stakeAmount) + delegatorAddress := addresses[0] + + pubKeys := simtestutil.CreateTestPubKeys(1) + validatorAddress := sdk.ValAddress(addresses[1]) + validator, err := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + require.NoError(t, err) + + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.Status = types.Bonded + stakingKeeper.SetValidator(ctx, validator) + + // Fix block time and set unbonding period to 1 day + blockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + ctx = ctx.WithBlockTime(blockTime) + + unbondingPeriod := time.Hour * 24 + params := stakingKeeper.GetParams(ctx) + params.UnbondingTime = unbondingPeriod + stakingKeeper.SetParams(ctx, params) + unlockTime := blockTime.Add(unbondingPeriod) + + // Build test messages (some of which will be reused) + delegateMsg := types.MsgDelegate{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: stakeToken, + } + tokenizeMsg := types.MsgTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: stakeToken, + TokenizedShareOwner: delegatorAddress.String(), + } + redeemMsg := types.MsgRedeemTokensForShares{ + DelegatorAddress: delegatorAddress.String(), + } + disableMsg := types.MsgDisableTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + } + enableMsg := types.MsgEnableTokenizeShares{ + DelegatorAddress: delegatorAddress.String(), + } + + // Delegate normally + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + require.NoError(t, err, "no error expected when delegating") + + // Tokenize shares - it should succeed + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.NoError(t, err, "no error expected when tokenizing shares for the first time") + + liquidToken := bankKeeper.GetBalance(ctx, delegatorAddress, validatorAddress.String()+"/1") + require.Equal(t, stakeAmount.Int64(), liquidToken.Amount.Int64(), "user received token after tokenizing share") + + // Redeem to remove all tokenized shares + redeemMsg.Amount = liquidToken + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &redeemMsg) + require.NoError(t, err, "no error expected when redeeming") + + // Attempt to enable tokenizing shares when there is no lock in place, it should error + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyEnabledForAccount) + + // Attempt to disable when no lock is in place, it should succeed + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.NoError(t, err, "no error expected when disabling tokenization") + + // Disabling again while the lock is already in place, should error + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesAlreadyDisabledForAccount) + + // Attempt to tokenize, it should fail since tokenization is disabled + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + + // Now enable tokenization + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.NoError(t, err, "no error expected when enabling tokenization") + + // Attempt to tokenize again, it should still fail since the unbonding period has + // not passed and the lock is still active + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.ErrorIs(t, err, types.ErrTokenizeSharesDisabledForAccount) + require.ErrorContains(t, err, fmt.Sprintf("tokenization will be allowed at %s", + blockTime.Add(unbondingPeriod))) + + // Confirm the unlock is queued + authorizations := stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + require.Equal(t, []string{delegatorAddress.String()}, authorizations.Addresses, + "pending tokenize share authorizations") + + // Disable tokenization again - it should remove the pending record from the queue + _, err = msgServer.DisableTokenizeShares(sdk.WrapSDKContext(ctx), &disableMsg) + require.NoError(t, err, "no error expected when re-enabling tokenization") + + authorizations = stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, unlockTime) + require.Empty(t, authorizations.Addresses, "there should be no pending authorizations in the queue") + + // Enable one more time + _, err = msgServer.EnableTokenizeShares(sdk.WrapSDKContext(ctx), &enableMsg) + require.NoError(t, err, "no error expected when enabling tokenization again") + + // Increment the block time by the unbonding period and remove the expired locks + ctx = ctx.WithBlockTime(unlockTime) + stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, ctx.BlockTime()) + + // Attempt to tokenize again, it should succeed this time since the lock has expired + _, err = msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &tokenizeMsg) + require.NoError(t, err, "no error expected when tokenizing after lock has expired") } // TODO refactor LSM test func TestUnbondValidator(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // addrs := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) - // addrAcc1 := addrs[0] - // addrVal1 := sdk.ValAddress(addrAcc1) - - // pubKeys := simapp.CreateTestPubKeys(1) - // pk1 := pubKeys[0] - - // // Create Validators and Delegation - // val1 := stakingtypes.NewValidator(addrVal1, pk1, stakingtypes.Description{}) - // val1.Status = sdkstaking.Bonded - // app.StakingKeeper.SetValidator(ctx, val1) - // app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) - // err := app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) - // require.NoError(t, err) - - // // try unbonding not available validator - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - // _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ - // ValidatorAddress: sdk.ValAddress(addrs[1]).String(), - // }) - // require.Error(t, err) - - // // unbond validator - // _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ - // ValidatorAddress: addrVal1.String(), - // }) - // require.NoError(t, err) - - // // check if validator is jailed - // validator, found := app.StakingKeeper.GetValidator(ctx, addrVal1) - // require.True(t, found) - // require.True(t, validator.Jailed) + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, stakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrAcc1 := addrs[0] + addrVal1 := sdk.ValAddress(addrAcc1) + + pubKeys := simtestutil.CreateTestPubKeys(1) + pk1 := pubKeys[0] + + // Create Validators and Delegation + val1, err := stakingtypes.NewValidator(addrVal1, pk1, stakingtypes.Description{}) + require.NoError(t, err) + val1.Status = stakingtypes.Bonded + stakingKeeper.SetValidator(ctx, val1) + stakingKeeper.SetValidatorByPowerIndex(ctx, val1) + err = stakingKeeper.SetValidatorByConsAddr(ctx, val1) + require.NoError(t, err) + + // try unbonding not available validator + msgServer = keeper.NewMsgServerImpl(stakingKeeper) + _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + ValidatorAddress: sdk.ValAddress(addrs[1]).String(), + }) + require.Error(t, err) + + // unbond validator + _, err = msgServer.UnbondValidator(sdk.WrapSDKContext(ctx), &types.MsgUnbondValidator{ + ValidatorAddress: addrVal1.String(), + }) + require.NoError(t, err) + + // check if validator is jailed + validator, found := stakingKeeper.GetValidator(ctx, addrVal1) + require.True(t, found) + require.True(t, validator.Jailed) } // TODO refactor LSM test @@ -1464,73 +1579,101 @@ func TestUnbondValidator(t *testing.T) { // TestICADelegateUndelegate tests that an ICA account can undelegate // sequentially right after delegating. func TestICADelegateUndelegate(t *testing.T) { - // app := simapp.Setup(t, false) - // ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - // msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - - // // Create a delegator and validator (the delegator will be an ICA account) - // delegateAmount := sdk.NewInt(1000) - // delegateCoin := sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), delegateAmount) - // icaAccountAddress := createICAAccount(app, ctx) - - // // Fund ICA account - // err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) - // require.NoError(t, err) - // err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) - // require.NoError(t, err) - - // addresses := simapp.AddTestAddrs(app, ctx, 1, sdk.NewInt(0)) - // pubKeys := simapp.CreateTestPubKeys(1) - // validatorAddress := sdk.ValAddress(addresses[0]) - // validator := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) - - // validator.DelegatorShares = sdk.NewDec(1_000_000) - // validator.Tokens = sdk.NewInt(1_000_000) - // validator.LiquidShares = sdk.NewDec(0) - // app.StakingKeeper.SetValidator(ctx, validator) - - // delegateMsg := types.MsgDelegate{ - // DelegatorAddress: icaAccountAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // } - - // undelegateMsg := types.MsgUndelegate{ - // DelegatorAddress: icaAccountAddress.String(), - // ValidatorAddress: validatorAddress.String(), - // Amount: delegateCoin, - // } - - // // Delegate normally - // _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) - // require.NoError(t, err, "no error expected when delegating") - - // // Confirm delegation record - // _, found := app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) - // require.True(t, found, "delegation should have been found") - - // // Confirm liquid staking totals were incremented - // expectedTotalLiquidStaked := delegateAmount.Int64() - // actualTotalLiquidStaked := app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() - // require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked, "total liquid staked tokens after delegation") - - // validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found, "validator should have been found") - // require.Equal(t, delegateAmount.ToDec(), validator.LiquidShares, "validator liquid shares after delegation") - - // // Try to undelegate - // _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &undelegateMsg) - // require.NoError(t, err, "no error expected when sequentially undelegating") - - // // Confirm delegation record was removed - // _, found = app.StakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) - // require.False(t, found, "delegation not have been found") - - // // Confirm liquid staking totals were decremented - // actualTotalLiquidStaked = app.StakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() - // require.Zero(t, actualTotalLiquidStaked, "total liquid staked tokens after undelegation") - - // validator, found = app.StakingKeeper.GetValidator(ctx, validatorAddress) - // require.True(t, found, "validator should have been found") - // require.Equal(t, sdk.ZeroDec(), validator.LiquidShares, "validator liquid shares after undelegation") + var ( + accountKeeper accountKeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + + // Create a delegator and validator (the delegator will be an ICA account) + delegateAmount := sdk.NewInt(1000) + delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) + icaAccountAddress := createICAAccount(ctx, accountKeeper) + + // Fund ICA account + err = bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) + require.NoError(t, err) + err = bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) + require.NoError(t, err) + + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 1, sdk.NewInt(0)) + pubKeys := simtestutil.CreateTestPubKeys(1) + validatorAddress := sdk.ValAddress(addresses[0]) + validator, err := stakingtypes.NewValidator(validatorAddress, pubKeys[0], stakingtypes.Description{}) + require.NoError(t, err) + + validator.DelegatorShares = sdk.NewDec(1_000_000) + validator.Tokens = sdk.NewInt(1_000_000) + validator.LiquidShares = sdk.NewDec(0) + stakingKeeper.SetValidator(ctx, validator) + + delegateMsg := types.MsgDelegate{ + DelegatorAddress: icaAccountAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + } + + undelegateMsg := types.MsgUndelegate{ + DelegatorAddress: icaAccountAddress.String(), + ValidatorAddress: validatorAddress.String(), + Amount: delegateCoin, + } + + // Delegate normally + _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) + require.NoError(t, err, "no error expected when delegating") + + // Confirm delegation record + _, found := stakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + require.True(t, found, "delegation should have been found") + + // Confirm liquid staking totals were incremented + expectedTotalLiquidStaked := delegateAmount.Int64() + actualTotalLiquidStaked := stakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked, "total liquid staked tokens after delegation") + + validator, found = stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, sdk.NewDecFromInt(delegateAmount), validator.LiquidShares, "validator liquid shares after delegation") + + // Try to undelegate + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &undelegateMsg) + require.NoError(t, err, "no error expected when sequentially undelegating") + + // Confirm delegation record was removed + _, found = stakingKeeper.GetDelegation(ctx, icaAccountAddress, validatorAddress) + require.False(t, found, "delegation not have been found") + + // Confirm liquid staking totals were decremented + actualTotalLiquidStaked = stakingKeeper.GetTotalLiquidStakedTokens(ctx).Int64() + require.Zero(t, actualTotalLiquidStaked, "total liquid staked tokens after undelegation") + + validator, found = stakingKeeper.GetValidator(ctx, validatorAddress) + require.True(t, found, "validator should have been found") + require.Equal(t, sdk.ZeroDec(), validator.LiquidShares, "validator liquid shares after undelegation") +} + +// Helper function to create 32-length account +// Used to mock an liquid staking provider's ICA account +func createICAAccount(ctx sdk.Context, ak accountKeeper.AccountKeeper) sdk.AccAddress { + icahost := "icahost" + connectionID := "connection-0" + portID := icahost + + moduleAddress := authtypes.NewModuleAddress(icahost) + icaAddress := sdk.AccAddress(address.Derive(moduleAddress, []byte(connectionID+portID))) + + account := authtypes.NewBaseAccountWithAddress(icaAddress) + ak.SetAccount(ctx, account) + + return icaAddress } diff --git a/x/staking/keeper/liquid_stake.go b/x/staking/keeper/liquid_stake.go index 64c44e4cd35d..eb8aa197705a 100644 --- a/x/staking/keeper/liquid_stake.go +++ b/x/staking/keeper/liquid_stake.go @@ -3,8 +3,6 @@ package keeper import ( "time" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -76,8 +74,9 @@ func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens sdk.I } // Calculate the percentage of stake that is liquid - updatedLiquidStaked := math.LegacyNewDec(liquidStakedAmount.Add(tokens).Int64()) - liquidStakePercent := updatedLiquidStaked.Quo(math.LegacyNewDec(totalStakedAmount.Int64())) + + updatedLiquidStaked := sdk.NewDecFromInt(liquidStakedAmount.Add(tokens)) + liquidStakePercent := updatedLiquidStaked.Quo(sdk.NewDecFromInt(totalStakedAmount)) return liquidStakePercent.GT(liquidStakingCap) } diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index abeba9b9343b..223de9065903 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -2,22 +2,12 @@ package keeper_test // TODO refactor LSM tests -// import ( -// "fmt" -// "testing" -// "time" - -// testutil "github.com/cosmos/cosmos-sdk/testutil/sims" - -// "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" -// "github.com/cosmos/cosmos-sdk/simapp" -// sdk "github.com/cosmos/cosmos-sdk/types" -// "github.com/cosmos/cosmos-sdk/types/address" -// authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -// minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" -// "github.com/cosmos/cosmos-sdk/x/staking/types" -// "github.com/stretchr/testify/require" -// ) +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" + accountKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" +) // // Helper function to create a base account from an account name // // Used to differentiate against liquid staking provider module account @@ -27,22 +17,6 @@ package keeper_test // return baseAccountAddress // } -// // Helper function to create 32-length account -// // Used to mock an liquid staking provider's ICA account -// func createICAAccount(app *simapp.SimApp, ctx sdk.Context) sdk.AccAddress { -// icahost := "icahost" -// connectionID := "connection-0" -// portID := icahost - -// moduleAddress := authtypes.NewModuleAddress(icahost) -// icaAddress := sdk.AccAddress(address.Derive(moduleAddress, []byte(connectionID+portID))) - -// account := authtypes.NewBaseAccountWithAddress(icaAddress) -// app.AccountKeeper.SetAccount(ctx, account) - -// return icaAddress -// } - // // Helper function to create a module account address from a tokenized share // // Used to mock the delegation owner of a tokenized share // func createTokenizeShareModuleAccount(recordID uint64) sdk.AccAddress { diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 843c120a41a3..cd650696f97d 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -6,7 +6,6 @@ import ( "strconv" "time" - "cosmossdk.io/math" "github.com/armon/go-metrics" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/telemetry" @@ -855,7 +854,7 @@ func (k msgServer) RedeemTokensForShares(goCtx context.Context, msg *types.MsgRe // Similar to undelegations, if the account is attempting to tokenize the full delegation, // but there's a precision error due to the decimal to int conversion, round up to the // full decimal amount before modifying the delegation - shares := math.LegacyNewDec(shareToken.Amount.Int64()) + shares := sdk.NewDecFromInt(shareToken.Amount) if shareToken.Amount.Equal(delegation.Shares.TruncateInt()) { shares = delegation.Shares } diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index 68680096243b..1f920462638b 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -4,7 +4,6 @@ import ( "fmt" "math/rand" - "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/testutil" @@ -808,11 +807,11 @@ func SimulateMsgTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k *k // check that tokenization would not exceed global cap params := k.GetParams(ctx) - totalStaked := math.LegacyNewDec(k.TotalBondedTokens(ctx).Int64()) + totalStaked := sdk.NewDecFromInt(k.TotalBondedTokens(ctx)) if totalStaked.IsZero() { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "cannot happened - no validators bonded if stake is 0.0"), nil, nil // skip } - totalLiquidStaked := math.LegacyNewDec(k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt).Int64()) + totalLiquidStaked := sdk.NewDecFromInt(k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt)) liquidStakedPercent := totalLiquidStaked.Quo(totalStaked) if liquidStakedPercent.GT(params.GlobalLiquidStakingCap) { return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "global liquid staking cap exceeded"), nil, nil From ab7ff3a17081ed2f2871c0f4be04fe70451f08d5 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 5 Dec 2023 10:48:34 +0100 Subject: [PATCH 22/31] make integration tests pass --- .../staking/keeper/delegation_test.go | 171 ++ .../staking/keeper/liquid_stake_test.go | 563 ++++++ .../staking/keeper/msg_server_test.go | 287 ++- x/staking/keeper/delegation_test.go | 180 -- x/staking/keeper/liquid_stake_test.go | 1695 +++++------------ 5 files changed, 1366 insertions(+), 1530 deletions(-) create mode 100644 tests/integration/staking/keeper/liquid_stake_test.go diff --git a/tests/integration/staking/keeper/delegation_test.go b/tests/integration/staking/keeper/delegation_test.go index 384e949149f1..0d9b78961532 100644 --- a/tests/integration/staking/keeper/delegation_test.go +++ b/tests/integration/staking/keeper/delegation_test.go @@ -96,3 +96,174 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { require.True(math.IntEq(t, newBonded, oldBonded.SubRaw(1))) require.True(math.IntEq(t, newNotBonded, oldNotBonded.AddRaw(1))) } + +// TODO refactor LSM tests: +func TestValidatorBondUndelegate(t *testing.T) { + _, app, ctx := createTestInput(t) + + addrDels := simtestutil.AddTestAddrs(app.BankKeeper, app.StakingKeeper, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrVals := simtestutil.ConvertAddrsToValAddrs(addrDels) + + startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + + bondDenom := app.StakingKeeper.BondDenom(ctx) + notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) + + require.NoError(t, banktestutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) + app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) + + // create a validator and a delegator to that validator + validator := testutil.NewValidator(t, addrVals[0], PKs[0]) + validator.Status = types.Bonded + app.StakingKeeper.SetValidator(ctx, validator) + + // set validator bond factor + params := app.StakingKeeper.GetParams(ctx) + params.ValidatorBondFactor = sdk.NewDec(1) + app.StakingKeeper.SetParams(ctx, params) + + // convert to validator self-bond + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err := delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[0], startTokens, validator) + require.NoError(t, err) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: addrDels[0].String(), + ValidatorAddress: addrVals[0].String(), + }) + require.NoError(t, err) + + // tokenize share for 2nd account delegation + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err = delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[1], startTokens, validator) + require.NoError(t, err) + tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: addrDels[1].String(), + ValidatorAddress: addrVals[0].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + TokenizedShareOwner: addrDels[0].String(), + }) + require.NoError(t, err) + + // try undelegating + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ + DelegatorAddress: addrDels[0].String(), + ValidatorAddress: addrVals[0].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + }) + require.Error(t, err) + + // redeem full amount on 2nd account and try undelegation + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err = delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[1], startTokens, validator) + require.NoError(t, err) + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: addrDels[1].String(), + Amount: tokenizeShareResp.Amount, + }) + require.NoError(t, err) + + // try undelegating + _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ + DelegatorAddress: addrDels[0].String(), + ValidatorAddress: addrVals[0].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + }) + require.NoError(t, err) + + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) +} + +func TestValidatorBondRedelegate(t *testing.T) { + _, app, ctx := createTestInput(t) + + addrDels := simtestutil.AddTestAddrs(app.BankKeeper, app.StakingKeeper, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) + addrVals := simtestutil.ConvertAddrsToValAddrs(addrDels) + + startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) + + bondDenom := app.StakingKeeper.BondDenom(ctx) + notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) + + startPoolToken := sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens.Mul(sdk.NewInt(2)))) + require.NoError(t, banktestutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startPoolToken)) + app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) + + // create a validator and a delegator to that validator + validator := testutil.NewValidator(t, addrVals[0], PKs[0]) + validator.Status = types.Bonded + app.StakingKeeper.SetValidator(ctx, validator) + validator2 := testutil.NewValidator(t, addrVals[1], PKs[1]) + validator.Status = types.Bonded + app.StakingKeeper.SetValidator(ctx, validator2) + + // set validator bond factor + params := app.StakingKeeper.GetParams(ctx) + params.ValidatorBondFactor = sdk.NewDec(1) + app.StakingKeeper.SetParams(ctx, params) + + // set total liquid stake + app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(100)) + + // delegate to each validator + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err := delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[0], startTokens, validator) + require.NoError(t, err) + + validator2, _ = app.StakingKeeper.GetValidator(ctx, addrVals[1]) + err = delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[1], startTokens, validator2) + require.NoError(t, err) + + // convert to validator self-bond + msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ + DelegatorAddress: addrDels[0].String(), + ValidatorAddress: addrVals[0].String(), + }) + require.NoError(t, err) + + // tokenize share for 2nd account delegation + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err = delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[1], startTokens, validator) + require.NoError(t, err) + tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ + DelegatorAddress: addrDels[1].String(), + ValidatorAddress: addrVals[0].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + TokenizedShareOwner: addrDels[0].String(), + }) + require.NoError(t, err) + + // try undelegating + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: addrDels[0].String(), + ValidatorSrcAddress: addrVals[0].String(), + ValidatorDstAddress: addrVals[1].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + }) + require.Error(t, err) + + // redeem full amount on 2nd account and try undelegation + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + err = delegateCoinsFromAccount(ctx, *app.StakingKeeper, addrDels[1], startTokens, validator) + require.NoError(t, err) + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ + DelegatorAddress: addrDels[1].String(), + Amount: tokenizeShareResp.Amount, + }) + require.NoError(t, err) + + // try undelegating + _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ + DelegatorAddress: addrDels[0].String(), + ValidatorSrcAddress: addrVals[0].String(), + ValidatorDstAddress: addrVals[1].String(), + Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), + }) + require.NoError(t, err) + + validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) + require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) +} diff --git a/tests/integration/staking/keeper/liquid_stake_test.go b/tests/integration/staking/keeper/liquid_stake_test.go new file mode 100644 index 000000000000..dfd33c63b89c --- /dev/null +++ b/tests/integration/staking/keeper/liquid_stake_test.go @@ -0,0 +1,563 @@ +package keeper_test + +import ( + "testing" + "time" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/staking/keeper" + "github.com/cosmos/cosmos-sdk/x/staking/testutil" + "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" +) + +// Helper function to clear the Bonded pool balances before a unit test +func clearPoolBalance(t *testing.T, sk keeper.Keeper, ak accountkeeper.AccountKeeper, bk bankkeeper.Keeper, ctx sdk.Context) { + bondDenom := sk.BondDenom(ctx) + initialBondedBalance := bk.GetBalance(ctx, ak.GetModuleAddress(types.BondedPoolName), bondDenom) + + err := bk.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, minttypes.ModuleName, sdk.NewCoins(initialBondedBalance)) + require.NoError(t, err, "no error expected when clearing bonded pool balance") +} + +// Helper function to fund the Bonded pool balances before a unit test +func fundPoolBalance(t *testing.T, sk keeper.Keeper, bk bankkeeper.Keeper, ctx sdk.Context, amount sdk.Int) { + bondDenom := sk.BondDenom(ctx) + bondedPoolCoin := sdk.NewCoin(bondDenom, amount) + + err := bk.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(bondedPoolCoin)) + require.NoError(t, err, "no error expected when minting") + + err = bk.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.BondedPoolName, sdk.NewCoins(bondedPoolCoin)) + require.NoError(t, err, "no error expected when sending tokens to bonded pool") +} + +// Tests CheckExceedsGlobalLiquidStakingCap +func TestCheckExceedsGlobalLiquidStakingCap(t *testing.T) { + var ( + accountKeeper accountkeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + testCases := []struct { + name string + globalLiquidCap sdk.Dec + totalLiquidStake sdk.Int + totalStake sdk.Int + newLiquidStake sdk.Int + tokenizingShares bool + expectedExceeds bool + }{ + { + // Cap: 10% - Native Delegation - Delegation Below Threshold + // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 1 + // => Total Liquid Stake: 5+1=6, Total Stake: 95+1=96 => 6/96 = 6% < 10% cap + name: "10 percent cap _ native delegation _ delegation below cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.1"), + totalLiquidStake: sdk.NewInt(5), + totalStake: sdk.NewInt(95), + newLiquidStake: sdk.NewInt(1), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 10% - Native Delegation - Delegation At Threshold + // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 5 + // => Total Liquid Stake: 5+5=10, Total Stake: 95+5=100 => 10/100 = 10% == 10% cap + name: "10 percent cap _ native delegation _ delegation equals cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.1"), + totalLiquidStake: sdk.NewInt(5), + totalStake: sdk.NewInt(95), + newLiquidStake: sdk.NewInt(5), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 10% - Native Delegation - Delegation Exceeds Threshold + // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 6 + // => Total Liquid Stake: 5+6=11, Total Stake: 95+6=101 => 11/101 = 11% > 10% cap + name: "10 percent cap _ native delegation _ delegation exceeds cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.1"), + totalLiquidStake: sdk.NewInt(5), + totalStake: sdk.NewInt(95), + newLiquidStake: sdk.NewInt(6), + tokenizingShares: false, + expectedExceeds: true, + }, + { + // Cap: 20% - Native Delegation - Delegation Below Threshold + // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 29 + // => Total Liquid Stake: 20+29=49, Total Stake: 220+29=249 => 49/249 = 19% < 20% cap + name: "20 percent cap _ native delegation _ delegation below cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.20"), + totalLiquidStake: sdk.NewInt(20), + totalStake: sdk.NewInt(220), + newLiquidStake: sdk.NewInt(29), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 20% - Native Delegation - Delegation At Threshold + // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 30 + // => Total Liquid Stake: 20+30=50, Total Stake: 220+30=250 => 50/250 = 20% == 20% cap + name: "20 percent cap _ native delegation _ delegation equals cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.20"), + totalLiquidStake: sdk.NewInt(20), + totalStake: sdk.NewInt(220), + newLiquidStake: sdk.NewInt(30), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 20% - Native Delegation - Delegation Exceeds Threshold + // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 31 + // => Total Liquid Stake: 20+31=51, Total Stake: 220+31=251 => 51/251 = 21% > 20% cap + name: "20 percent cap _ native delegation _ delegation exceeds cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.20"), + totalLiquidStake: sdk.NewInt(20), + totalStake: sdk.NewInt(220), + newLiquidStake: sdk.NewInt(31), + tokenizingShares: false, + expectedExceeds: true, + }, + { + // Cap: 50% - Native Delegation - Delegation Below Threshold + // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 + // => Total Liquid Stake: 0+50=50, Total Stake: 100+50=150 => 50/150 = 33% < 50% cap + name: "50 percent cap _ native delegation _ delegation below cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.5"), + totalLiquidStake: sdk.NewInt(0), + totalStake: sdk.NewInt(100), + newLiquidStake: sdk.NewInt(50), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 50% - Tokenized Delegation - Delegation At Threshold + // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 + // => 50 / 100 = 50% == 50% cap + name: "50 percent cap _ tokenized delegation _ delegation equals cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.5"), + totalLiquidStake: sdk.NewInt(0), + totalStake: sdk.NewInt(100), + newLiquidStake: sdk.NewInt(50), + tokenizingShares: true, + expectedExceeds: false, + }, + { + // Cap: 50% - Native Delegation - Delegation Below Threshold + // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 + // => Total Liquid Stake: 0+51=51, Total Stake: 100+51=151 => 51/151 = 33% < 50% cap + name: "50 percent cap _ native delegation _ delegation below cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.5"), + totalLiquidStake: sdk.NewInt(0), + totalStake: sdk.NewInt(100), + newLiquidStake: sdk.NewInt(51), + tokenizingShares: false, + expectedExceeds: false, + }, + { + // Cap: 50% - Tokenized Delegation - Delegation Exceeds Threshold + // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 + // => 51 / 100 = 51% > 50% cap + name: "50 percent cap _ tokenized delegation _delegation exceeds cap", + globalLiquidCap: sdk.MustNewDecFromStr("0.5"), + totalLiquidStake: sdk.NewInt(0), + totalStake: sdk.NewInt(100), + newLiquidStake: sdk.NewInt(51), + tokenizingShares: true, + expectedExceeds: true, + }, + { + // Cap of 0% - everything should exceed + name: "0 percent cap", + globalLiquidCap: sdk.ZeroDec(), + totalLiquidStake: sdk.NewInt(0), + totalStake: sdk.NewInt(1_000_000), + newLiquidStake: sdk.NewInt(1), + tokenizingShares: false, + expectedExceeds: true, + }, + { + // Cap of 100% - nothing should exceed + name: "100 percent cap", + globalLiquidCap: sdk.OneDec(), + totalLiquidStake: sdk.NewInt(1), + totalStake: sdk.NewInt(1), + newLiquidStake: sdk.NewInt(1_000_000), + tokenizingShares: false, + expectedExceeds: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // Update the global liquid staking cap + params := stakingKeeper.GetParams(ctx) + params.GlobalLiquidStakingCap = tc.globalLiquidCap + stakingKeeper.SetParams(ctx, params) + + // Update the total liquid tokens + stakingKeeper.SetTotalLiquidStakedTokens(ctx, tc.totalLiquidStake) + + // Fund each pool for the given test case + clearPoolBalance(t, *stakingKeeper, accountKeeper, bankKeeper, ctx) + fundPoolBalance(t, *stakingKeeper, bankKeeper, ctx, tc.totalStake) + + // Check if the new tokens would exceed the global cap + actualExceeds := stakingKeeper.CheckExceedsGlobalLiquidStakingCap(ctx, tc.newLiquidStake, tc.tokenizingShares) + require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) + }) + } +} + +// Tests SafelyIncreaseTotalLiquidStakedTokens +func TestSafelyIncreaseTotalLiquidStakedTokens(t *testing.T) { + var ( + accountKeeper accountkeeper.AccountKeeper + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + intitialTotalLiquidStaked := sdk.NewInt(100) + increaseAmount := sdk.NewInt(10) + poolBalance := sdk.NewInt(200) + + // Set the total staked and total liquid staked amounts + // which are required components when checking the global cap + // Total stake is calculated from the pool balance + clearPoolBalance(t, *stakingKeeper, accountKeeper, bankKeeper, ctx) + fundPoolBalance(t, *stakingKeeper, bankKeeper, ctx, poolBalance) + stakingKeeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) + + // Set the global cap such that a small delegation would exceed the cap + params := stakingKeeper.GetParams(ctx) + params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.0001") + stakingKeeper.SetParams(ctx, params) + + // Attempt to increase the total liquid stake again, it should error since + // the cap was exceeded + err = stakingKeeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) + require.ErrorIs(t, err, types.ErrGlobalLiquidStakingCapExceeded) + require.Equal(t, intitialTotalLiquidStaked, stakingKeeper.GetTotalLiquidStakedTokens(ctx)) + + // Now relax the cap so that the increase succeeds + params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.99") + stakingKeeper.SetParams(ctx, params) + + // Confirm the total increased + err = stakingKeeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) + require.NoError(t, err) + require.Equal(t, intitialTotalLiquidStaked.Add(increaseAmount), stakingKeeper.GetTotalLiquidStakedTokens(ctx)) +} + +// Helper function to create a base account from an account name +// Used to differentiate against liquid staking provider module account +func createBaseAccount(ak accountkeeper.AccountKeeper, ctx sdk.Context, accountName string) sdk.AccAddress { + baseAccountAddress := sdk.AccAddress(accountName) + ak.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) + return baseAccountAddress +} + +// Tests DelegatorIsLiquidStaker +func TestDelegatorIsLiquidStaker(t *testing.T) { + var ( + accountKeeper accountkeeper.AccountKeeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &accountKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + // Create base and ICA accounts + baseAccountAddress := createBaseAccount(accountKeeper, ctx, "base-account") + icaAccountAddress := createICAAccount(ctx, accountKeeper) + + // Only the ICA module account should be considered a liquid staking provider + require.False(t, stakingKeeper.DelegatorIsLiquidStaker(baseAccountAddress), "base account") + require.True(t, stakingKeeper.DelegatorIsLiquidStaker(icaAccountAddress), "ICA module account") +} + +// Tests Add/Remove/Get/SetTokenizeSharesLock +func TestTokenizeSharesLock(t *testing.T) { + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(1)) + addressA, addressB := addresses[0], addresses[1] + + unlocked := types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED.String() + locked := types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String() + lockExpiring := types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String() + + // Confirm both accounts start unlocked + status, _ := stakingKeeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(t, unlocked, status.String(), "addressA unlocked at start") + + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(t, unlocked, status.String(), "addressB unlocked at start") + + // Lock the first account + stakingKeeper.AddTokenizeSharesLock(ctx, addressA) + + // The first account should now have tokenize shares disabled + // and the unlock time should be the zero time + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(t, locked, status.String(), "addressA locked") + + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(t, unlocked, status.String(), "addressB still unlocked") + + // Update the lock time and confirm it was set + expectedUnlockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addressA, expectedUnlockTime) + + status, actualUnlockTime := stakingKeeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(t, lockExpiring, status.String(), "addressA lock expiring") + require.Equal(t, expectedUnlockTime, actualUnlockTime, "addressA unlock time") + + // Confirm B is still unlocked + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(t, unlocked, status.String(), "addressB still unlocked") + + // Remove the lock + stakingKeeper.RemoveTokenizeSharesLock(ctx, addressA) + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(t, unlocked, status.String(), "addressA unlocked at end") + + status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(t, unlocked, status.String(), "addressB unlocked at end") +} + +// Tests GetAllTokenizeSharesLocks +func TestGetAllTokenizeSharesLocks(t *testing.T) { + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 4, sdk.NewInt(1)) + + // Set 2 locked accounts, and two accounts with a lock expiring + stakingKeeper.AddTokenizeSharesLock(ctx, addresses[0]) + stakingKeeper.AddTokenizeSharesLock(ctx, addresses[1]) + + unlockTime1 := time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC) + unlockTime2 := time.Date(2023, 1, 2, 1, 0, 0, 0, time.UTC) + stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addresses[2], unlockTime1) + stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addresses[3], unlockTime2) + + // Defined expected locks after GetAll + expectedLocks := map[string]types.TokenizeShareLock{ + addresses[0].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + addresses[1].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + addresses[2].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: unlockTime1, + }, + addresses[3].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: unlockTime2, + }, + } + + // Check output from GetAll + actualLocks := stakingKeeper.GetAllTokenizeSharesLocks(ctx) + require.Len(t, actualLocks, len(expectedLocks), "number of locks") + + for i, actual := range actualLocks { + expected, ok := expectedLocks[actual.Address] + require.True(t, ok, "address %s not expected", actual.Address) + require.Equal(t, expected.Status, actual.Status, "tokenize share lock #%d status", i) + require.Equal(t, expected.CompletionTime, actual.CompletionTime, "tokenize share lock #%d completion time", i) + } +} + +// Test Get/SetPendingTokenizeShareAuthorizations +func TestPendingTokenizeShareAuthorizations(t *testing.T) { + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + // Create dummy accounts and completion times + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 3, sdk.NewInt(1)) + addressStrings := []string{} + for _, address := range addresses { + addressStrings = append(addressStrings, address.String()) + } + + timeA := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + timeB := timeA.Add(time.Hour) + + // There should be no addresses returned originally + authorizationsA := stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) + require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected") + + authorizationsB := stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) + require.Empty(t, authorizationsB.Addresses, "no addresses at timeB expected") + + // Store addresses for timeB + stakingKeeper.SetPendingTokenizeShareAuthorizations(ctx, timeB, types.PendingTokenizeShareAuthorizations{ + Addresses: addressStrings, + }) + + // Check addresses + authorizationsA = stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) + require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected at end") + + authorizationsB = stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) + require.Equal(t, addressStrings, authorizationsB.Addresses, "address length") +} + +// Test QueueTokenizeSharesAuthorization and RemoveExpiredTokenizeShareLocks +func TestTokenizeShareAuthorizationQueue(t *testing.T) { + var ( + bankKeeper bankkeeper.Keeper + stakingKeeper *keeper.Keeper + ) + + app, err := simtestutil.Setup(testutil.AppConfig, + &bankKeeper, + &stakingKeeper, + ) + require.NoError(t, err) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + // We'll start by adding the following addresses to the queue + // Time 0: [address0] + // Time 1: [] + // Time 2: [address1, address2, address3] + // Time 3: [address4, address5] + // Time 4: [address6] + addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 7, sdk.NewInt(1)) + addressesByTime := map[int][]sdk.AccAddress{ + 0: {addresses[0]}, + 1: {}, + 2: {addresses[1], addresses[2], addresses[3]}, + 3: {addresses[4], addresses[5]}, + 4: {addresses[6]}, + } + + // Set the unbonding time to 1 day + unbondingPeriod := time.Hour * 24 + params := stakingKeeper.GetParams(ctx) + params.UnbondingTime = unbondingPeriod + stakingKeeper.SetParams(ctx, params) + + // Add each address to the queue and then increment the block time + // such that the times line up as follows + // Time 0: 2023-01-01 00:00:00 + // Time 1: 2023-01-01 00:01:00 + // Time 2: 2023-01-01 00:02:00 + // Time 3: 2023-01-01 00:03:00 + startTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + ctx = ctx.WithBlockTime(startTime) + blockTimeIncrement := time.Hour + + for timeIndex := 0; timeIndex <= 4; timeIndex++ { + for _, address := range addressesByTime[timeIndex] { + stakingKeeper.QueueTokenizeSharesAuthorization(ctx, address) + } + ctx = ctx.WithBlockTime(ctx.BlockTime().Add(blockTimeIncrement)) + } + + // We'll unlock the tokens using the following progression + // The "alias'"/keys for these times assume a starting point of the Time 0 + // from above, plus the Unbonding Time + // Time -1 (2023-01-01 23:59:99): [] + // Time 0 (2023-01-02 00:00:00): [address0] + // Time 1 (2023-01-02 00:01:00): [] + // Time 2.5 (2023-01-02 00:02:30): [address1, address2, address3] + // Time 10 (2023-01-02 00:10:00): [address4, address5, address6] + unlockBlockTimes := map[string]time.Time{ + "-1": startTime.Add(unbondingPeriod).Add(-time.Second), + "0": startTime.Add(unbondingPeriod), + "1": startTime.Add(unbondingPeriod).Add(blockTimeIncrement), + "2.5": startTime.Add(unbondingPeriod).Add(2 * blockTimeIncrement).Add(blockTimeIncrement / 2), + "10": startTime.Add(unbondingPeriod).Add(10 * blockTimeIncrement), + } + expectedUnlockedAddresses := map[string][]string{ + "-1": {}, + "0": {addresses[0].String()}, + "1": {}, + "2.5": {addresses[1].String(), addresses[2].String(), addresses[3].String()}, + "10": {addresses[4].String(), addresses[5].String(), addresses[6].String()}, + } + + // Now we'll remove items from the queue sequentially + // First check with a block time before the first expiration - it should remove no addresses + actualAddresses := stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["-1"]) + require.Equal(t, expectedUnlockedAddresses["-1"], actualAddresses, "no addresses unlocked from time -1") + + // Then pass in (time 0 + unbonding time) - it should remove the first address + actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["0"]) + require.Equal(t, expectedUnlockedAddresses["0"], actualAddresses, "one address unlocked from time 0") + + // Now pass in (time 1 + unbonding time) - it should remove no addresses since + // the address at time 0 was already removed + actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["1"]) + require.Equal(t, expectedUnlockedAddresses["1"], actualAddresses, "no addresses unlocked from time 1") + + // Now pass in (time 2.5 + unbonding time) - it should remove the three addresses from time 2 + actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["2.5"]) + require.Equal(t, expectedUnlockedAddresses["2.5"], actualAddresses, "addresses unlocked from time 2.5") + + // Finally pass in a block time far in the future, which should remove all the remaining locks + actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["10"]) + require.Equal(t, expectedUnlockedAddresses["10"], actualAddresses, "addresses unlocked from time 10") +} diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 6fb777e73fa6..b9a6bfa4a893 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -11,15 +11,13 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" - accountKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" - distribkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/testutil" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -162,22 +160,10 @@ func TestCancelUnbondingDelegation(t *testing.T) { // TODO refactor LSM test func TestTokenizeSharesAndRedeemTokens(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - accountKeeper accountKeeper.AccountKeeper - bankKeeper bankkeeper.Keeper - distrKeeper distribkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &accountKeeper, - &bankKeeper, - &distrKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper ) - require.NoError(t, err) - - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) liquidStakingCapStrict := sdk.ZeroDec() liquidStakingCapConservative := sdk.MustNewDecFromStr("0.8") @@ -497,21 +483,24 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - // reset store for each tc - cc, _ := ctx.CacheContext() - - addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, cc, 2, stakingKeeper.TokensFromConsensusPower(cc, 10000)) + _, app, ctx := createTestInput(t) + var ( + bankKeeper = app.BankKeeper + accountKeeper = app.AccountKeeper + stakingKeeper = app.StakingKeeper + ) + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, stakingKeeper.TokensFromConsensusPower(ctx, 10000)) addrAcc1, addrAcc2 := addrs[0], addrs[1] addrVal1, addrVal2 := sdk.ValAddress(addrAcc1), sdk.ValAddress(addrAcc2) // Create ICA module account - icaAccountAddress := createICAAccount(cc, accountKeeper) + icaAccountAddress := createICAAccount(ctx, accountKeeper) // Fund module account - delegationCoin := sdk.NewCoin(stakingKeeper.BondDenom(cc), tc.delegationAmount) - err := bankKeeper.MintCoins(cc, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) + delegationCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), tc.delegationAmount) + err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegationCoin)) require.NoError(t, err) - err = bankKeeper.SendCoinsFromModuleToAccount(cc, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) + err = bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegationCoin)) require.NoError(t, err) // set the delegator address depending on whether the delegator should be a liquid staking provider @@ -521,73 +510,73 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { } // set validator bond factor and global liquid staking cap - params := stakingKeeper.GetParams(cc) + params := stakingKeeper.GetParams(ctx) params.ValidatorBondFactor = tc.validatorBondFactor params.GlobalLiquidStakingCap = tc.globalLiquidStakingCap params.ValidatorLiquidStakingCap = tc.validatorLiquidStakingCap - stakingKeeper.SetParams(cc, params) + stakingKeeper.SetParams(ctx, params) // set the total liquid staked tokens - stakingKeeper.SetTotalLiquidStakedTokens(cc, sdk.ZeroInt()) + stakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.ZeroInt()) if !tc.vestingAmount.IsZero() { // create vesting account pubkey := secp256k1.GenPrivKey().PubKey() baseAcc := authtypes.NewBaseAccount(addrAcc2, pubkey, 0, 0) initialVesting := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, tc.vestingAmount)) - baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, cc.BlockTime().Unix()+86400*365) + baseVestingWithCoins := vestingtypes.NewBaseVestingAccount(baseAcc, initialVesting, ctx.BlockTime().Unix()+86400*365) delayedVestingAccount := vestingtypes.NewDelayedVestingAccountRaw(baseVestingWithCoins) - accountKeeper.SetAccount(cc, delayedVestingAccount) + accountKeeper.SetAccount(ctx, delayedVestingAccount) } pubKeys := simtestutil.CreateTestPubKeys(2) pk1, pk2 := pubKeys[0], pubKeys[1] // Create Validators and Delegation - tstaking := testutil.NewHelper(t, cc, stakingKeeper) - - tstaking.CreateValidator(addrVal1, pk1, sdk.NewInt(100), true) - tstaking.CreateValidator(addrVal2, pk2, sdk.NewInt(100), true) - - // end block to bond validator and start new block - staking.EndBlocker(cc, stakingKeeper) - cc = cc.WithBlockHeight(cc.BlockHeight() + 1) - tstaking.Ctx = cc + val1 := testutil.NewValidator(t, addrVal1, pk1) + val1.Status = stakingtypes.Bonded + app.StakingKeeper.SetValidator(ctx, val1) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val1) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val1) + require.NoError(t, err) - // fetch validators - val1 := stakingKeeper.Validator(cc, addrVal1) - // val2 := stakingKeeper.Validator(cc, addrVal2) + val2 := testutil.NewValidator(t, addrVal2, pk2) + val2.Status = stakingtypes.Bonded + app.StakingKeeper.SetValidator(ctx, val2) + app.StakingKeeper.SetValidatorByPowerIndex(ctx, val2) + err = app.StakingKeeper.SetValidatorByConsAddr(ctx, val2) + require.NoError(t, err) // Delegate from both the main delegator as well as a random account so there is a // non-zero delegation after redemption - err = delegateCoinsFromAccount(cc, *stakingKeeper, delegatorAccount, tc.delegationAmount, val1) + err = delegateCoinsFromAccount(ctx, *stakingKeeper, delegatorAccount, tc.delegationAmount, val1) require.NoError(t, err) // apply TM updates - applyValidatorSetUpdates(t, cc, stakingKeeper, -1) + applyValidatorSetUpdates(t, ctx, stakingKeeper, -1) - _, found := stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + _, found := stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) require.True(t, found, "delegation not found after delegate") - lastRecordID := stakingKeeper.GetLastTokenizeShareRecordID(cc) - oldValidator, found := stakingKeeper.GetValidator(cc, addrVal1) + lastRecordID := stakingKeeper.GetLastTokenizeShareRecordID(ctx) + oldValidator, found := stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) msgServer := keeper.NewMsgServerImpl(stakingKeeper) if tc.validatorBondDelegation { - err := delegateCoinsFromAccount(cc, *stakingKeeper, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) + err := delegateCoinsFromAccount(ctx, *stakingKeeper, addrs[tc.validatorBondDelegatorIndex], tc.delegationAmount, val1) require.NoError(t, err) - _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(cc), &types.MsgValidatorBond{ + _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ DelegatorAddress: addrs[tc.validatorBondDelegatorIndex].String(), ValidatorAddress: addrVal1.String(), }) require.NoError(t, err) } - resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(cc), &types.MsgTokenizeShares{ + resp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ DelegatorAddress: delegatorAccount.String(), ValidatorAddress: addrVal1.String(), - Amount: sdk.NewCoin(stakingKeeper.BondDenom(cc), tc.tokenizeShareAmount), + Amount: sdk.NewCoin(stakingKeeper.BondDenom(ctx), tc.tokenizeShareAmount), TokenizedShareOwner: delegatorAccount.String(), }) if tc.expTokenizeErr { @@ -597,15 +586,15 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { require.NoError(t, err) // check last record id increase - require.Equal(t, lastRecordID+1, stakingKeeper.GetLastTokenizeShareRecordID(cc)) + require.Equal(t, lastRecordID+1, stakingKeeper.GetLastTokenizeShareRecordID(ctx)) // ensure validator's total tokens is consistent - newValidator, found := stakingKeeper.GetValidator(cc, addrVal1) + newValidator, found := stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) require.Equal(t, oldValidator.Tokens, newValidator.Tokens) // if the delegator was not a provider, check that the total liquid staked and validator liquid shares increased - totalLiquidTokensAfterTokenization := stakingKeeper.GetTotalLiquidStakedTokens(cc) + totalLiquidTokensAfterTokenization := stakingKeeper.GetTotalLiquidStakedTokens(ctx) validatorLiquidSharesAfterTokenization := newValidator.LiquidShares if !tc.delegatorIsLSTP { require.Equal(t, tc.tokenizeShareAmount.String(), totalLiquidTokensAfterTokenization.String(), "total liquid tokens after tokenization") @@ -616,27 +605,27 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { } if tc.vestingAmount.IsPositive() { - acc := accountKeeper.GetAccount(cc, addrAcc2) + acc := accountKeeper.GetAccount(ctx, addrAcc2) vestingAcc := acc.(vesting.VestingAccount) - require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(cc)).String(), tc.targetVestingDelAfterShare.String()) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterShare.String()) } if tc.prevAccountDelegationExists { - _, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + _, found = stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) require.True(t, found, "delegation found after partial tokenize share") } else { - _, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + _, found = stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) require.False(t, found, "delegation found after full tokenize share") } - shareToken := bankKeeper.GetBalance(cc, delegatorAccount, resp.Amount.Denom) + shareToken := bankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) require.Equal(t, resp.Amount, shareToken) - _, found = stakingKeeper.GetValidator(cc, addrVal1) + _, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found, true, "validator not found") - records := stakingKeeper.GetAllTokenizeShareRecords(cc) + records := stakingKeeper.GetAllTokenizeShareRecords(ctx) require.Len(t, records, 1) - delegation, found := stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + delegation, found := stakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) require.True(t, found, "delegation not found from tokenize share module account after tokenize share") // slash before redeem @@ -646,30 +635,30 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { if tc.slashFactor.IsPositive() { consAddr, err := val1.GetConsAddr() require.NoError(t, err) - cc = cc.WithBlockHeight(100) - val1, found = stakingKeeper.GetValidator(cc, addrVal1) + ctx = ctx.WithBlockHeight(100) + val1, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) - power := stakingKeeper.TokensToConsensusPower(cc, val1.(types.Validator).Tokens) - stakingKeeper.Slash(cc, consAddr, 10, power, tc.slashFactor) - slashedTokens = sdk.NewDecFromInt(val1.(types.Validator).Tokens).Mul(tc.slashFactor).TruncateInt() + power := stakingKeeper.TokensToConsensusPower(ctx, val1.Tokens) + stakingKeeper.Slash(ctx, consAddr, 10, power, tc.slashFactor) + slashedTokens = sdk.NewDecFromInt(val1.Tokens).Mul(tc.slashFactor).TruncateInt() - val1, _ := stakingKeeper.GetValidator(cc, addrVal1) + val1, _ := stakingKeeper.GetValidator(ctx, addrVal1) redeemedTokens = val1.TokensFromShares(sdk.NewDecFromInt(redeemedShares)).TruncateInt() } - // get deletagor balance and delegation - bondDenomAmountBefore := bankKeeper.GetBalance(cc, delegatorAccount, stakingKeeper.BondDenom(cc)) - val1, found = stakingKeeper.GetValidator(cc, addrVal1) + // get delegator balance and delegation + bondDenomAmountBefore := bankKeeper.GetBalance(ctx, delegatorAccount, stakingKeeper.BondDenom(ctx)) + val1, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) - delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + delegation, found = stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) if !found { delegation = types.Delegation{Shares: sdk.ZeroDec()} } delAmountBefore := val1.TokensFromShares(delegation.Shares) - oldValidator, found = stakingKeeper.GetValidator(cc, addrVal1) + oldValidator, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) - _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(cc), &types.MsgRedeemTokensForShares{ + _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ DelegatorAddress: delegatorAccount.String(), Amount: sdk.NewCoin(resp.Amount.Denom, tc.redeemAmount), }) @@ -680,13 +669,13 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { require.NoError(t, err) // ensure validator's total tokens is consistent - newValidator, found = stakingKeeper.GetValidator(cc, addrVal1) + newValidator, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) require.Equal(t, oldValidator.Tokens, newValidator.Tokens) // if the delegator was not a liquid staking provider, check that the total liquid staked // and liquid shares decreased - totalLiquidTokensAfterRedemption := stakingKeeper.GetTotalLiquidStakedTokens(cc) + totalLiquidTokensAfterRedemption := stakingKeeper.GetTotalLiquidStakedTokens(ctx) validatorLiquidSharesAfterRedemption := newValidator.LiquidShares expectedLiquidTokens := totalLiquidTokensAfterTokenization.Sub(redeemedTokens).Sub(slashedTokens) expectedLiquidShares := validatorLiquidSharesAfterTokenization.Sub(sdk.NewDecFromInt(redeemedShares)) @@ -699,48 +688,48 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { } if tc.vestingAmount.IsPositive() { - acc := accountKeeper.GetAccount(cc, addrAcc2) + acc := accountKeeper.GetAccount(ctx, addrAcc2) vestingAcc := acc.(vesting.VestingAccount) - require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(cc)).String(), tc.targetVestingDelAfterRedeem.String()) + require.Equal(t, vestingAcc.GetDelegatedVesting().AmountOf(stakingKeeper.BondDenom(ctx)).String(), tc.targetVestingDelAfterRedeem.String()) } expectedDelegatedShares := sdk.NewDecFromInt(tc.delegationAmount.Sub(tc.tokenizeShareAmount).Add(tc.redeemAmount)) - delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + delegation, found = stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) require.True(t, found, "delegation not found after redeem tokens") require.Equal(t, delegatorAccount.String(), delegation.DelegatorAddress) require.Equal(t, addrVal1.String(), delegation.ValidatorAddress) require.Equal(t, expectedDelegatedShares, delegation.Shares, "delegation shares after redeem") // check delegator balance is not changed - bondDenomAmountAfter := bankKeeper.GetBalance(cc, delegatorAccount, stakingKeeper.BondDenom(cc)) + bondDenomAmountAfter := bankKeeper.GetBalance(ctx, delegatorAccount, stakingKeeper.BondDenom(ctx)) require.Equal(t, bondDenomAmountAfter.Amount.String(), bondDenomAmountBefore.Amount.String()) // get delegation amount is changed correctly - val1, found = stakingKeeper.GetValidator(cc, addrVal1) + val1, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found) - delegation, found = stakingKeeper.GetDelegation(cc, delegatorAccount, addrVal1) + delegation, found = stakingKeeper.GetDelegation(ctx, delegatorAccount, addrVal1) if !found { delegation = types.Delegation{Shares: sdk.ZeroDec()} } delAmountAfter := val1.TokensFromShares(delegation.Shares) require.Equal(t, delAmountAfter.String(), delAmountBefore.Add(sdk.NewDecFromInt(tc.redeemAmount).Mul(sdk.OneDec().Sub(tc.slashFactor))).String()) - shareToken = bankKeeper.GetBalance(cc, delegatorAccount, resp.Amount.Denom) + shareToken = bankKeeper.GetBalance(ctx, delegatorAccount, resp.Amount.Denom) require.Equal(t, shareToken.Amount.String(), tc.tokenizeShareAmount.Sub(tc.redeemAmount).String()) - _, found = stakingKeeper.GetValidator(cc, addrVal1) + _, found = stakingKeeper.GetValidator(ctx, addrVal1) require.True(t, found, true, "validator not found") if tc.recordAccountDelegationExists { - _, found = stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + _, found = stakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) require.True(t, found, "delegation not found from tokenize share module account after redeem partial amount") - records = stakingKeeper.GetAllTokenizeShareRecords(cc) + records = stakingKeeper.GetAllTokenizeShareRecords(ctx) require.Len(t, records, 1) } else { - _, found = stakingKeeper.GetDelegation(cc, records[0].GetModuleAddress(), addrVal1) + _, found = stakingKeeper.GetDelegation(ctx, records[0].GetModuleAddress(), addrVal1) require.False(t, found, "delegation found from tokenize share module account after redeem full amount") - records = stakingKeeper.GetAllTokenizeShareRecords(cc) + records = stakingKeeper.GetAllTokenizeShareRecords(ctx) require.Len(t, records, 0) } }) @@ -798,20 +787,12 @@ func simulateSlashWithImprecision(t *testing.T, sk keeper.Keeper, ctx sdk.Contex // Note, in this example, there 2 tokens are lost during the decimal to int conversion // during the unbonding step within tokenization and redemption func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) msgServer := keeper.NewMsgServerImpl(stakingKeeper) - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) // slash the validator @@ -822,7 +803,7 @@ func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { // Delegate and confirm the delegation record was created delegateAmount := sdk.NewInt(1000) delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ DelegatorAddress: delegatorAddress.String(), ValidatorAddress: validatorAddress.String(), Amount: delegateCoin, @@ -872,26 +853,18 @@ func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within tokenization func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) msgServer := keeper.NewMsgServerImpl(stakingKeeper) - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) // Delegate and confirm the delegation record was created delegateAmount := sdk.NewInt(1000) delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ DelegatorAddress: delegatorAddress.String(), ValidatorAddress: validatorAddress.String(), Amount: delegateCoin, @@ -948,27 +921,19 @@ func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { // Delegate -> Tokenize -> Slash -> Redeem // Note, in this example, there 1 token lost during the decimal to int conversion // during the unbonding step within redemption -func TestTokenizeAndRedeemConversion_SlashBeforeRedemptino(t *testing.T) { +func TestTokenizeAndRedeemConversion_SlashBeforeRedemption(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) msgServer := keeper.NewMsgServerImpl(stakingKeeper) - delegatorAddress, validatorAddress := setupTestTokenizeAndRedeemConversion(t, *stakingKeeper, bankKeeper, ctx) // Delegate and confirm the delegation record was created delegateAmount := sdk.NewInt(1000) delegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegateAmount) - _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ + _, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ DelegatorAddress: delegatorAddress.String(), ValidatorAddress: validatorAddress.String(), Amount: delegateCoin, @@ -1023,15 +988,14 @@ func TestTransferTokenizeShareRecord(t *testing.T) { bankKeeper bankkeeper.Keeper stakingKeeper *keeper.Keeper ) - app, err := simtestutil.Setup(testutil.AppConfig, &bankKeeper, &stakingKeeper, ) require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) msgServer := keeper.NewMsgServerImpl(stakingKeeper) + addrs := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 3, stakingKeeper.TokensFromConsensusPower(ctx, 10000)) addrAcc1, addrAcc2, valAcc := addrs[0], addrs[1], addrs[2] addrVal := sdk.ValAddress(valAcc) @@ -1075,7 +1039,6 @@ func TestTransferTokenizeShareRecord(t *testing.T) { // TODO refactor LSM test func TestValidatorBond(t *testing.T) { - testCases := []struct { name string createValidator bool @@ -1126,20 +1089,12 @@ func TestValidatorBond(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - accountKeeper accountKeeper.AccountKeeper - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &accountKeeper, - &bankKeeper, - &stakingKeeper, + accountKeeper = app.AccountKeeper + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - pubKeys := simtestutil.CreateTestPubKeys(2) validatorPubKey := pubKeys[0] @@ -1158,7 +1113,7 @@ func TestValidatorBond(t *testing.T) { delegationAmount := stakingKeeper.TokensFromConsensusPower(ctx, 20) coins := sdk.NewCoins(sdk.NewCoin(stakingKeeper.BondDenom(ctx), delegationAmount)) - err = bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) require.NoError(t, err, "no error expected when minting") err = bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, delegatorAddress, coins) @@ -1224,18 +1179,11 @@ func TestValidatorBond(t *testing.T) { // TODO refactor LSM test func TestChangeValidatorBond(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - msgServer := keeper.NewMsgServerImpl(stakingKeeper) checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) @@ -1286,6 +1234,7 @@ func TestChangeValidatorBond(t *testing.T) { undelegateCoin := sdk.NewCoin(stakingKeeper.BondDenom(ctx), undelegateAmount) // Delegate to validator's A and C - validator bond shares should not change + msgServer := keeper.NewMsgServerImpl(stakingKeeper) _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &types.MsgDelegate{ DelegatorAddress: delegatorAddress.String(), ValidatorAddress: validatorAAddress.String(), @@ -1395,18 +1344,11 @@ func TestChangeValidatorBond(t *testing.T) { // TODO refactor LSM test func TestEnableDisableTokenizeShares(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - msgServer := keeper.NewMsgServerImpl(stakingKeeper) // Create a delegator and validator stakeAmount := sdk.NewInt(1000) stakeToken := sdk.NewCoin(stakingKeeper.BondDenom(ctx), stakeAmount) @@ -1456,6 +1398,7 @@ func TestEnableDisableTokenizeShares(t *testing.T) { DelegatorAddress: delegatorAddress.String(), } + msgServer := keeper.NewMsgServerImpl(stakingKeeper) // Delegate normally _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) require.NoError(t, err, "no error expected when delegating") @@ -1579,20 +1522,12 @@ func TestUnbondValidator(t *testing.T) { // TestICADelegateUndelegate tests that an ICA account can undelegate // sequentially right after delegating. func TestICADelegateUndelegate(t *testing.T) { + _, app, ctx := createTestInput(t) var ( - accountKeeper accountKeeper.AccountKeeper - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &accountKeeper, - &bankKeeper, - &stakingKeeper, + accountKeeper = app.AccountKeeper + stakingKeeper = app.StakingKeeper + bankKeeper = app.BankKeeper ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - msgServer := keeper.NewMsgServerImpl(stakingKeeper) // Create a delegator and validator (the delegator will be an ICA account) delegateAmount := sdk.NewInt(1000) @@ -1600,7 +1535,7 @@ func TestICADelegateUndelegate(t *testing.T) { icaAccountAddress := createICAAccount(ctx, accountKeeper) // Fund ICA account - err = bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) + err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(delegateCoin)) require.NoError(t, err) err = bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, icaAccountAddress, sdk.NewCoins(delegateCoin)) require.NoError(t, err) @@ -1628,6 +1563,8 @@ func TestICADelegateUndelegate(t *testing.T) { Amount: delegateCoin, } + msgServer := keeper.NewMsgServerImpl(stakingKeeper) + // Delegate normally _, err = msgServer.Delegate(sdk.WrapSDKContext(ctx), &delegateMsg) require.NoError(t, err, "no error expected when delegating") @@ -1664,7 +1601,7 @@ func TestICADelegateUndelegate(t *testing.T) { // Helper function to create 32-length account // Used to mock an liquid staking provider's ICA account -func createICAAccount(ctx sdk.Context, ak accountKeeper.AccountKeeper) sdk.AccAddress { +func createICAAccount(ctx sdk.Context, ak accountkeeper.AccountKeeper) sdk.AccAddress { icahost := "icahost" connectionID := "connection-0" portID := icahost diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 98ed2aa9378d..04f6e0e699b7 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -800,183 +800,3 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { red, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) require.False(found, "%v", red) } - -/*TODO refactor LSM tests: - -- Note that in v0.45.16-lsm the redelegation tests are renamed such that: -TestRedelegateFromUnbondingValidator -> TestValidatorBondUndelegate and -TestRedelegateFromUnbondedValidator -> TestValidatorBondUndelegate - -- Note that in v0.45.16-lsm the keeper tests are still using testing.T -and simapp, which should updated to unit test with gomock, see tests above. - -*/ -// func TestValidatorBondUndelegate(t *testing.T) { -// _, app, ctx := createTestInput() - -// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) -// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - -// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - -// bondDenom := app.StakingKeeper.BondDenom(ctx) -// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - -// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) -// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - -// // create a validator and a delegator to that validator -// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator) - -// // set validator bond factor -// params := app.StakingKeeper.GetParams(ctx) -// params.ValidatorBondFactor = sdk.NewDec(1) -// app.StakingKeeper.SetParams(ctx, params) - -// // convert to validator self-bond -// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// }) -// require.NoError(t, err) - -// // tokenize share for 2nd account delegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ -// DelegatorAddress: addrDels[1].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// TokenizedShareOwner: addrDels[0].String(), -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.Error(t, err) - -// // redeem full amount on 2nd account and try undelegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ -// DelegatorAddress: addrDels[1].String(), -// Amount: tokenizeShareResp.Amount, -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.NoError(t, err) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) -// } - -// func TestValidatorBondRedelegate(t *testing.T) { -// _, app, ctx := createTestInput() - -// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) -// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - -// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - -// bondDenom := app.StakingKeeper.BondDenom(ctx) -// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - -// startPoolToken := sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens.Mul(sdk.NewInt(2)))) -// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startPoolToken)) -// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - -// // create a validator and a delegator to that validator -// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator) -// validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator2) - -// // set validator bond factor -// params := app.StakingKeeper.GetParams(ctx) -// params.ValidatorBondFactor = sdk.NewDec(1) -// app.StakingKeeper.SetParams(ctx, params) - -// // set total liquid stake -// app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(100)) - -// // delegate to each validator -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) -// require.NoError(t, err) - -// validator2, _ = app.StakingKeeper.GetValidator(ctx, addrVals[1]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator2) -// require.NoError(t, err) - -// // convert to validator self-bond -// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) -// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// }) -// require.NoError(t, err) - -// // tokenize share for 2nd account delegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ -// DelegatorAddress: addrDels[1].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// TokenizedShareOwner: addrDels[0].String(), -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorSrcAddress: addrVals[0].String(), -// ValidatorDstAddress: addrVals[1].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.Error(t, err) - -// // redeem full amount on 2nd account and try undelegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ -// DelegatorAddress: addrDels[1].String(), -// Amount: tokenizeShareResp.Amount, -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorSrcAddress: addrVals[0].String(), -// ValidatorDstAddress: addrVals[1].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.NoError(t, err) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) -// } diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index 223de9065903..8b4c75e98f12 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -1,1183 +1,528 @@ package keeper_test -// TODO refactor LSM tests - import ( + "fmt" + + "cosmossdk.io/simapp" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/address" - accountKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// // Helper function to create a base account from an account name -// // Used to differentiate against liquid staking provider module account -// func createBaseAccount(app *simapp.SimApp, ctx sdk.Context, accountName string) sdk.AccAddress { -// baseAccountAddress := sdk.AccAddress(accountName) -// app.AccountKeeper.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) -// return baseAccountAddress -// } - -// // Helper function to create a module account address from a tokenized share -// // Used to mock the delegation owner of a tokenized share -// func createTokenizeShareModuleAccount(recordID uint64) sdk.AccAddress { -// record := types.TokenizeShareRecord{ -// Id: recordID, -// ModuleAccount: fmt.Sprintf("%s%d", types.TokenizeShareModuleAccountPrefix, recordID), -// } -// return record.GetModuleAddress() -// } - -// // Tests Set/Get TotalLiquidStakedTokens -// func (s *KeeperTestSuite) TestTotalLiquidStakedTokens(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Update the total liquid staked -// total := sdk.NewInt(100) -// keeper.SetTotalLiquidStakedTokens(ctx, total) - -// // Confirm it was updated -// require.Equal(t, total, keeper.GetTotalLiquidStakedTokens(ctx), "initial") -// } - -// // Tests Increase/Decrease TotalValidatorLiquidShares -// func (s *KeeperTestSuite) TestValidatorLiquidShares(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper - -// // Create a validator address -// privKey := secp256k1.GenPrivKey() -// pubKey := privKey.PubKey() -// valAddress := sdk.ValAddress(pubKey.Address()) - -// // Set an initial total -// initial := sdk.NewDec(100) -// validator := types.Validator{ -// OperatorAddress: valAddress.String(), -// LiquidShares: initial, -// } -// keeper.SetValidator(ctx, validator) -// } - -// // Tests DelegatorIsLiquidStaker -// func (s *KeeperTestSuite) TestDelegatorIsLiquidStaker(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Create base and ICA accounts -// baseAccountAddress := createBaseAccount(app, ctx, "base-account") -// icaAccountAddress := createICAAccount(app, ctx) - -// // Only the ICA module account should be considered a liquid staking provider -// require.False(keeper.DelegatorIsLiquidStaker(baseAccountAddress), "base account") -// require.True(keeper.DelegatorIsLiquidStaker(icaAccountAddress), "ICA module account") -// } - -// // Helper function to clear the Bonded pool balances before a unit test -// func clearPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context) { -// bondDenom := keeper.BondDenom(ctx) -// initialBondedBalance := app.BankKeeper.GetBalance(ctx, app.AccountKeeper.GetModuleAddress(types.BondedPoolName), bondDenom) - -// err := app.BankKeeper.SendCoinsFromModuleToModule(ctx, types.BondedPoolName, minttypes.ModuleName, sdk.NewCoins(initialBondedBalance)) -// require.NoError(t, err, "no error expected when clearing bonded pool balance") -// } - -// // Helper function to fund the Bonded pool balances before a unit test -// func fundPoolBalance(t *testing.T, app *simapp.SimApp, ctx sdk.Context, amount sdk.Int) { -// bondDenom := keeper.BondDenom(ctx) -// bondedPoolCoin := sdk.NewCoin(bondDenom, amount) - -// err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, sdk.NewCoins(bondedPoolCoin)) -// require.NoError(t, err, "no error expected when minting") - -// err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, types.BondedPoolName, sdk.NewCoins(bondedPoolCoin)) -// require.NoError(t, err, "no error expected when sending tokens to bonded pool") -// } - -// // Tests CheckExceedsGlobalLiquidStakingCap -// func (s *KeeperTestSuite) TestCheckExceedsGlobalLiquidStakingCap(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// testCases := []struct { -// name string -// globalLiquidCap sdk.Dec -// totalLiquidStake sdk.Int -// totalStake sdk.Int -// newLiquidStake sdk.Int -// tokenizingShares bool -// expectedExceeds bool -// }{ -// { -// // Cap: 10% - Native Delegation - Delegation Below Threshold -// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 1 -// // => Total Liquid Stake: 5+1=6, Total Stake: 95+1=96 => 6/96 = 6% < 10% cap -// name: "10 percent cap _ native delegation _ delegation below cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), -// totalLiquidStake: sdk.NewInt(5), -// totalStake: sdk.NewInt(95), -// newLiquidStake: sdk.NewInt(1), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 10% - Native Delegation - Delegation At Threshold -// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 5 -// // => Total Liquid Stake: 5+5=10, Total Stake: 95+5=100 => 10/100 = 10% == 10% cap -// name: "10 percent cap _ native delegation _ delegation equals cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), -// totalLiquidStake: sdk.NewInt(5), -// totalStake: sdk.NewInt(95), -// newLiquidStake: sdk.NewInt(5), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 10% - Native Delegation - Delegation Exceeds Threshold -// // Total Liquid Stake: 5, Total Stake: 95, New Liquid Stake: 6 -// // => Total Liquid Stake: 5+6=11, Total Stake: 95+6=101 => 11/101 = 11% > 10% cap -// name: "10 percent cap _ native delegation _ delegation exceeds cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.1"), -// totalLiquidStake: sdk.NewInt(5), -// totalStake: sdk.NewInt(95), -// newLiquidStake: sdk.NewInt(6), -// tokenizingShares: false, -// expectedExceeds: true, -// }, -// { -// // Cap: 20% - Native Delegation - Delegation Below Threshold -// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 29 -// // => Total Liquid Stake: 20+29=49, Total Stake: 220+29=249 => 49/249 = 19% < 20% cap -// name: "20 percent cap _ native delegation _ delegation below cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), -// totalLiquidStake: sdk.NewInt(20), -// totalStake: sdk.NewInt(220), -// newLiquidStake: sdk.NewInt(29), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 20% - Native Delegation - Delegation At Threshold -// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 30 -// // => Total Liquid Stake: 20+30=50, Total Stake: 220+30=250 => 50/250 = 20% == 20% cap -// name: "20 percent cap _ native delegation _ delegation equals cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), -// totalLiquidStake: sdk.NewInt(20), -// totalStake: sdk.NewInt(220), -// newLiquidStake: sdk.NewInt(30), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 20% - Native Delegation - Delegation Exceeds Threshold -// // Total Liquid Stake: 20, Total Stake: 220, New Liquid Stake: 31 -// // => Total Liquid Stake: 20+31=51, Total Stake: 220+31=251 => 51/251 = 21% > 20% cap -// name: "20 percent cap _ native delegation _ delegation exceeds cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.20"), -// totalLiquidStake: sdk.NewInt(20), -// totalStake: sdk.NewInt(220), -// newLiquidStake: sdk.NewInt(31), -// tokenizingShares: false, -// expectedExceeds: true, -// }, -// { -// // Cap: 50% - Native Delegation - Delegation Below Threshold -// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 -// // => Total Liquid Stake: 0+50=50, Total Stake: 100+50=150 => 50/150 = 33% < 50% cap -// name: "50 percent cap _ native delegation _ delegation below cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), -// totalLiquidStake: sdk.NewInt(0), -// totalStake: sdk.NewInt(100), -// newLiquidStake: sdk.NewInt(50), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 50% - Tokenized Delegation - Delegation At Threshold -// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 50 -// // => 50 / 100 = 50% == 50% cap -// name: "50 percent cap _ tokenized delegation _ delegation equals cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), -// totalLiquidStake: sdk.NewInt(0), -// totalStake: sdk.NewInt(100), -// newLiquidStake: sdk.NewInt(50), -// tokenizingShares: true, -// expectedExceeds: false, -// }, -// { -// // Cap: 50% - Native Delegation - Delegation Below Threshold -// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 -// // => Total Liquid Stake: 0+51=51, Total Stake: 100+51=151 => 51/151 = 33% < 50% cap -// name: "50 percent cap _ native delegation _ delegation below cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), -// totalLiquidStake: sdk.NewInt(0), -// totalStake: sdk.NewInt(100), -// newLiquidStake: sdk.NewInt(51), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// { -// // Cap: 50% - Tokenized Delegation - Delegation Exceeds Threshold -// // Total Liquid Stake: 0, Total Stake: 100, New Liquid Stake: 51 -// // => 51 / 100 = 51% > 50% cap -// name: "50 percent cap _ tokenized delegation _delegation exceeds cap", -// globalLiquidCap: sdk.MustNewDecFromStr("0.5"), -// totalLiquidStake: sdk.NewInt(0), -// totalStake: sdk.NewInt(100), -// newLiquidStake: sdk.NewInt(51), -// tokenizingShares: true, -// expectedExceeds: true, -// }, -// { -// // Cap of 0% - everything should exceed -// name: "0 percent cap", -// globalLiquidCap: sdk.ZeroDec(), -// totalLiquidStake: sdk.NewInt(0), -// totalStake: sdk.NewInt(1_000_000), -// newLiquidStake: sdk.NewInt(1), -// tokenizingShares: false, -// expectedExceeds: true, -// }, -// { -// // Cap of 100% - nothing should exceed -// name: "100 percent cap", -// globalLiquidCap: sdk.OneDec(), -// totalLiquidStake: sdk.NewInt(1), -// totalStake: sdk.NewInt(1), -// newLiquidStake: sdk.NewInt(1_000_000), -// tokenizingShares: false, -// expectedExceeds: false, -// }, -// } - -// for _, tc := range testCases { -// t.Run(tc.name, func(t *testing.T) { -// // Update the global liquid staking cap -// params := keeper.GetParams(ctx) -// params.GlobalLiquidStakingCap = tc.globalLiquidCap -// keeper.SetParams(ctx, params) - -// // Update the total liquid tokens -// keeper.SetTotalLiquidStakedTokens(ctx, tc.totalLiquidStake) - -// // Fund each pool for the given test case -// clearPoolBalance(t, app, ctx) -// fundPoolBalance(t, app, ctx, tc.totalStake) - -// // Check if the new tokens would exceed the global cap -// actualExceeds := keeper.CheckExceedsGlobalLiquidStakingCap(ctx, tc.newLiquidStake, tc.tokenizingShares) -// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) -// }) -// } -// } - -// // Tests SafelyIncreaseTotalLiquidStakedTokens -// func (s *KeeperTestSuite) TestSafelyIncreaseTotalLiquidStakedTokens(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// intitialTotalLiquidStaked := sdk.NewInt(100) -// increaseAmount := sdk.NewInt(10) -// poolBalance := sdk.NewInt(200) - -// // Set the total staked and total liquid staked amounts -// // which are required components when checking the global cap -// // Total stake is calculated from the pool balance -// clearPoolBalance(t, app, ctx) -// fundPoolBalance(t, app, ctx, poolBalance) -// keeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) - -// // Set the global cap such that a small delegation would exceed the cap -// params := keeper.GetParams(ctx) -// params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.0001") -// keeper.SetParams(ctx, params) - -// // Attempt to increase the total liquid stake again, it should error since -// // the cap was exceeded -// err := keeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) -// require.ErrorIs(t, err, types.ErrGlobalLiquidStakingCapExceeded) -// require.Equal(t, intitialTotalLiquidStaked, keeper.GetTotalLiquidStakedTokens(ctx)) - -// // Now relax the cap so that the increase succeeds -// params.GlobalLiquidStakingCap = sdk.MustNewDecFromStr("0.99") -// keeper.SetParams(ctx, params) - -// // Confirm the total increased -// err = keeper.SafelyIncreaseTotalLiquidStakedTokens(ctx, increaseAmount, true) -// require.NoError(t, err) -// require.Equal(t, intitialTotalLiquidStaked.Add(increaseAmount), keeper.GetTotalLiquidStakedTokens(ctx)) -// } - -// // Tests DecreaseTotalLiquidStakedTokens -// func (s *KeeperTestSuite) TestDecreaseTotalLiquidStakedTokens(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// intitialTotalLiquidStaked := sdk.NewInt(100) -// decreaseAmount := sdk.NewInt(10) - -// // Set the total liquid staked to an arbitrary value -// keeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) - -// // Decrease the total liquid stake and confirm the total was updated -// err := keeper.DecreaseTotalLiquidStakedTokens(ctx, decreaseAmount) -// require.NoError(t, err, "no error expected when decreasing total liquid staked tokens") -// require.Equal(t, intitialTotalLiquidStaked.Sub(decreaseAmount), keeper.GetTotalLiquidStakedTokens(ctx)) - -// // Attempt to decrease by an excessive amount, it should error -// err = keeper.DecreaseTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) -// require.ErrorIs(err, types.ErrTotalLiquidStakedUnderflow) -// } - -// // Tests CheckExceedsValidatorBondCap -// func (s *KeeperTestSuite) TestCheckExceedsValidatorBondCap(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// testCases := []struct { -// name string -// validatorShares sdk.Dec -// validatorBondFactor sdk.Dec -// currentLiquidShares sdk.Dec -// newShares sdk.Dec -// expectedExceeds bool -// }{ -// { -// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 -// // New Shares: 5 - below cap -// name: "factor 1 - below cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(1), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(5), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 -// // New Shares: 10 - at cap -// name: "factor 1 - at cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(1), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(10), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 -// // New Shares: 15 - above cap -// name: "factor 1 - above cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(1), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(15), -// expectedExceeds: true, -// }, -// { -// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 -// // New Shares: 5 - below cap -// name: "factor 2 - well below cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(2), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(5), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 -// // New Shares: 100 - below cap -// name: "factor 2 - below cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(2), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(100), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 -// // New Shares: 110 - below cap -// name: "factor 2 - at cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(2), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(110), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 -// // New Shares: 111 - above cap -// name: "factor 2 - above cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(2), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(111), -// expectedExceeds: true, -// }, -// { -// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 -// // New Shares: 100 - below cap -// name: "factor 100 - below cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(100), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(100), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 -// // New Shares: 9910 - at cap -// name: "factor 100 - at cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(100), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(9910), -// expectedExceeds: false, -// }, -// { -// // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 -// // New Shares: 9911 - above cap -// name: "factor 100 - above cap", -// validatorShares: sdk.NewDec(100), -// validatorBondFactor: sdk.NewDec(100), -// currentLiquidShares: sdk.NewDec(90), -// newShares: sdk.NewDec(9911), -// expectedExceeds: true, -// }, -// { -// // Factor of -1 (disabled): Should always return false -// name: "factor disabled", -// validatorShares: sdk.NewDec(1), -// validatorBondFactor: sdk.NewDec(-1), -// currentLiquidShares: sdk.NewDec(1), -// newShares: sdk.NewDec(1_000_000), -// expectedExceeds: false, -// }, -// } - -// for _, tc := range testCases { -// t.Run(tc.name, func(t *testing.T) { -// // Update the validator bond factor -// params := keeper.GetParams(ctx) -// params.ValidatorBondFactor = tc.validatorBondFactor -// keeper.SetParams(ctx, params) - -// // Create a validator with designated self-bond shares -// validator := types.Validator{ -// LiquidShares: tc.currentLiquidShares, -// ValidatorBondShares: tc.validatorShares, -// } - -// // Check whether the cap is exceeded -// actualExceeds := keeper.CheckExceedsValidatorBondCap(ctx, validator, tc.newShares) -// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) -// }) -// } -// } - -// // Tests TestCheckExceedsValidatorLiquidStakingCap -// func (s *KeeperTestSuite) TestCheckExceedsValidatorLiquidStakingCap(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// testCases := []struct { -// name string -// validatorLiquidCap sdk.Dec -// validatorLiquidShares sdk.Dec -// validatorTotalShares sdk.Dec -// newLiquidShares sdk.Dec -// expectedExceeds bool -// }{ -// { -// // Cap: 10% - Delegation Below Threshold -// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 1 -// // => Liquid Shares: 5+1=6, Total Shares: 95+1=96 => 6/96 = 6% < 10% cap -// name: "10 percent cap _ delegation below cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), -// validatorLiquidShares: sdk.NewDec(5), -// validatorTotalShares: sdk.NewDec(95), -// newLiquidShares: sdk.NewDec(1), -// expectedExceeds: false, -// }, -// { -// // Cap: 10% - Delegation At Threshold -// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 5 -// // => Liquid Shares: 5+5=10, Total Shares: 95+5=100 => 10/100 = 10% == 10% cap -// name: "10 percent cap _ delegation equals cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), -// validatorLiquidShares: sdk.NewDec(5), -// validatorTotalShares: sdk.NewDec(95), -// newLiquidShares: sdk.NewDec(4), -// expectedExceeds: false, -// }, -// { -// // Cap: 10% - Delegation Exceeds Threshold -// // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 6 -// // => Liquid Shares: 5+6=11, Total Shares: 95+6=101 => 11/101 = 11% > 10% cap -// name: "10 percent cap _ delegation exceeds cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), -// validatorLiquidShares: sdk.NewDec(5), -// validatorTotalShares: sdk.NewDec(95), -// newLiquidShares: sdk.NewDec(6), -// expectedExceeds: true, -// }, -// { -// // Cap: 20% - Delegation Below Threshold -// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 29 -// // => Liquid Shares: 20+29=49, Total Shares: 220+29=249 => 49/249 = 19% < 20% cap -// name: "20 percent cap _ delegation below cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), -// validatorLiquidShares: sdk.NewDec(20), -// validatorTotalShares: sdk.NewDec(220), -// newLiquidShares: sdk.NewDec(29), -// expectedExceeds: false, -// }, -// { -// // Cap: 20% - Delegation At Threshold -// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 30 -// // => Liquid Shares: 20+30=50, Total Shares: 220+30=250 => 50/250 = 20% == 20% cap -// name: "20 percent cap _ delegation equals cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), -// validatorLiquidShares: sdk.NewDec(20), -// validatorTotalShares: sdk.NewDec(220), -// newLiquidShares: sdk.NewDec(30), -// expectedExceeds: false, -// }, -// { -// // Cap: 20% - Delegation Exceeds Threshold -// // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 31 -// // => Liquid Shares: 20+31=51, Total Shares: 220+31=251 => 51/251 = 21% > 20% cap -// name: "20 percent cap _ delegation exceeds cap", -// validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), -// validatorLiquidShares: sdk.NewDec(20), -// validatorTotalShares: sdk.NewDec(220), -// newLiquidShares: sdk.NewDec(31), -// expectedExceeds: true, -// }, -// { -// // Cap of 0% - everything should exceed -// name: "0 percent cap", -// validatorLiquidCap: sdk.ZeroDec(), -// validatorLiquidShares: sdk.NewDec(0), -// validatorTotalShares: sdk.NewDec(1_000_000), -// newLiquidShares: sdk.NewDec(1), -// expectedExceeds: true, -// }, -// { -// // Cap of 100% - nothing should exceed -// name: "100 percent cap", -// validatorLiquidCap: sdk.OneDec(), -// validatorLiquidShares: sdk.NewDec(1), -// validatorTotalShares: sdk.NewDec(1_000_000), -// newLiquidShares: sdk.NewDec(1), -// expectedExceeds: false, -// }, -// } - -// for _, tc := range testCases { -// t.Run(tc.name, func(t *testing.T) { -// // Update the validator liquid staking cap -// params := keeper.GetParams(ctx) -// params.ValidatorLiquidStakingCap = tc.validatorLiquidCap -// keeper.SetParams(ctx, params) - -// // Create a validator with designated self-bond shares -// validator := types.Validator{ -// LiquidShares: tc.validatorLiquidShares, -// DelegatorShares: tc.validatorTotalShares, -// } - -// // Check whether the cap is exceeded -// actualExceeds := keeper.CheckExceedsValidatorLiquidStakingCap(ctx, validator, tc.newLiquidShares) -// require.Equal(t, tc.expectedExceeds, actualExceeds, tc.name) -// }) -// } -// } - -// // Tests SafelyIncreaseValidatorLiquidShares -// func (s *KeeperTestSuite) TestSafelyIncreaseValidatorLiquidShares(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Generate a test validator address -// privKey := secp256k1.GenPrivKey() -// pubKey := privKey.PubKey() -// valAddress := sdk.ValAddress(pubKey.Address()) - -// // Helper function to check the validator's liquid shares -// checkValidatorLiquidShares := func(expected sdk.Dec, description string) { -// actualValidator, found := keeper.GetValidator(ctx, valAddress) -// require.True(found) -// require.Equal(expected.TruncateInt64(), actualValidator.LiquidShares.TruncateInt64(), description) -// } - -// // Start with the following: -// // Initial Liquid Shares: 0 -// // Validator Bond Shares: 10 -// // Validator TotalShares: 75 -// // -// // Initial Caps: -// // ValidatorBondFactor: 1 (Cap applied at 10 shares) -// // ValidatorLiquidStakingCap: 25% (Cap applied at 25 shares) -// // -// // Cap Increases: -// // ValidatorBondFactor: 10 (Cap applied at 100 shares) -// // ValidatorLiquidStakingCap: 40% (Cap applied at 50 shares) -// initialLiquidShares := sdk.NewDec(0) -// validatorBondShares := sdk.NewDec(10) -// validatorTotalShares := sdk.NewDec(75) - -// firstIncreaseAmount := sdk.NewDec(20) -// secondIncreaseAmount := sdk.NewDec(10) // total increase of 30 - -// initialBondFactor := sdk.NewDec(1) -// finalBondFactor := sdk.NewDec(10) -// initialLiquidStakingCap := sdk.MustNewDecFromStr("0.25") -// finalLiquidStakingCap := sdk.MustNewDecFromStr("0.4") - -// // Create a validator with designated self-bond shares -// initialValidator := types.Validator{ -// OperatorAddress: valAddress.String(), -// LiquidShares: initialLiquidShares, -// ValidatorBondShares: validatorBondShares, -// DelegatorShares: validatorTotalShares, -// } -// keeper.SetValidator(ctx, initialValidator) - -// // Set validator bond factor to a small number such that any delegation would fail, -// // and set the liquid staking cap such that the first stake would succeed, but the second -// // would fail -// params := keeper.GetParams(ctx) -// params.ValidatorBondFactor = initialBondFactor -// params.ValidatorLiquidStakingCap = initialLiquidStakingCap -// keeper.SetParams(ctx, params) - -// // Attempt to increase the validator liquid shares, it should throw an -// // error that the validator bond cap was exceeded -// _, err := keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) -// require.ErrorIs(t, err, types.ErrInsufficientValidatorBondShares) -// checkValidatorLiquidShares(initialLiquidShares, "shares after low bond factor") - -// // Change validator bond factor to a more conservative number, so that the increase succeeds -// params.ValidatorBondFactor = finalBondFactor -// keeper.SetParams(ctx, params) - -// // Try the increase again and check that it succeeded -// expectedLiquidSharesAfterFirstStake := initialLiquidShares.Add(firstIncreaseAmount) -// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) -// require.NoError(t, err) -// checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares with cap loose bond cap") - -// // Attempt another increase, it should fail from the liquid staking cap -// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) -// require.ErrorIs(t, err, types.ErrValidatorLiquidStakingCapExceeded) -// checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares after liquid staking cap hit") - -// // Raise the liquid staking cap so the new increment succeeds -// params.ValidatorLiquidStakingCap = finalLiquidStakingCap -// keeper.SetParams(ctx, params) - -// // Finally confirm that the increase succeeded this time -// expectedLiquidSharesAfterSecondStake := expectedLiquidSharesAfterFirstStake.Add(secondIncreaseAmount) -// _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) -// require.NoError(t, err, "no error expected after increasing liquid staking cap") -// checkValidatorLiquidShares(expectedLiquidSharesAfterSecondStake, "shares after loose liquid stake cap") -// } - -// // Tests DecreaseValidatorLiquidShares -// func (s *KeeperTestSuite) TestDecreaseValidatorLiquidShares(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// initialLiquidShares := sdk.NewDec(100) -// decreaseAmount := sdk.NewDec(10) - -// // Create a validator with designated self-bond shares -// privKey := secp256k1.GenPrivKey() -// pubKey := privKey.PubKey() -// valAddress := sdk.ValAddress(pubKey.Address()) - -// initialValidator := types.Validator{ -// OperatorAddress: valAddress.String(), -// LiquidShares: initialLiquidShares, -// } -// keeper.SetValidator(ctx, initialValidator) - -// // Decrease the validator liquid shares, and confirm the new share amount has been updated -// _, err := keeper.DecreaseValidatorLiquidShares(ctx, valAddress, decreaseAmount) -// require.NoError(t, err, "no error expected when decreasing validator liquid shares") - -// actualValidator, found := keeper.GetValidator(ctx, valAddress) -// require.True(t, found) -// require.Equal(t, initialLiquidShares.Sub(decreaseAmount), actualValidator.LiquidShares, "liquid shares") - -// // Attempt to decrease by a larger amount than it has, it should fail -// _, err = keeper.DecreaseValidatorLiquidShares(ctx, valAddress, initialLiquidShares) -// require.ErrorIs(t, err, types.ErrValidatorLiquidSharesUnderflow) -// } - -// // Tests SafelyDecreaseValidatorBond -// func (s *KeeperTestSuite) TestSafelyDecreaseValidatorBond(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Initial Bond Factor: 100, Initial Validator Bond: 10 -// // => Max Liquid Shares 1000 (Initial Liquid Shares: 200) -// initialBondFactor := sdk.NewDec(100) -// initialValidatorBondShares := sdk.NewDec(10) -// initialLiquidShares := sdk.NewDec(200) - -// // Create a validator with designated self-bond shares -// privKey := secp256k1.GenPrivKey() -// pubKey := privKey.PubKey() -// valAddress := sdk.ValAddress(pubKey.Address()) - -// initialValidator := types.Validator{ -// OperatorAddress: valAddress.String(), -// ValidatorBondShares: initialValidatorBondShares, -// LiquidShares: initialLiquidShares, -// } -// keeper.SetValidator(ctx, initialValidator) - -// // Set the bond factor -// params := keeper.GetParams(ctx) -// params.ValidatorBondFactor = initialBondFactor -// keeper.SetParams(ctx, params) - -// // Decrease the validator bond from 10 to 5 (minus 5) -// // This will adjust the cap (factor * shares) -// // from (100 * 10 = 1000) to (100 * 5 = 500) -// // Since this is still above the initial liquid shares of 200, this will succeed -// decreaseAmount, expectedBondShares := sdk.NewDec(5), sdk.NewDec(5) -// err := keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) -// require.NoError(t, err) - -// actualValidator, found := keeper.GetValidator(ctx, valAddress) -// require.True(t, found) -// require.Equal(t, expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") - -// // Now attempt to decrease the validator bond again from 5 to 1 (minus 4) -// // This time, the cap will be reduced to (factor * shares) = (100 * 1) = 100 -// // However, the liquid shares are currently 200, so this should fail -// decreaseAmount, expectedBondShares = sdk.NewDec(4), sdk.NewDec(1) -// err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) -// require.ErrorIs(t, err, types.ErrInsufficientValidatorBondShares) - -// // Finally, disable the cap and attempt to decrease again -// // This time it should succeed -// params.ValidatorBondFactor = types.ValidatorBondCapDisabled -// keeper.SetParams(ctx, params) - -// err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) -// require.NoError(t, err) - -// actualValidator, found = keeper.GetValidator(ctx, valAddress) -// require.True(t, found) -// require.Equal(t, expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") -// } - -// // Tests Add/Remove/Get/SetTokenizeSharesLock -// func (s *KeeperTestSuite) TestTokenizeSharesLock(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// addresses := simtestutil.AddTestAddrs(s.bankKeeper, ctx, 2, sdk.NewInt(1)) -// addressA, addressB := addresses[0], addresses[1] - -// unlocked := types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED.String() -// locked := types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String() -// lockExpiring := types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String() - -// // Confirm both accounts start unlocked -// status, _ := keeper.GetTokenizeSharesLock(ctx, addressA) -// require.Equal(t, unlocked, status.String(), "addressA unlocked at start") - -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) -// require.Equal(t, unlocked, status.String(), "addressB unlocked at start") - -// // Lock the first account -// keeper.AddTokenizeSharesLock(ctx, addressA) - -// // The first account should now have tokenize shares disabled -// // and the unlock time should be the zero time -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) -// require.Equal(t, locked, status.String(), "addressA locked") - -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) -// require.Equal(t, unlocked, status.String(), "addressB still unlocked") - -// // Update the lock time and confirm it was set -// expectedUnlockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) -// keeper.SetTokenizeSharesUnlockTime(ctx, addressA, expectedUnlockTime) - -// status, actualUnlockTime := keeper.GetTokenizeSharesLock(ctx, addressA) -// require.Equal(t, lockExpiring, status.String(), "addressA lock expiring") -// require.Equal(t, expectedUnlockTime, actualUnlockTime, "addressA unlock time") - -// // Confirm B is still unlocked -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) -// require.Equal(t, unlocked, status.String(), "addressB still unlocked") - -// // Remove the lock -// keeper.RemoveTokenizeSharesLock(ctx, addressA) -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) -// require.Equal(t, unlocked, status.String(), "addressA unlocked at end") - -// status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) -// require.Equal(t, unlocked, status.String(), "addressB unlocked at end") -// } - -// // Tests GetAllTokenizeSharesLocks -// func (s *KeeperTestSuite) TestGetAllTokenizeSharesLocks(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// addresses := simapp.AddTestAddrs(app, ctx, 4, sdk.NewInt(1)) - -// // Set 2 locked accounts, and two accounts with a lock expiring -// keeper.AddTokenizeSharesLock(ctx, addresses[0]) -// keeper.AddTokenizeSharesLock(ctx, addresses[1]) - -// unlockTime1 := time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC) -// unlockTime2 := time.Date(2023, 1, 2, 1, 0, 0, 0, time.UTC) -// keeper.SetTokenizeSharesUnlockTime(ctx, addresses[2], unlockTime1) -// keeper.SetTokenizeSharesUnlockTime(ctx, addresses[3], unlockTime2) - -// // Defined expected locks after GetAll -// expectedLocks := map[string]types.TokenizeShareLock{ -// addresses[0].String(): { -// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), -// }, -// addresses[1].String(): { -// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), -// }, -// addresses[2].String(): { -// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), -// CompletionTime: unlockTime1, -// }, -// addresses[3].String(): { -// Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), -// CompletionTime: unlockTime2, -// }, -// } - -// // Check output from GetAll -// actualLocks := keeper.GetAllTokenizeSharesLocks(ctx) -// require.Len(actualLocks, len(expectedLocks), "number of locks") - -// for i, actual := range actualLocks { -// expected, ok := expectedLocks[actual.Address] -// require.True(ok, "address %s not expected", actual.Address) -// require.Equal(expected.Status, actual.Status, "tokenize share lock #%d status", i) -// require.Equal(expected.CompletionTime, actual.CompletionTime, "tokenize share lock #%d completion time", i) -// } -// } - -// // Test Get/SetPendingTokenizeShareAuthorizations -// func (s *KeeperTestSuite) TestPendingTokenizeShareAuthorizations(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Create dummy accounts and completion times -// addresses := simapp.AddTestAddrs(app, ctx, 3, sdk.NewInt(1)) -// addressStrings := []string{} -// for _, address := range addresses { -// addressStrings = append(addressStrings, address.String()) -// } - -// timeA := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) -// timeB := timeA.Add(time.Hour) - -// // There should be no addresses returned originally -// authorizationsA := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) -// require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected") - -// authorizationsB := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) -// require.Empty(t, authorizationsB.Addresses, "no addresses at timeB expected") - -// // Store addresses for timeB -// keeper.SetPendingTokenizeShareAuthorizations(ctx, timeB, types.PendingTokenizeShareAuthorizations{ -// Addresses: addressStrings, -// }) - -// // Check addresses -// authorizationsA = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) -// require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected at end") - -// authorizationsB = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) -// require.Equal(t, addressStrings, authorizationsB.Addresses, "address length") -// } - -// // Test QueueTokenizeSharesAuthorization and RemoveExpiredTokenizeShareLocks -// func (s *KeeperTestSuite) TestTokenizeShareAuthorizationQueue(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // We'll start by adding the following addresses to the queue -// // Time 0: [address0] -// // Time 1: [] -// // Time 2: [address1, address2, address3] -// // Time 3: [address4, address5] -// // Time 4: [address6] -// addresses := simapp.AddTestAddrs(app, ctx, 7, sdk.NewInt(1)) -// addressesByTime := map[int][]sdk.AccAddress{ -// 0: {addresses[0]}, -// 1: {}, -// 2: {addresses[1], addresses[2], addresses[3]}, -// 3: {addresses[4], addresses[5]}, -// 4: {addresses[6]}, -// } - -// // Set the unbonding time to 1 day -// unbondingPeriod := time.Hour * 24 -// params := keeper.GetParams(ctx) -// params.UnbondingTime = unbondingPeriod -// keeper.SetParams(ctx, params) - -// // Add each address to the queue and then increment the block time -// // such that the times line up as follows -// // Time 0: 2023-01-01 00:00:00 -// // Time 1: 2023-01-01 00:01:00 -// // Time 2: 2023-01-01 00:02:00 -// // Time 3: 2023-01-01 00:03:00 -// startTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) -// ctx = ctx.WithBlockTime(startTime) -// blockTimeIncrement := time.Hour - -// for timeIndex := 0; timeIndex <= 4; timeIndex++ { -// for _, address := range addressesByTime[timeIndex] { -// keeper.QueueTokenizeSharesAuthorization(ctx, address) -// } -// ctx = ctx.WithBlockTime(ctx.BlockTime().Add(blockTimeIncrement)) -// } - -// // We'll unlock the tokens using the following progression -// // The "alias'"/keys for these times assume a starting point of the Time 0 -// // from above, plus the Unbonding Time -// // Time -1 (2023-01-01 23:59:99): [] -// // Time 0 (2023-01-02 00:00:00): [address0] -// // Time 1 (2023-01-02 00:01:00): [] -// // Time 2.5 (2023-01-02 00:02:30): [address1, address2, address3] -// // Time 10 (2023-01-02 00:10:00): [address4, address5, address6] -// unlockBlockTimes := map[string]time.Time{ -// "-1": startTime.Add(unbondingPeriod).Add(-time.Second), -// "0": startTime.Add(unbondingPeriod), -// "1": startTime.Add(unbondingPeriod).Add(blockTimeIncrement), -// "2.5": startTime.Add(unbondingPeriod).Add(2 * blockTimeIncrement).Add(blockTimeIncrement / 2), -// "10": startTime.Add(unbondingPeriod).Add(10 * blockTimeIncrement), -// } -// expectedUnlockedAddresses := map[string][]string{ -// "-1": {}, -// "0": {addresses[0].String()}, -// "1": {}, -// "2.5": {addresses[1].String(), addresses[2].String(), addresses[3].String()}, -// "10": {addresses[4].String(), addresses[5].String(), addresses[6].String()}, -// } - -// // Now we'll remove items from the queue sequentially -// // First check with a block time before the first expiration - it should remove no addresses -// actualAddresses := keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["-1"]) -// require.Equal(t, expectedUnlockedAddresses["-1"], actualAddresses, "no addresses unlocked from time -1") - -// // Then pass in (time 0 + unbonding time) - it should remove the first address -// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["0"]) -// require.Equal(t, expectedUnlockedAddresses["0"], actualAddresses, "one address unlocked from time 0") - -// // Now pass in (time 1 + unbonding time) - it should remove no addresses since -// // the address at time 0 was already removed -// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["1"]) -// require.Equal(t, expectedUnlockedAddresses["1"], actualAddresses, "no addresses unlocked from time 1") - -// // Now pass in (time 2.5 + unbonding time) - it should remove the three addresses from time 2 -// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["2.5"]) -// require.Equal(t, expectedUnlockedAddresses["2.5"], actualAddresses, "addresses unlocked from time 2.5") - -// // Finally pass in a block time far in the future, which should remove all the remaining locks -// actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["10"]) -// require.Equal(t, expectedUnlockedAddresses["10"], actualAddresses, "addresses unlocked from time 10") -// } - -// // Test RefreshTotalLiquidStaked -// func (s *KeeperTestSuite) TestRefreshTotalLiquidStaked(t *testing.T) { -// ctx, keeper := s.ctx, s.stakingKeeper -// require := s.Require() - -// // Set an arbitrary total liquid staked tokens amount that will get overwritten by the refresh -// keeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(999)) - -// // Add validator's with various exchange rates -// validators := []types.Validator{ -// { -// // Exchange rate of 1 -// OperatorAddress: "valA", -// Tokens: sdk.NewInt(100), -// DelegatorShares: sdk.NewDec(100), -// LiquidShares: sdk.NewDec(100), // should be overwritten -// }, -// { -// // Exchange rate of 0.9 -// OperatorAddress: "valB", -// Tokens: sdk.NewInt(90), -// DelegatorShares: sdk.NewDec(100), -// LiquidShares: sdk.NewDec(200), // should be overwritten -// }, -// { -// // Exchange rate of 0.75 -// OperatorAddress: "valC", -// Tokens: sdk.NewInt(75), -// DelegatorShares: sdk.NewDec(100), -// LiquidShares: sdk.NewDec(300), // should be overwritten -// }, -// } - -// // Add various delegations across the above validator's -// // Total Liquid Staked: 1,849 + 922 = 2,771 -// // Liquid Shares: -// // ValA: 400 + 325 = 725 -// // ValB: 860 + 580 = 1,440 -// // ValC: 900 + 100 = 1,000 -// expectedTotalLiquidStaked := int64(2771) -// expectedValidatorLiquidShares := map[string]sdk.Dec{ -// "valA": sdk.NewDec(725), -// "valB": sdk.NewDec(1440), -// "valC": sdk.NewDec(1000), -// } - -// delegations := []struct { -// delegation types.Delegation -// isLSTP bool -// isTokenized bool -// }{ -// // Delegator A - Not a liquid staking provider -// // Number of tokens/shares is irrelevant for this test -// { -// isLSTP: false, -// delegation: types.Delegation{ -// DelegatorAddress: "delA", -// ValidatorAddress: "valA", -// Shares: sdk.NewDec(100), -// }, -// }, -// { -// isLSTP: false, -// delegation: types.Delegation{ -// DelegatorAddress: "delA", -// ValidatorAddress: "valB", -// Shares: sdk.NewDec(860), -// }, -// }, -// { -// isLSTP: false, -// delegation: types.Delegation{ -// DelegatorAddress: "delA", -// ValidatorAddress: "valC", -// Shares: sdk.NewDec(750), -// }, -// }, -// // Delegator B - Liquid staking provider, tokens included in total -// // Total liquid staked: 400 + 774 + 675 = 1,849 -// { -// // Shares: 400 shares, Exchange Rate: 1.0, Tokens: 400 -// isLSTP: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delB-LSTP", -// ValidatorAddress: "valA", -// Shares: sdk.NewDec(400), -// }, -// }, -// { -// // Shares: 860 shares, Exchange Rate: 0.9, Tokens: 774 -// isLSTP: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delB-LSTP", -// ValidatorAddress: "valB", -// Shares: sdk.NewDec(860), -// }, -// }, -// { -// // Shares: 900 shares, Exchange Rate: 0.75, Tokens: 675 -// isLSTP: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delB-LSTP", -// ValidatorAddress: "valC", -// Shares: sdk.NewDec(900), -// }, -// }, -// // Delegator C - Tokenized shares, tokens included in total -// // Total liquid staked: 325 + 522 + 75 = 922 -// { -// // Shares: 325 shares, Exchange Rate: 1.0, Tokens: 325 -// isTokenized: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delC-LSTP", -// ValidatorAddress: "valA", -// Shares: sdk.NewDec(325), -// }, -// }, -// { -// // Shares: 580 shares, Exchange Rate: 0.9, Tokens: 522 -// isTokenized: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delC-LSTP", -// ValidatorAddress: "valB", -// Shares: sdk.NewDec(580), -// }, -// }, -// { -// // Shares: 100 shares, Exchange Rate: 0.75, Tokens: 75 -// isTokenized: true, -// delegation: types.Delegation{ -// DelegatorAddress: "delC-LSTP", -// ValidatorAddress: "valC", -// Shares: sdk.NewDec(100), -// }, -// }, -// } - -// // Create validators based on the above (must use an actual validator address) -// addresses := testutil.AddTestAddrsIncremental(s.bankKeeper, ctx, 5, keeper.TokensFromConsensusPower(ctx, 300)) -// validatorAddresses := map[string]sdk.ValAddress{ -// "valA": sdk.ValAddress(addresses[0]), -// "valB": sdk.ValAddress(addresses[1]), -// "valC": sdk.ValAddress(addresses[2]), -// } -// for _, validator := range validators { -// validator.OperatorAddress = validatorAddresses[validator.OperatorAddress].String() -// keeper.SetValidator(ctx, validator) -// } - -// // Create the delegations based on the above (must use actual delegator addresses) -// for _, delegationCase := range delegations { -// var delegatorAddress sdk.AccAddress -// switch { -// case delegationCase.isLSTP: -// delegatorAddress = createICAAccount(app, ctx) -// case delegationCase.isTokenized: -// delegatorAddress = createTokenizeShareModuleAccount(1) -// default: -// delegatorAddress = createBaseAccount(app, ctx, delegationCase.delegation.DelegatorAddress) -// } - -// delegation := delegationCase.delegation -// delegation.DelegatorAddress = delegatorAddress.String() -// delegation.ValidatorAddress = validatorAddresses[delegation.ValidatorAddress].String() -// keeper.SetDelegation(ctx, delegation) -// } - -// // Refresh the total liquid staked and validator liquid shares -// err := keeper.RefreshTotalLiquidStaked(ctx) -// require.NoError(t, err, "no error expected when refreshing total liquid staked") - -// // Check the total liquid staked and liquid shares by validator -// actualTotalLiquidStaked := keeper.GetTotalLiquidStakedTokens(ctx) -// require.Equal(t, expectedTotalLiquidStaked, actualTotalLiquidStaked.Int64(), "total liquid staked tokens") - -// for _, moniker := range []string{"valA", "valB", "valC"} { -// address := validatorAddresses[moniker] -// expectedLiquidShares := expectedValidatorLiquidShares[moniker] - -// actualValidator, found := keeper.GetValidator(ctx, address) -// require.True(t, found, "validator %s should have been found after refresh", moniker) +// TODO refactor LSM tests -// actualLiquidShares := actualValidator.LiquidShares -// require.Equal(t, expectedLiquidShares.TruncateInt64(), actualLiquidShares.TruncateInt64(), -// "liquid staked shares for validator %s", moniker) -// } -// } +// Helper function to create a base account from an account name +// Used to differentiate against liquid staking provider module account +func createBaseAccount(app *simapp.SimApp, ctx sdk.Context, accountName string) sdk.AccAddress { + baseAccountAddress := sdk.AccAddress(accountName) + app.AccountKeeper.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) + return baseAccountAddress +} + +// Helper function to create a module account address from a tokenized share +// Used to mock the delegation owner of a tokenized share +func createTokenizeShareModuleAccount(recordID uint64) sdk.AccAddress { + record := types.TokenizeShareRecord{ + Id: recordID, + ModuleAccount: fmt.Sprintf("%s%d", types.TokenizeShareModuleAccountPrefix, recordID), + } + return record.GetModuleAddress() +} + +// Tests Set/Get TotalLiquidStakedTokens +func (s *KeeperTestSuite) TestTotalLiquidStakedTokens() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Update the total liquid staked + total := sdk.NewInt(100) + keeper.SetTotalLiquidStakedTokens(ctx, total) + + // Confirm it was updated + require.Equal(total, keeper.GetTotalLiquidStakedTokens(ctx), "initial") +} + +// Tests Increase/Decrease TotalValidatorLiquidShares +func (s *KeeperTestSuite) TestValidatorLiquidShares() { + ctx, keeper := s.ctx, s.stakingKeeper + + // Create a validator address + privKey := secp256k1.GenPrivKey() + pubKey := privKey.PubKey() + valAddress := sdk.ValAddress(pubKey.Address()) + + // Set an initial total + initial := sdk.NewDec(100) + validator := types.Validator{ + OperatorAddress: valAddress.String(), + LiquidShares: initial, + } + keeper.SetValidator(ctx, validator) +} + +// Tests DecreaseTotalLiquidStakedTokens +func (s *KeeperTestSuite) TestDecreaseTotalLiquidStakedTokens() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + intitialTotalLiquidStaked := sdk.NewInt(100) + decreaseAmount := sdk.NewInt(10) + + // Set the total liquid staked to an arbitrary value + keeper.SetTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) + + // Decrease the total liquid stake and confirm the total was updated + err := keeper.DecreaseTotalLiquidStakedTokens(ctx, decreaseAmount) + require.NoError(err, "no error expected when decreasing total liquid staked tokens") + require.Equal(intitialTotalLiquidStaked.Sub(decreaseAmount), keeper.GetTotalLiquidStakedTokens(ctx)) + + // Attempt to decrease by an excessive amount, it should error + err = keeper.DecreaseTotalLiquidStakedTokens(ctx, intitialTotalLiquidStaked) + require.ErrorIs(err, types.ErrTotalLiquidStakedUnderflow) +} + +// Tests CheckExceedsValidatorBondCap +func (s *KeeperTestSuite) TestCheckExceedsValidatorBondCap() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + testCases := []struct { + name string + validatorShares sdk.Dec + validatorBondFactor sdk.Dec + currentLiquidShares sdk.Dec + newShares sdk.Dec + expectedExceeds bool + }{ + { + // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 + // New Shares: 5 - below cap + name: "factor 1 - below cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(1), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(5), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 + // New Shares: 10 - at cap + name: "factor 1 - at cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(1), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(10), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 1, Current Shares: 90 => 100 Max Shares, Capacity: 10 + // New Shares: 15 - above cap + name: "factor 1 - above cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(1), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(15), + expectedExceeds: true, + }, + { + // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 + // New Shares: 5 - below cap + name: "factor 2 - well below cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(2), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(5), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 + // New Shares: 100 - below cap + name: "factor 2 - below cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(2), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(100), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 + // New Shares: 110 - below cap + name: "factor 2 - at cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(2), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(110), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 2, Current Shares: 90 => 200 Max Shares, Capacity: 110 + // New Shares: 111 - above cap + name: "factor 2 - above cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(2), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(111), + expectedExceeds: true, + }, + { + // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 + // New Shares: 100 - below cap + name: "factor 100 - below cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(100), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(100), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 + // New Shares: 9910 - at cap + name: "factor 100 - at cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(100), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(9910), + expectedExceeds: false, + }, + { + // Validator Shares: 100, Factor: 100, Current Shares: 90 => 10000 Max Shares, Capacity: 9910 + // New Shares: 9911 - above cap + name: "factor 100 - above cap", + validatorShares: sdk.NewDec(100), + validatorBondFactor: sdk.NewDec(100), + currentLiquidShares: sdk.NewDec(90), + newShares: sdk.NewDec(9911), + expectedExceeds: true, + }, + { + // Factor of -1 (disabled): Should always return false + name: "factor disabled", + validatorShares: sdk.NewDec(1), + validatorBondFactor: sdk.NewDec(-1), + currentLiquidShares: sdk.NewDec(1), + newShares: sdk.NewDec(1_000_000), + expectedExceeds: false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + // Update the validator bond factor + params := keeper.GetParams(ctx) + params.ValidatorBondFactor = tc.validatorBondFactor + keeper.SetParams(ctx, params) + + // Create a validator with designated self-bond shares + validator := types.Validator{ + LiquidShares: tc.currentLiquidShares, + ValidatorBondShares: tc.validatorShares, + } + + // Check whether the cap is exceeded + actualExceeds := keeper.CheckExceedsValidatorBondCap(ctx, validator, tc.newShares) + require.Equal(tc.expectedExceeds, actualExceeds, tc.name) + }) + } +} + +// Tests TestCheckExceedsValidatorLiquidStakingCap +func (s *KeeperTestSuite) TestCheckExceedsValidatorLiquidStakingCap() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + testCases := []struct { + name string + validatorLiquidCap sdk.Dec + validatorLiquidShares sdk.Dec + validatorTotalShares sdk.Dec + newLiquidShares sdk.Dec + expectedExceeds bool + }{ + { + // Cap: 10% - Delegation Below Threshold + // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 1 + // => Liquid Shares: 5+1=6, Total Shares: 95+1=96 => 6/96 = 6% < 10% cap + name: "10 percent cap _ delegation below cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), + validatorLiquidShares: sdk.NewDec(5), + validatorTotalShares: sdk.NewDec(95), + newLiquidShares: sdk.NewDec(1), + expectedExceeds: false, + }, + { + // Cap: 10% - Delegation At Threshold + // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 5 + // => Liquid Shares: 5+5=10, Total Shares: 95+5=100 => 10/100 = 10% == 10% cap + name: "10 percent cap _ delegation equals cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), + validatorLiquidShares: sdk.NewDec(5), + validatorTotalShares: sdk.NewDec(95), + newLiquidShares: sdk.NewDec(4), + expectedExceeds: false, + }, + { + // Cap: 10% - Delegation Exceeds Threshold + // Liquid Shares: 5, Total Shares: 95, New Liquid Shares: 6 + // => Liquid Shares: 5+6=11, Total Shares: 95+6=101 => 11/101 = 11% > 10% cap + name: "10 percent cap _ delegation exceeds cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.1"), + validatorLiquidShares: sdk.NewDec(5), + validatorTotalShares: sdk.NewDec(95), + newLiquidShares: sdk.NewDec(6), + expectedExceeds: true, + }, + { + // Cap: 20% - Delegation Below Threshold + // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 29 + // => Liquid Shares: 20+29=49, Total Shares: 220+29=249 => 49/249 = 19% < 20% cap + name: "20 percent cap _ delegation below cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), + validatorLiquidShares: sdk.NewDec(20), + validatorTotalShares: sdk.NewDec(220), + newLiquidShares: sdk.NewDec(29), + expectedExceeds: false, + }, + { + // Cap: 20% - Delegation At Threshold + // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 30 + // => Liquid Shares: 20+30=50, Total Shares: 220+30=250 => 50/250 = 20% == 20% cap + name: "20 percent cap _ delegation equals cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), + validatorLiquidShares: sdk.NewDec(20), + validatorTotalShares: sdk.NewDec(220), + newLiquidShares: sdk.NewDec(30), + expectedExceeds: false, + }, + { + // Cap: 20% - Delegation Exceeds Threshold + // Liquid Shares: 20, Total Shares: 220, New Liquid Shares: 31 + // => Liquid Shares: 20+31=51, Total Shares: 220+31=251 => 51/251 = 21% > 20% cap + name: "20 percent cap _ delegation exceeds cap", + validatorLiquidCap: sdk.MustNewDecFromStr("0.2"), + validatorLiquidShares: sdk.NewDec(20), + validatorTotalShares: sdk.NewDec(220), + newLiquidShares: sdk.NewDec(31), + expectedExceeds: true, + }, + { + // Cap of 0% - everything should exceed + name: "0 percent cap", + validatorLiquidCap: sdk.ZeroDec(), + validatorLiquidShares: sdk.NewDec(0), + validatorTotalShares: sdk.NewDec(1_000_000), + newLiquidShares: sdk.NewDec(1), + expectedExceeds: true, + }, + { + // Cap of 100% - nothing should exceed + name: "100 percent cap", + validatorLiquidCap: sdk.OneDec(), + validatorLiquidShares: sdk.NewDec(1), + validatorTotalShares: sdk.NewDec(1_000_000), + newLiquidShares: sdk.NewDec(1), + expectedExceeds: false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + // Update the validator liquid staking cap + params := keeper.GetParams(ctx) + params.ValidatorLiquidStakingCap = tc.validatorLiquidCap + keeper.SetParams(ctx, params) + + // Create a validator with designated self-bond shares + validator := types.Validator{ + LiquidShares: tc.validatorLiquidShares, + DelegatorShares: tc.validatorTotalShares, + } + + // Check whether the cap is exceeded + actualExceeds := keeper.CheckExceedsValidatorLiquidStakingCap(ctx, validator, tc.newLiquidShares) + require.Equal(tc.expectedExceeds, actualExceeds, tc.name) + }) + } +} + +// Tests SafelyIncreaseValidatorLiquidShares +func (s *KeeperTestSuite) TestSafelyIncreaseValidatorLiquidShares() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Generate a test validator address + privKey := secp256k1.GenPrivKey() + pubKey := privKey.PubKey() + valAddress := sdk.ValAddress(pubKey.Address()) + + // Helper function to check the validator's liquid shares + checkValidatorLiquidShares := func(expected sdk.Dec, description string) { + actualValidator, found := keeper.GetValidator(ctx, valAddress) + require.True(found) + require.Equal(expected.TruncateInt64(), actualValidator.LiquidShares.TruncateInt64(), description) + } + + // Start with the following: + // Initial Liquid Shares: 0 + // Validator Bond Shares: 10 + // Validator TotalShares: 75 + // + // Initial Caps: + // ValidatorBondFactor: 1 (Cap applied at 10 shares) + // ValidatorLiquidStakingCap: 25% (Cap applied at 25 shares) + // + // Cap Increases: + // ValidatorBondFactor: 10 (Cap applied at 100 shares) + // ValidatorLiquidStakingCap: 40% (Cap applied at 50 shares) + initialLiquidShares := sdk.NewDec(0) + validatorBondShares := sdk.NewDec(10) + validatorTotalShares := sdk.NewDec(75) + + firstIncreaseAmount := sdk.NewDec(20) + secondIncreaseAmount := sdk.NewDec(10) // total increase of 30 + + initialBondFactor := sdk.NewDec(1) + finalBondFactor := sdk.NewDec(10) + initialLiquidStakingCap := sdk.MustNewDecFromStr("0.25") + finalLiquidStakingCap := sdk.MustNewDecFromStr("0.4") + + // Create a validator with designated self-bond shares + initialValidator := types.Validator{ + OperatorAddress: valAddress.String(), + LiquidShares: initialLiquidShares, + ValidatorBondShares: validatorBondShares, + DelegatorShares: validatorTotalShares, + } + keeper.SetValidator(ctx, initialValidator) + + // Set validator bond factor to a small number such that any delegation would fail, + // and set the liquid staking cap such that the first stake would succeed, but the second + // would fail + params := keeper.GetParams(ctx) + params.ValidatorBondFactor = initialBondFactor + params.ValidatorLiquidStakingCap = initialLiquidStakingCap + keeper.SetParams(ctx, params) + + // Attempt to increase the validator liquid shares, it should throw an + // error that the validator bond cap was exceeded + _, err := keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) + require.ErrorIs(err, types.ErrInsufficientValidatorBondShares) + checkValidatorLiquidShares(initialLiquidShares, "shares after low bond factor") + + // Change validator bond factor to a more conservative number, so that the increase succeeds + params.ValidatorBondFactor = finalBondFactor + keeper.SetParams(ctx, params) + + // Try the increase again and check that it succeeded + expectedLiquidSharesAfterFirstStake := initialLiquidShares.Add(firstIncreaseAmount) + _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, firstIncreaseAmount) + require.NoError(err) + checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares with cap loose bond cap") + + // Attempt another increase, it should fail from the liquid staking cap + _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) + require.ErrorIs(err, types.ErrValidatorLiquidStakingCapExceeded) + checkValidatorLiquidShares(expectedLiquidSharesAfterFirstStake, "shares after liquid staking cap hit") + + // Raise the liquid staking cap so the new increment succeeds + params.ValidatorLiquidStakingCap = finalLiquidStakingCap + keeper.SetParams(ctx, params) + + // Finally confirm that the increase succeeded this time + expectedLiquidSharesAfterSecondStake := expectedLiquidSharesAfterFirstStake.Add(secondIncreaseAmount) + _, err = keeper.SafelyIncreaseValidatorLiquidShares(ctx, valAddress, secondIncreaseAmount) + require.NoError(err, "no error expected after increasing liquid staking cap") + checkValidatorLiquidShares(expectedLiquidSharesAfterSecondStake, "shares after loose liquid stake cap") +} + +// Tests DecreaseValidatorLiquidShares +func (s *KeeperTestSuite) TestDecreaseValidatorLiquidShares() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + initialLiquidShares := sdk.NewDec(100) + decreaseAmount := sdk.NewDec(10) + + // Create a validator with designated self-bond shares + privKey := secp256k1.GenPrivKey() + pubKey := privKey.PubKey() + valAddress := sdk.ValAddress(pubKey.Address()) + + initialValidator := types.Validator{ + OperatorAddress: valAddress.String(), + LiquidShares: initialLiquidShares, + } + keeper.SetValidator(ctx, initialValidator) + + // Decrease the validator liquid shares, and confirm the new share amount has been updated + _, err := keeper.DecreaseValidatorLiquidShares(ctx, valAddress, decreaseAmount) + require.NoError(err, "no error expected when decreasing validator liquid shares") + + actualValidator, found := keeper.GetValidator(ctx, valAddress) + require.True(found) + require.Equal(initialLiquidShares.Sub(decreaseAmount), actualValidator.LiquidShares, "liquid shares") + + // Attempt to decrease by a larger amount than it has, it should fail + _, err = keeper.DecreaseValidatorLiquidShares(ctx, valAddress, initialLiquidShares) + require.ErrorIs(err, types.ErrValidatorLiquidSharesUnderflow) +} + +// Tests SafelyDecreaseValidatorBond +func (s *KeeperTestSuite) TestSafelyDecreaseValidatorBond() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Initial Bond Factor: 100, Initial Validator Bond: 10 + // => Max Liquid Shares 1000 (Initial Liquid Shares: 200) + initialBondFactor := sdk.NewDec(100) + initialValidatorBondShares := sdk.NewDec(10) + initialLiquidShares := sdk.NewDec(200) + + // Create a validator with designated self-bond shares + privKey := secp256k1.GenPrivKey() + pubKey := privKey.PubKey() + valAddress := sdk.ValAddress(pubKey.Address()) + + initialValidator := types.Validator{ + OperatorAddress: valAddress.String(), + ValidatorBondShares: initialValidatorBondShares, + LiquidShares: initialLiquidShares, + } + keeper.SetValidator(ctx, initialValidator) + + // Set the bond factor + params := keeper.GetParams(ctx) + params.ValidatorBondFactor = initialBondFactor + keeper.SetParams(ctx, params) + + // Decrease the validator bond from 10 to 5 (minus 5) + // This will adjust the cap (factor * shares) + // from (100 * 10 = 1000) to (100 * 5 = 500) + // Since this is still above the initial liquid shares of 200, this will succeed + decreaseAmount, expectedBondShares := sdk.NewDec(5), sdk.NewDec(5) + err := keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) + require.NoError(err) + + actualValidator, found := keeper.GetValidator(ctx, valAddress) + require.True(found) + require.Equal(expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") + + // Now attempt to decrease the validator bond again from 5 to 1 (minus 4) + // This time, the cap will be reduced to (factor * shares) = (100 * 1) = 100 + // However, the liquid shares are currently 200, so this should fail + decreaseAmount, expectedBondShares = sdk.NewDec(4), sdk.NewDec(1) + err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) + require.ErrorIs(err, types.ErrInsufficientValidatorBondShares) + + // Finally, disable the cap and attempt to decrease again + // This time it should succeed + params.ValidatorBondFactor = types.ValidatorBondCapDisabled + keeper.SetParams(ctx, params) + + err = keeper.SafelyDecreaseValidatorBond(ctx, valAddress, decreaseAmount) + require.NoError(err) + + actualValidator, found = keeper.GetValidator(ctx, valAddress) + require.True(found) + require.Equal(expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") +} From 7ee723c7543c44e2b3ed106e1199cb24f7e98a5c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 5 Dec 2023 18:24:42 +0100 Subject: [PATCH 23/31] clean up --- .../staking/keeper/delegation_test.go | 1 - .../staking/keeper/determinstic_test.go | 72 +++++++++----- .../staking/keeper/genesis_test.go | 95 ++++++++++--------- .../staking/keeper/msg_server_test.go | 17 ---- x/staking/keeper/liquid_stake_test.go | 2 - .../keeper/tokenize_share_record_test.go | 1 - 6 files changed, 97 insertions(+), 91 deletions(-) diff --git a/tests/integration/staking/keeper/delegation_test.go b/tests/integration/staking/keeper/delegation_test.go index 0d9b78961532..0b0ed641dcb1 100644 --- a/tests/integration/staking/keeper/delegation_test.go +++ b/tests/integration/staking/keeper/delegation_test.go @@ -97,7 +97,6 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { require.True(math.IntEq(t, newNotBonded, oldNotBonded.AddRaw(1))) } -// TODO refactor LSM tests: func TestValidatorBondUndelegate(t *testing.T) { _, app, ctx := createTestInput(t) diff --git a/tests/integration/staking/keeper/determinstic_test.go b/tests/integration/staking/keeper/determinstic_test.go index eefb8c7ec819..cc6c671a6173 100644 --- a/tests/integration/staking/keeper/determinstic_test.go +++ b/tests/integration/staking/keeper/determinstic_test.go @@ -60,7 +60,6 @@ func (s *DeterministicTestSuite) SetupTest() { ) s.Require().NoError(err) - // s.ctx = app.BaseApp.NewContext(false, tmproto.Header{Height: 1, Time: time.Now()}).WithGasMeter(sdk.NewInfiniteGasMeter()) s.ctx = app.BaseApp.NewContext(false, tmproto.Header{}) queryHelper := baseapp.NewQueryServerTestHelper(s.ctx, interfaceRegistry) @@ -258,13 +257,15 @@ func (suite *DeterministicTestSuite) TestGRPCValidator() { ValidatorAddr: val.OperatorAddress, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Validator, 1915, false) + // NOTE: gas consumption delta changed from 1915 to 1933 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Validator, 1933, false) } func (suite *DeterministicTestSuite) TestGRPCValidators() { validatorStatus := []string{stakingtypes.BondStatusBonded, stakingtypes.BondStatusUnbonded, stakingtypes.BondStatusUnbonding, ""} rapid.Check(suite.T(), func(t *rapid.T) { - valsCount := rapid.IntRange(1, 3).Draw(t, "num-validators") + // NOTE: max number of validators changed from 3 to 2 to prevent the test from timing out after 30s. + valsCount := rapid.IntRange(1, 2).Draw(t, "num-validators") for i := 0; i < valsCount; i++ { suite.createAndSetValidator(t) } @@ -281,13 +282,15 @@ func (suite *DeterministicTestSuite) TestGRPCValidators() { suite.getStaticValidator() suite.getStaticValidator2() - testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryValidatorsRequest{}, suite.queryClient.Validators, 3525, false) + // NOTE: gas consumption delta changed from 3525 to 3597 + testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryValidatorsRequest{}, suite.queryClient.Validators, 3597, false) } func (suite *DeterministicTestSuite) TestGRPCValidatorDelegations() { rapid.Check(suite.T(), func(t *rapid.T) { validator := suite.createAndSetValidatorWithStatus(t, stakingtypes.Bonded) - numDels := rapid.IntRange(1, 5).Draw(t, "num-dels") + // NOTE: max number of delegation changed from 5 to 2 to prevent the test from timing out after 30s. + numDels := rapid.IntRange(1, 2).Draw(t, "num-dels") for i := 0; i < numDels; i++ { delegator := testdata.AddressGenerator(t).Draw(t, "delegator") @@ -317,7 +320,8 @@ func (suite *DeterministicTestSuite) TestGRPCValidatorDelegations() { ValidatorAddr: validator.OperatorAddress, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.ValidatorDelegations, 11985, false) + // NOTE: gas consumption delta changed from 11985 to 12615 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.ValidatorDelegations, 12615, false) } func (suite *DeterministicTestSuite) TestGRPCValidatorUnbondingDelegations() { @@ -390,7 +394,8 @@ func (suite *DeterministicTestSuite) TestGRPCDelegation() { DelegatorAddr: delegator1, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Delegation, 4635, false) + // NOTE: gas consumption delta changed from 4635 to 4845 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Delegation, 4845, false) } func (suite *DeterministicTestSuite) TestGRPCUnbondingDelegation() { @@ -457,7 +462,8 @@ func (suite *DeterministicTestSuite) TestGRPCDelegatorDelegations() { DelegatorAddr: delegator1, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorDelegations, 4238, false) + // NOTE: gas consumption delta changed from 4238 to 4448 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorDelegations, 4448, false) } func (suite *DeterministicTestSuite) TestGRPCDelegatorValidator() { @@ -488,7 +494,8 @@ func (suite *DeterministicTestSuite) TestGRPCDelegatorValidator() { ValidatorAddr: validator.OperatorAddress, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorValidator, 3563, false) + // NOTE: gas consumption delta changed from 3563 to 3581 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorValidator, 3581, false) } func (suite *DeterministicTestSuite) TestGRPCDelegatorUnbondingDelegations() { @@ -579,7 +586,8 @@ func (suite *DeterministicTestSuite) TestGRPCHistoricalInfo() { Height: height, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.HistoricalInfo, 1930, false) + // NOTE: gas consumption delta changed from 1930 to 1948 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.HistoricalInfo, 1948, false) } func (suite *DeterministicTestSuite) TestGRPCDelegatorValidators() { @@ -609,7 +617,9 @@ func (suite *DeterministicTestSuite) TestGRPCDelegatorValidators() { suite.Require().NoError(err) req := &stakingtypes.QueryDelegatorValidatorsRequest{DelegatorAddr: delegator1} - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorValidators, 3166, false) + + // NOTE: gas consumption delta changed from 3166 to 3184 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.DelegatorValidators, 3184, false) } func (suite *DeterministicTestSuite) TestGRPCPool() { @@ -621,7 +631,9 @@ func (suite *DeterministicTestSuite) TestGRPCPool() { suite.SetupTest() // reset suite.getStaticValidator() - testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryPoolRequest{}, suite.queryClient.Pool, 6185, false) + + // NOTE: gas consumption delta changed from 6185 to 6377 + testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryPoolRequest{}, suite.queryClient.Pool, 6377, false) } func (suite *DeterministicTestSuite) TestGRPCRedelegations() { @@ -683,18 +695,22 @@ func (suite *DeterministicTestSuite) TestGRPCRedelegations() { DstValidatorAddr: validator2, } - testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Redelegations, 3920, false) + // NOTE: gas consumption delta changed from 3920 to 3938 + testdata.DeterministicIterations(suite.ctx, suite.Require(), req, suite.queryClient.Redelegations, 3938, false) } func (suite *DeterministicTestSuite) TestGRPCParams() { rapid.Check(suite.T(), func(t *rapid.T) { params := stakingtypes.Params{ - BondDenom: rapid.StringMatching(sdk.DefaultCoinDenomRegex()).Draw(t, "bond-denom"), - UnbondingTime: durationGenerator().Draw(t, "duration"), - MaxValidators: rapid.Uint32Min(1).Draw(t, "max-validators"), - MaxEntries: rapid.Uint32Min(1).Draw(t, "max-entries"), - HistoricalEntries: rapid.Uint32Min(1).Draw(t, "historical-entries"), - MinCommissionRate: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(t, "commission"), 2), + BondDenom: rapid.StringMatching(sdk.DefaultCoinDenomRegex()).Draw(t, "bond-denom"), + UnbondingTime: durationGenerator().Draw(t, "duration"), + MaxValidators: rapid.Uint32Min(1).Draw(t, "max-validators"), + MaxEntries: rapid.Uint32Min(1).Draw(t, "max-entries"), + HistoricalEntries: rapid.Uint32Min(1).Draw(t, "historical-entries"), + MinCommissionRate: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(t, "commission"), 2), + ValidatorBondFactor: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(t, "bond-factor"), 2), + GlobalLiquidStakingCap: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(t, "global-liquid-staking-cap"), 2), + ValidatorLiquidStakingCap: sdk.NewDecWithPrec(rapid.Int64Range(0, 100).Draw(t, "validator-liquid-staking-cap"), 2), } err := suite.stakingKeeper.SetParams(suite.ctx, params) @@ -704,16 +720,20 @@ func (suite *DeterministicTestSuite) TestGRPCParams() { }) params := stakingtypes.Params{ - BondDenom: "denom", - UnbondingTime: time.Hour, - MaxValidators: 85, - MaxEntries: 5, - HistoricalEntries: 5, - MinCommissionRate: sdk.NewDecWithPrec(5, 2), + BondDenom: "denom", + UnbondingTime: time.Hour, + MaxValidators: 85, + MaxEntries: 5, + HistoricalEntries: 5, + MinCommissionRate: sdk.NewDecWithPrec(5, 2), + ValidatorBondFactor: sdk.NewDecWithPrec(18, 2), + GlobalLiquidStakingCap: sdk.NewDecWithPrec(11, 2), + ValidatorLiquidStakingCap: sdk.NewDecWithPrec(2, 2), } err := suite.stakingKeeper.SetParams(suite.ctx, params) suite.Require().NoError(err) - testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryParamsRequest{}, suite.queryClient.Params, 1114, false) + // NOTE: gas consumption delta changed from 1114 to 1291 + testdata.DeterministicIterations(suite.ctx, suite.Require(), &stakingtypes.QueryParamsRequest{}, suite.queryClient.Params, 1291, false) } diff --git a/tests/integration/staking/keeper/genesis_test.go b/tests/integration/staking/keeper/genesis_test.go index 7e453a59fbec..0e8a9b222f3d 100644 --- a/tests/integration/staking/keeper/genesis_test.go +++ b/tests/integration/staking/keeper/genesis_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "fmt" "testing" + "time" "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" @@ -11,8 +12,9 @@ import ( "cosmossdk.io/simapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/testutil" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -65,7 +67,7 @@ func TestInitGenesis(t *testing.T) { // mint coins in the bonded pool representing the validators coins i2 := len(validators) - 1 // -1 to exclude genesis validator require.NoError(t, - testutil.FundModuleAccount( + banktestutil.FundModuleAccount( app.BankKeeper, ctx, types.BondedPoolName, @@ -199,7 +201,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { // mint coins in the bonded pool representing the validators coins require.NoError(t, - testutil.FundModuleAccount( + banktestutil.FundModuleAccount( app.BankKeeper, ctx, types.BondedPoolName, @@ -219,46 +221,51 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { require.Equal(t, abcivals, vals) } -// TODO: refactor LSM TEST func TestInitExportLiquidStakingGenesis(t *testing.T) { - // app, ctx, addrs := bootstrapGenesisTest(t, 2) - // address1, address2 := addrs[0], addrs[1] - - // // Mock out a genesis state - // inGenesisState := types.GenesisState{ - // Params: types.DefaultParams(), - // TokenizeShareRecords: []types.TokenizeShareRecord{ - // {Id: 1, Owner: address1.String(), ModuleAccount: "module1", Validator: "val1"}, - // {Id: 2, Owner: address2.String(), ModuleAccount: "module2", Validator: "val2"}, - // }, - // LastTokenizeShareRecordId: 2, - // TotalLiquidStakedTokens: sdk.NewInt(1_000_000), - // TokenizeShareLocks: []types.TokenizeShareLock{ - // { - // Address: address1.String(), - // Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), - // }, - // { - // Address: address2.String(), - // Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), - // CompletionTime: time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC), - // }, - // }, - // } - - // // Call init and then export genesis - confirming the same state is returned - // staking.InitGenesis(ctx, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, &inGenesisState) - // outGenesisState := *staking.ExportGenesis(ctx, app.StakingKeeper) - - // require.ElementsMatch(t, inGenesisState.TokenizeShareRecords, outGenesisState.TokenizeShareRecords, - // "tokenize share records") - - // require.Equal(t, inGenesisState.LastTokenizeShareRecordId, outGenesisState.LastTokenizeShareRecordId, - // "last tokenize share record ID") - - // require.Equal(t, inGenesisState.TotalLiquidStakedTokens.Int64(), outGenesisState.TotalLiquidStakedTokens.Int64(), - // "total liquid staked") - - // require.ElementsMatch(t, inGenesisState.TokenizeShareLocks, outGenesisState.TokenizeShareLocks, - // "tokenize share locks") + app := simapp.Setup(t, false) + ctx := app.NewContext(false, tmproto.Header{}) + + addresses := simtestutil.AddTestAddrs(app.BankKeeper, app.StakingKeeper, ctx, 2, sdk.OneInt()) + addrAcc1, addrAcc2 := addresses[0], addresses[1] + + // Mock out a genesis state + inGenesisState := types.GenesisState{ + Params: types.DefaultParams(), + TokenizeShareRecords: []types.TokenizeShareRecord{ + {Id: 1, Owner: addrAcc1.String(), ModuleAccount: "module1", Validator: "val1"}, + {Id: 2, Owner: addrAcc2.String(), ModuleAccount: "module2", Validator: "val2"}, + }, + LastTokenizeShareRecordId: 2, + TotalLiquidStakedTokens: sdk.NewInt(1_000_000), + TokenizeShareLocks: []types.TokenizeShareLock{ + { + Address: addrAcc1.String(), + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + { + Address: addrAcc2.String(), + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC), + }, + }, + // Ensure that the bonded pool balance matches the bonded coins by passing existing validators + // Note: the above wasn't required in v0.45.16-ics-lsm + Validators: app.StakingKeeper.GetAllValidators(ctx), + } + + // Call init and then export genesis - confirming the same state is returned + app.StakingKeeper.InitGenesis(ctx, &inGenesisState) + outGenesisState := app.StakingKeeper.ExportGenesis(ctx) + + require.ElementsMatch(t, inGenesisState.TokenizeShareRecords, outGenesisState.TokenizeShareRecords, + "tokenize share records") + + require.Equal(t, inGenesisState.LastTokenizeShareRecordId, outGenesisState.LastTokenizeShareRecordId, + "last tokenize share record ID") + + require.Equal(t, inGenesisState.TotalLiquidStakedTokens.Int64(), outGenesisState.TotalLiquidStakedTokens.Int64(), + "total liquid staked") + + require.ElementsMatch(t, inGenesisState.TokenizeShareLocks, outGenesisState.TokenizeShareLocks, + "tokenize share locks") } diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index b9a6bfa4a893..861fe61b2940 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -158,7 +158,6 @@ func TestCancelUnbondingDelegation(t *testing.T) { } } -// TODO refactor LSM test func TestTokenizeSharesAndRedeemTokens(t *testing.T) { _, app, ctx := createTestInput(t) var ( @@ -736,8 +735,6 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { } } -// TODO refactor LSM test -// // Helper function to setup a delegator and validator for the Tokenize/Redeem conversion tests func setupTestTokenizeAndRedeemConversion( t *testing.T, @@ -765,8 +762,6 @@ func setupTestTokenizeAndRedeemConversion( return delegatorAddress, validatorAddress } -// TODO refactor LSM test -// // Simulate a slash by decrementing the validator's tokens // We'll do this in a way such that the exchange rate is not an even integer // and the shares associated with a delegation will have a long decimal @@ -781,7 +776,6 @@ func simulateSlashWithImprecision(t *testing.T, sk keeper.Keeper, ctx sdk.Contex sk.SetValidator(ctx, validator) } -// TODO refactor LSM test // Tests the conversion from tokenization and redemption from the following scenario: // Slash -> Delegate -> Tokenize -> Redeem // Note, in this example, there 2 tokens are lost during the decimal to int conversion @@ -846,8 +840,6 @@ func TestTokenizeAndRedeemConversion_SlashBeforeDelegation(t *testing.T) { require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } -// TODO refactor LSM test -// // Tests the conversion from tokenization and redemption from the following scenario: // Delegate -> Slash -> Tokenize -> Redeem // Note, in this example, there 1 token lost during the decimal to int conversion @@ -915,8 +907,6 @@ func TestTokenizeAndRedeemConversion_SlashBeforeTokenization(t *testing.T) { require.Equal(t, expectedDelegationTokens, endDelegationTokens, "final delegation tokens") } -// TODO refactor LSM test -// // Tests the conversion from tokenization and redemption from the following scenario: // Delegate -> Tokenize -> Slash -> Redeem // Note, in this example, there 1 token lost during the decimal to int conversion @@ -982,7 +972,6 @@ func TestTokenizeAndRedeemConversion_SlashBeforeRedemption(t *testing.T) { require.Equal(t, delegationAmountAfterSlash-1, endDelegationTokens, "final delegation tokens") } -// TODO refactor LSM test func TestTransferTokenizeShareRecord(t *testing.T) { var ( bankKeeper bankkeeper.Keeper @@ -1037,7 +1026,6 @@ func TestTransferTokenizeShareRecord(t *testing.T) { require.Len(t, records, 1) } -// TODO refactor LSM test func TestValidatorBond(t *testing.T) { testCases := []struct { name string @@ -1177,7 +1165,6 @@ func TestValidatorBond(t *testing.T) { } } -// TODO refactor LSM test func TestChangeValidatorBond(t *testing.T) { _, app, ctx := createTestInput(t) var ( @@ -1342,7 +1329,6 @@ func TestChangeValidatorBond(t *testing.T) { checkValidatorBondShares(validatorCAddress, expectedBondSharesC) } -// TODO refactor LSM test func TestEnableDisableTokenizeShares(t *testing.T) { _, app, ctx := createTestInput(t) var ( @@ -1467,7 +1453,6 @@ func TestEnableDisableTokenizeShares(t *testing.T) { require.NoError(t, err, "no error expected when tokenizing after lock has expired") } -// TODO refactor LSM test func TestUnbondValidator(t *testing.T) { var ( bankKeeper bankkeeper.Keeper @@ -1517,8 +1502,6 @@ func TestUnbondValidator(t *testing.T) { require.True(t, validator.Jailed) } -// TODO refactor LSM test -// // TestICADelegateUndelegate tests that an ICA account can undelegate // sequentially right after delegating. func TestICADelegateUndelegate(t *testing.T) { diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index 8b4c75e98f12..02e84f8be4da 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -10,8 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// TODO refactor LSM tests - // Helper function to create a base account from an account name // Used to differentiate against liquid staking provider module account func createBaseAccount(app *simapp.SimApp, ctx sdk.Context, accountName string) sdk.AccAddress { diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go index 0fc9043f96cf..1db82cf02630 100644 --- a/x/staking/keeper/tokenize_share_record_test.go +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -9,7 +9,6 @@ func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { suite.Equal(lastTokenizeShareRecordID, uint64(100)) } -// TODO: refactor LSM test // Note that this test might be moved to the integration tests // // func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { From 1e9cc373f0fbf80193b26392f5e5dc80e53cdcef Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 5 Dec 2023 18:25:21 +0100 Subject: [PATCH 24/31] clean up --- x/staking/keeper/tokenize_share_record_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go index 1db82cf02630..0fc9043f96cf 100644 --- a/x/staking/keeper/tokenize_share_record_test.go +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -9,6 +9,7 @@ func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { suite.Equal(lastTokenizeShareRecordID, uint64(100)) } +// TODO: refactor LSM test // Note that this test might be moved to the integration tests // // func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { From 38c8e2f300e0b99edeacbff76436e48b3f693c8e Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 6 Dec 2023 09:21:59 +0100 Subject: [PATCH 25/31] refactor last integration --- .../keeper/tokenize_share_record_test.go | 101 +++++++++--------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/x/staking/keeper/tokenize_share_record_test.go b/x/staking/keeper/tokenize_share_record_test.go index 0fc9043f96cf..fd9dd76a6765 100644 --- a/x/staking/keeper/tokenize_share_record_test.go +++ b/x/staking/keeper/tokenize_share_record_test.go @@ -1,5 +1,10 @@ package keeper_test +import ( + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/cosmos/cosmos-sdk/x/staking/types" +) + func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { ctx, keeper := suite.ctx, suite.stakingKeeper lastTokenizeShareRecordID := keeper.GetLastTokenizeShareRecordID(ctx) @@ -9,52 +14,50 @@ func (suite *KeeperTestSuite) TestGetLastTokenizeShareRecordId() { suite.Equal(lastTokenizeShareRecordID, uint64(100)) } -// TODO: refactor LSM test -// Note that this test might be moved to the integration tests -// -// func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { -// app, ctx := suite.app, suite.ctx -// owner1, owner2 := suite.addrs[0], suite.addrs[1] - -// tokenizeShareRecord1 := types.TokenizeShareRecord{ -// Id: 0, -// Owner: owner1.String(), -// ModuleAccount: "test-module-account-1", -// Validator: "test-validator", -// } -// tokenizeShareRecord2 := types.TokenizeShareRecord{ -// Id: 1, -// Owner: owner2.String(), -// ModuleAccount: "test-module-account-2", -// Validator: "test-validator", -// } -// tokenizeShareRecord3 := types.TokenizeShareRecord{ -// Id: 2, -// Owner: owner1.String(), -// ModuleAccount: "test-module-account-3", -// Validator: "test-validator", -// } -// err := app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord1) -// suite.NoError(err) -// err = app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord2) -// suite.NoError(err) -// err = app.StakingKeeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord3) -// suite.NoError(err) - -// tokenizeShareRecord, err := app.StakingKeeper.GetTokenizeShareRecord(ctx, 2) -// suite.NoError(err) -// suite.Equal(tokenizeShareRecord, tokenizeShareRecord3) - -// tokenizeShareRecord, err = app.StakingKeeper.GetTokenizeShareRecordByDenom(ctx, tokenizeShareRecord2.GetShareTokenDenom()) -// suite.NoError(err) -// suite.Equal(tokenizeShareRecord, tokenizeShareRecord2) - -// tokenizeShareRecords := app.StakingKeeper.GetAllTokenizeShareRecords(ctx) -// suite.Equal(len(tokenizeShareRecords), 3) - -// tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner1) -// suite.Equal(len(tokenizeShareRecords), 2) - -// tokenizeShareRecords = app.StakingKeeper.GetTokenizeShareRecordsByOwner(ctx, owner2) -// suite.Equal(len(tokenizeShareRecords), 1) -// } +func (suite *KeeperTestSuite) TestGetTokenizeShareRecord() { + ctx, keeper := suite.ctx, suite.stakingKeeper + addrs := simtestutil.CreateIncrementalAccounts(2) + + owner1, owner2 := addrs[0], addrs[1] + tokenizeShareRecord1 := types.TokenizeShareRecord{ + Id: 0, + Owner: owner1.String(), + ModuleAccount: "test-module-account-1", + Validator: "test-validator", + } + tokenizeShareRecord2 := types.TokenizeShareRecord{ + Id: 1, + Owner: owner2.String(), + ModuleAccount: "test-module-account-2", + Validator: "test-validator", + } + tokenizeShareRecord3 := types.TokenizeShareRecord{ + Id: 2, + Owner: owner1.String(), + ModuleAccount: "test-module-account-3", + Validator: "test-validator", + } + err := keeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord1) + suite.NoError(err) + err = keeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord2) + suite.NoError(err) + err = keeper.AddTokenizeShareRecord(ctx, tokenizeShareRecord3) + suite.NoError(err) + + tokenizeShareRecord, err := keeper.GetTokenizeShareRecord(ctx, 2) + suite.NoError(err) + suite.Equal(tokenizeShareRecord, tokenizeShareRecord3) + + tokenizeShareRecord, err = keeper.GetTokenizeShareRecordByDenom(ctx, tokenizeShareRecord2.GetShareTokenDenom()) + suite.NoError(err) + suite.Equal(tokenizeShareRecord, tokenizeShareRecord2) + + tokenizeShareRecords := keeper.GetAllTokenizeShareRecords(ctx) + suite.Equal(len(tokenizeShareRecords), 3) + + tokenizeShareRecords = keeper.GetTokenizeShareRecordsByOwner(ctx, owner1) + suite.Equal(len(tokenizeShareRecords), 2) + + tokenizeShareRecords = keeper.GetTokenizeShareRecordsByOwner(ctx, owner2) + suite.Equal(len(tokenizeShareRecords), 1) +} From 87c4cd33f3d58741f2b8e6ed7714f77cdf451eea Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 6 Dec 2023 10:06:11 +0100 Subject: [PATCH 26/31] nits --- .../staking/keeper/liquid_stake_test.go | 290 ------------------ x/staking/keeper/liquid_stake_test.go | 263 ++++++++++++++-- 2 files changed, 243 insertions(+), 310 deletions(-) diff --git a/tests/integration/staking/keeper/liquid_stake_test.go b/tests/integration/staking/keeper/liquid_stake_test.go index dfd33c63b89c..ef7f7058e417 100644 --- a/tests/integration/staking/keeper/liquid_stake_test.go +++ b/tests/integration/staking/keeper/liquid_stake_test.go @@ -2,13 +2,11 @@ package keeper_test import ( "testing" - "time" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" accountkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/keeper" @@ -273,291 +271,3 @@ func TestSafelyIncreaseTotalLiquidStakedTokens(t *testing.T) { require.NoError(t, err) require.Equal(t, intitialTotalLiquidStaked.Add(increaseAmount), stakingKeeper.GetTotalLiquidStakedTokens(ctx)) } - -// Helper function to create a base account from an account name -// Used to differentiate against liquid staking provider module account -func createBaseAccount(ak accountkeeper.AccountKeeper, ctx sdk.Context, accountName string) sdk.AccAddress { - baseAccountAddress := sdk.AccAddress(accountName) - ak.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) - return baseAccountAddress -} - -// Tests DelegatorIsLiquidStaker -func TestDelegatorIsLiquidStaker(t *testing.T) { - var ( - accountKeeper accountkeeper.AccountKeeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &accountKeeper, - &stakingKeeper, - ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // Create base and ICA accounts - baseAccountAddress := createBaseAccount(accountKeeper, ctx, "base-account") - icaAccountAddress := createICAAccount(ctx, accountKeeper) - - // Only the ICA module account should be considered a liquid staking provider - require.False(t, stakingKeeper.DelegatorIsLiquidStaker(baseAccountAddress), "base account") - require.True(t, stakingKeeper.DelegatorIsLiquidStaker(icaAccountAddress), "ICA module account") -} - -// Tests Add/Remove/Get/SetTokenizeSharesLock -func TestTokenizeSharesLock(t *testing.T) { - var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, - ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 2, sdk.NewInt(1)) - addressA, addressB := addresses[0], addresses[1] - - unlocked := types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED.String() - locked := types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String() - lockExpiring := types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String() - - // Confirm both accounts start unlocked - status, _ := stakingKeeper.GetTokenizeSharesLock(ctx, addressA) - require.Equal(t, unlocked, status.String(), "addressA unlocked at start") - - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) - require.Equal(t, unlocked, status.String(), "addressB unlocked at start") - - // Lock the first account - stakingKeeper.AddTokenizeSharesLock(ctx, addressA) - - // The first account should now have tokenize shares disabled - // and the unlock time should be the zero time - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressA) - require.Equal(t, locked, status.String(), "addressA locked") - - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) - require.Equal(t, unlocked, status.String(), "addressB still unlocked") - - // Update the lock time and confirm it was set - expectedUnlockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addressA, expectedUnlockTime) - - status, actualUnlockTime := stakingKeeper.GetTokenizeSharesLock(ctx, addressA) - require.Equal(t, lockExpiring, status.String(), "addressA lock expiring") - require.Equal(t, expectedUnlockTime, actualUnlockTime, "addressA unlock time") - - // Confirm B is still unlocked - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) - require.Equal(t, unlocked, status.String(), "addressB still unlocked") - - // Remove the lock - stakingKeeper.RemoveTokenizeSharesLock(ctx, addressA) - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressA) - require.Equal(t, unlocked, status.String(), "addressA unlocked at end") - - status, _ = stakingKeeper.GetTokenizeSharesLock(ctx, addressB) - require.Equal(t, unlocked, status.String(), "addressB unlocked at end") -} - -// Tests GetAllTokenizeSharesLocks -func TestGetAllTokenizeSharesLocks(t *testing.T) { - var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, - ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 4, sdk.NewInt(1)) - - // Set 2 locked accounts, and two accounts with a lock expiring - stakingKeeper.AddTokenizeSharesLock(ctx, addresses[0]) - stakingKeeper.AddTokenizeSharesLock(ctx, addresses[1]) - - unlockTime1 := time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC) - unlockTime2 := time.Date(2023, 1, 2, 1, 0, 0, 0, time.UTC) - stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addresses[2], unlockTime1) - stakingKeeper.SetTokenizeSharesUnlockTime(ctx, addresses[3], unlockTime2) - - // Defined expected locks after GetAll - expectedLocks := map[string]types.TokenizeShareLock{ - addresses[0].String(): { - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), - }, - addresses[1].String(): { - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), - }, - addresses[2].String(): { - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), - CompletionTime: unlockTime1, - }, - addresses[3].String(): { - Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), - CompletionTime: unlockTime2, - }, - } - - // Check output from GetAll - actualLocks := stakingKeeper.GetAllTokenizeSharesLocks(ctx) - require.Len(t, actualLocks, len(expectedLocks), "number of locks") - - for i, actual := range actualLocks { - expected, ok := expectedLocks[actual.Address] - require.True(t, ok, "address %s not expected", actual.Address) - require.Equal(t, expected.Status, actual.Status, "tokenize share lock #%d status", i) - require.Equal(t, expected.CompletionTime, actual.CompletionTime, "tokenize share lock #%d completion time", i) - } -} - -// Test Get/SetPendingTokenizeShareAuthorizations -func TestPendingTokenizeShareAuthorizations(t *testing.T) { - var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, - ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // Create dummy accounts and completion times - addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 3, sdk.NewInt(1)) - addressStrings := []string{} - for _, address := range addresses { - addressStrings = append(addressStrings, address.String()) - } - - timeA := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - timeB := timeA.Add(time.Hour) - - // There should be no addresses returned originally - authorizationsA := stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) - require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected") - - authorizationsB := stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) - require.Empty(t, authorizationsB.Addresses, "no addresses at timeB expected") - - // Store addresses for timeB - stakingKeeper.SetPendingTokenizeShareAuthorizations(ctx, timeB, types.PendingTokenizeShareAuthorizations{ - Addresses: addressStrings, - }) - - // Check addresses - authorizationsA = stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) - require.Empty(t, authorizationsA.Addresses, "no addresses at timeA expected at end") - - authorizationsB = stakingKeeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) - require.Equal(t, addressStrings, authorizationsB.Addresses, "address length") -} - -// Test QueueTokenizeSharesAuthorization and RemoveExpiredTokenizeShareLocks -func TestTokenizeShareAuthorizationQueue(t *testing.T) { - var ( - bankKeeper bankkeeper.Keeper - stakingKeeper *keeper.Keeper - ) - - app, err := simtestutil.Setup(testutil.AppConfig, - &bankKeeper, - &stakingKeeper, - ) - require.NoError(t, err) - ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - - // We'll start by adding the following addresses to the queue - // Time 0: [address0] - // Time 1: [] - // Time 2: [address1, address2, address3] - // Time 3: [address4, address5] - // Time 4: [address6] - addresses := simtestutil.AddTestAddrs(bankKeeper, stakingKeeper, ctx, 7, sdk.NewInt(1)) - addressesByTime := map[int][]sdk.AccAddress{ - 0: {addresses[0]}, - 1: {}, - 2: {addresses[1], addresses[2], addresses[3]}, - 3: {addresses[4], addresses[5]}, - 4: {addresses[6]}, - } - - // Set the unbonding time to 1 day - unbondingPeriod := time.Hour * 24 - params := stakingKeeper.GetParams(ctx) - params.UnbondingTime = unbondingPeriod - stakingKeeper.SetParams(ctx, params) - - // Add each address to the queue and then increment the block time - // such that the times line up as follows - // Time 0: 2023-01-01 00:00:00 - // Time 1: 2023-01-01 00:01:00 - // Time 2: 2023-01-01 00:02:00 - // Time 3: 2023-01-01 00:03:00 - startTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) - ctx = ctx.WithBlockTime(startTime) - blockTimeIncrement := time.Hour - - for timeIndex := 0; timeIndex <= 4; timeIndex++ { - for _, address := range addressesByTime[timeIndex] { - stakingKeeper.QueueTokenizeSharesAuthorization(ctx, address) - } - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(blockTimeIncrement)) - } - - // We'll unlock the tokens using the following progression - // The "alias'"/keys for these times assume a starting point of the Time 0 - // from above, plus the Unbonding Time - // Time -1 (2023-01-01 23:59:99): [] - // Time 0 (2023-01-02 00:00:00): [address0] - // Time 1 (2023-01-02 00:01:00): [] - // Time 2.5 (2023-01-02 00:02:30): [address1, address2, address3] - // Time 10 (2023-01-02 00:10:00): [address4, address5, address6] - unlockBlockTimes := map[string]time.Time{ - "-1": startTime.Add(unbondingPeriod).Add(-time.Second), - "0": startTime.Add(unbondingPeriod), - "1": startTime.Add(unbondingPeriod).Add(blockTimeIncrement), - "2.5": startTime.Add(unbondingPeriod).Add(2 * blockTimeIncrement).Add(blockTimeIncrement / 2), - "10": startTime.Add(unbondingPeriod).Add(10 * blockTimeIncrement), - } - expectedUnlockedAddresses := map[string][]string{ - "-1": {}, - "0": {addresses[0].String()}, - "1": {}, - "2.5": {addresses[1].String(), addresses[2].String(), addresses[3].String()}, - "10": {addresses[4].String(), addresses[5].String(), addresses[6].String()}, - } - - // Now we'll remove items from the queue sequentially - // First check with a block time before the first expiration - it should remove no addresses - actualAddresses := stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["-1"]) - require.Equal(t, expectedUnlockedAddresses["-1"], actualAddresses, "no addresses unlocked from time -1") - - // Then pass in (time 0 + unbonding time) - it should remove the first address - actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["0"]) - require.Equal(t, expectedUnlockedAddresses["0"], actualAddresses, "one address unlocked from time 0") - - // Now pass in (time 1 + unbonding time) - it should remove no addresses since - // the address at time 0 was already removed - actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["1"]) - require.Equal(t, expectedUnlockedAddresses["1"], actualAddresses, "no addresses unlocked from time 1") - - // Now pass in (time 2.5 + unbonding time) - it should remove the three addresses from time 2 - actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["2.5"]) - require.Equal(t, expectedUnlockedAddresses["2.5"], actualAddresses, "addresses unlocked from time 2.5") - - // Finally pass in a block time far in the future, which should remove all the remaining locks - actualAddresses = stakingKeeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["10"]) - require.Equal(t, expectedUnlockedAddresses["10"], actualAddresses, "addresses unlocked from time 10") -} diff --git a/x/staking/keeper/liquid_stake_test.go b/x/staking/keeper/liquid_stake_test.go index 02e84f8be4da..9e622c815d08 100644 --- a/x/staking/keeper/liquid_stake_test.go +++ b/x/staking/keeper/liquid_stake_test.go @@ -1,33 +1,16 @@ package keeper_test import ( - "fmt" + "time" - "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// Helper function to create a base account from an account name -// Used to differentiate against liquid staking provider module account -func createBaseAccount(app *simapp.SimApp, ctx sdk.Context, accountName string) sdk.AccAddress { - baseAccountAddress := sdk.AccAddress(accountName) - app.AccountKeeper.SetAccount(ctx, authtypes.NewBaseAccountWithAddress(baseAccountAddress)) - return baseAccountAddress -} - -// Helper function to create a module account address from a tokenized share -// Used to mock the delegation owner of a tokenized share -func createTokenizeShareModuleAccount(recordID uint64) sdk.AccAddress { - record := types.TokenizeShareRecord{ - Id: recordID, - ModuleAccount: fmt.Sprintf("%s%d", types.TokenizeShareModuleAccountPrefix, recordID), - } - return record.GetModuleAddress() -} - // Tests Set/Get TotalLiquidStakedTokens func (s *KeeperTestSuite) TestTotalLiquidStakedTokens() { ctx, keeper := s.ctx, s.stakingKeeper @@ -524,3 +507,243 @@ func (s *KeeperTestSuite) TestSafelyDecreaseValidatorBond() { require.True(found) require.Equal(expectedBondShares, actualValidator.ValidatorBondShares, "validator bond shares shares") } + +// Tests Add/Remove/Get/SetTokenizeSharesLock +func (s *KeeperTestSuite) TestTokenizeSharesLock() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + addresses := simtestutil.CreateIncrementalAccounts(2) + addressA, addressB := addresses[0], addresses[1] + + unlocked := types.TOKENIZE_SHARE_LOCK_STATUS_UNLOCKED.String() + locked := types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String() + lockExpiring := types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String() + + // Confirm both accounts start unlocked + status, _ := keeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(unlocked, status.String(), "addressA unlocked at start") + + status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(unlocked, status.String(), "addressB unlocked at start") + + // Lock the first account + keeper.AddTokenizeSharesLock(ctx, addressA) + + // The first account should now have tokenize shares disabled + // and the unlock time should be the zero time + status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(locked, status.String(), "addressA locked") + + status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(unlocked, status.String(), "addressB still unlocked") + + // Update the lock time and confirm it was set + expectedUnlockTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + keeper.SetTokenizeSharesUnlockTime(ctx, addressA, expectedUnlockTime) + + status, actualUnlockTime := keeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(lockExpiring, status.String(), "addressA lock expiring") + require.Equal(expectedUnlockTime, actualUnlockTime, "addressA unlock time") + + // Confirm B is still unlocked + status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(unlocked, status.String(), "addressB still unlocked") + + // Remove the lock + keeper.RemoveTokenizeSharesLock(ctx, addressA) + status, _ = keeper.GetTokenizeSharesLock(ctx, addressA) + require.Equal(unlocked, status.String(), "addressA unlocked at end") + + status, _ = keeper.GetTokenizeSharesLock(ctx, addressB) + require.Equal(unlocked, status.String(), "addressB unlocked at end") +} + +// Tests GetAllTokenizeSharesLocks +func (s *KeeperTestSuite) TestGetAllTokenizeSharesLocks() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + addresses := simtestutil.CreateIncrementalAccounts(4) + + // Set 2 locked accounts, and two accounts with a lock expiring + keeper.AddTokenizeSharesLock(ctx, addresses[0]) + keeper.AddTokenizeSharesLock(ctx, addresses[1]) + + unlockTime1 := time.Date(2023, 1, 1, 1, 0, 0, 0, time.UTC) + unlockTime2 := time.Date(2023, 1, 2, 1, 0, 0, 0, time.UTC) + keeper.SetTokenizeSharesUnlockTime(ctx, addresses[2], unlockTime1) + keeper.SetTokenizeSharesUnlockTime(ctx, addresses[3], unlockTime2) + + // Defined expected locks after GetAll + expectedLocks := map[string]types.TokenizeShareLock{ + addresses[0].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + addresses[1].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCKED.String(), + }, + addresses[2].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: unlockTime1, + }, + addresses[3].String(): { + Status: types.TOKENIZE_SHARE_LOCK_STATUS_LOCK_EXPIRING.String(), + CompletionTime: unlockTime2, + }, + } + + // Check output from GetAll + actualLocks := keeper.GetAllTokenizeSharesLocks(ctx) + require.Len(actualLocks, len(expectedLocks), "number of locks") + + for i, actual := range actualLocks { + expected, ok := expectedLocks[actual.Address] + require.True(ok, "address %s not expected", actual.Address) + require.Equal(expected.Status, actual.Status, "tokenize share lock #%d status", i) + require.Equal(expected.CompletionTime, actual.CompletionTime, "tokenize share lock #%d completion time", i) + } +} + +// Test Get/SetPendingTokenizeShareAuthorizations +func (s *KeeperTestSuite) TestPendingTokenizeShareAuthorizations() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Create dummy accounts and completion times + + addresses := simtestutil.CreateIncrementalAccounts(4) + addressStrings := []string{} + for _, address := range addresses { + addressStrings = append(addressStrings, address.String()) + } + + timeA := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + timeB := timeA.Add(time.Hour) + + // There should be no addresses returned originally + authorizationsA := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) + require.Empty(authorizationsA.Addresses, "no addresses at timeA expected") + + authorizationsB := keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) + require.Empty(authorizationsB.Addresses, "no addresses at timeB expected") + + // Store addresses for timeB + keeper.SetPendingTokenizeShareAuthorizations(ctx, timeB, types.PendingTokenizeShareAuthorizations{ + Addresses: addressStrings, + }) + + // Check addresses + authorizationsA = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeA) + require.Empty(authorizationsA.Addresses, "no addresses at timeA expected at end") + + authorizationsB = keeper.GetPendingTokenizeShareAuthorizations(ctx, timeB) + require.Equal(addressStrings, authorizationsB.Addresses, "address length") +} + +// Test QueueTokenizeSharesAuthorization and RemoveExpiredTokenizeShareLocks +func (s *KeeperTestSuite) TestTokenizeShareAuthorizationQueue() { + ctx, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Create dummy accounts and completion times + + // We'll start by adding the following addresses to the queue + // Time 0: [address0] + // Time 1: [] + // Time 2: [address1, address2, address3] + // Time 3: [address4, address5] + // Time 4: [address6] + addresses := simtestutil.CreateIncrementalAccounts(7) + addressesByTime := map[int][]sdk.AccAddress{ + 0: {addresses[0]}, + 1: {}, + 2: {addresses[1], addresses[2], addresses[3]}, + 3: {addresses[4], addresses[5]}, + 4: {addresses[6]}, + } + + // Set the unbonding time to 1 day + unbondingPeriod := time.Hour * 24 + params := keeper.GetParams(ctx) + params.UnbondingTime = unbondingPeriod + keeper.SetParams(ctx, params) + + // Add each address to the queue and then increment the block time + // such that the times line up as follows + // Time 0: 2023-01-01 00:00:00 + // Time 1: 2023-01-01 00:01:00 + // Time 2: 2023-01-01 00:02:00 + // Time 3: 2023-01-01 00:03:00 + startTime := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC) + ctx = ctx.WithBlockTime(startTime) + blockTimeIncrement := time.Hour + + for timeIndex := 0; timeIndex <= 4; timeIndex++ { + for _, address := range addressesByTime[timeIndex] { + keeper.QueueTokenizeSharesAuthorization(ctx, address) + } + ctx = ctx.WithBlockTime(ctx.BlockTime().Add(blockTimeIncrement)) + } + + // We'll unlock the tokens using the following progression + // The "alias'"/keys for these times assume a starting point of the Time 0 + // from above, plus the Unbonding Time + // Time -1 (2023-01-01 23:59:99): [] + // Time 0 (2023-01-02 00:00:00): [address0] + // Time 1 (2023-01-02 00:01:00): [] + // Time 2.5 (2023-01-02 00:02:30): [address1, address2, address3] + // Time 10 (2023-01-02 00:10:00): [address4, address5, address6] + unlockBlockTimes := map[string]time.Time{ + "-1": startTime.Add(unbondingPeriod).Add(-time.Second), + "0": startTime.Add(unbondingPeriod), + "1": startTime.Add(unbondingPeriod).Add(blockTimeIncrement), + "2.5": startTime.Add(unbondingPeriod).Add(2 * blockTimeIncrement).Add(blockTimeIncrement / 2), + "10": startTime.Add(unbondingPeriod).Add(10 * blockTimeIncrement), + } + expectedUnlockedAddresses := map[string][]string{ + "-1": {}, + "0": {addresses[0].String()}, + "1": {}, + "2.5": {addresses[1].String(), addresses[2].String(), addresses[3].String()}, + "10": {addresses[4].String(), addresses[5].String(), addresses[6].String()}, + } + + // Now we'll remove items from the queue sequentially + // First check with a block time before the first expiration - it should remove no addresses + actualAddresses := keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["-1"]) + require.Equal(expectedUnlockedAddresses["-1"], actualAddresses, "no addresses unlocked from time -1") + + // Then pass in (time 0 + unbonding time) - it should remove the first address + actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["0"]) + require.Equal(expectedUnlockedAddresses["0"], actualAddresses, "one address unlocked from time 0") + + // Now pass in (time 1 + unbonding time) - it should remove no addresses since + // the address at time 0 was already removed + actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["1"]) + require.Equal(expectedUnlockedAddresses["1"], actualAddresses, "no addresses unlocked from time 1") + + // Now pass in (time 2.5 + unbonding time) - it should remove the three addresses from time 2 + actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["2.5"]) + require.Equal(expectedUnlockedAddresses["2.5"], actualAddresses, "addresses unlocked from time 2.5") + + // Finally pass in a block time far in the future, which should remove all the remaining locks + actualAddresses = keeper.RemoveExpiredTokenizeShareLocks(ctx, unlockBlockTimes["10"]) + require.Equal(expectedUnlockedAddresses["10"], actualAddresses, "addresses unlocked from time 10") +} + +// Tests DelegatorIsLiquidStaker +func (s *KeeperTestSuite) TestDelegatorIsLiquidStaker() { + _, keeper := s.ctx, s.stakingKeeper + require := s.Require() + + // Create base and ICA accounts + baseAccountAddress := sdk.AccAddress("base-account") + icaAccountAddress := sdk.AccAddress( + address.Derive(authtypes.NewModuleAddress("icahost"), []byte("connection-0"+"icahost")), + ) + + // Only the ICA module account should be considered a liquid staking provider + require.False(keeper.DelegatorIsLiquidStaker(baseAccountAddress), "base account") + require.True(keeper.DelegatorIsLiquidStaker(icaAccountAddress), "ICA module account") +} From 743f059ef1b0ce9f99a5269524e7eefc7138b108 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Wed, 6 Dec 2023 14:31:01 +0100 Subject: [PATCH 27/31] revert deterministic tests change --- tests/integration/staking/keeper/determinstic_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/integration/staking/keeper/determinstic_test.go b/tests/integration/staking/keeper/determinstic_test.go index cc6c671a6173..ffa5a675f43f 100644 --- a/tests/integration/staking/keeper/determinstic_test.go +++ b/tests/integration/staking/keeper/determinstic_test.go @@ -264,8 +264,7 @@ func (suite *DeterministicTestSuite) TestGRPCValidator() { func (suite *DeterministicTestSuite) TestGRPCValidators() { validatorStatus := []string{stakingtypes.BondStatusBonded, stakingtypes.BondStatusUnbonded, stakingtypes.BondStatusUnbonding, ""} rapid.Check(suite.T(), func(t *rapid.T) { - // NOTE: max number of validators changed from 3 to 2 to prevent the test from timing out after 30s. - valsCount := rapid.IntRange(1, 2).Draw(t, "num-validators") + valsCount := rapid.IntRange(1, 3).Draw(t, "num-validators") for i := 0; i < valsCount; i++ { suite.createAndSetValidator(t) } @@ -289,8 +288,7 @@ func (suite *DeterministicTestSuite) TestGRPCValidators() { func (suite *DeterministicTestSuite) TestGRPCValidatorDelegations() { rapid.Check(suite.T(), func(t *rapid.T) { validator := suite.createAndSetValidatorWithStatus(t, stakingtypes.Bonded) - // NOTE: max number of delegation changed from 5 to 2 to prevent the test from timing out after 30s. - numDels := rapid.IntRange(1, 2).Draw(t, "num-dels") + numDels := rapid.IntRange(1, 5).Draw(t, "num-dels") for i := 0; i < numDels; i++ { delegator := testdata.AddressGenerator(t).Draw(t, "delegator") From 5b8e28f3247bd3c851d4d7a4d00649f60b700743 Mon Sep 17 00:00:00 2001 From: MSalopek Date: Wed, 6 Dec 2023 15:44:52 +0100 Subject: [PATCH 28/31] tests: update simulation randfees calc (#9) --- types/simulation/account.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/types/simulation/account.go b/types/simulation/account.go index b9f69ffa6116..6bd3f7692937 100644 --- a/types/simulation/account.go +++ b/types/simulation/account.go @@ -3,6 +3,7 @@ package simulation import ( "fmt" "math/rand" + "strings" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -66,14 +67,23 @@ func FindAccount(accs []Account, address sdk.Address) (Account, bool) { // amount from the account's available balance. If the user doesn't have enough // funds for paying fees, it returns empty coins. func RandomFees(r *rand.Rand, ctx sdk.Context, spendableCoins sdk.Coins) (sdk.Coins, error) { - if spendableCoins.Empty() { + spendable := sdk.NewCoins() + // remove liquid staking denoms from spendable coins since fees cannot be paid in those denoms + for _, coin := range spendableCoins { + if strings.Contains(coin.Denom, sdk.Bech32PrefixValAddr) { + continue + } + spendable = append(spendable, coin) + } + + if spendable.Empty() { return nil, nil } - perm := r.Perm(len(spendableCoins)) + perm := r.Perm(len(spendable)) var randCoin sdk.Coin for _, index := range perm { - randCoin = spendableCoins[index] + randCoin = spendable[index] if !randCoin.Amount.IsZero() { break } From ff8046c41429b0fca9ff5157ea55348748977805 Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 7 Dec 2023 09:14:58 +0100 Subject: [PATCH 29/31] address min self delegation depreciation in tests --- Makefile | 2 +- snapshots/store.go | 2 +- x/staking/keeper/delegation_test.go | 191 +--------------------------- x/staking/keeper/msg_server.go | 2 +- x/staking/keeper/params.go | 1 - x/staking/types/validator.go | 1 + 6 files changed, 11 insertions(+), 188 deletions(-) diff --git a/Makefile b/Makefile index d9313246778c..be69109df5a6 100644 --- a/Makefile +++ b/Makefile @@ -347,7 +347,7 @@ benchmark: ############################################################################### golangci_lint_cmd=golangci-lint -golangci_version=v1.50.1 +golangci_version=v1.55.2 lint: @echo "--> Running linter" diff --git a/snapshots/store.go b/snapshots/store.go index 1087c826fab2..3ceafa2bbe03 100644 --- a/snapshots/store.go +++ b/snapshots/store.go @@ -260,7 +260,7 @@ func (s *Store) Save( snapshotHasher := sha256.New() chunkHasher := sha256.New() for chunkBody := range chunks { - defer chunkBody.Close() //nolint:staticcheck + defer chunkBody.Close() dir := s.pathSnapshot(height, format) err = os.MkdirAll(dir, 0o755) if err != nil { diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index 98ed2aa9378d..ee205bcf2b0f 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -602,6 +602,7 @@ func (s *KeeperTestSuite) TestRedelegationMaxEntries() { require.NoError(err) } +// NOTE: redelegating self-delegations does not put validators in unbonding state with LSM func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { ctx, keeper := s.ctx, s.stakingKeeper require := s.Require() @@ -644,13 +645,12 @@ func (s *KeeperTestSuite) TestRedelegateSelfDelegation() { require.NoError(err) // end block - s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) s.applyValidatorSetUpdates(ctx, keeper, 2) validator, found := keeper.GetValidator(ctx, addrVals[0]) require.True(found) require.Equal(valTokens, validator.Tokens) - require.Equal(stakingtypes.Unbonding, validator.Status) + require.Equal(stakingtypes.Bonded, validator.Status) } func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { @@ -686,7 +686,7 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { validator2, issuedShares = validator2.AddTokensFromDel(valTokens) require.Equal(valTokens, issuedShares.RoundInt()) s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.NotBondedPoolName, stakingtypes.BondedPoolName, gomock.Any()) - _ = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator2, true) + validator2 = stakingkeeper.TestingUpdateValidator(keeper, ctx, validator2, true) header := ctx.BlockHeader() blockHeight := int64(10) @@ -733,6 +733,7 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondingValidator() { require.True(blockTime.Add(params.UnbondingTime).Equal(ubd.Entries[0].CompletionTime)) } +// NOTE: undelegating all self-delegation does not put a validator in unbonding state with LSM func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { ctx, keeper := s.ctx, s.stakingKeeper require := s.Require() @@ -772,10 +773,12 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { ctx = ctx.WithBlockHeight(10) ctx = ctx.WithBlockTime(time.Unix(333, 0)) - // unbond the all self-delegation to put validator in unbonding state + // unbond the all self-delegation s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) _, err := keeper.Undelegate(ctx, val0AccAddr, addrVals[0], sdk.NewDecFromInt(delTokens)) require.NoError(err) + // jail to put validator in unbonding state + keeper.Jail(ctx, sdk.ConsAddress(PKs[0].Address())) // end block s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, gomock.Any()) @@ -800,183 +803,3 @@ func (s *KeeperTestSuite) TestRedelegateFromUnbondedValidator() { red, found := keeper.GetRedelegation(ctx, addrDels[0], addrVals[0], addrVals[1]) require.False(found, "%v", red) } - -/*TODO refactor LSM tests: - -- Note that in v0.45.16-lsm the redelegation tests are renamed such that: -TestRedelegateFromUnbondingValidator -> TestValidatorBondUndelegate and -TestRedelegateFromUnbondedValidator -> TestValidatorBondUndelegate - -- Note that in v0.45.16-lsm the keeper tests are still using testing.T -and simapp, which should updated to unit test with gomock, see tests above. - -*/ -// func TestValidatorBondUndelegate(t *testing.T) { -// _, app, ctx := createTestInput() - -// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) -// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - -// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - -// bondDenom := app.StakingKeeper.BondDenom(ctx) -// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - -// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) -// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - -// // create a validator and a delegator to that validator -// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator) - -// // set validator bond factor -// params := app.StakingKeeper.GetParams(ctx) -// params.ValidatorBondFactor = sdk.NewDec(1) -// app.StakingKeeper.SetParams(ctx, params) - -// // convert to validator self-bond -// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// }) -// require.NoError(t, err) - -// // tokenize share for 2nd account delegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ -// DelegatorAddress: addrDels[1].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// TokenizedShareOwner: addrDels[0].String(), -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.Error(t, err) - -// // redeem full amount on 2nd account and try undelegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ -// DelegatorAddress: addrDels[1].String(), -// Amount: tokenizeShareResp.Amount, -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.Undelegate(sdk.WrapSDKContext(ctx), &types.MsgUndelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.NoError(t, err) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) -// } - -// func TestValidatorBondRedelegate(t *testing.T) { -// _, app, ctx := createTestInput() - -// addrDels := simapp.AddTestAddrs(app, ctx, 2, app.StakingKeeper.TokensFromConsensusPower(ctx, 10000)) -// addrVals := simapp.ConvertAddrsToValAddrs(addrDels) - -// startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) - -// bondDenom := app.StakingKeeper.BondDenom(ctx) -// notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - -// startPoolToken := sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens.Mul(sdk.NewInt(2)))) -// require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startPoolToken)) -// app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - -// // create a validator and a delegator to that validator -// validator := teststaking.NewValidator(t, addrVals[0], PKs[0]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator) -// validator2 := teststaking.NewValidator(t, addrVals[1], PKs[1]) -// validator.Status = types.Bonded -// app.StakingKeeper.SetValidator(ctx, validator2) - -// // set validator bond factor -// params := app.StakingKeeper.GetParams(ctx) -// params.ValidatorBondFactor = sdk.NewDec(1) -// app.StakingKeeper.SetParams(ctx, params) - -// // set total liquid stake -// app.StakingKeeper.SetTotalLiquidStakedTokens(ctx, sdk.NewInt(100)) - -// // delegate to each validator -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err := delegateCoinsFromAccount(ctx, app, addrDels[0], startTokens, validator) -// require.NoError(t, err) - -// validator2, _ = app.StakingKeeper.GetValidator(ctx, addrVals[1]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator2) -// require.NoError(t, err) - -// // convert to validator self-bond -// msgServer := keeper.NewMsgServerImpl(app.StakingKeeper) -// _, err = msgServer.ValidatorBond(sdk.WrapSDKContext(ctx), &types.MsgValidatorBond{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorAddress: addrVals[0].String(), -// }) -// require.NoError(t, err) - -// // tokenize share for 2nd account delegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// tokenizeShareResp, err := msgServer.TokenizeShares(sdk.WrapSDKContext(ctx), &types.MsgTokenizeShares{ -// DelegatorAddress: addrDels[1].String(), -// ValidatorAddress: addrVals[0].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// TokenizedShareOwner: addrDels[0].String(), -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorSrcAddress: addrVals[0].String(), -// ValidatorDstAddress: addrVals[1].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.Error(t, err) - -// // redeem full amount on 2nd account and try undelegation -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// err = delegateCoinsFromAccount(ctx, app, addrDels[1], startTokens, validator) -// require.NoError(t, err) -// _, err = msgServer.RedeemTokensForShares(sdk.WrapSDKContext(ctx), &types.MsgRedeemTokensForShares{ -// DelegatorAddress: addrDels[1].String(), -// Amount: tokenizeShareResp.Amount, -// }) -// require.NoError(t, err) - -// // try undelegating -// _, err = msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), &types.MsgBeginRedelegate{ -// DelegatorAddress: addrDels[0].String(), -// ValidatorSrcAddress: addrVals[0].String(), -// ValidatorDstAddress: addrVals[1].String(), -// Amount: sdk.NewCoin(sdk.DefaultBondDenom, startTokens), -// }) -// require.NoError(t, err) - -// validator, _ = app.StakingKeeper.GetValidator(ctx, addrVals[0]) -// require.Equal(t, validator.ValidatorBondShares, sdk.ZeroDec()) -// } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index cd650696f97d..b74ad429281e 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -642,13 +642,13 @@ func (k msgServer) UnbondValidator(goCtx context.Context, msg *types.MsgUnbondVa if err != nil { return nil, err } + // validator must already be registered validator, found := k.GetValidator(ctx, valAddr) if !found { return nil, types.ErrNoValidatorFound } - // jail the validator. k.jailValidator(ctx, validator) return &types.MsgUnbondValidatorResponse{}, nil } diff --git a/x/staking/keeper/params.go b/x/staking/keeper/params.go index 06dfad471852..640525e53a26 100644 --- a/x/staking/keeper/params.go +++ b/x/staking/keeper/params.go @@ -47,7 +47,6 @@ func (k Keeper) PowerReduction(ctx sdk.Context) math.Int { // Validator bond factor for all validators func (k Keeper) ValidatorBondFactor(ctx sdk.Context) (res sdk.Dec) { return k.GetParams(ctx).ValidatorBondFactor - } // Global liquid staking cap across all liquid staking providers diff --git a/x/staking/types/validator.go b/x/staking/types/validator.go index f8467933380b..c3f093ad1703 100644 --- a/x/staking/types/validator.go +++ b/x/staking/types/validator.go @@ -58,6 +58,7 @@ func NewValidator(operator sdk.ValAddress, pubKey cryptotypes.PubKey, descriptio UnbondingHeight: int64(0), UnbondingTime: time.Unix(0, 0).UTC(), Commission: NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()), + MinSelfDelegation: sdk.ZeroInt(), UnbondingOnHoldRefCount: 0, ValidatorBondShares: sdk.ZeroDec(), LiquidShares: sdk.ZeroDec(), From e7b7d2b0d3ce6993c9698578e73344ed438dca3c Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Thu, 7 Dec 2023 11:15:37 +0100 Subject: [PATCH 30/31] refactor e2e tests and other nits --- tests/e2e/staking/suite.go | 9 ++++--- .../integration/staking/keeper/common_test.go | 3 ++- .../staking/keeper/liquid_stake_test.go | 9 +++---- .../staking/keeper/msg_server_test.go | 15 ++++++------ x/staking/keeper/delegation.go | 10 -------- x/staking/keeper/liquid_stake.go | 24 +++++++++++-------- x/staking/migrations/v3/json_test.go | 17 +++++++++++-- x/staking/simulation/genesis.go | 7 +++--- 8 files changed, 53 insertions(+), 41 deletions(-) diff --git a/tests/e2e/staking/suite.go b/tests/e2e/staking/suite.go index dff54520f9cf..cee0eac0b7b6 100644 --- a/tests/e2e/staking/suite.go +++ b/tests/e2e/staking/suite.go @@ -914,16 +914,19 @@ func (s *E2ETestSuite) TestGetCmdQueryParams() { "with text output", []string{fmt.Sprintf("--%s=text", flags.FlagOutput)}, `bond_denom: stake +global_liquid_staking_cap: "1.000000000000000000" historical_entries: 10000 max_entries: 7 max_validators: 100 min_commission_rate: "0.000000000000000000" -unbonding_time: 1814400s`, +unbonding_time: 1814400s +validator_bond_factor: "-1.000000000000000000" +validator_liquid_staking_cap: "1.000000000000000000"`, }, { "with json output", []string{fmt.Sprintf("--%s=json", flags.FlagOutput)}, - `{"unbonding_time":"1814400s","max_validators":100,"max_entries":7,"historical_entries":10000,"bond_denom":"stake","min_commission_rate":"0.000000000000000000"}`, + `{"unbonding_time":"1814400s","max_validators":100,"max_entries":7,"historical_entries":10000,"bond_denom":"stake","min_commission_rate":"0.000000000000000000","validator_bond_factor":"-1.000000000000000000","global_liquid_staking_cap":"1.000000000000000000","validator_liquid_staking_cap":"1.000000000000000000"}`, }, } for _, tc := range testCases { @@ -1224,7 +1227,7 @@ func (s *E2ETestSuite) TestNewRedelegateCmd() { fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastSync), fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), }, - false, 31, &sdk.TxResponse{}, + false, 3, &sdk.TxResponse{}, }, { "valid transaction of delegate", diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index ffb77c3afc7b..d882a5a666c6 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -7,6 +7,7 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + "cosmossdk.io/math" "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/codec" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" @@ -89,7 +90,7 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers return addrs, valAddrs, vals } -func delegateCoinsFromAccount(ctx sdk.Context, sk keeper.Keeper, addr sdk.AccAddress, amount sdk.Int, val types.ValidatorI) error { +func delegateCoinsFromAccount(ctx sdk.Context, sk keeper.Keeper, addr sdk.AccAddress, amount math.Int, val types.ValidatorI) error { _, err := sk.Delegate(ctx, addr, amount, types.Unbonded, val.(types.Validator), true) return err diff --git a/tests/integration/staking/keeper/liquid_stake_test.go b/tests/integration/staking/keeper/liquid_stake_test.go index ef7f7058e417..1f0a96382f16 100644 --- a/tests/integration/staking/keeper/liquid_stake_test.go +++ b/tests/integration/staking/keeper/liquid_stake_test.go @@ -3,6 +3,7 @@ package keeper_test import ( "testing" + "cosmossdk.io/math" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" @@ -25,7 +26,7 @@ func clearPoolBalance(t *testing.T, sk keeper.Keeper, ak accountkeeper.AccountKe } // Helper function to fund the Bonded pool balances before a unit test -func fundPoolBalance(t *testing.T, sk keeper.Keeper, bk bankkeeper.Keeper, ctx sdk.Context, amount sdk.Int) { +func fundPoolBalance(t *testing.T, sk keeper.Keeper, bk bankkeeper.Keeper, ctx sdk.Context, amount math.Int) { bondDenom := sk.BondDenom(ctx) bondedPoolCoin := sdk.NewCoin(bondDenom, amount) @@ -55,9 +56,9 @@ func TestCheckExceedsGlobalLiquidStakingCap(t *testing.T) { testCases := []struct { name string globalLiquidCap sdk.Dec - totalLiquidStake sdk.Int - totalStake sdk.Int - newLiquidStake sdk.Int + totalLiquidStake math.Int + totalStake math.Int + newLiquidStake math.Int tokenizingShares bool expectedExceeds bool }{ diff --git a/tests/integration/staking/keeper/msg_server_test.go b/tests/integration/staking/keeper/msg_server_test.go index 861fe61b2940..535ecfcc9190 100644 --- a/tests/integration/staking/keeper/msg_server_test.go +++ b/tests/integration/staking/keeper/msg_server_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "cosmossdk.io/math" "cosmossdk.io/simapp" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -174,12 +175,12 @@ func TestTokenizeSharesAndRedeemTokens(t *testing.T) { testCases := []struct { name string - vestingAmount sdk.Int - delegationAmount sdk.Int - tokenizeShareAmount sdk.Int - redeemAmount sdk.Int - targetVestingDelAfterShare sdk.Int - targetVestingDelAfterRedeem sdk.Int + vestingAmount math.Int + delegationAmount math.Int + tokenizeShareAmount math.Int + redeemAmount math.Int + targetVestingDelAfterShare math.Int + targetVestingDelAfterRedeem math.Int globalLiquidStakingCap sdk.Dec slashFactor sdk.Dec validatorLiquidStakingCap sdk.Dec @@ -1172,7 +1173,7 @@ func TestChangeValidatorBond(t *testing.T) { bankKeeper = app.BankKeeper ) - checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares sdk.Int) { + checkValidatorBondShares := func(validatorAddress sdk.ValAddress, expectedShares math.Int) { validator, found := stakingKeeper.GetValidator(ctx, validatorAddress) require.True(t, found, "validator should have been found") require.Equal(t, expectedShares.Int64(), validator.ValidatorBondShares.TruncateInt64(), "validator bond shares") diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 23cb929099e8..cc97f9ec6bee 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -746,16 +746,6 @@ func (k Keeper) Unbond( return amount, err } - isValidatorOperator := delegatorAddress.Equals(validator.GetOperator()) - - // If the delegation is the operator of the validator and undelegating will decrease the validator's - // self-delegation below their minimum, we jail the validator. - if isValidatorOperator && !validator.Jailed && - validator.TokensFromShares(delegation.Shares).TruncateInt().LT(validator.MinSelfDelegation) { - k.jailValidator(ctx, validator) - validator = k.mustGetValidator(ctx, validator.GetOperator()) - } - if delegation.Shares.IsZero() { err = k.RemoveDelegation(ctx, delegation) } else { diff --git a/x/staking/keeper/liquid_stake.go b/x/staking/keeper/liquid_stake.go index eb8aa197705a..62b2473f50fc 100644 --- a/x/staking/keeper/liquid_stake.go +++ b/x/staking/keeper/liquid_stake.go @@ -3,12 +3,13 @@ package keeper import ( "time" + "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" ) // SetTotalLiquidStakedTokens stores the total outstanding tokens owned by a liquid staking provider -func (k Keeper) SetTotalLiquidStakedTokens(ctx sdk.Context, tokens sdk.Int) { +func (k Keeper) SetTotalLiquidStakedTokens(ctx sdk.Context, tokens math.Int) { store := ctx.KVStore(k.storeKey) tokensBz, err := tokens.Marshal() @@ -21,7 +22,7 @@ func (k Keeper) SetTotalLiquidStakedTokens(ctx sdk.Context, tokens sdk.Int) { // GetTotalLiquidStakedTokens returns the total outstanding tokens owned by a liquid staking provider // Returns zero if the total liquid stake amount has not been initialized -func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) sdk.Int { +func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) math.Int { store := ctx.KVStore(k.storeKey) tokensBz := store.Get(types.TotalLiquidStakedTokensKey) @@ -29,7 +30,7 @@ func (k Keeper) GetTotalLiquidStakedTokens(ctx sdk.Context) sdk.Int { return sdk.ZeroInt() } - var tokens sdk.Int + var tokens math.Int if err := tokens.Unmarshal(tokensBz); err != nil { panic(err) } @@ -60,7 +61,7 @@ func (k Keeper) DelegatorIsLiquidStaker(delegatorAddress sdk.AccAddress) bool { // the tokens are already included in the bonded pool // If the delegation's shares are not bonded (e.g. normal delegation), // we need to add the tokens to the current bonded pool balance to get the total staked -func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens sdk.Int, sharesAlreadyBonded bool) bool { +func (k Keeper) CheckExceedsGlobalLiquidStakingCap(ctx sdk.Context, tokens math.Int, sharesAlreadyBonded bool) bool { liquidStakingCap := k.GlobalLiquidStakingCap(ctx) liquidStakedAmount := k.GetTotalLiquidStakedTokens(ctx) @@ -113,7 +114,7 @@ func (k Keeper) CheckExceedsValidatorLiquidStakingCap(ctx sdk.Context, validator // // The percentage of liquid staked tokens must be less than the GlobalLiquidStakingCap: // (TotalLiquidStakedTokens / TotalStakedTokens) <= GlobalLiquidStakingCap -func (k Keeper) SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int, sharesAlreadyBonded bool) error { +func (k Keeper) SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount math.Int, sharesAlreadyBonded bool) error { if k.CheckExceedsGlobalLiquidStakingCap(ctx, amount, sharesAlreadyBonded) { return types.ErrGlobalLiquidStakingCapExceeded } @@ -123,7 +124,7 @@ func (k Keeper) SafelyIncreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sd } // DecreaseTotalLiquidStakedTokens decrements the total liquid staked tokens -func (k Keeper) DecreaseTotalLiquidStakedTokens(ctx sdk.Context, amount sdk.Int) error { +func (k Keeper) DecreaseTotalLiquidStakedTokens(ctx sdk.Context, amount math.Int) error { totalLiquidStake := k.GetTotalLiquidStakedTokens(ctx) if amount.GT(totalLiquidStake) { return types.ErrTotalLiquidStakedUnderflow @@ -362,14 +363,17 @@ func (k Keeper) RemoveExpiredTokenizeShareLocks(ctx sdk.Context, blockTime time. // collect all unlocked addresses unlockedAddresses = []string{} + keys := [][]byte{} for ; iterator.Valid(); iterator.Next() { authorizations := types.PendingTokenizeShareAuthorizations{} k.cdc.MustUnmarshal(iterator.Value(), &authorizations) + unlockedAddresses = append(unlockedAddresses, authorizations.Addresses...) + keys = append(keys, iterator.Key()) + } - for _, addressString := range authorizations.Addresses { - unlockedAddresses = append(unlockedAddresses, addressString) - } - store.Delete(iterator.Key()) + // delete unlocked addresses keys + for _, k := range keys { + store.Delete(k) } // remove the lock from each unlocked address diff --git a/x/staking/migrations/v3/json_test.go b/x/staking/migrations/v3/json_test.go index c111f366515e..52f3c2ea27ed 100644 --- a/x/staking/migrations/v3/json_test.go +++ b/x/staking/migrations/v3/json_test.go @@ -34,21 +34,34 @@ func TestMigrateJSON(t *testing.T) { indentedBz, err := json.MarshalIndent(jsonObj, "", "\t") require.NoError(t, err) - // Make sure about new param MinCommissionRate. + // Make sure about new params MinCommissionRate. + + // NOTE: the LSM module introduces: + // params: + // - GlobalLiquidStakingCap, ValidatorBondFactor, ValidatorLiquidStakingCap + // states: + // - LastTokenizeShareRecordId, TokenizeShareLocks, TokenizeShareRecords, TotalLiquidStakeTokens expected := `{ "delegations": [], "exported": false, + "last_tokenize_share_record_id": "0", "last_total_power": "0", "last_validator_powers": [], "params": { "bond_denom": "stake", + "global_liquid_staking_cap": "1.000000000000000000", "historical_entries": 10000, "max_entries": 7, "max_validators": 100, "min_commission_rate": "0.000000000000000000", - "unbonding_time": "1814400s" + "unbonding_time": "1814400s", + "validator_bond_factor": "-1.000000000000000000", + "validator_liquid_staking_cap": "1.000000000000000000" }, "redelegations": [], + "tokenize_share_locks": [], + "tokenize_share_records": [], + "total_liquid_staked_tokens": "0", "unbonding_delegations": [], "validators": [] }` diff --git a/x/staking/simulation/genesis.go b/x/staking/simulation/genesis.go index 6a6de6a408bb..2787e532f96a 100644 --- a/x/staking/simulation/genesis.go +++ b/x/staking/simulation/genesis.go @@ -11,7 +11,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/types/simulation" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -42,17 +41,17 @@ func getHistEntries(r *rand.Rand) uint32 { // getGlobalLiquidStakingCap returns randomized GlobalLiquidStakingCap between 0-1. func getGlobalLiquidStakingCap(r *rand.Rand) sdk.Dec { - return simtypes.RandomDecAmount(r, sdk.OneDec()) + return simulation.RandomDecAmount(r, sdk.OneDec()) } // getValidatorLiquidStakingCap returns randomized ValidatorLiquidStakingCap between 0-1. func getValidatorLiquidStakingCap(r *rand.Rand) sdk.Dec { - return simtypes.RandomDecAmount(r, sdk.OneDec()) + return simulation.RandomDecAmount(r, sdk.OneDec()) } // getValidatorBondFactor returns randomized ValidatorBondCap between -1 and 300. func getValidatorBondFactor(r *rand.Rand) sdk.Dec { - return sdk.NewDec(int64(simtypes.RandIntBetween(r, -1, 300))) + return sdk.NewDec(int64(simulation.RandIntBetween(r, -1, 300))) } // RandomizedGenState generates a random GenesisState for staking From 6d0a5b4efb84dea9f7fc94b46ef5f67ada551f8e Mon Sep 17 00:00:00 2001 From: MSalopek Date: Thu, 7 Dec 2023 12:27:33 +0100 Subject: [PATCH 31/31] tests: appease linter in randfees --- types/simulation/account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/simulation/account.go b/types/simulation/account.go index 6bd3f7692937..1f04d558def7 100644 --- a/types/simulation/account.go +++ b/types/simulation/account.go @@ -70,7 +70,7 @@ func RandomFees(r *rand.Rand, ctx sdk.Context, spendableCoins sdk.Coins) (sdk.Co spendable := sdk.NewCoins() // remove liquid staking denoms from spendable coins since fees cannot be paid in those denoms for _, coin := range spendableCoins { - if strings.Contains(coin.Denom, sdk.Bech32PrefixValAddr) { + if strings.Contains(coin.Denom, sdk.GetConfig().GetBech32ValidatorAddrPrefix()) { continue } spendable = append(spendable, coin)