From 52d46b2454f510f92541b26812922f79bad0de32 Mon Sep 17 00:00:00 2001 From: nghuyenthevinh2000 Date: Thu, 30 Jun 2022 20:17:07 +0700 Subject: [PATCH] Issue 1525: sub-section: combine superfluid query and staking query on querying delegation by delegator (#1539) * add normarl staking query for superfluid * add TestGRPCQuerySuperfluidDelegationsWithNormalStaking * add Query Delegation * combine hieuvubk's work on Osmo equivalent. The idea belongs to hieuvubk * change proto and cli * minor * change name to total-delegation-by-delegator * another minor :v * last minor * Apply suggestions from code review Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> * apply changes from review * add feature to changelog.md * minor fix in changelog Co-authored-by: Matt, Park <45252226+mattverse@users.noreply.github.com> --- CHANGELOG.md | 1 + docs/core/proto-docs.md | 35 ++ proto/osmosis/superfluid/query.proto | 30 +- scripts/multinode-local-testnet.sh | 0 x/superfluid/client/cli/query.go | 30 ++ x/superfluid/keeper/grpc_query.go | 88 ++++ x/superfluid/keeper/grpc_query_test.go | 66 +++ x/superfluid/types/query.pb.go | 569 +++++++++++++++++++++++++ x/superfluid/types/query.pb.gw.go | 101 +++++ 9 files changed, 919 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/multinode-local-testnet.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index e43094448c2..405f64acb73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1312] Stableswap: Createpool logic * [#1230] Stableswap CFMM equations * [#1429] solver for multi-asset CFMM +* [#1539] Superfluid: Combine superfluid and staking query on querying delegation by delegator ### Bug Fixes * [1700](https://github.com/osmosis-labs/osmosis/pull/1700) Upgrade sdk fork with missing snapshot manager fix. diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 0d4c1ce7850..eb34b54b013 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -252,6 +252,8 @@ - [ConnectedIntermediaryAccountResponse](#osmosis.superfluid.ConnectedIntermediaryAccountResponse) - [EstimateSuperfluidDelegatedAmountByValidatorDenomRequest](#osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) - [EstimateSuperfluidDelegatedAmountByValidatorDenomResponse](#osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) + - [QueryDelegationRequest](#osmosis.superfluid.QueryDelegationRequest) + - [QueryDelegationResponse](#osmosis.superfluid.QueryDelegationResponse) - [QueryParamsRequest](#osmosis.superfluid.QueryParamsRequest) - [QueryParamsResponse](#osmosis.superfluid.QueryParamsResponse) - [SuperfluidDelegationAmountRequest](#osmosis.superfluid.SuperfluidDelegationAmountRequest) @@ -3610,6 +3612,38 @@ assets + + +### QueryDelegationRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | | + + + + + + + + +### QueryDelegationResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `superfluid_delegation_records` | [SuperfluidDelegationRecord](#osmosis.superfluid.SuperfluidDelegationRecord) | repeated | | +| `delegation_response` | [cosmos.staking.v1beta1.DelegationResponse](#cosmos.staking.v1beta1.DelegationResponse) | repeated | | +| `total_delegated_coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + + + + ### QueryParamsRequest @@ -3831,6 +3865,7 @@ Query defines the gRPC querier service. | `SuperfluidUndelegationsByDelegator` | [SuperfluidUndelegationsByDelegatorRequest](#osmosis.superfluid.SuperfluidUndelegationsByDelegatorRequest) | [SuperfluidUndelegationsByDelegatorResponse](#osmosis.superfluid.SuperfluidUndelegationsByDelegatorResponse) | | GET|/osmosis/superfluid/v1beta1/superfluid_undelegations_by_delegator/{delegator_address}| | `SuperfluidDelegationsByValidatorDenom` | [SuperfluidDelegationsByValidatorDenomRequest](#osmosis.superfluid.SuperfluidDelegationsByValidatorDenomRequest) | [SuperfluidDelegationsByValidatorDenomResponse](#osmosis.superfluid.SuperfluidDelegationsByValidatorDenomResponse) | Returns all the superfluid positions of a specific denom delegated to one validator | GET|/osmosis/superfluid/v1beta1/superfluid_delegations_by_validator_denom| | `EstimateSuperfluidDelegatedAmountByValidatorDenom` | [EstimateSuperfluidDelegatedAmountByValidatorDenomRequest](#osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) | [EstimateSuperfluidDelegatedAmountByValidatorDenomResponse](#osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) | Returns the amount of a specific denom delegated to a specific validator This is labeled an estimate, because the way it calculates the amount can lead rounding errors from the true delegated amount | GET|/osmosis/superfluid/v1beta1/estimate_superfluid_delegation_amount_by_validator_denom| +| `Delegation` | [QueryDelegationRequest](#osmosis.superfluid.QueryDelegationRequest) | [QueryDelegationResponse](#osmosis.superfluid.QueryDelegationResponse) | | GET|/osmosis/superfluid/v1beta1/delegation/{delegator_address}| diff --git a/proto/osmosis/superfluid/query.proto b/proto/osmosis/superfluid/query.proto index 5420b021e65..65c18b34b05 100644 --- a/proto/osmosis/superfluid/query.proto +++ b/proto/osmosis/superfluid/query.proto @@ -10,6 +10,7 @@ import "osmosis/superfluid/superfluid.proto"; import "osmosis/superfluid/params.proto"; import "osmosis/lockup/lock.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/staking/v1beta1/staking.proto"; option go_package = "github.com/osmosis-labs/osmosis/v7/x/superfluid/types"; @@ -112,6 +113,12 @@ service Query { // option (google.api.http).get = // "/osmosis/superfluid/v1beta1/superfluid_unbondings_by_validator_denom"; // } + +// Returns the specified delegations for a specific delegator + rpc TotalDelegationByDelegator (QueryTotalDelegationByDelegatorRequest) returns (QueryTotalDelegationByDelegatorResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "total_delegation_by_delegator/{delegator_address}"; + } } message QueryParamsRequest {} @@ -256,4 +263,25 @@ message EstimateSuperfluidDelegatedAmountByValidatorDenomResponse { // (gogoproto.nullable) = false, // (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" // ]; -// } \ No newline at end of file +// } + +message QueryTotalDelegationByDelegatorRequest { + string delegator_address = 1; +} + +message QueryTotalDelegationByDelegatorResponse { + repeated SuperfluidDelegationRecord superfluid_delegation_records = 1 + [ (gogoproto.nullable) = false ]; + + repeated cosmos.staking.v1beta1.DelegationResponse delegation_response = 2 [ + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin total_delegated_coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; +} \ No newline at end of file diff --git a/scripts/multinode-local-testnet.sh b/scripts/multinode-local-testnet.sh old mode 100644 new mode 100755 diff --git a/x/superfluid/client/cli/query.go b/x/superfluid/client/cli/query.go index a9f07d38aeb..22e9bddc4c8 100644 --- a/x/superfluid/client/cli/query.go +++ b/x/superfluid/client/cli/query.go @@ -35,6 +35,7 @@ func GetQueryCmd() *cobra.Command { GetCmdSuperfluidDelegationsByDelegator(), GetCmdSuperfluidUndelegationsByDelegator(), GetCmdTotalSuperfluidDelegations(), + GetCmdTotalDelegationByDelegator(), ) return cmd @@ -349,3 +350,32 @@ func GetCmdTotalSuperfluidDelegations() *cobra.Command { return cmd } + +func GetCmdTotalDelegationByDelegator() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-delegation-by-delegator [delegator_address]", + Short: "Query both superfluid delegation and normal delegation", + Args: cobra.ExactArgs(1), + 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.TotalDelegationByDelegator(cmd.Context(), &types.QueryTotalDelegationByDelegatorRequest{ + DelegatorAddress: args[0], + }) + + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/superfluid/keeper/grpc_query.go b/x/superfluid/keeper/grpc_query.go index f91f5d8f867..8d8e475ab71 100644 --- a/x/superfluid/keeper/grpc_query.go +++ b/x/superfluid/keeper/grpc_query.go @@ -423,3 +423,91 @@ func (q Querier) TotalSuperfluidDelegations(goCtx context.Context, _ *types.Tota TotalDelegations: totalSuperfluidDelegated, }, nil } + +func (q Querier) TotalDelegationByDelegator(goCtx context.Context, req *types.QueryTotalDelegationByDelegatorRequest) (*types.QueryTotalDelegationByDelegatorResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if len(req.DelegatorAddress) == 0 { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "empty delegator address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + delAddr, err := sdk.AccAddressFromBech32(req.DelegatorAddress) + if err != nil { + return nil, err + } + + res := types.QueryTotalDelegationByDelegatorResponse{ + SuperfluidDelegationRecords: []types.SuperfluidDelegationRecord{}, + DelegationResponse: []stakingtypes.DelegationResponse{}, + TotalDelegatedCoins: sdk.NewCoins(), + TotalEquivalentStakedAmount: sdk.NewCoin(appparams.BaseCoinUnit, sdk.ZeroInt()), + } + + syntheticLocks := q.Keeper.lk.GetAllSyntheticLockupsByAddr(ctx, delAddr) + + for _, syntheticLock := range syntheticLocks { + // don't include unbonding delegations + if strings.Contains(syntheticLock.SynthDenom, "superunbonding") { + continue + } + + periodLock, err := q.Keeper.lk.GetLockByID(ctx, syntheticLock.UnderlyingLockId) + if err != nil { + return nil, err + } + + baseDenom := periodLock.Coins.GetDenomByIndex(0) + lockedCoins := sdk.NewCoin(baseDenom, periodLock.GetCoins().AmountOf(baseDenom)) + valAddr, err := ValidatorAddressFromSyntheticDenom(syntheticLock.SynthDenom) + + // Find how many osmo tokens this delegation is worth at superfluids current risk adjustment + // and twap of the denom. + equivalentAmount := q.Keeper.GetSuperfluidOSMOTokens(ctx, baseDenom, lockedCoins.Amount) + coin := sdk.NewCoin(appparams.BaseCoinUnit, equivalentAmount) + + if err != nil { + return nil, err + } + res.SuperfluidDelegationRecords = append(res.SuperfluidDelegationRecords, + types.SuperfluidDelegationRecord{ + DelegatorAddress: req.DelegatorAddress, + ValidatorAddress: valAddr, + DelegationAmount: lockedCoins, + EquivalentStakedAmount: &coin, + }, + ) + res.TotalDelegatedCoins = res.TotalDelegatedCoins.Add(lockedCoins) + res.TotalEquivalentStakedAmount = res.TotalEquivalentStakedAmount.Add(coin) + } + + //this is for getting normal staking + q.sk.IterateDelegations(ctx, delAddr, func(_ int64, del stakingtypes.DelegationI) bool { + val, found := q.sk.GetValidator(ctx, del.GetValidatorAddr()) + if !found { + return true + } + + lockedCoins := sdk.NewCoin(appparams.BaseCoinUnit, val.TokensFromShares(del.GetShares()).TruncateInt()) + + res.DelegationResponse = append(res.DelegationResponse, + stakingtypes.DelegationResponse{ + Delegation: stakingtypes.Delegation{ + DelegatorAddress: del.GetDelegatorAddr().String(), + ValidatorAddress: del.GetValidatorAddr().String(), + Shares: del.GetShares(), + }, + Balance: lockedCoins, + }, + ) + + res.TotalDelegatedCoins = res.TotalDelegatedCoins.Add(lockedCoins) + res.TotalEquivalentStakedAmount = res.TotalEquivalentStakedAmount.Add(lockedCoins) + + return false + }) + + return &res, nil +} diff --git a/x/superfluid/keeper/grpc_query_test.go b/x/superfluid/keeper/grpc_query_test.go index abbf5c2abb5..8b027179e33 100644 --- a/x/superfluid/keeper/grpc_query_test.go +++ b/x/superfluid/keeper/grpc_query_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -200,3 +202,67 @@ func (suite *KeeperTestSuite) TestGRPCQuerySuperfluidDelegationsDontIncludeUnbon suite.Require().NoError(err) suite.Require().Equal(totalSuperfluidDelegationsRes.TotalDelegations, sdk.NewInt(30000000)) } + +func (suite *KeeperTestSuite) TestGRPCQueryTotalDelegationByDelegator() { + suite.SetupTest() + + // Generate delegator addresses + delAddrs := CreateRandomAccounts(2) + + // setup 2 validators + valAddrs := suite.SetupValidators([]stakingtypes.BondStatus{stakingtypes.Bonded, stakingtypes.Bonded}) + + denoms, _ := suite.SetupGammPoolsAndSuperfluidAssets([]sdk.Dec{sdk.NewDec(20), sdk.NewDec(20)}) + + // create a delegation of 1000000 for every combination of 2 delegations, 2 validators, and 2 superfluid denoms + superfluidDelegations := []superfluidDelegation{ + {0, 0, 0, 1000000}, + {0, 1, 1, 1000000}, + {1, 0, 1, 1000000}, + {1, 1, 0, 1000000}, + } + + // setup superfluid delegations + suite.SetupSuperfluidDelegations(delAddrs, valAddrs, superfluidDelegations, denoms) + + // setup normal delegations + bond0to0 := stakingtypes.NewDelegation(delAddrs[0], valAddrs[0], sdk.NewDec(9000000)) + bond0to1 := stakingtypes.NewDelegation(delAddrs[0], valAddrs[1], sdk.NewDec(9000000)) + bond1to0 := stakingtypes.NewDelegation(delAddrs[1], valAddrs[0], sdk.NewDec(9000000)) + bond1to1 := stakingtypes.NewDelegation(delAddrs[1], valAddrs[1], sdk.NewDec(9000000)) + + suite.App.StakingKeeper.SetDelegation(suite.Ctx, bond0to0) + suite.App.StakingKeeper.SetDelegation(suite.Ctx, bond0to1) + suite.App.StakingKeeper.SetDelegation(suite.Ctx, bond1to0) + suite.App.StakingKeeper.SetDelegation(suite.Ctx, bond1to1) + + multiplier0 := suite.querier.Keeper.GetOsmoEquivalentMultiplier(suite.Ctx, denoms[0]) + multiplier1 := suite.querier.Keeper.GetOsmoEquivalentMultiplier(suite.Ctx, denoms[1]) + minRiskFactor := suite.querier.Keeper.GetParams(suite.Ctx).MinimumRiskFactor + + expectAmount0 := multiplier0.Mul(sdk.NewDec(1000000)).Sub(multiplier0.Mul(sdk.NewDec(1000000)).Mul(minRiskFactor)) + expectAmount1 := multiplier1.Mul(sdk.NewDec(1000000)).Sub(multiplier1.Mul(sdk.NewDec(1000000)).Mul(minRiskFactor)) + + // for each delegator, query all their superfluid delegations and normal delegations. Making sure they have 4 delegations + // Making sure TotalEquivalentStakedAmount is equal to converted amount + normal delegations + for _, delegator := range delAddrs { + res, err := suite.queryClient.TotalDelegationByDelegator(sdk.WrapSDKContext(suite.Ctx), &types.QueryTotalDelegationByDelegatorRequest{ + DelegatorAddress: delegator.String(), + }) + + fmt.Printf("res = %v \n", res) + + suite.Require().NoError(err) + suite.Require().Len(res.SuperfluidDelegationRecords, 2) + suite.Require().Len(res.DelegationResponse, 2) + suite.Require().True(res.TotalDelegatedCoins.IsEqual(sdk.NewCoins( + sdk.NewInt64Coin(denoms[0], 1000000), + sdk.NewInt64Coin(denoms[1], 1000000), + sdk.NewInt64Coin("uosmo", 18000000), + ))) + + total_osmo_equivalent := sdk.NewCoin("uosmo", expectAmount0.RoundInt().Add(expectAmount1.RoundInt()).Add(sdk.NewInt(18000000))) + + suite.Require().True(res.TotalEquivalentStakedAmount.IsEqual(total_osmo_equivalent)) + } +} diff --git a/x/superfluid/types/query.pb.go b/x/superfluid/types/query.pb.go index 27cd1d36102..9c911b9637e 100644 --- a/x/superfluid/types/query.pb.go +++ b/x/superfluid/types/query.pb.go @@ -9,6 +9,7 @@ import ( 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" + types2 "github.com/cosmos/cosmos-sdk/x/staking/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -1236,6 +1237,122 @@ func (m *EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) GetTotalDele return nil } +type QueryTotalDelegationByDelegatorRequest struct { + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty"` +} + +func (m *QueryTotalDelegationByDelegatorRequest) Reset() { + *m = QueryTotalDelegationByDelegatorRequest{} +} +func (m *QueryTotalDelegationByDelegatorRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalDelegationByDelegatorRequest) ProtoMessage() {} +func (*QueryTotalDelegationByDelegatorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d9448e4ed3943f, []int{25} +} +func (m *QueryTotalDelegationByDelegatorRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalDelegationByDelegatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalDelegationByDelegatorRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalDelegationByDelegatorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalDelegationByDelegatorRequest.Merge(m, src) +} +func (m *QueryTotalDelegationByDelegatorRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalDelegationByDelegatorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalDelegationByDelegatorRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalDelegationByDelegatorRequest proto.InternalMessageInfo + +func (m *QueryTotalDelegationByDelegatorRequest) GetDelegatorAddress() string { + if m != nil { + return m.DelegatorAddress + } + return "" +} + +type QueryTotalDelegationByDelegatorResponse struct { + SuperfluidDelegationRecords []SuperfluidDelegationRecord `protobuf:"bytes,1,rep,name=superfluid_delegation_records,json=superfluidDelegationRecords,proto3" json:"superfluid_delegation_records"` + DelegationResponse []types2.DelegationResponse `protobuf:"bytes,2,rep,name=delegation_response,json=delegationResponse,proto3" json:"delegation_response"` + TotalDelegatedCoins github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=total_delegated_coins,json=totalDelegatedCoins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_delegated_coins"` + TotalEquivalentStakedAmount types.Coin `protobuf:"bytes,4,opt,name=total_equivalent_staked_amount,json=totalEquivalentStakedAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"total_equivalent_staked_amount"` +} + +func (m *QueryTotalDelegationByDelegatorResponse) Reset() { + *m = QueryTotalDelegationByDelegatorResponse{} +} +func (m *QueryTotalDelegationByDelegatorResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalDelegationByDelegatorResponse) ProtoMessage() {} +func (*QueryTotalDelegationByDelegatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e3d9448e4ed3943f, []int{26} +} +func (m *QueryTotalDelegationByDelegatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalDelegationByDelegatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalDelegationByDelegatorResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalDelegationByDelegatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalDelegationByDelegatorResponse.Merge(m, src) +} +func (m *QueryTotalDelegationByDelegatorResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalDelegationByDelegatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalDelegationByDelegatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalDelegationByDelegatorResponse proto.InternalMessageInfo + +func (m *QueryTotalDelegationByDelegatorResponse) GetSuperfluidDelegationRecords() []SuperfluidDelegationRecord { + if m != nil { + return m.SuperfluidDelegationRecords + } + return nil +} + +func (m *QueryTotalDelegationByDelegatorResponse) GetDelegationResponse() []types2.DelegationResponse { + if m != nil { + return m.DelegationResponse + } + return nil +} + +func (m *QueryTotalDelegationByDelegatorResponse) GetTotalDelegatedCoins() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.TotalDelegatedCoins + } + return nil +} + +func (m *QueryTotalDelegationByDelegatorResponse) GetTotalEquivalentStakedAmount() types.Coin { + if m != nil { + return m.TotalEquivalentStakedAmount + } + return types.Coin{} +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "osmosis.superfluid.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "osmosis.superfluid.QueryParamsResponse") @@ -1262,6 +1379,8 @@ func init() { proto.RegisterType((*SuperfluidDelegationsByValidatorDenomResponse)(nil), "osmosis.superfluid.SuperfluidDelegationsByValidatorDenomResponse") proto.RegisterType((*EstimateSuperfluidDelegatedAmountByValidatorDenomRequest)(nil), "osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomRequest") proto.RegisterType((*EstimateSuperfluidDelegatedAmountByValidatorDenomResponse)(nil), "osmosis.superfluid.EstimateSuperfluidDelegatedAmountByValidatorDenomResponse") + proto.RegisterType((*QueryTotalDelegationByDelegatorRequest)(nil), "osmosis.superfluid.QueryTotalDelegationByDelegatorRequest") + proto.RegisterType((*QueryTotalDelegationByDelegatorResponse)(nil), "osmosis.superfluid.QueryTotalDelegationByDelegatorResponse") } func init() { proto.RegisterFile("osmosis/superfluid/query.proto", fileDescriptor_e3d9448e4ed3943f) } @@ -1408,6 +1527,7 @@ type QueryClient interface { // This is labeled an estimate, because the way it calculates the amount can // lead rounding errors from the true delegated amount EstimateSuperfluidDelegatedAmountByValidatorDenom(ctx context.Context, in *EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, opts ...grpc.CallOption) (*EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error) + TotalDelegationByDelegator(ctx context.Context, in *QueryTotalDelegationByDelegatorRequest, opts ...grpc.CallOption) (*QueryTotalDelegationByDelegatorResponse, error) } type queryClient struct { @@ -1526,6 +1646,15 @@ func (c *queryClient) EstimateSuperfluidDelegatedAmountByValidatorDenom(ctx cont return out, nil } +func (c *queryClient) TotalDelegationByDelegator(ctx context.Context, in *QueryTotalDelegationByDelegatorRequest, opts ...grpc.CallOption) (*QueryTotalDelegationByDelegatorResponse, error) { + out := new(QueryTotalDelegationByDelegatorResponse) + err := c.cc.Invoke(ctx, "/osmosis.superfluid.Query/TotalDelegationByDelegator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params returns the total set of minting parameters. @@ -1556,6 +1685,7 @@ type QueryServer interface { // This is labeled an estimate, because the way it calculates the amount can // lead rounding errors from the true delegated amount EstimateSuperfluidDelegatedAmountByValidatorDenom(context.Context, *EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) (*EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error) + TotalDelegationByDelegator(context.Context, *QueryTotalDelegationByDelegatorRequest) (*QueryTotalDelegationByDelegatorResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1598,6 +1728,9 @@ func (*UnimplementedQueryServer) SuperfluidDelegationsByValidatorDenom(ctx conte func (*UnimplementedQueryServer) EstimateSuperfluidDelegatedAmountByValidatorDenom(ctx context.Context, req *EstimateSuperfluidDelegatedAmountByValidatorDenomRequest) (*EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EstimateSuperfluidDelegatedAmountByValidatorDenom not implemented") } +func (*UnimplementedQueryServer) TotalDelegationByDelegator(ctx context.Context, req *QueryTotalDelegationByDelegatorRequest) (*QueryTotalDelegationByDelegatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalDelegationByDelegator not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1819,6 +1952,24 @@ func _Query_EstimateSuperfluidDelegatedAmountByValidatorDenom_Handler(srv interf return interceptor(ctx, in, info, handler) } +func _Query_TotalDelegationByDelegator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalDelegationByDelegatorRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalDelegationByDelegator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.superfluid.Query/TotalDelegationByDelegator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalDelegationByDelegator(ctx, req.(*QueryTotalDelegationByDelegatorRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.superfluid.Query", HandlerType: (*QueryServer)(nil), @@ -1871,6 +2022,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "EstimateSuperfluidDelegatedAmountByValidatorDenom", Handler: _Query_EstimateSuperfluidDelegatedAmountByValidatorDenom_Handler, }, + { + MethodName: "TotalDelegationByDelegator", + Handler: _Query_TotalDelegationByDelegator_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/superfluid/query.proto", @@ -2789,6 +2944,111 @@ func (m *EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) MarshalToSiz return len(dAtA) - i, nil } +func (m *QueryTotalDelegationByDelegatorRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalDelegationByDelegatorRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalDelegationByDelegatorRequest) 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 *QueryTotalDelegationByDelegatorResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalDelegationByDelegatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalDelegationByDelegatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TotalEquivalentStakedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.TotalDelegatedCoins) > 0 { + for iNdEx := len(m.TotalDelegatedCoins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TotalDelegatedCoins[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.DelegationResponse) > 0 { + for iNdEx := len(m.DelegationResponse) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DelegationResponse[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.SuperfluidDelegationRecords) > 0 { + for iNdEx := len(m.SuperfluidDelegationRecords) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SuperfluidDelegationRecords[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 @@ -3176,6 +3436,48 @@ func (m *EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) Size() (n in return n } +func (m *QueryTotalDelegationByDelegatorRequest) 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 *QueryTotalDelegationByDelegatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SuperfluidDelegationRecords) > 0 { + for _, e := range m.SuperfluidDelegationRecords { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.DelegationResponse) > 0 { + for _, e := range m.DelegationResponse { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.TotalDelegatedCoins) > 0 { + for _, e := range m.TotalDelegatedCoins { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + l = m.TotalEquivalentStakedAmount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5553,6 +5855,273 @@ func (m *EstimateSuperfluidDelegatedAmountByValidatorDenomResponse) Unmarshal(dA } return nil } +func (m *QueryTotalDelegationByDelegatorRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalDelegationByDelegatorRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalDelegationByDelegatorRequest: 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 *QueryTotalDelegationByDelegatorResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalDelegationByDelegatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalDelegationByDelegatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SuperfluidDelegationRecords", 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.SuperfluidDelegationRecords = append(m.SuperfluidDelegationRecords, SuperfluidDelegationRecord{}) + if err := m.SuperfluidDelegationRecords[len(m.SuperfluidDelegationRecords)-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 DelegationResponse", 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.DelegationResponse = append(m.DelegationResponse, types2.DelegationResponse{}) + if err := m.DelegationResponse[len(m.DelegationResponse)-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 TotalDelegatedCoins", 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.TotalDelegatedCoins = append(m.TotalDelegatedCoins, types.Coin{}) + if err := m.TotalDelegatedCoins[len(m.TotalDelegatedCoins)-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 TotalEquivalentStakedAmount", 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.TotalEquivalentStakedAmount.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 diff --git a/x/superfluid/types/query.pb.gw.go b/x/superfluid/types/query.pb.gw.go index fe43324bff8..71178790d6a 100644 --- a/x/superfluid/types/query.pb.gw.go +++ b/x/superfluid/types/query.pb.gw.go @@ -483,6 +483,60 @@ func local_request_Query_EstimateSuperfluidDelegatedAmountByValidatorDenom_0(ctx } +func request_Query_TotalDelegationByDelegator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalDelegationByDelegatorRequest + 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.TotalDelegationByDelegator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalDelegationByDelegator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalDelegationByDelegatorRequest + 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.TotalDelegationByDelegator(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. @@ -765,6 +819,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TotalDelegationByDelegator_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_TotalDelegationByDelegator_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_TotalDelegationByDelegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1046,6 +1123,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TotalDelegationByDelegator_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_TotalDelegationByDelegator_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_TotalDelegationByDelegator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1073,6 +1170,8 @@ var ( pattern_Query_SuperfluidDelegationsByValidatorDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "superfluid", "v1beta1", "superfluid_delegations_by_validator_denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_EstimateSuperfluidDelegatedAmountByValidatorDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "superfluid", "v1beta1", "estimate_superfluid_delegation_amount_by_validator_denom"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalDelegationByDelegator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "superfluid", "v1beta1", "total_delegation_by_delegator", "delegator_address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1099,4 +1198,6 @@ var ( forward_Query_SuperfluidDelegationsByValidatorDenom_0 = runtime.ForwardResponseMessage forward_Query_EstimateSuperfluidDelegatedAmountByValidatorDenom_0 = runtime.ForwardResponseMessage + + forward_Query_TotalDelegationByDelegator_0 = runtime.ForwardResponseMessage )