From ab0893327facecf9d0efc3a0b1b043f4ad705674 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Mon, 20 May 2024 09:58:46 +0800 Subject: [PATCH 01/13] add missed rpc and cli to query usd value and undelegations, add unit test for slash --- proto/exocore/delegation/v1/query.proto | 37 + proto/exocore/operator/v1/query.proto | 57 +- proto/exocore/operator/v1/tx.proto | 61 +- x/assets/keeper/operator_asset.go | 9 +- x/assets/types/query.pb.gw.go | 34 +- x/avs/keeper/avs_test.go | 1 - x/avs/types/query.pb.go | 38 +- x/avs/types/query.pb.gw.go | 7 +- x/avs/types/tx.pb.go | 39 +- x/delegation/client/cli/query.go | 64 ++ x/delegation/keeper/grpc_query.go | 22 + x/delegation/types/query.pb.go | 736 ++++++++++++- x/delegation/types/query.pb.gw.go | 166 +++ x/deposit/types/query.pb.gw.go | 7 +- x/dogfood/types/query.pb.gw.go | 7 +- x/operator/client/cli/query.go | 89 ++ x/operator/keeper/abci.go | 60 +- x/operator/keeper/grpc_query.go | 33 + x/operator/keeper/operator_slash_state.go | 28 +- x/operator/keeper/opt_test.go | 29 +- x/operator/keeper/slash.go | 321 ++---- x/operator/keeper/slash_test.go | 95 ++ x/operator/keeper/usd_value_test.go | 2 +- x/operator/module.go | 4 +- x/operator/types/codec.go | 28 - x/operator/types/errors.go | 4 +- x/operator/types/expected_keepers.go | 2 +- x/operator/types/query.pb.go | 1216 +++++++++++++++++++-- x/operator/types/query.pb.gw.go | 263 ++++- x/operator/types/tx.pb.go | 1148 ++++++++++++++++--- x/reward/types/query.pb.gw.go | 7 +- x/slash/types/query.pb.gw.go | 7 +- 32 files changed, 4013 insertions(+), 608 deletions(-) create mode 100644 x/operator/keeper/slash_test.go diff --git a/proto/exocore/delegation/v1/query.proto b/proto/exocore/delegation/v1/query.proto index 1334c73c5..9fa387f2d 100644 --- a/proto/exocore/delegation/v1/query.proto +++ b/proto/exocore/delegation/v1/query.proto @@ -3,6 +3,7 @@ package exocore.delegation.v1; import "cosmos/query/v1/query.proto"; import "cosmos_proto/cosmos.proto"; +import "exocore/delegation/v1/tx.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -69,6 +70,28 @@ message SingleDelegationInfoReq { string asset_id = 3 [(gogoproto.customname) = "AssetID"]; } +// UndelegationsReq is the request to obtain all delegations +// by staker id and asset id. +message UndelegationsReq { + // staker_id is the staker id. + string staker_id = 1 [(gogoproto.customname) = "StakerID"]; + // asset_id is the asset id. + string asset_id = 2 [(gogoproto.customname) = "AssetID"]; +} + +// UndelegationsReq is the request to obtain all undelegations waiting to be completed +// by height. +message WaitCompleteUndelegationsReq { + // block_height is the block height to query. + uint64 block_height = 1; +} + +// UndelegationRecordList is the response to query undelegations. +message UndelegationRecordList { + // UndelegationRecord is the returned undelegations + repeated UndelegationRecord undelegations = 1; +} + // Query is the service API for the delegation module. service Query { // DelegationInfo queries the delegation information for {stakerID, assetID}. @@ -82,5 +105,19 @@ service Query { option (cosmos.query.v1.module_query_safe) = true; option (google.api.http).get = "/exocore/delegation/v1/QuerySingleDelegationInfo"; } + + // QueryUndelegations queries all undelegations for + // {staker, asset}. + rpc QueryUndelegations(UndelegationsReq) returns (UndelegationRecordList) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegations"; + } + + // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // {height}. + rpc QueryWaitCompleteUndelegations(WaitCompleteUndelegationsReq) returns (UndelegationRecordList) { + option (cosmos.query.v1.module_query_safe) = true; + option (google.api.http).get = "/exocore/delegation/v1/QueryWaitCompleteUndelegations"; + } } diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index e9e53c643..ee59639fc 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -16,6 +16,42 @@ message GetOperatorInfoReq { [(cosmos_proto.scalar) = "cosmos.AddressString"]; } +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +message QueryOperatorUSDValueRequest { + // operator_addr is the operator address,its type should be a sdk.AccAddress + string operator_addr = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs_address is the AVS address opted-in by the operator + string avs_address = 2 + [(gogoproto.customname) = "AVSAddress"]; +} + +// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. +message QueryAVSUSDValueRequest { + // avs_address is the AVS address opted-in by the operator + string avs_address = 1 + [(gogoproto.customname) = "AVSAddress"]; +} + +// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified +// operator and AVS +message QueryOperatorSlashInfoRequest { + // operator_addr is the operator address,its type should be a sdk.AccAddress + string operator_addr = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs_address is the AVS address opted-in by the operator + string avs_address = 2 + [(gogoproto.customname) = "AVSAddress"]; +} + +// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest +message QueryOperatorSlashInfoResponse{ + // AllSlashInfo the key is slashID, the value is the specified slash information + // It's okay to use a map here, because it won't be used to store state, only in + // the response to an RPC call + map all_slash_info = 1; +} + // QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator message QueryOperatorConsKeyRequest { // addr is the ACC address of operator @@ -27,21 +63,36 @@ message QueryOperatorConsKeyRequest { // QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest message QueryOperatorConsKeyResponse { // public_key is the consensus public key of the operator - tendermint.crypto.PublicKey public_key = 1 [ (gogoproto.nullable) = false ]; + tendermint.crypto.PublicKey public_key = 1 [(gogoproto.nullable) = false]; } // Query defines the gRPC querier service. service Query { // OperatorInfo queries the operator information. rpc GetOperatorInfo(GetOperatorInfoReq) returns(OperatorInfo){ - option (google.api.http).get = "/exocore/delegation/v1/GetOperatorInfo"; + option (google.api.http).get = "/exocore/operator/v1/GetOperatorInfo"; } // QueryOperatorConsKeyForChainID queries the consensus public key for the operator rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns (QueryOperatorConsKeyResponse) { option (google.api.http) = { - get: "/exocore/operator_consent/v1/GetOperatorConsKey/{addr}/{chain_id}" + get: "/exocore/operator/v1/GetOperatorConsKey/{addr}/{chain_id}" }; } + + // QueryOperatorUSDValue queries the opted-in USD value for the operator + rpc QueryOperatorUSDValue(QueryOperatorUSDValueRequest) returns(DecValueField){ + option (google.api.http).get = "/exocore/operator/v1/QueryOperatorUSDValue"; + } + + // QueryAVSUSDValue queries the USD value for the AVS + rpc QueryAVSUSDValue(QueryAVSUSDValueRequest) returns(DecValueField){ + option (google.api.http).get = "/exocore/operator/v1/QueryAVSUSDValue"; + } + + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + rpc QueryOperatorSlashInfo(QueryOperatorSlashInfoRequest) returns(QueryOperatorSlashInfoResponse){ + option (google.api.http).get = "/exocore/operator/v1/QueryOperatorSlashInfo"; + } } diff --git a/proto/exocore/operator/v1/tx.proto b/proto/exocore/operator/v1/tx.proto index 3a950cc16..0257be234 100644 --- a/proto/exocore/operator/v1/tx.proto +++ b/proto/exocore/operator/v1/tx.proto @@ -92,6 +92,55 @@ enum SlashType { SLASH_TYPE_NO_INSTANTANEOUS_SLASH = 2; } +// SlashFromUndelegation records the slash detail from the undelegation +message SlashFromUndelegation { + // staker_id is the staker id. + string staker_id = 1 [(gogoproto.customname) = "StakerID"]; + // asset_id is the asset id. + string asset_id = 2 [(gogoproto.customname) = "AssetID"]; + // amount is the slashed amount from the undelegation. + string amount = 3 + [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} +// SlashFromAssetsPool records the slash detail from the operator assets pool +message SlashFromAssetsPool { + string asset_id = 1 [(gogoproto.customname) = "AssetID"]; + // amount is the slashed amount from the assets pool. + string amount = 2 + [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + + +// SlashAssetsInfo is the slashed assets information +message SlashExecutionInfo { + // slash_proportion is the new calculated proportion when execute the slash + string slash_proportion = 1 + [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // slash_value is the usd value of all slashed assets + string slash_value = 2 + [ + (cosmos_proto.scalar) = "cosmos.Dec", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // SlashUndelegations records all slash info related to the undelegation + repeated SlashFromUndelegation slash_undelegations = 3; + // SlashFromAssetsPool records all slash info related to the assets pool + repeated SlashFromAssetsPool slash_assets_pool = 4; +} + // OperatorSlashInfo is the slash info of operator message OperatorSlashInfo { // slash_contract is the address of slash contract @@ -100,19 +149,19 @@ message OperatorSlashInfo { int64 submitted_height = 2; // event_height is the exocore block height at which the slash event occurs int64 event_height = 3; - // processed_height is the exocore block height at which the slash event is processed - int64 processed_height = 4; // is_vetoed is a flag to indicate if this slash is vetoed - bool is_vetoed = 5; + bool is_vetoed = 4; // slash_proportion is the proportion of assets that need to be slashed - string slash_proportion = 6 + string slash_proportion = 5 [ (cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; - // type indicates the slash type. - SlashType slash_type = 7; + // slash_type indicates the slash type of specified AVS. + uint32 slash_type = 6; + // SlashExecutionInfo stores the slashed execution information + SlashExecutionInfo execution_info = 7; } // RegisterOperatorReq is the request to register a new operator. diff --git a/x/assets/keeper/operator_asset.go b/x/assets/keeper/operator_asset.go index 64bfff253..b1a6b798b 100644 --- a/x/assets/keeper/operator_asset.go +++ b/x/assets/keeper/operator_asset.go @@ -16,7 +16,7 @@ func (k Keeper) GetOperatorAssetInfos(ctx sdk.Context, operatorAddr sdk.Address, ret[assetID] = state return nil } - err = k.IteratorAssetsForOperator(ctx, operatorAddr.String(), assetsFilter, opFunc) + err = k.IteratorAssetsForOperator(ctx, false, operatorAddr.String(), assetsFilter, opFunc) if err != nil { return nil, err } @@ -96,7 +96,7 @@ func (k Keeper) UpdateOperatorAssetState(ctx sdk.Context, operatorAddr sdk.Addre // IteratorAssetsForOperator iterates all assets for the specified operator // if `assetsFilter` is nil, the `opFunc` will handle all assets, it equals to an iterator without filter // if `assetsFilter` isn't nil, the `opFunc` will only handle the assets that is in the filter map. -func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, operator string, assetsFilter map[string]interface{}, opFunc func(assetID string, state *assetstype.OperatorAssetInfo) error) error { +func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, isUpdate bool, operator string, assetsFilter map[string]interface{}, opFunc func(assetID string, state *assetstype.OperatorAssetInfo) error) error { store := prefix.NewStore(ctx.KVStore(k.storeKey), assetstype.KeyPrefixOperatorAssetInfos) iterator := sdk.KVStorePrefixIterator(store, []byte(operator)) defer iterator.Close() @@ -116,6 +116,11 @@ func (k Keeper) IteratorAssetsForOperator(ctx sdk.Context, operator string, asse if err != nil { return err } + if isUpdate { + // store the updated state + bz := k.cdc.MustMarshal(&amounts) + store.Set(iterator.Key(), bz) + } } return nil } diff --git a/x/assets/types/query.pb.gw.go b/x/assets/types/query.pb.gw.go index 507e99040..4bc526699 100644 --- a/x/assets/types/query.pb.gw.go +++ b/x/assets/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ 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 @@ -358,12 +360,14 @@ func local_request_Query_QueStakerExoCoreAddr_0(ctx context.Context, marshaler r // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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 { @@ -371,6 +375,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) @@ -384,6 +389,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueClientChainInfoByIndex_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 { @@ -391,6 +398,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueClientChainInfoByIndex_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) @@ -404,6 +412,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueAllClientChainInfo_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 { @@ -411,6 +421,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueAllClientChainInfo_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) @@ -424,6 +435,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueStakingAssetInfo_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 { @@ -431,6 +444,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueStakingAssetInfo_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) @@ -444,6 +458,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueAllStakingAssetsInfo_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 { @@ -451,6 +467,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueAllStakingAssetsInfo_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) @@ -464,6 +481,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueStakerAssetInfos_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 { @@ -471,6 +490,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueStakerAssetInfos_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) @@ -484,6 +504,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueStakerSpecifiedAssetAmount_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 { @@ -491,6 +513,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueStakerSpecifiedAssetAmount_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) @@ -504,6 +527,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueOperatorAssetInfos_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 { @@ -511,6 +536,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueOperatorAssetInfos_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) @@ -524,6 +550,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueOperatorSpecifiedAssetAmount_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 { @@ -531,6 +559,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueOperatorSpecifiedAssetAmount_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) @@ -544,6 +573,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueStakerExoCoreAddr_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 { @@ -551,6 +582,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueStakerExoCoreAddr_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) diff --git a/x/avs/keeper/avs_test.go b/x/avs/keeper/avs_test.go index 59d0479c3..e73f22c27 100644 --- a/x/avs/keeper/avs_test.go +++ b/x/avs/keeper/avs_test.go @@ -9,5 +9,4 @@ func (suite *AVSTestSuite) TestAVS() { suite.NoError(err) suite.Equal(avsAddres, info.GetInfo().AvsAddress) - } diff --git a/x/avs/types/query.pb.go b/x/avs/types/query.pb.go index 7a23a3394..b7ee18426 100644 --- a/x/avs/types/query.pb.go +++ b/x/avs/types/query.pb.go @@ -29,7 +29,9 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryAVSInfoReq is the request to query avs related information type QueryAVSInfoReq struct { + // avs_address is the address of avs AVSAddres string `protobuf:"bytes,1,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` } @@ -73,7 +75,9 @@ func (m *QueryAVSInfoReq) GetAVSAddres() string { return "" } +// QueryAVSInfoResponse is the response of avs related information type QueryAVSInfoResponse struct { + // basic information of avs Info *AVSInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` } @@ -128,23 +132,23 @@ var fileDescriptor_d9df5f5965203ddc = []byte{ // 303 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x2c, 0x2b, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, - 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x4a, 0xe8, 0x25, 0x96, 0x15, 0x4b, 0x89, 0xa4, 0xe7, 0xa7, - 0xe7, 0x83, 0xc5, 0xf5, 0x41, 0x2c, 0x88, 0x12, 0x29, 0x99, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54, - 0xfd, 0xc4, 0x82, 0x4c, 0xfd, 0xc4, 0xbc, 0xbc, 0xfc, 0x92, 0xc4, 0x92, 0xcc, 0xfc, 0xbc, 0x62, - 0xa8, 0xac, 0x08, 0xb2, 0xc9, 0x25, 0x15, 0x10, 0x51, 0x25, 0x47, 0x2e, 0xfe, 0x40, 0x90, 0x2d, - 0x8e, 0x61, 0xc1, 0x9e, 0x79, 0x69, 0xf9, 0x41, 0xa9, 0x85, 0x42, 0x7a, 0x5c, 0xdc, 0x89, 0x65, - 0xc5, 0xf1, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, - 0xbc, 0x8f, 0xee, 0xc9, 0x73, 0x3a, 0x86, 0x05, 0x3b, 0x82, 0x45, 0x83, 0xb8, 0x12, 0xcb, 0x8a, - 0x21, 0xcc, 0x62, 0x25, 0x07, 0x2e, 0x11, 0x54, 0x23, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, - 0x34, 0xb8, 0x58, 0x32, 0xf3, 0xd2, 0xf2, 0xc1, 0x06, 0x70, 0x1b, 0x89, 0xe8, 0x21, 0x79, 0x40, - 0x0f, 0xa6, 0x16, 0xac, 0xc2, 0xa8, 0x9b, 0x91, 0x8b, 0x15, 0x6c, 0x84, 0x50, 0x23, 0x23, 0x17, - 0x0f, 0xb2, 0x61, 0x42, 0x32, 0x28, 0xda, 0xd0, 0x9c, 0x2a, 0xa5, 0x88, 0x47, 0x16, 0xe2, 0x0a, - 0x25, 0x83, 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x69, 0x09, 0x69, 0xe8, 0xbb, 0x42, 0x94, 0xfa, 0xa5, - 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0x23, 0x07, 0x07, 0xb2, 0x4e, 0x27, 0xf7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0x4b, 0x04, 0xd5, 0x88, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, + 0x0d, 0x2e, 0x96, 0xcc, 0xbc, 0xb4, 0x7c, 0xb0, 0x01, 0xdc, 0x46, 0x22, 0x7a, 0x48, 0x1e, 0xd0, + 0x83, 0xa9, 0x05, 0xab, 0x30, 0xea, 0x66, 0xe4, 0x62, 0x05, 0x1b, 0x21, 0xd4, 0xc8, 0xc8, 0xc5, + 0x83, 0x6c, 0x98, 0x90, 0x0c, 0x8a, 0x36, 0x34, 0xa7, 0x4a, 0x29, 0xe2, 0x91, 0x85, 0xb8, 0x42, + 0xc9, 0xa0, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0x5a, 0x42, 0x1a, 0xfa, 0xae, 0x10, 0xa5, 0x7e, 0xa9, + 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0xc8, 0x41, 0x88, 0xac, 0xd3, 0xc9, 0xfd, 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, 0x74, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, + 0xf3, 0x73, 0x71, 0x99, 0x56, 0x01, 0x89, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x10, + 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x89, 0x99, 0x19, 0x87, 0xd4, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/avs/types/query.pb.gw.go b/x/avs/types/query.pb.gw.go index b2855b174..0bbcae265 100644 --- a/x/avs/types/query.pb.gw.go +++ b/x/avs/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join var ( filter_Query_QueryAVSInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -70,12 +72,14 @@ func local_request_Query_QueryAVSInfo_0(ctx context.Context, marshaler runtime.M // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_QueryAVSInfo_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 { @@ -83,6 +87,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueryAVSInfo_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) diff --git a/x/avs/types/tx.pb.go b/x/avs/types/tx.pb.go index 1c62e02c4..ecf1d43ab 100644 --- a/x/avs/types/tx.pb.go +++ b/x/avs/types/tx.pb.go @@ -29,11 +29,16 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// AVSinfo represent the information of avs type AVSInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` + // name of avs + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // address of avs + AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` + // registered operator of avs OperatorAddress []string `protobuf:"bytes,3,rep,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` - AvsOwnerAddress string `protobuf:"bytes,4,opt,name=avs_owner_address,json=avsOwnerAddress,proto3" json:"avs_owner_address,omitempty"` + // the owner who has permission for avs + AvsOwnerAddress string `protobuf:"bytes,4,opt,name=avs_owner_address,json=avsOwnerAddress,proto3" json:"avs_owner_address,omitempty"` // asset_basic_info is all the basic asset information of the avs. AssetId []string `protobuf:"bytes,5,rep,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` } @@ -106,9 +111,12 @@ func (m *AVSInfo) GetAssetId() []string { return nil } +// RegisterAVSReq is requst to register avs type RegisterAVSReq struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // from_address is the source + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs information + Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } func (m *RegisterAVSReq) Reset() { *m = RegisterAVSReq{} } @@ -158,9 +166,12 @@ func (m *RegisterAVSReq) GetInfo() *AVSInfo { return nil } +// RegisterAVSResponse is the response for register avs type RegisterAVSResponse struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // from_address is the source + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs information + Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } func (m *RegisterAVSResponse) Reset() { *m = RegisterAVSResponse{} } @@ -210,9 +221,12 @@ func (m *RegisterAVSResponse) GetInfo() *AVSInfo { return nil } +// DeRegisterAVSReq is requst to deregister avs type DeRegisterAVSReq struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // from_address is the source address + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs information + Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } func (m *DeRegisterAVSReq) Reset() { *m = DeRegisterAVSReq{} } @@ -262,9 +276,12 @@ func (m *DeRegisterAVSReq) GetInfo() *AVSInfo { return nil } +// DeRegisterAVSResponse is requst to register avs type DeRegisterAVSResponse struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` + // from_address is the source address + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs information + Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } func (m *DeRegisterAVSResponse) Reset() { *m = DeRegisterAVSResponse{} } diff --git a/x/delegation/client/cli/query.go b/x/delegation/client/cli/query.go index 8bece122d..db5b24ccd 100644 --- a/x/delegation/client/cli/query.go +++ b/x/delegation/client/cli/query.go @@ -26,6 +26,8 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( QuerySingleDelegationInfo(), QueryDelegationInfo(), + QueryUndelegations(), + QueryWaitCompleteUndelegations(), ) return cmd } @@ -95,3 +97,65 @@ func QueryDelegationInfo() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// QueryUndelegations queries all undelegations for staker and asset +func QueryUndelegations() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryUndelegations stakerID assetID", + Short: "Get undelegations", + Long: "Get undelegations", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := delegationtype.NewQueryClient(clientCtx) + req := &delegationtype.UndelegationsReq{ + StakerID: args[0], + AssetID: args[1], + } + res, err := queryClient.QueryUndelegations(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by height +func QueryWaitCompleteUndelegations() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryWaitCompleteUndelegations height", + Short: "Get undelegations waiting to be completed", + Long: "Get undelegations waiting to be completed", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + height, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + queryClient := delegationtype.NewQueryClient(clientCtx) + req := &delegationtype.WaitCompleteUndelegationsReq{ + BlockHeight: height, + } + res, err := queryClient.QueryWaitCompleteUndelegations(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/delegation/keeper/grpc_query.go b/x/delegation/keeper/grpc_query.go index 990479874..e3758411d 100644 --- a/x/delegation/keeper/grpc_query.go +++ b/x/delegation/keeper/grpc_query.go @@ -18,3 +18,25 @@ func (k *Keeper) QueryDelegationInfo(ctx context.Context, info *delegationtype.D c := sdk.UnwrapSDKContext(ctx) return k.GetDelegationInfo(c, info.StakerID, info.AssetID) } + +func (k *Keeper) QueryUndelegations(ctx context.Context, req *delegationtype.UndelegationsReq) (*delegationtype.UndelegationRecordList, error) { + c := sdk.UnwrapSDKContext(ctx) + undelegations, err := k.GetStakerUndelegationRecords(c, req.StakerID, req.AssetID) + if err != nil { + return nil, err + } + return &delegationtype.UndelegationRecordList{ + Undelegations: undelegations, + }, nil +} + +func (k *Keeper) QueryWaitCompleteUndelegations(ctx context.Context, req *delegationtype.WaitCompleteUndelegationsReq) (*delegationtype.UndelegationRecordList, error) { + c := sdk.UnwrapSDKContext(ctx) + undelegations, err := k.GetWaitCompleteUndelegationRecords(c, req.BlockHeight) + if err != nil { + return nil, err + } + return &delegationtype.UndelegationRecordList{ + Undelegations: undelegations, + }, nil +} diff --git a/x/delegation/types/query.pb.go b/x/delegation/types/query.pb.go index 9162decc3..c163893be 100644 --- a/x/delegation/types/query.pb.go +++ b/x/delegation/types/query.pb.go @@ -296,6 +296,155 @@ func (m *SingleDelegationInfoReq) GetAssetID() string { return "" } +// UndelegationsReq is the request to obtain all delegations +// by staker id and asset id. +type UndelegationsReq struct { + // staker_id is the staker id. + StakerID string `protobuf:"bytes,1,opt,name=staker_id,json=stakerId,proto3" json:"staker_id,omitempty"` + // asset_id is the asset id. + AssetID string `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` +} + +func (m *UndelegationsReq) Reset() { *m = UndelegationsReq{} } +func (m *UndelegationsReq) String() string { return proto.CompactTextString(m) } +func (*UndelegationsReq) ProtoMessage() {} +func (*UndelegationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{5} +} +func (m *UndelegationsReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationsReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationsReq.Merge(m, src) +} +func (m *UndelegationsReq) XXX_Size() int { + return m.Size() +} +func (m *UndelegationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationsReq proto.InternalMessageInfo + +func (m *UndelegationsReq) GetStakerID() string { + if m != nil { + return m.StakerID + } + return "" +} + +func (m *UndelegationsReq) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// UndelegationsReq is the request to obtain all undelegations waiting to be completed +// by height. +type WaitCompleteUndelegationsReq struct { + // block_height is the block height to query. + BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` +} + +func (m *WaitCompleteUndelegationsReq) Reset() { *m = WaitCompleteUndelegationsReq{} } +func (m *WaitCompleteUndelegationsReq) String() string { return proto.CompactTextString(m) } +func (*WaitCompleteUndelegationsReq) ProtoMessage() {} +func (*WaitCompleteUndelegationsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{6} +} +func (m *WaitCompleteUndelegationsReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WaitCompleteUndelegationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WaitCompleteUndelegationsReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WaitCompleteUndelegationsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_WaitCompleteUndelegationsReq.Merge(m, src) +} +func (m *WaitCompleteUndelegationsReq) XXX_Size() int { + return m.Size() +} +func (m *WaitCompleteUndelegationsReq) XXX_DiscardUnknown() { + xxx_messageInfo_WaitCompleteUndelegationsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_WaitCompleteUndelegationsReq proto.InternalMessageInfo + +func (m *WaitCompleteUndelegationsReq) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + +// UndelegationRecordList is the response to query undelegations. +type UndelegationRecordList struct { + // UndelegationRecord is the returned undelegations + Undelegations []*UndelegationRecord `protobuf:"bytes,1,rep,name=undelegations,proto3" json:"undelegations,omitempty"` +} + +func (m *UndelegationRecordList) Reset() { *m = UndelegationRecordList{} } +func (m *UndelegationRecordList) String() string { return proto.CompactTextString(m) } +func (*UndelegationRecordList) ProtoMessage() {} +func (*UndelegationRecordList) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{7} +} +func (m *UndelegationRecordList) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationRecordList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationRecordList.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationRecordList) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationRecordList.Merge(m, src) +} +func (m *UndelegationRecordList) XXX_Size() int { + return m.Size() +} +func (m *UndelegationRecordList) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationRecordList.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationRecordList proto.InternalMessageInfo + +func (m *UndelegationRecordList) GetUndelegations() []*UndelegationRecord { + if m != nil { + return m.Undelegations + } + return nil +} + func init() { proto.RegisterType((*DelegationInfoReq)(nil), "exocore.delegation.v1.DelegationInfoReq") proto.RegisterType((*StakerList)(nil), "exocore.delegation.v1.StakerList") @@ -303,52 +452,64 @@ func init() { proto.RegisterType((*QueryDelegationInfoResponse)(nil), "exocore.delegation.v1.QueryDelegationInfoResponse") proto.RegisterMapType((map[string]*DelegationAmounts)(nil), "exocore.delegation.v1.QueryDelegationInfoResponse.DelegationInfosEntry") proto.RegisterType((*SingleDelegationInfoReq)(nil), "exocore.delegation.v1.SingleDelegationInfoReq") + proto.RegisterType((*UndelegationsReq)(nil), "exocore.delegation.v1.UndelegationsReq") + proto.RegisterType((*WaitCompleteUndelegationsReq)(nil), "exocore.delegation.v1.WaitCompleteUndelegationsReq") + proto.RegisterType((*UndelegationRecordList)(nil), "exocore.delegation.v1.UndelegationRecordList") } func init() { proto.RegisterFile("exocore/delegation/v1/query.proto", fileDescriptor_aab345e1cf20490c) } var fileDescriptor_aab345e1cf20490c = []byte{ - // 637 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x4f, 0x13, 0x41, - 0x1c, 0xed, 0x94, 0x20, 0x30, 0x60, 0xc4, 0x01, 0xb5, 0x14, 0xd3, 0xe2, 0x1e, 0x48, 0x25, 0x61, - 0x57, 0xaa, 0x26, 0xc6, 0x88, 0x09, 0xa4, 0x84, 0x6c, 0x62, 0x48, 0xdc, 0xc6, 0x8b, 0x97, 0xcd, - 0xd0, 0x1d, 0x96, 0x4d, 0xb7, 0x33, 0x65, 0x66, 0x5a, 0xe8, 0xd5, 0x93, 0x47, 0x13, 0xbf, 0x85, - 0x5e, 0x3c, 0xf0, 0x21, 0x38, 0x12, 0xbc, 0x18, 0x0f, 0x8d, 0x29, 0x26, 0x1e, 0xfc, 0x06, 0x5e, - 0x34, 0xbb, 0x33, 0xc0, 0xb6, 0x76, 0x55, 0xe2, 0x69, 0x77, 0x7e, 0x7f, 0xde, 0xef, 0xcd, 0x7b, - 0xbf, 0x5d, 0x78, 0x87, 0x1c, 0xb0, 0x1a, 0xe3, 0xc4, 0xf2, 0x48, 0x48, 0x7c, 0x2c, 0x03, 0x46, - 0xad, 0xf6, 0x8a, 0xb5, 0xd7, 0x22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42, 0x54, 0x25, 0x0f, 0xa8, 0xef, 0x4c, 0x9d, 0x95, 0x47, 0xe1, 0xbe, 0xa5, - 0x1e, 0x49, 0x5f, 0xea, 0xf2, 0xf7, 0x2c, 0x1c, 0x8d, 0x15, 0x46, 0xef, 0x00, 0x9c, 0x19, 0xa2, - 0x35, 0xfa, 0xbb, 0x08, 0xfa, 0x76, 0xf9, 0xf2, 0xe5, 0x1d, 0x34, 0x1e, 0xbe, 0xfe, 0xf6, 0x61, - 0x09, 0xbc, 0xfa, 0xf8, 0xf5, 0x6d, 0x76, 0x09, 0x95, 0xac, 0xe1, 0x3f, 0x9c, 0x4d, 0x22, 0x07, - 0x48, 0x1d, 0x02, 0x38, 0x17, 0xc3, 0x0e, 0x53, 0x1a, 0x99, 0x29, 0x44, 0x52, 0x6c, 0xc9, 0xff, - 0xb3, 0xcf, 0xc6, 0xea, 0x05, 0xdd, 0x32, 0xba, 0x97, 0x42, 0x37, 0x95, 0xd8, 0xfa, 0xd6, 0x51, - 0xaf, 0x00, 0x8e, 0x7b, 0x05, 0xf0, 0xa5, 0x57, 0x00, 0x6f, 0x4e, 0x0b, 0x99, 0xe3, 0xd3, 0x42, - 0xe6, 0xd3, 0x69, 0x21, 0xf3, 0xf2, 0x41, 0xe2, 0x2b, 0xdc, 0x50, 0xa8, 0x5b, 0x44, 0xee, 0x33, - 0x5e, 0x3f, 0x1f, 0x72, 0x90, 0x1c, 0x13, 0x7f, 0x97, 0xdb, 0x57, 0xe2, 0x3f, 0xe0, 0xfd, 0x5f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x10, 0x6e, 0xc3, 0x42, 0xa9, 0x05, 0x00, 0x00, + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x4f, 0x13, 0x4d, + 0x1c, 0xee, 0xc0, 0xcb, 0x0b, 0x4c, 0x21, 0x2f, 0xef, 0xc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+ 0xcb, 0x88, 0x81, 0x79, 0x90, 0x1c, 0xdd, 0x18, 0x6b, 0xb7, 0x12, 0x23, 0x79, 0x1e, 0xcc, 0x65, + 0xb5, 0x11, 0x3f, 0x9d, 0x33, 0xd0, 0x22, 0x1c, 0xd1, 0x29, 0xc5, 0xcc, 0xab, 0x1c, 0xe0, 0x95, + 0xd1, 0x76, 0x2b, 0x31, 0x9c, 0xf1, 0x62, 0xb9, 0xac, 0x36, 0xcc, 0x93, 0x39, 0x43, 0x5e, 0x84, + 0xd0, 0xef, 0x7e, 0x64, 0x51, 0x86, 0x62, 0x70, 0xd8, 0x47, 0xa0, 0x31, 0x30, 0x3f, 0x98, 0x1c, + 0xd5, 0x4e, 0x97, 0xf2, 0x77, 0x10, 0x24, 0x94, 0xa9, 0x92, 0xba, 0xc3, 0x28, 0xaa, 0xc2, 0xc9, + 0xba, 0x23, 0x76, 0xad, 0x17, 0x6d, 0x5c, 0xa0, 0x65, 0xdd, 0xc5, 0x82, 0xda, 0xbd, 0xc3, 0x56, + 0x22, 0xf2, 0xa9, 0x95, 0x58, 0x34, 0x2d, 0x56, 0xae, 0x17, 0x95, 0x12, 0xa9, 0x8a, 0x73, 0x13, + 0x3f, 0x29, 0x6a, 0x54, 0x54, 0xd6, 0xac, 0x61, 0xaa, 0x64, 0x71, 0xe9, 0xf8, 0x20, 0x05, 0xc5, + 0xb1, 0x66, 0x71, 0x49, 0x43, 0x5d, 0xc0, 0x79, 0x0f, 0x17, 0x35, 0x60, 0x6c, 0x4f, 0xb7, 0x58, + 0xe1, 0x2c, 0x65, 0x11, 0xa7, 0xa0, 0x73, 0x2e, 0x62, 0x93, 0x57, 0x99, 0x99, 0x73, 0x58, 0x60, + 0x66, 0xce, 0x61, 0xda, 0xb4, 0x87, 0xfe, 0x34, 0x00, 0xee, 0xef, 0x53, 0xfe, 0x01, 0xe0, 0xec, + 0x13, 0xcf, 0x0b, 0xe7, 0x25, 0xa1, 0x35, 0xe2, 0x50, 0x8c, 0x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, 0x1e, 0x8a, 0x7f, 0xf3, 0x87, 0x78, 0xf5, 0x67, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x6e, 0xb7, 0xe8, 0x4f, 0x50, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -368,6 +529,12 @@ type QueryClient interface { // SingleDelegationInfo queries the single delegation information for // {chain, staker, asset, operator}. QuerySingleDelegationInfo(ctx context.Context, in *SingleDelegationInfoReq, opts ...grpc.CallOption) (*DelegationAmounts, error) + // QueryUndelegations queries all undelegations for + // {staker, asset}. + QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) + // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // {height}. + QueryWaitCompleteUndelegations(ctx context.Context, in *WaitCompleteUndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) } type queryClient struct { @@ -396,6 +563,24 @@ func (c *queryClient) QuerySingleDelegationInfo(ctx context.Context, in *SingleD return out, nil } +func (c *queryClient) QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { + out := new(UndelegationRecordList) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryWaitCompleteUndelegations(ctx context.Context, in *WaitCompleteUndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { + out := new(UndelegationRecordList) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryWaitCompleteUndelegations", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // DelegationInfo queries the delegation information for {stakerID, assetID}. @@ -403,6 +588,12 @@ type QueryServer interface { // SingleDelegationInfo queries the single delegation information for // {chain, staker, asset, operator}. QuerySingleDelegationInfo(context.Context, *SingleDelegationInfoReq) (*DelegationAmounts, error) + // QueryUndelegations queries all undelegations for + // {staker, asset}. + QueryUndelegations(context.Context, *UndelegationsReq) (*UndelegationRecordList, error) + // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // {height}. + QueryWaitCompleteUndelegations(context.Context, *WaitCompleteUndelegationsReq) (*UndelegationRecordList, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -415,6 +606,12 @@ func (*UnimplementedQueryServer) QueryDelegationInfo(ctx context.Context, req *D func (*UnimplementedQueryServer) QuerySingleDelegationInfo(ctx context.Context, req *SingleDelegationInfoReq) (*DelegationAmounts, error) { return nil, status.Errorf(codes.Unimplemented, "method QuerySingleDelegationInfo not implemented") } +func (*UnimplementedQueryServer) QueryUndelegations(ctx context.Context, req *UndelegationsReq) (*UndelegationRecordList, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegations not implemented") +} +func (*UnimplementedQueryServer) QueryWaitCompleteUndelegations(ctx context.Context, req *WaitCompleteUndelegationsReq) (*UndelegationRecordList, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryWaitCompleteUndelegations not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -456,6 +653,42 @@ func _Query_QuerySingleDelegationInfo_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_QueryUndelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndelegationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryUndelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.delegation.v1.Query/QueryUndelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryUndelegations(ctx, req.(*UndelegationsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryWaitCompleteUndelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WaitCompleteUndelegationsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryWaitCompleteUndelegations(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.delegation.v1.Query/QueryWaitCompleteUndelegations", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryWaitCompleteUndelegations(ctx, req.(*WaitCompleteUndelegationsReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.delegation.v1.Query", HandlerType: (*QueryServer)(nil), @@ -468,6 +701,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QuerySingleDelegationInfo", Handler: _Query_QuerySingleDelegationInfo_Handler, }, + { + MethodName: "QueryUndelegations", + Handler: _Query_QueryUndelegations_Handler, + }, + { + MethodName: "QueryWaitCompleteUndelegations", + Handler: _Query_QueryWaitCompleteUndelegations_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/delegation/v1/query.proto", @@ -678,6 +919,108 @@ func (m *SingleDelegationInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *UndelegationsReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationsReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0x12 + } + if len(m.StakerID) > 0 { + i -= len(m.StakerID) + copy(dAtA[i:], m.StakerID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.StakerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WaitCompleteUndelegationsReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WaitCompleteUndelegationsReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WaitCompleteUndelegationsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *UndelegationRecordList) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationRecordList) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationRecordList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Undelegations) > 0 { + for iNdEx := len(m.Undelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Undelegations[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 @@ -777,6 +1120,50 @@ func (m *SingleDelegationInfoReq) Size() (n int) { return n } +func (m *UndelegationsReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.StakerID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *WaitCompleteUndelegationsReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + return n +} + +func (m *UndelegationRecordList) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Undelegations) > 0 { + for _, e := range m.Undelegations { + 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 } @@ -1422,6 +1809,273 @@ func (m *SingleDelegationInfoReq) Unmarshal(dAtA []byte) error { } return nil } +func (m *UndelegationsReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationsReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationsReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StakerID", 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.StakerID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", 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.AssetID = 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 *WaitCompleteUndelegationsReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WaitCompleteUndelegationsReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WaitCompleteUndelegationsReq: 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 |= 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 *UndelegationRecordList) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationRecordList: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationRecordList: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Undelegations", 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.Undelegations = append(m.Undelegations, &UndelegationRecord{}) + if err := m.Undelegations[len(m.Undelegations)-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 diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go index cbf25a404..629be28c6 100644 --- a/x/delegation/types/query.pb.gw.go +++ b/x/delegation/types/query.pb.gw.go @@ -105,6 +105,78 @@ func local_request_Query_QuerySingleDelegationInfo_0(ctx context.Context, marsha } +var ( + filter_Query_QueryUndelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsReq + 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_QueryUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryUndelegations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsReq + 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_QueryUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryUndelegations(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryWaitCompleteUndelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryWaitCompleteUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WaitCompleteUndelegationsReq + 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_QueryWaitCompleteUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryWaitCompleteUndelegations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryWaitCompleteUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq WaitCompleteUndelegationsReq + 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_QueryWaitCompleteUndelegations_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryWaitCompleteUndelegations(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. @@ -157,6 +229,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryUndelegations_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_QueryUndelegations_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_QueryUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryWaitCompleteUndelegations_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_QueryWaitCompleteUndelegations_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_QueryWaitCompleteUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -238,6 +356,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryUndelegations_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_QueryUndelegations_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_QueryUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryWaitCompleteUndelegations_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_QueryWaitCompleteUndelegations_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_QueryWaitCompleteUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -245,10 +403,18 @@ var ( pattern_Query_QueryDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "GetDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QuerySingleDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QuerySingleDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryWaitCompleteUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryWaitCompleteUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_QueryDelegationInfo_0 = runtime.ForwardResponseMessage forward_Query_QuerySingleDelegationInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryUndelegations_0 = runtime.ForwardResponseMessage + + forward_Query_QueryWaitCompleteUndelegations_0 = runtime.ForwardResponseMessage ) diff --git a/x/deposit/types/query.pb.gw.go b/x/deposit/types/query.pb.gw.go index 2c727832e..4e143091e 100644 --- a/x/deposit/types/query.pb.gw.go +++ b/x/deposit/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ 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 @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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 { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) diff --git a/x/dogfood/types/query.pb.gw.go b/x/dogfood/types/query.pb.gw.go index cbec494da..f078ad093 100644 --- a/x/dogfood/types/query.pb.gw.go +++ b/x/dogfood/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ 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 @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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 { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index 6f41f7055..4d93324ed 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -22,6 +22,9 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetOperatorInfo(), + QueryOperatorUSDValue(), + QueryAVSUSDValue(), + QueryOperatorSlashInfo(), ) return cmd } @@ -54,3 +57,89 @@ func GetOperatorInfo() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// QueryOperatorUSDValue queries the opted-in USD value for the operator +func QueryOperatorUSDValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryOperatorUSDValue operatorAddr avsAddr", + Short: "Get the opted-in USD value for the operator", + Long: "Get the opted-in USD value for the operator", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryOperatorUSDValueRequest{ + OperatorAddr: args[0], + AVSAddress: args[1], + } + res, err := queryClient.QueryOperatorUSDValue(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryAVSUSDValue queries the USD value for the avs +func QueryAVSUSDValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryAVSUSDValue avsAddr", + Short: "Get the USD value for the avs", + Long: "Get the USD value for the avs", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryAVSUSDValueRequest{ + AVSAddress: args[0], + } + res, err := queryClient.QueryAVSUSDValue(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// QueryOperatorSlashInfo queries the slash information for the specified operator and AVS +func QueryOperatorSlashInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "QueryOperatorUSDValue operatorAddr avsAddr", + Short: "Get the the slash information for the operator", + Long: "Get the the slash information for the operator", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := operatortypes.NewQueryClient(clientCtx) + req := &operatortypes.QueryOperatorSlashInfoRequest{ + OperatorAddr: args[0], + AVSAddress: args[1], + } + res, err := queryClient.QueryOperatorSlashInfo(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index 8b399709e..24cd60adc 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -9,35 +9,61 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type OperatorUSDValue struct { + Staking sdkmath.LegacyDec + SelfStaking sdkmath.LegacyDec + StakingAndWaitUnbonding sdkmath.LegacyDec +} + // CalculateUSDValueForOperator calculates the total and self usd value for the // operator according to the input assets filter and prices. func (k *Keeper) CalculateUSDValueForOperator( ctx sdk.Context, + isForSlash bool, operator string, assetsFilter map[string]interface{}, decimals map[string]uint32, prices map[string]operatortypes.Price, -) (sdkmath.LegacyDec, sdkmath.LegacyDec, error) { - usdValue := sdkmath.LegacyNewDec(0) - selfUSDValue := sdkmath.LegacyNewDec(0) +) (OperatorUSDValue, error) { + var err error + ret := OperatorUSDValue{ + Staking: sdkmath.LegacyNewDec(0), + SelfStaking: sdkmath.LegacyNewDec(0), + StakingAndWaitUnbonding: sdkmath.LegacyNewDec(0), + } // iterate all assets owned by the operator to calculate its voting power opFuncToIterateAssets := func(assetID string, state *assetstypes.OperatorAssetInfo) error { - price := prices[assetID] - decimal := decimals[assetID] - usdValue = usdValue.Add(CalculateUSDValue(state.TotalAmount, price.Value, decimal, price.Decimal)) - // calculate the token amount from the share for the operator - selfAmount, err := delegationkeeper.TokensFromShares(state.OperatorShare, state.TotalShare, state.TotalAmount) - if err != nil { - return err + var price operatortypes.Price + var decimal uint32 + if isForSlash { + price, err = k.oracleKeeper.GetSpecifiedAssetsPrice(ctx, assetID) + if err != nil { + return err + } + assetInfo, err := k.assetsKeeper.GetStakingAssetInfo(ctx, assetID) + if err != nil { + return err + } + decimal = assetInfo.AssetBasicInfo.Decimals + ret.StakingAndWaitUnbonding = ret.StakingAndWaitUnbonding.Add(CalculateUSDValue(state.TotalAmount.Add(state.WaitUnbondingAmount), price.Value, decimal, price.Decimal)) + } else { + price = prices[assetID] + decimal = decimals[assetID] + ret.Staking = ret.Staking.Add(CalculateUSDValue(state.TotalAmount, price.Value, decimal, price.Decimal)) + // calculate the token amount from the share for the operator + selfAmount, err := delegationkeeper.TokensFromShares(state.OperatorShare, state.TotalShare, state.TotalAmount) + if err != nil { + return err + } + ret.SelfStaking = ret.SelfStaking.Add(CalculateUSDValue(selfAmount, price.Value, decimal, price.Decimal)) } - selfUSDValue = selfUSDValue.Add(CalculateUSDValue(selfAmount, price.Value, decimal, price.Decimal)) return nil } - err := k.assetsKeeper.IteratorAssetsForOperator(ctx, operator, assetsFilter, opFuncToIterateAssets) + err = k.assetsKeeper.IteratorAssetsForOperator(ctx, false, operator, assetsFilter, opFuncToIterateAssets) if err != nil { - return sdkmath.LegacyDec{}, sdkmath.LegacyDec{}, err + return ret, err } - return usdValue, selfUSDValue, nil + return ret, nil } // UpdateVotingPower update the voting power of the specified AVS and its operators at @@ -71,12 +97,12 @@ func (k *Keeper) UpdateVotingPower(ctx sdk.Context, avsAddr string) error { opFunc := func(operator string, votingPower *sdkmath.LegacyDec) error { // clear the old voting power for the operator *votingPower = sdkmath.LegacyNewDec(0) - usdValue, selfUSDValue, err := k.CalculateUSDValueForOperator(ctx, operator, assets, decimals, prices) + usdValues, err := k.CalculateUSDValueForOperator(ctx, false, operator, assets, decimals, prices) if err != nil { return err } - if selfUSDValue.GTE(minimumSelfDelegation) { - *votingPower = votingPower.Add(usdValue) + if usdValues.SelfStaking.GTE(minimumSelfDelegation) { + *votingPower = votingPower.Add(usdValues.Staking) avsVotingPower = avsVotingPower.Add(*votingPower) } return nil diff --git a/x/operator/keeper/grpc_query.go b/x/operator/keeper/grpc_query.go index 3865c6d36..650690813 100644 --- a/x/operator/keeper/grpc_query.go +++ b/x/operator/keeper/grpc_query.go @@ -38,3 +38,36 @@ func (k *Keeper) QueryOperatorConsKeyForChainID( PublicKey: *key, }, nil } + +func (k *Keeper) QueryOperatorUSDValue(ctx context.Context, req *operatortypes.QueryOperatorUSDValueRequest) (*operatortypes.DecValueField, error) { + c := sdk.UnwrapSDKContext(ctx) + usdValue, err := k.GetOperatorUSDValue(c, req.OperatorAddr, req.AVSAddress) + if err != nil { + return nil, err + } + return &operatortypes.DecValueField{ + Amount: usdValue, + }, nil +} + +func (k *Keeper) QueryAVSUSDValue(ctx context.Context, req *operatortypes.QueryAVSUSDValueRequest) (*operatortypes.DecValueField, error) { + c := sdk.UnwrapSDKContext(ctx) + usdValue, err := k.GetAVSUSDValue(c, req.AVSAddress) + if err != nil { + return nil, err + } + return &operatortypes.DecValueField{ + Amount: usdValue, + }, nil +} + +func (k *Keeper) QueryOperatorSlashInfo(ctx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { + c := sdk.UnwrapSDKContext(ctx) + slashInfo, err := k.AllOperatorSlashInfo(c, req.OperatorAddr, req.AVSAddress) + if err != nil { + return nil, err + } + return &operatortypes.QueryOperatorSlashInfoResponse{ + AllSlashInfo: slashInfo, + }, nil +} diff --git a/x/operator/keeper/operator_slash_state.go b/x/operator/keeper/operator_slash_state.go index be6a9c82a..7f9bd064b 100644 --- a/x/operator/keeper/operator_slash_state.go +++ b/x/operator/keeper/operator_slash_state.go @@ -30,8 +30,12 @@ func (k *Keeper) UpdateOperatorSlashInfo(ctx sdk.Context, operatorAddr, avsAddr, return errorsmod.Wrap(operatortypes.ErrSlashInfoExist, fmt.Sprintf("slashInfoKey:%s", slashInfoKey)) } // check the validation of slash info - if slashInfo.SlashContract == "" { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err slashContract:%s", slashInfo.SlashContract)) + getSlashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) + if err != nil { + return err + } + if slashInfo.SlashContract != getSlashContract { + return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err slashContract:%s, stored contract:%s", slashInfo.SlashContract, getSlashContract)) } if slashInfo.EventHeight > slashInfo.SubmittedHeight { return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err SubmittedHeight:%v,EventHeight:%v", slashInfo.SubmittedHeight, slashInfo.EventHeight)) @@ -62,6 +66,26 @@ func (k *Keeper) GetOperatorSlashInfo(ctx sdk.Context, avsAddr, operatorAddr, sl return &operatorSlashInfo, nil } +// AllOperatorSlashInfo return all slash information for the specified operator and AVS +func (k *Keeper) AllOperatorSlashInfo(ctx sdk.Context, avsAddr, operatorAddr string) (map[string]*operatortypes.OperatorSlashInfo, error) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixOperatorSlashInfo) + prefix := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr) + + ret := make(map[string]*operatortypes.OperatorSlashInfo, 0) + iterator := sdk.KVStorePrefixIterator(store, prefix) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var slashInfo operatortypes.OperatorSlashInfo + k.cdc.MustUnmarshal(iterator.Value(), &slashInfo) + keys, err := assetstype.ParseJoinedKey(iterator.Key()) + if err != nil { + return nil, err + } + ret[keys[2]] = &slashInfo + } + return ret, nil +} + // UpdateSlashAssetsState This is a function to update the assets amount that need to be slashed // The stored state is: // KeyPrefixSlashAssetsState key-value: diff --git a/x/operator/keeper/opt_test.go b/x/operator/keeper/opt_test.go index f0988b46c..513388aac 100644 --- a/x/operator/keeper/opt_test.go +++ b/x/operator/keeper/opt_test.go @@ -60,12 +60,10 @@ func (suite *OperatorTestSuite) prepareDeposit(assetAddr common.Address, amount suite.NoError(err) } -func (suite *OperatorTestSuite) prepareDelegation(assetAddr common.Address, amount sdkmath.Int) { +func (suite *OperatorTestSuite) prepareDelegation(isDelegation bool, assetAddr common.Address, amount sdkmath.Int) { suite.delegationAmount = amount - // delegate to operator - delegationParam := &delegationtype.DelegationOrUndelegationParams{ + param := &delegationtype.DelegationOrUndelegationParams{ ClientChainLzID: suite.clientChainLzID, - Action: assetstypes.DelegateTo, AssetsAddress: assetAddr[:], OperatorAddress: suite.operatorAddr, StakerAddress: suite.Address[:], @@ -73,7 +71,12 @@ func (suite *OperatorTestSuite) prepareDelegation(assetAddr common.Address, amou LzNonce: 0, TxHash: common.HexToHash("0x24c4a315d757249c12a7a1d7b6fb96261d49deee26f06a3e1787d008b445c3ac"), } - err := suite.App.DelegationKeeper.DelegateTo(suite.Ctx, delegationParam) + var err error + if isDelegation { + err = suite.App.DelegationKeeper.DelegateTo(suite.Ctx, param) + } else { + err = suite.App.DelegationKeeper.UndelegateFrom(suite.Ctx, param) + } suite.NoError(err) } @@ -83,7 +86,7 @@ func (suite *OperatorTestSuite) prepare() { delegationAmount := sdkmath.NewInt(50) suite.prepareOperator() suite.prepareDeposit(usdtAddress, depositAmount) - suite.prepareDelegation(usdtAddress, delegationAmount) + suite.prepareDelegation(true, usdtAddress, delegationAmount) } func (suite *OperatorTestSuite) CheckState(expectedState *StateForCheck) { @@ -165,17 +168,3 @@ func (suite *OperatorTestSuite) TestOptOut() { suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) suite.CheckState(expectedState) } - -func (suite *OperatorTestSuite) TestSlash() { - suite.prepare() - err := suite.App.OperatorKeeper.OptIn(suite.Ctx, suite.operatorAddr, suite.avsAddr) - suite.NoError(err) - optInHeight := suite.Ctx.BlockHeight() - - // run to the block at specified height - runToHeight := optInHeight + 10 - for i := optInHeight; i < runToHeight; i++ { - suite.NextBlock() - } - suite.Equal(runToHeight, suite.Ctx.BlockHeight()) -} diff --git a/x/operator/keeper/slash.go b/x/operator/keeper/slash.go index 18194d911..4fb688ef1 100644 --- a/x/operator/keeper/slash.go +++ b/x/operator/keeper/slash.go @@ -3,8 +3,6 @@ package keeper import ( "fmt" - delegationkeeper "github.com/ExocoreNetwork/exocore/x/delegation/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ethereum/go-ethereum/common/hexutil" @@ -18,7 +16,9 @@ import ( ) type SlashInputInfo struct { - SlashType types.SlashType + IsDogFood bool + Power int64 + SlashType uint32 Operator sdk.AccAddress AVSAddr string SlashContract string @@ -33,10 +33,12 @@ func GetSlashIDForDogfood(infraction stakingtypes.Infraction, infractionHeight i return string(assetstype.GetJoinedStoreKey(hexutil.EncodeUint64(uint64(infraction)), hexutil.EncodeUint64(uint64(infractionHeight)))) } -func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, totalSlashAmount, slashAmount sdkmath.Int) (sdkmath.Int, error) { +// SlashFromUndelegation executes the slash from an undelegation +func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slashProportion sdkmath.LegacyDec) (*types.SlashFromUndelegation, error) { if undelegation.ActualCompletedAmount.IsZero() { - return totalSlashAmount, nil + return nil, nil } + slashAmount := slashProportion.MulInt(undelegation.Amount).TruncateInt() // reduce the actual_completed_amount in the record if slashAmount.GTE(undelegation.ActualCompletedAmount) { slashAmount = undelegation.ActualCompletedAmount @@ -44,174 +46,66 @@ func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, tota } else { undelegation.ActualCompletedAmount = undelegation.ActualCompletedAmount.Sub(slashAmount) } - // slashing from the operator isn't needed if the remainingSlashAmount isn't positive - remainingSlashAmount := totalSlashAmount.Sub(slashAmount) - return remainingSlashAmount, nil + + return &types.SlashFromUndelegation{ + StakerID: undelegation.StakerID, + AssetID: undelegation.AssetID, + Amount: slashAmount, + }, nil } -func (k *Keeper) VerifySlashEvent(ctx sdk.Context, parameter *SlashInputInfo) (sdk.Context, error) { +func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *SlashInputInfo) error { height := ctx.BlockHeight() if parameter.SlashEventHeight > height { - return ctx, errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", parameter.SlashEventHeight, height)) - } - - // get the state when the slash occurred - // get the opted-in info - // When the slash occurs, retrieves the end block height of the epoch - // where the used voting power resides. - heightForVotingPower, err := k.avsKeeper.GetHeightForVotingPower(ctx, parameter.AVSAddr, parameter.SlashEventHeight) - if err != nil { - return ctx, err - } - if k.historicalCtx == nil { - return ctx, errorsmod.Wrap(types.ErrValueIsNilOrZero, "VerifySlashEvent the historicalCtx is nil") - } - historicalStateCtx, err := k.historicalCtx(heightForVotingPower, false) - if err != nil { - return ctx, err - } - if !k.IsOptedIn(ctx, parameter.Operator.String(), parameter.AVSAddr) { - return ctx, types.ErrNotOptedIn + return errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", parameter.SlashEventHeight, height)) } - optedInfo, err := k.GetOptedInfo(historicalStateCtx, parameter.Operator.String(), parameter.AVSAddr) - if err != nil { - return ctx, err - } - if optedInfo.SlashContract != parameter.SlashContract { - return ctx, errorsmod.Wrap(types.ErrSlashContractNotMatch, fmt.Sprintf("input slashContract:%s, opted-in slash contract:%suite", parameter.SlashContract, optedInfo.SlashContract)) - } - - return historicalStateCtx, nil -} -// NoInstantaneousSlash indicates that the slash event will be processed after a certain -// period of time, thus requiring a reduction in the share of the corresponding staker. -// It will slash the assets from the undelegation firstly, then slash the asset from the -// staker's share. -// Compared to the instant slash, the con is the handling isn't efficient, but the pro is -// there isn't any slash mistake for the new-coming delegations after the slash event. -func (k *Keeper) NoInstantaneousSlash(ctx, historicalStateCtx sdk.Context, parameter *SlashInputInfo) error { - // get assetsInfo supported by AVS - assetsFilter, err := k.avsKeeper.GetAVSSupportedAssets(historicalStateCtx, parameter.AVSAddr) - if err != nil { - return err - } - for assetID := range assetsFilter { - historyOperatorAsset, err := k.assetsKeeper.GetOperatorSpecifiedAssetInfo(historicalStateCtx, parameter.Operator, assetID) - if err != nil { - return err + if parameter.IsDogFood { + if parameter.Power <= 0 { + return errorsmod.Wrapf(types.ErrInvalidSlashPower, "slash for dogfood, the power is:%v", parameter.Power) } - stakerList, err := k.delegationKeeper.GetStakersByOperator(historicalStateCtx, parameter.Operator.String(), assetID) - if err != nil { - return err - } - // slash the staker share according to the historical and current state - for _, stakerID := range stakerList.Stakers { - delegationState, err := k.delegationKeeper.GetSingleDelegationInfo(historicalStateCtx, stakerID, assetID, parameter.Operator.String()) - if err != nil { - return err - } - assetAmount, err := delegationkeeper.TokensFromShares(delegationState.UndelegatableShare, historyOperatorAsset.TotalShare, historyOperatorAsset.TotalAmount) - if err != nil { - return err - } - shouldSlashAmount := parameter.SlashProportion.MulInt(assetAmount).TruncateInt() - // slash the asset from the undelegation firstly. - undelegations, err := k.delegationKeeper.GetStakerUndelegationRecords(ctx, stakerID, assetID) - if err != nil { - return err - } - isSlashFromShare := true - for _, undelegation := range undelegations { - if undelegation.OperatorAddr == parameter.Operator.String() { - remainingSlashAmount, err := SlashFromUndelegation(undelegation, shouldSlashAmount, shouldSlashAmount) - if err != nil { - return err - } - // update the undelegation state - _, err = k.delegationKeeper.SetSingleUndelegationRecord(ctx, undelegation) - if err != nil { - return err - } - if remainingSlashAmount.IsZero() { - // all amount has been slashed from the undelegaion, - // so the share of staker shouldn't be slashed. - isSlashFromShare = false - break - } - // slash the remaining amount from the next undelegation - shouldSlashAmount = remainingSlashAmount - } - } - // slash the asset from the staker's asset share if there is still remaining slash amount after - // slashing from the undelegation. - if isSlashFromShare { - slashShare, err := k.delegationKeeper.CalculateSlashShare(ctx, parameter.Operator, stakerID, assetID, shouldSlashAmount) - if err != nil { - return err - } - _, err = k.delegationKeeper.RemoveShare(ctx, false, parameter.Operator, stakerID, assetID, slashShare) - if err != nil { - return err - } - } + } else { + if parameter.Power != 0 { + return errorsmod.Wrapf(types.ErrInvalidSlashPower, "slash for other AVSs, the power is:%v", parameter.Power) } + // todo: get the historical voting power from the snapshot for the other AVSs } return nil } -// InstantSlash represents the slash events that will be handled instantly after occurring -// so the slash will reduce the amount of related operator's assets pool. -// The implementation is similar to the cosmos-sdk, but the difference is the comos-sdk -// slashes a proportion from every undelegations, which may result in the actual total slash amount is greater -// than intended. But this function won't slash the remaining undelegation if the total slash amount -// is reached. So some undelegations might escape from the slash because of the other new-coming -// delegations. -// The new delegated assets after the slash event might be slashed incorrectly, which is same as cosmos-sdk. -// So this function only apply to the situation that the slash events will be handled instantly after occurring. -// The pro is that the handling is more efficient compared to the no-instantaneous slash. -func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *SlashInputInfo) error { - // todo: should we check if the slashEventHeight is too smaller than the current block height? - // Then force the AVS using the `NoInstantaneousSlash` if the slash event is too old - // This may depend on the level of authority we want to grant to AVS when - // setting their own slash logic. - - slashAssets := make(map[string]sdkmath.Int, 0) - // get assetsInfo supported by AVS - assetsFilter, err := k.avsKeeper.GetAVSSupportedAssets(historicalStateCtx, parameter.AVSAddr) - if err != nil { - return err - } - - // get the Assets opted in the operator - historyOperatorAssets, err := k.assetsKeeper.GetOperatorAssetInfos(historicalStateCtx, parameter.Operator, assetsFilter) +// SlashAssets slash the assets according to the new calculated proportion +// It slashs the undelegation first, then slash the assets pool of the related operator +// If the remaining amount of the assets pool after slash is zero, the share of related +// stakers should be cleared, because the divisor will be zero when calculating the share +// of new delegation after the slash. +func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *SlashInputInfo) (*types.SlashExecutionInfo, error) { + // calculate the new slash proportion according to the historical power and current assets state + slashUSDValue := sdkmath.LegacyNewDec(parameter.Power).Mul(parameter.SlashProportion) + // calculate the current usd value of all assets pool for the operator + usdValues, err := k.CalculateUSDValueForOperator(ctx, true, parameter.Operator.String(), nil, nil, nil) if err != nil { - return err + return nil, err } + // calculate the new slash proportion + newSlashProportion := slashUSDValue.Quo(usdValues.StakingAndWaitUnbonding) + newSlashProportion = sdkmath.LegacyMinDec(sdkmath.LegacyNewDec(1), newSlashProportion) - // calculate the assets amount that should be slashed - for assetID, state := range historyOperatorAssets { - slashAmount := parameter.SlashProportion.MulInt(state.TotalAmount).TruncateInt() - slashAssets[assetID] = slashAmount + executionInfo := &types.SlashExecutionInfo{ + SlashProportion: newSlashProportion, + SlashValue: slashUSDValue, + SlashUndelegations: make([]*types.SlashFromUndelegation, 0), + SlashAssetsPool: make([]*types.SlashFromAssetsPool, 0), } - // slash from the unbonding stakers if parameter.SlashEventHeight < ctx.BlockHeight() { // get the undelegations that are submitted after the slash. opFunc := func(undelegation *delegationtype.UndelegationRecord) error { - totalSlashAmount, ok := slashAssets[undelegation.AssetID] - if ok { - slashAmount := parameter.SlashProportion.MulInt(undelegation.Amount).TruncateInt() - remainingSlashAmount, err := SlashFromUndelegation(undelegation, totalSlashAmount, slashAmount) - if err != nil { - return err - } - // slashing from the operator isn't needed if the remainingSlashAmount isn't positive - if !remainingSlashAmount.IsPositive() { - delete(slashAssets, undelegation.AssetID) - } else { - slashAssets[undelegation.AssetID] = remainingSlashAmount - } + slashFromUndelegation, err := SlashFromUndelegation(undelegation, newSlashProportion) + if err != nil { + return err + } + if slashFromUndelegation != nil { + executionInfo.SlashUndelegations = append(executionInfo.SlashUndelegations, slashFromUndelegation) } return nil } @@ -219,29 +113,21 @@ func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *Sl heightFilter := uint64(parameter.SlashEventHeight) err = k.delegationKeeper.IterateUndelegationsByOperator(ctx, parameter.Operator.String(), &heightFilter, true, opFunc) if err != nil { - return err + return nil, err } } - // slash the remaining from the assets pool of the operator - for assetID, slashAmount := range slashAssets { - operatorAsset, err := k.assetsKeeper.GetOperatorSpecifiedAssetInfo(ctx, parameter.Operator, assetID) - if err != nil { - return err - } - isClearUselessShare := false - if slashAmount.GTE(operatorAsset.TotalAmount) { - slashAmount = operatorAsset.TotalAmount - isClearUselessShare = true - } + // slash from the assets pool of the operator + opFuncToIterateAssets := func(assetID string, state *assetstype.OperatorAssetInfo) error { + slashAmount := newSlashProportion.MulInt(state.TotalAmount).TruncateInt() + remainingAmount := state.TotalAmount.Sub(slashAmount) + // todo: consider slash all assets if the remaining amount is too small, + // which can avoid the unbalance between share and amount - changeAmount := assetstype.DeltaOperatorSingleAsset{ - TotalAmount: slashAmount.Neg(), - } // all shares need to be cleared if the asset amount is slashed to zero, // otherwise there will be a problem in updating the shares when handling // the new delegations. - if isClearUselessShare { + if remainingAmount.IsZero() { // clear the share of other stakers stakerList, err := k.delegationKeeper.GetStakersByOperator(ctx, parameter.Operator.String(), assetID) if err != nil { @@ -255,46 +141,45 @@ func (k *Keeper) InstantSlash(ctx, historicalStateCtx sdk.Context, parameter *Sl if err != nil { return err } - changeAmount.TotalShare = sdkmath.LegacyNewDec(0) - changeAmount.OperatorAmount = sdkmath.NewInt(0) - changeAmount.OperatorShare = sdkmath.LegacyNewDec(0) - } - - err = k.assetsKeeper.UpdateOperatorAssetState(ctx, parameter.Operator, assetID, changeAmount) - if err != nil { - return err + state.TotalShare = sdkmath.LegacyNewDec(0) + state.OperatorAmount = sdkmath.NewInt(0) + state.OperatorShare = sdkmath.LegacyNewDec(0) } + state.TotalAmount = remainingAmount + executionInfo.SlashAssetsPool = append(executionInfo.SlashAssetsPool, &types.SlashFromAssetsPool{ + AssetID: assetID, + Amount: slashAmount, + }) + return nil } - return nil + err = k.assetsKeeper.IteratorAssetsForOperator(ctx, true, parameter.Operator.String(), nil, opFuncToIterateAssets) + if err != nil { + return nil, err + } + return executionInfo, nil } -// Slash performs all slash events include instant slash and no-instantaneous slash. +// Slash performs all slash events and stores the execution result func (k *Keeper) Slash(ctx sdk.Context, parameter *SlashInputInfo) error { - historicalStateCtx, err := k.VerifySlashEvent(ctx, parameter) + err := k.CheckSlashParameter(ctx, parameter) if err != nil { return err } - switch parameter.SlashType { - case types.SlashType_SLASH_TYPE_INSTANT_SLASH: - err = k.InstantSlash(ctx, historicalStateCtx, parameter) - case types.SlashType_SLASH_TYPE_NO_INSTANTANEOUS_SLASH: - err = k.NoInstantaneousSlash(ctx, historicalStateCtx, parameter) - default: - return errorsmod.Wrap(types.ErrInvalidSlashType, fmt.Sprintf("the slash type is:%v", parameter.SlashType)) - } + + // slash assets according to the input information + executionInfo, err := k.SlashAssets(ctx, parameter) if err != nil { return err } - - // todo: recording the slash event might be moved to the slash module + // store the slash information height := ctx.BlockHeight() slashInfo := types.OperatorSlashInfo{ + SlashType: parameter.SlashType, SlashContract: parameter.SlashContract, SubmittedHeight: height, EventHeight: parameter.SlashEventHeight, SlashProportion: parameter.SlashProportion, - ProcessedHeight: height + types.SlashVetoDuration, - SlashType: parameter.SlashType, + ExecutionInfo: executionInfo, } err = k.UpdateOperatorSlashInfo(ctx, parameter.Operator.String(), parameter.AVSAddr, parameter.SlashID, slashInfo) if err != nil { @@ -305,37 +190,31 @@ func (k *Keeper) Slash(ctx sdk.Context, parameter *SlashInputInfo) error { // SlashWithInfractionReason is an expected slash interface for the dogfood module. func (k Keeper) SlashWithInfractionReason( - ctx sdk.Context, addr sdk.AccAddress, infractionHeight, _ int64, + ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, slashFactor sdk.Dec, infraction stakingtypes.Infraction, ) sdkmath.Int { - // todo: disable the slash currently, waiting for the new slash implementation - k.Logger(ctx).Info("slash occurs", addr, infractionHeight, slashFactor, infraction) - /* chainID := ctx.ChainID() - avsAddr, err := k.avsKeeper.GetAVSAddrByChainID(ctx, chainID) - if err != nil { - k.Logger(ctx).Error(err.Error(), chainID) - return sdkmath.NewInt(0) - } - slashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) - if err != nil { - k.Logger(ctx).Error(err.Error(), avsAddr) - return sdkmath.NewInt(0) - } - slashID := GetSlashIDForDogfood(infraction, infractionHeight) - slashParam := &SlashInputInfo{ - SlashType: types.SlashType_SLASH_TYPE_INSTANT_SLASH, - Operator: addr, - AVSAddr: avsAddr, - SlashContract: slashContract, - SlashID: slashID, - SlashEventHeight: infractionHeight, - SlashProportion: slashFactor, - } - err = k.Slash(ctx, slashParam) - if err != nil { - k.Logger(ctx).Error(err.Error(), avsAddr) - return sdkmath.NewInt(0) - }*/ + chainID := ctx.ChainID() + avsAddr, err := k.avsKeeper.GetAVSAddrByChainID(ctx, chainID) + if err != nil { + k.Logger(ctx).Error(err.Error(), chainID) + return sdkmath.NewInt(0) + } + slashID := GetSlashIDForDogfood(infraction, infractionHeight) + slashParam := &SlashInputInfo{ + IsDogFood: true, + Power: power, + SlashType: uint32(infraction), + Operator: addr, + AVSAddr: avsAddr, + SlashID: slashID, + SlashEventHeight: infractionHeight, + SlashProportion: slashFactor, + } + err = k.Slash(ctx, slashParam) + if err != nil { + k.Logger(ctx).Error(err.Error(), avsAddr) + return sdkmath.NewInt(0) + } // todo: The returned value should be the amount of burned Exo if we considering a slash from the reward // Now it doesn't slash from the reward, so just return 0 return sdkmath.NewInt(0) diff --git a/x/operator/keeper/slash_test.go b/x/operator/keeper/slash_test.go new file mode 100644 index 000000000..dc9b1d4cf --- /dev/null +++ b/x/operator/keeper/slash_test.go @@ -0,0 +1,95 @@ +package keeper_test + +import ( + sdkmath "cosmossdk.io/math" + "github.com/ExocoreNetwork/exocore/x/operator/keeper" + "github.com/ExocoreNetwork/exocore/x/operator/types" + abci "github.com/cometbft/cometbft/abci/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ethereum/go-ethereum/common" +) + +func (suite *OperatorTestSuite) TestSlashWithInfractionReason() { + // prepare the deposit and delegation + suite.prepareOperator() + usdtAddress := common.HexToAddress("0xdAC17F958D2ee523a2206206994597C13D831ec7") + assetDecimal := 6 + depositAmount := sdkmath.NewIntWithDecimal(100, assetDecimal) + suite.prepareDeposit(usdtAddress, depositAmount) + delegationAmount := sdkmath.NewIntWithDecimal(50, assetDecimal) + suite.prepareDelegation(true, suite.assetAddr, delegationAmount) + + // opt into the AVS + avsAddr := suite.Ctx.ChainID() + err := suite.App.OperatorKeeper.OptIn(suite.Ctx, suite.operatorAddr, avsAddr) + suite.NoError(err) + // call the EndBlock to update the voting power + suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + infractionHeight := suite.Ctx.BlockHeight() + usdValue, err := suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, avsAddr, suite.operatorAddr.String()) + suite.NoError(err) + // get the historical voting power + power := usdValue.TruncateInt64() + // run to next block + suite.NextBlock() + + // delegates new amount to the operator + newDelegateAmount := sdkmath.NewIntWithDecimal(20, assetDecimal) + suite.prepareDelegation(true, suite.assetAddr, newDelegateAmount) + // updating the voting power + suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + newUSDValue, err := suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, avsAddr, suite.operatorAddr.String()) + suite.NoError(err) + // submits an undelegation to test the slashFromUndelegation + undelegationAmount := sdkmath.NewIntWithDecimal(10, assetDecimal) + suite.prepareDelegation(false, suite.assetAddr, undelegationAmount) + delegationRemaining := delegationAmount.Add(newDelegateAmount).Sub(undelegationAmount) + startHeight := uint64(suite.Ctx.BlockHeight()) + completedHeight := suite.App.OperatorKeeper.GetUnbondingExpirationBlockNumber(suite.Ctx, suite.operatorAddr, startHeight) + + // trigger the slash with a downtime event + slashFactor := suite.App.SlashingKeeper.SlashFractionDowntime(suite.Ctx) + slashType := stakingtypes.Infraction_INFRACTION_DOWNTIME + exoSlashValue := suite.App.OperatorKeeper.SlashWithInfractionReason(suite.Ctx, suite.operatorAddr, infractionHeight, power, slashFactor, slashType) + suite.Equal(sdkmath.NewInt(0), exoSlashValue) + + // verify the state after the slash + slashID := keeper.GetSlashIDForDogfood(slashType, infractionHeight) + slashInfo, err := suite.App.OperatorKeeper.GetOperatorSlashInfo(suite.Ctx, avsAddr, suite.operatorAddr.String(), slashID) + suite.NoError(err) + + // check the stored slash records + slashValue := usdValue.Mul(slashFactor) + newSlashProportion := slashValue.Quo(newUSDValue) + suite.Equal(suite.Ctx.BlockHeight(), slashInfo.SubmittedHeight) + suite.Equal(infractionHeight, slashInfo.EventHeight) + suite.Equal(slashFactor, slashInfo.SlashProportion) + suite.Equal(uint32(slashType), slashInfo.SlashType) + suite.Equal(types.SlashFromUndelegation{ + StakerID: suite.stakerID, + AssetID: suite.assetID, + Amount: newSlashProportion.MulInt(undelegationAmount).TruncateInt(), + }, *slashInfo.ExecutionInfo.SlashUndelegations[0]) + suite.Equal(types.SlashFromAssetsPool{ + AssetID: suite.assetID, + Amount: newSlashProportion.MulInt(delegationRemaining).TruncateInt(), + }, *slashInfo.ExecutionInfo.SlashAssetsPool[0]) + + // check the assets state of undelegation and assets pool + assetsInfo, err := suite.App.AssetsKeeper.GetOperatorSpecifiedAssetInfo(suite.Ctx, suite.operatorAddr, suite.assetID) + suite.NoError(err) + suite.Equal(delegationRemaining.Sub(slashInfo.ExecutionInfo.SlashAssetsPool[0].Amount), assetsInfo.TotalAmount) + + undelegations, err := suite.App.DelegationKeeper.GetStakerUndelegationRecords(suite.Ctx, suite.stakerID, suite.assetID) + suite.NoError(err) + suite.Equal(undelegationAmount.Sub(slashInfo.ExecutionInfo.SlashUndelegations[0].Amount), undelegations[0].ActualCompletedAmount) + + // run to the block at which the undelegation is completed + for i := startHeight; i < completedHeight; i++ { + suite.NextBlock() + } + suite.App.DelegationKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + undelegations, err = suite.App.DelegationKeeper.GetStakerUndelegationRecords(suite.Ctx, suite.stakerID, suite.assetID) + suite.NoError(err) + suite.Equal(0, len(undelegations)) +} diff --git a/x/operator/keeper/usd_value_test.go b/x/operator/keeper/usd_value_test.go index cfd83bc8f..071d7580b 100644 --- a/x/operator/keeper/usd_value_test.go +++ b/x/operator/keeper/usd_value_test.go @@ -85,7 +85,7 @@ func (suite *OperatorTestSuite) TestAVSUSDValue() { usdcPrice, err := suite.App.OperatorKeeper.OracleInterface().GetSpecifiedAssetsPrice(suite.Ctx, suite.assetID) suite.NoError(err) delegatedAmount := sdkmath.NewIntWithDecimal(8, 7) - suite.prepareDelegation(usdcAddr, delegatedAmount) + suite.prepareDelegation(true, usdcAddr, delegatedAmount) // updating the new voting power suite.NoError(err) diff --git a/x/operator/module.go b/x/operator/module.go index 29999fbee..aad914018 100644 --- a/x/operator/module.go +++ b/x/operator/module.go @@ -32,9 +32,7 @@ func (b AppModuleBasic) Name() string { return operatortypes.ModuleName } -func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { - operatortypes.RegisterLegacyAminoCodec(amino) -} +func (b AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) {} func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { operatortypes.RegisterInterfaces(registry) diff --git a/x/operator/types/codec.go b/x/operator/types/codec.go index 17edd4f33..23fb17a94 100644 --- a/x/operator/types/codec.go +++ b/x/operator/types/codec.go @@ -1,32 +1,11 @@ package types import ( - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) -var ( - amino = codec.NewLegacyAmino() - - // ModuleCdc references the global erc20 module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - // - // The actual codec used for serialization should be provided to modules/erc20 and - // defined at the application level. - ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) - - // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) -) - -// NOTE: This is required for the GetSignBytes function -func init() { - RegisterLegacyAminoCodec(amino) - amino.Seal() -} - // RegisterInterfaces register implementations func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( @@ -37,10 +16,3 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } - -// RegisterLegacyAminoCodec registers the necessary x/revenue interfaces and -// concrete types on the provided LegacyAmino codec. These types are used for -// Amino JSON serialization and EIP-712 compatibility. -func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { - // cdc.RegisterConcrete(&RegisterOperatorReq{}, registerOperator, nil) -} diff --git a/x/operator/types/errors.go b/x/operator/types/errors.go index 06311a46e..dbd3bc496 100644 --- a/x/operator/types/errors.go +++ b/x/operator/types/errors.go @@ -77,9 +77,9 @@ var ( "avs address should be a hex evm contract address", ) - ErrInvalidSlashType = errorsmod.Register( + ErrInvalidSlashPower = errorsmod.Register( ModuleName, 15, - "the slash type is invalid", + "the slash power is invalid", ) ErrKeyAlreadyExist = errorsmod.Register( diff --git a/x/operator/types/expected_keepers.go b/x/operator/types/expected_keepers.go index 102ba46a3..4867c4622 100644 --- a/x/operator/types/expected_keepers.go +++ b/x/operator/types/expected_keepers.go @@ -22,7 +22,7 @@ type AssetsKeeper interface { ctx sdk.Context, assets map[string]interface{}, ) (decimals map[string]uint32, err error) IteratorAssetsForOperator( - ctx sdk.Context, operator string, assetsFilter map[string]interface{}, + ctx sdk.Context, isUpdate bool, operator string, assetsFilter map[string]interface{}, f func(assetID string, state *assetstype.OperatorAssetInfo) error, ) error AppChainInfoIsExist(ctx sdk.Context, chainID string) bool diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index 737635e24..76baeefe8 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -77,6 +77,211 @@ func (m *GetOperatorInfoReq) GetOperatorAddr() string { return "" } +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +type QueryOperatorUSDValueRequest struct { + // operator_addr is the operator address,its type should be a sdk.AccAddress + OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDValueRequest{} } +func (m *QueryOperatorUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorUSDValueRequest) ProtoMessage() {} +func (*QueryOperatorUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{1} +} +func (m *QueryOperatorUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorUSDValueRequest.Merge(m, src) +} +func (m *QueryOperatorUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorUSDValueRequest proto.InternalMessageInfo + +func (m *QueryOperatorUSDValueRequest) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + +func (m *QueryOperatorUSDValueRequest) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. +type QueryAVSUSDValueRequest struct { + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,1,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *QueryAVSUSDValueRequest) Reset() { *m = QueryAVSUSDValueRequest{} } +func (m *QueryAVSUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAVSUSDValueRequest) ProtoMessage() {} +func (*QueryAVSUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{2} +} +func (m *QueryAVSUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAVSUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAVSUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAVSUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAVSUSDValueRequest.Merge(m, src) +} +func (m *QueryAVSUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAVSUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAVSUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAVSUSDValueRequest proto.InternalMessageInfo + +func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified +// operator and AVS +type QueryOperatorSlashInfoRequest struct { + // operator_addr is the operator address,its type should be a sdk.AccAddress + OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } +func (m *QueryOperatorSlashInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoRequest) ProtoMessage() {} +func (*QueryOperatorSlashInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{3} +} +func (m *QueryOperatorSlashInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoRequest.Merge(m, src) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoRequest proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoRequest) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + +func (m *QueryOperatorSlashInfoRequest) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest +type QueryOperatorSlashInfoResponse struct { + // AllSlashInfo the key is slashID, the value is the specified slash information + // It's okay to use a map here, because it won't be used to store state, only in + // the response to an RPC call + AllSlashInfo map[string]*OperatorSlashInfo `protobuf:"bytes,1,rep,name=all_slash_info,json=allSlashInfo,proto3" json:"all_slash_info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSlashInfoResponse{} } +func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} +func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{4} +} +func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoResponse.Merge(m, src) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoResponse proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() map[string]*OperatorSlashInfo { + if m != nil { + return m.AllSlashInfo + } + return nil +} + // QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator type QueryOperatorConsKeyRequest struct { // addr is the ACC address of operator @@ -89,7 +294,7 @@ func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKe func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{1} + return fileDescriptor_f91e795a3cecbdbf, []int{5} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -142,7 +347,7 @@ func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsK func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{2} + return fileDescriptor_f91e795a3cecbdbf, []int{6} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -180,6 +385,11 @@ func (m *QueryOperatorConsKeyResponse) GetPublicKey() crypto.PublicKey { func init() { proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") + proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") + proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") + proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") + proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") + proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") } @@ -187,38 +397,53 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 483 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x8d, 0xa3, 0xf2, 0xd1, 0x05, 0x84, 0xb4, 0xf4, 0x90, 0x86, 0xc8, 0x05, 0x1f, 0xa0, 0x17, - 0x76, 0x49, 0x38, 0x73, 0x48, 0xc2, 0x87, 0xa2, 0x56, 0x7c, 0xb8, 0x37, 0x2e, 0x96, 0x63, 0x0f, - 0xae, 0x95, 0x64, 0xc7, 0xd9, 0xdd, 0x94, 0x58, 0x55, 0x2f, 0xdc, 0x91, 0x90, 0xf8, 0x2b, 0xfc, - 0x88, 0x1e, 0x23, 0xb8, 0x70, 0x42, 0x28, 0xe1, 0xc4, 0xaf, 0x40, 0x5e, 0xdb, 0x0d, 0x0a, 0x16, - 0x12, 0x37, 0xef, 0xec, 0x9b, 0xf7, 0x66, 0xde, 0x5b, 0x93, 0x3d, 0x98, 0x63, 0x80, 0x12, 0x38, - 0x26, 0x20, 0x7d, 0x8d, 0x92, 0x9f, 0xb4, 0xf9, 0x74, 0x06, 0x32, 0x65, 0x89, 0x44, 0x8d, 0xf4, - 0x56, 0x01, 0x60, 0x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 0xfe, 0x8a, - 0x03, 0x00, 0x00, + // 730 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0x4d, 0x4f, 0xd4, 0x4e, + 0x1c, 0xc7, 0x77, 0x78, 0xfa, 0xff, 0x99, 0x45, 0xc4, 0x11, 0x75, 0x59, 0xb1, 0x60, 0xa3, 0x40, + 0x14, 0x5a, 0x29, 0x17, 0x1f, 0x0f, 0xcb, 0x93, 0x41, 0x88, 0x0f, 0xdd, 0xc8, 0xc1, 0xcb, 0xa6, + 0xb4, 0x43, 0x69, 0xb6, 0x74, 0x4a, 0x67, 0x76, 0xa5, 0x21, 0x5c, 0xbc, 0x9a, 0xa8, 0x09, 0xef, + 0xc0, 0xd7, 0x60, 0x7c, 0x0d, 0x1c, 0x89, 0x7a, 0xf0, 0x44, 0xcc, 0xe2, 0x6b, 0xf0, 0x6c, 0x3a, + 0x6d, 0x17, 0xe8, 0x76, 0x59, 0xd0, 0x83, 0xb7, 0xe9, 0xcc, 0xef, 0xf7, 0x9d, 0xcf, 0x7c, 0x67, + 0x7e, 0xbf, 0xc2, 0x21, 0xbc, 0x49, 0x74, 0xe2, 0x61, 0x99, 0xb8, 0xd8, 0xd3, 0x18, 0xf1, 0xe4, + 0xea, 0xa4, 0xbc, 0x51, 0xc1, 0x9e, 0x2f, 0xb9, 0x1e, 0x61, 0x04, 0x5d, 0x8c, 0x02, 0xa4, 0x38, + 0x40, 0xaa, 0x4e, 0xe6, 0x07, 0x74, 0x42, 0xd7, 0x09, 0x2d, 0xf1, 0x10, 0x39, 0xfc, 0x08, 0xe3, + 0xf3, 0x83, 0x69, 0x82, 0x6c, 0x33, 0x5a, 0xed, 0x37, 0x89, 0x49, 0xc2, 0xac, 0x60, 0x14, 0xe7, + 0x98, 0x84, 0x98, 0x36, 0x96, 0x35, 0xd7, 0x92, 0x35, 0xc7, 0x21, 0x4c, 0x63, 0x16, 0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 0xff, 0xff, 0x3b, 0x0d, 0x08, 0x4a, 0xdc, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -237,6 +462,12 @@ type QueryClient interface { GetOperatorInfo(ctx context.Context, in *GetOperatorInfoReq, opts ...grpc.CallOption) (*OperatorInfo, error) // QueryOperatorConsKeyForChainID queries the consensus public key for the operator QueryOperatorConsKeyForChainID(ctx context.Context, in *QueryOperatorConsKeyRequest, opts ...grpc.CallOption) (*QueryOperatorConsKeyResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) } type queryClient struct { @@ -265,12 +496,45 @@ func (c *queryClient) QueryOperatorConsKeyForChainID(ctx context.Context, in *Qu return out, nil } +func (c *queryClient) QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAVSUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) { + out := new(QueryOperatorSlashInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorSlashInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // OperatorInfo queries the operator information. GetOperatorInfo(context.Context, *GetOperatorInfoReq) (*OperatorInfo, error) // QueryOperatorConsKeyForChainID queries the consensus public key for the operator QueryOperatorConsKeyForChainID(context.Context, *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(context.Context, *QueryOperatorUSDValueRequest) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(context.Context, *QueryAVSUSDValueRequest) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(context.Context, *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -283,6 +547,15 @@ func (*UnimplementedQueryServer) GetOperatorInfo(ctx context.Context, req *GetOp func (*UnimplementedQueryServer) QueryOperatorConsKeyForChainID(ctx context.Context, req *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorConsKeyForChainID not implemented") } +func (*UnimplementedQueryServer) QueryOperatorUSDValue(ctx context.Context, req *QueryOperatorUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryAVSUSDValue(ctx context.Context, req *QueryAVSUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAVSUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorSlashInfo(ctx context.Context, req *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorSlashInfo not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -324,6 +597,60 @@ func _Query_QueryOperatorConsKeyForChainID_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } +func _Query_QueryOperatorUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, req.(*QueryOperatorUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAVSUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAVSUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAVSUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAVSUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAVSUSDValue(ctx, req.(*QueryAVSUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorSlashInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorSlashInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorSlashInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, req.(*QueryOperatorSlashInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "exocore.operator.v1.Query", HandlerType: (*QueryServer)(nil), @@ -336,6 +663,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryOperatorConsKeyForChainID", Handler: _Query_QueryOperatorConsKeyForChainID_Handler, }, + { + MethodName: "QueryOperatorUSDValue", + Handler: _Query_QueryOperatorUSDValue_Handler, + }, + { + MethodName: "QueryAVSUSDValue", + Handler: _Query_QueryAVSUSDValue_Handler, + }, + { + MethodName: "QueryOperatorSlashInfo", + Handler: _Query_QueryOperatorSlashInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/operator/v1/query.proto", @@ -371,7 +710,7 @@ func (m *GetOperatorInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -381,34 +720,34 @@ func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) i-- dAtA[i] = 0x12 } - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Addr))) + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -418,61 +757,283 @@ func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAVSUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAVSUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0xa } - 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++ +func (m *QueryOperatorSlashInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *GetOperatorInfoReq) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n + +func (m *QueryOperatorSlashInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Addr) - if l > 0 { + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorSlashInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k := range m.AllSlashInfo { + v := m.AllSlashInfo[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChainId) > 0 { + i -= len(m.ChainId) + copy(dAtA[i:], m.ChainId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Addr) > 0 { + i -= len(m.Addr) + copy(dAtA[i:], m.Addr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Addr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PublicKey.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 *GetOperatorInfoReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAVSUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k, v := range m.AllSlashInfo { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryOperatorConsKeyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Addr) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } l = len(m.ChainId) @@ -581,6 +1142,495 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllSlashInfo", 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.AllSlashInfo == nil { + m.AllSlashInfo = make(map[string]*OperatorSlashInfo) + } + var mapkey string + var mapvalue *OperatorSlashInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &OperatorSlashInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllSlashInfo[mapkey] = mapvalue + 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 *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/operator/types/query.pb.gw.go b/x/operator/types/query.pb.gw.go index 145ebcd2e..c46f12cc7 100644 --- a/x/operator/types/query.pb.gw.go +++ b/x/operator/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join var ( filter_Query_GetOperatorInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -143,15 +145,125 @@ func local_request_Query_QueryOperatorConsKeyForChainID_0(ctx context.Context, m } +var ( + filter_Query_QueryOperatorUSDValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryOperatorUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorUSDValueRequest + 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_QueryOperatorUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryOperatorUSDValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorUSDValueRequest + 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_QueryOperatorUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryOperatorUSDValue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAVSUSDValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAVSUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSUSDValueRequest + 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_QueryAVSUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAVSUSDValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAVSUSDValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSUSDValueRequest + 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_QueryAVSUSDValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAVSUSDValue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryOperatorSlashInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryOperatorSlashInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorSlashInfoRequest + 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_QueryOperatorSlashInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryOperatorSlashInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorSlashInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorSlashInfoRequest + 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_QueryOperatorSlashInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryOperatorSlashInfo(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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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_GetOperatorInfo_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 { @@ -159,6 +271,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetOperatorInfo_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) @@ -172,6 +285,8 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueryOperatorConsKeyForChainID_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 { @@ -179,6 +294,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueryOperatorConsKeyForChainID_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) @@ -189,6 +305,75 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_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_QueryOperatorUSDValue_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_QueryOperatorUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAVSUSDValue_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_QueryAVSUSDValue_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_QueryAVSUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryOperatorSlashInfo_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_QueryOperatorSlashInfo_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_QueryOperatorSlashInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -270,17 +455,89 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_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_QueryOperatorUSDValue_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_QueryOperatorUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAVSUSDValue_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_QueryAVSUSDValue_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_QueryAVSUSDValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryOperatorSlashInfo_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_QueryOperatorSlashInfo_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_QueryOperatorSlashInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_GetOperatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "GetOperatorInfo"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetOperatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "GetOperatorInfo"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOperatorConsKeyForChainID_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{"exocore", "operator", "v1", "GetOperatorConsKey", "addr", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryOperatorConsKeyForChainID_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{"exocore", "operator_consent", "v1", "GetOperatorConsKey", "addr", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryOperatorUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAVSUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryAVSUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOperatorSlashInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorSlashInfo"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_GetOperatorInfo_0 = runtime.ForwardResponseMessage forward_Query_QueryOperatorConsKeyForChainID_0 = runtime.ForwardResponseMessage + + forward_Query_QueryOperatorUSDValue_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAVSUSDValue_0 = runtime.ForwardResponseMessage + + forward_Query_QueryOperatorSlashInfo_0 = runtime.ForwardResponseMessage ) diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index 2b6add2f1..01fa6297d 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -405,6 +405,169 @@ func (m *OptedInAssetState) XXX_DiscardUnknown() { var xxx_messageInfo_OptedInAssetState proto.InternalMessageInfo +// SlashFromUndelegation records the slash detail from the undelegation +type SlashFromUndelegation struct { + // staker_id is the staker id. + StakerID string `protobuf:"bytes,1,opt,name=staker_id,json=stakerId,proto3" json:"staker_id,omitempty"` + // asset_id is the asset id. + AssetID string `protobuf:"bytes,2,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // amount is the slashed amount from the undelegation. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *SlashFromUndelegation) Reset() { *m = SlashFromUndelegation{} } +func (m *SlashFromUndelegation) String() string { return proto.CompactTextString(m) } +func (*SlashFromUndelegation) ProtoMessage() {} +func (*SlashFromUndelegation) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{6} +} +func (m *SlashFromUndelegation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashFromUndelegation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashFromUndelegation.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashFromUndelegation) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashFromUndelegation.Merge(m, src) +} +func (m *SlashFromUndelegation) XXX_Size() int { + return m.Size() +} +func (m *SlashFromUndelegation) XXX_DiscardUnknown() { + xxx_messageInfo_SlashFromUndelegation.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashFromUndelegation proto.InternalMessageInfo + +func (m *SlashFromUndelegation) GetStakerID() string { + if m != nil { + return m.StakerID + } + return "" +} + +func (m *SlashFromUndelegation) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// SlashFromAssetsPool records the slash detail from the operator assets pool +type SlashFromAssetsPool struct { + AssetID string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // amount is the slashed amount from the assets pool. + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *SlashFromAssetsPool) Reset() { *m = SlashFromAssetsPool{} } +func (m *SlashFromAssetsPool) String() string { return proto.CompactTextString(m) } +func (*SlashFromAssetsPool) ProtoMessage() {} +func (*SlashFromAssetsPool) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{7} +} +func (m *SlashFromAssetsPool) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashFromAssetsPool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashFromAssetsPool.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashFromAssetsPool) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashFromAssetsPool.Merge(m, src) +} +func (m *SlashFromAssetsPool) XXX_Size() int { + return m.Size() +} +func (m *SlashFromAssetsPool) XXX_DiscardUnknown() { + xxx_messageInfo_SlashFromAssetsPool.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashFromAssetsPool proto.InternalMessageInfo + +func (m *SlashFromAssetsPool) GetAssetID() string { + if m != nil { + return m.AssetID + } + return "" +} + +// SlashAssetsInfo is the slashed assets information +type SlashExecutionInfo struct { + // slash_proportion is the new calculated proportion when execute the slash + SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` + // slash_value is the usd value of all slashed assets + SlashValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=slash_value,json=slashValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_value"` + // SlashUndelegations records all slash info related to the undelegation + SlashUndelegations []*SlashFromUndelegation `protobuf:"bytes,3,rep,name=slash_undelegations,json=slashUndelegations,proto3" json:"slash_undelegations,omitempty"` + // SlashFromAssetsPool records all slash info related to the assets pool + SlashAssetsPool []*SlashFromAssetsPool `protobuf:"bytes,4,rep,name=slash_assets_pool,json=slashAssetsPool,proto3" json:"slash_assets_pool,omitempty"` +} + +func (m *SlashExecutionInfo) Reset() { *m = SlashExecutionInfo{} } +func (m *SlashExecutionInfo) String() string { return proto.CompactTextString(m) } +func (*SlashExecutionInfo) ProtoMessage() {} +func (*SlashExecutionInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{8} +} +func (m *SlashExecutionInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SlashExecutionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SlashExecutionInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SlashExecutionInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SlashExecutionInfo.Merge(m, src) +} +func (m *SlashExecutionInfo) XXX_Size() int { + return m.Size() +} +func (m *SlashExecutionInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SlashExecutionInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SlashExecutionInfo proto.InternalMessageInfo + +func (m *SlashExecutionInfo) GetSlashUndelegations() []*SlashFromUndelegation { + if m != nil { + return m.SlashUndelegations + } + return nil +} + +func (m *SlashExecutionInfo) GetSlashAssetsPool() []*SlashFromAssetsPool { + if m != nil { + return m.SlashAssetsPool + } + return nil +} + // OperatorSlashInfo is the slash info of operator type OperatorSlashInfo struct { // slash_contract is the address of slash contract @@ -413,21 +576,21 @@ type OperatorSlashInfo struct { SubmittedHeight int64 `protobuf:"varint,2,opt,name=submitted_height,json=submittedHeight,proto3" json:"submitted_height,omitempty"` // event_height is the exocore block height at which the slash event occurs EventHeight int64 `protobuf:"varint,3,opt,name=event_height,json=eventHeight,proto3" json:"event_height,omitempty"` - // processed_height is the exocore block height at which the slash event is processed - ProcessedHeight int64 `protobuf:"varint,4,opt,name=processed_height,json=processedHeight,proto3" json:"processed_height,omitempty"` // is_vetoed is a flag to indicate if this slash is vetoed - IsVetoed bool `protobuf:"varint,5,opt,name=is_vetoed,json=isVetoed,proto3" json:"is_vetoed,omitempty"` + IsVetoed bool `protobuf:"varint,4,opt,name=is_vetoed,json=isVetoed,proto3" json:"is_vetoed,omitempty"` // slash_proportion is the proportion of assets that need to be slashed - SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` - // type indicates the slash type. - SlashType SlashType `protobuf:"varint,7,opt,name=slash_type,json=slashType,proto3,enum=exocore.operator.v1.SlashType" json:"slash_type,omitempty"` + SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` + // slash_type indicates the slash type of specified AVS. + SlashType uint32 `protobuf:"varint,6,opt,name=slash_type,json=slashType,proto3" json:"slash_type,omitempty"` + // SlashExecutionInfo stores the slashed execution information + ExecutionInfo *SlashExecutionInfo `protobuf:"bytes,7,opt,name=execution_info,json=executionInfo,proto3" json:"execution_info,omitempty"` } func (m *OperatorSlashInfo) Reset() { *m = OperatorSlashInfo{} } func (m *OperatorSlashInfo) String() string { return proto.CompactTextString(m) } func (*OperatorSlashInfo) ProtoMessage() {} func (*OperatorSlashInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{6} + return fileDescriptor_b229d5663e4df167, []int{9} } func (m *OperatorSlashInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -477,13 +640,6 @@ func (m *OperatorSlashInfo) GetEventHeight() int64 { return 0 } -func (m *OperatorSlashInfo) GetProcessedHeight() int64 { - if m != nil { - return m.ProcessedHeight - } - return 0 -} - func (m *OperatorSlashInfo) GetIsVetoed() bool { if m != nil { return m.IsVetoed @@ -491,11 +647,18 @@ func (m *OperatorSlashInfo) GetIsVetoed() bool { return false } -func (m *OperatorSlashInfo) GetSlashType() SlashType { +func (m *OperatorSlashInfo) GetSlashType() uint32 { if m != nil { return m.SlashType } - return SlashType_SLASH_TYPE_UNSPECIFIED + return 0 +} + +func (m *OperatorSlashInfo) GetExecutionInfo() *SlashExecutionInfo { + if m != nil { + return m.ExecutionInfo + } + return nil } // RegisterOperatorReq is the request to register a new operator. @@ -510,7 +673,7 @@ func (m *RegisterOperatorReq) Reset() { *m = RegisterOperatorReq{} } func (m *RegisterOperatorReq) String() string { return proto.CompactTextString(m) } func (*RegisterOperatorReq) ProtoMessage() {} func (*RegisterOperatorReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{7} + return fileDescriptor_b229d5663e4df167, []int{10} } func (m *RegisterOperatorReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,7 +710,7 @@ func (m *RegisterOperatorResponse) Reset() { *m = RegisterOperatorRespon func (m *RegisterOperatorResponse) String() string { return proto.CompactTextString(m) } func (*RegisterOperatorResponse) ProtoMessage() {} func (*RegisterOperatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{8} + return fileDescriptor_b229d5663e4df167, []int{11} } func (m *RegisterOperatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -593,7 +756,7 @@ func (m *OptInToCosmosChainRequest) Reset() { *m = OptInToCosmosChainReq func (m *OptInToCosmosChainRequest) String() string { return proto.CompactTextString(m) } func (*OptInToCosmosChainRequest) ProtoMessage() {} func (*OptInToCosmosChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{9} + return fileDescriptor_b229d5663e4df167, []int{12} } func (m *OptInToCosmosChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -651,7 +814,7 @@ func (m *OptInToCosmosChainResponse) Reset() { *m = OptInToCosmosChainRe func (m *OptInToCosmosChainResponse) String() string { return proto.CompactTextString(m) } func (*OptInToCosmosChainResponse) ProtoMessage() {} func (*OptInToCosmosChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{10} + return fileDescriptor_b229d5663e4df167, []int{13} } func (m *OptInToCosmosChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,7 +855,7 @@ func (m *InitOptOutFromCosmosChainRequest) Reset() { *m = InitOptOutFrom func (m *InitOptOutFromCosmosChainRequest) String() string { return proto.CompactTextString(m) } func (*InitOptOutFromCosmosChainRequest) ProtoMessage() {} func (*InitOptOutFromCosmosChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{11} + return fileDescriptor_b229d5663e4df167, []int{14} } func (m *InitOptOutFromCosmosChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -743,7 +906,7 @@ func (m *InitOptOutFromCosmosChainResponse) Reset() { *m = InitOptOutFro func (m *InitOptOutFromCosmosChainResponse) String() string { return proto.CompactTextString(m) } func (*InitOptOutFromCosmosChainResponse) ProtoMessage() {} func (*InitOptOutFromCosmosChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{12} + return fileDescriptor_b229d5663e4df167, []int{15} } func (m *InitOptOutFromCosmosChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -780,6 +943,9 @@ func init() { proto.RegisterType((*OperatorInfo)(nil), "exocore.operator.v1.OperatorInfo") proto.RegisterType((*OptedInfo)(nil), "exocore.operator.v1.OptedInfo") proto.RegisterType((*OptedInAssetState)(nil), "exocore.operator.v1.OptedInAssetState") + proto.RegisterType((*SlashFromUndelegation)(nil), "exocore.operator.v1.SlashFromUndelegation") + proto.RegisterType((*SlashFromAssetsPool)(nil), "exocore.operator.v1.SlashFromAssetsPool") + proto.RegisterType((*SlashExecutionInfo)(nil), "exocore.operator.v1.SlashExecutionInfo") proto.RegisterType((*OperatorSlashInfo)(nil), "exocore.operator.v1.OperatorSlashInfo") proto.RegisterType((*RegisterOperatorReq)(nil), "exocore.operator.v1.RegisterOperatorReq") proto.RegisterType((*RegisterOperatorResponse)(nil), "exocore.operator.v1.RegisterOperatorResponse") @@ -792,79 +958,89 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/tx.proto", fileDescriptor_b229d5663e4df167) } var fileDescriptor_b229d5663e4df167 = []byte{ - // 1139 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x4f, 0x1b, 0x47, - 0x14, 0xf6, 0x62, 0x7e, 0xf9, 0x61, 0xb0, 0x19, 0x22, 0x30, 0x2e, 0x35, 0xb0, 0x69, 0x22, 0x82, - 0x8a, 0x2d, 0x68, 0x53, 0xa9, 0x69, 0x2b, 0xd5, 0x18, 0xa3, 0x58, 0x05, 0x1b, 0xad, 0x9d, 0x48, - 0x6d, 0x0f, 0xab, 0x65, 0x3d, 0x98, 0x29, 0xf6, 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 0xb8, 0x96, 0x8c, 0xa0, 0x19, 0x48, 0x85, 0x7c, 0xa5, 0x72, 0xb5, - 0x96, 0x2f, 0xd7, 0x4c, 0x69, 0x4a, 0x6a, 0xe8, 0x06, 0xcc, 0x87, 0xbc, 0xe5, 0x4a, 0x00, 0xc8, - 0x97, 0x8b, 0x95, 0x7b, 0x55, 0x05, 0xeb, 0x5b, 0xf9, 0x36, 0x0a, 0xd1, 0x4d, 0xd6, 0x40, 0x7b, - 0x90, 0x7c, 0xf1, 0xea, 0xd0, 0x42, 0x4f, 0xb5, 0xf4, 0x90, 0x68, 0x7a, 0xe9, 0x15, 0x91, 0xfe, - 0x88, 0xe8, 0x21, 0xa0, 0x8b, 0x97, 0x81, 0xb2, 0x97, 0x88, 0xf3, 0x12, 0xd1, 0xa4, 0x73, 0xaf, - 0x8c, 0x57, 0xb7, 0x1c, 0x41, 0x3f, 0x6a, 0x30, 0x7d, 0xe9, 0x0d, 0xa0, 0xdb, 0x3d, 0x13, 0xbe, - 0x4c, 0x18, 0xe9, 0x0f, 0xae, 0x1a, 0x16, 0xb4, 0x93, 0x1e, 0xf8, 0x46, 0xfc, 0x79, 0x5b, 0xdd, - 0x78, 0x7a, 0x9c, 0xd1, 0x9e, 0x1d, 0x67, 0xb4, 0xbf, 0x8f, 0x33, 0xda, 0x4f, 0x27, 0x99, 0xc8, - 0xb3, 0x93, 0x4c, 0xe4, 0xcf, 0x93, 0x4c, 0xe4, 0x8b, 0x95, 0xd0, 0x62, 0x2a, 0xfa, 0x45, 0xca, - 0x98, 0x3f, 0xa4, 0xde, 0x5e, 0x2e, 0xf8, 0xfc, 0xdc, 0x3f, 0xfb, 0x00, 0x95, 0x8b, 0x6a, 0x7b, - 0x50, 0x7e, 0xe9, 0xbd, 0xf7, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0x8a, 0x43, 0x4e, 0xa1, - 0x0a, 0x00, 0x00, + // 1312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xc6, 0xf9, 0xf2, 0xb3, 0xd3, 0x38, 0x93, 0xd2, 0x3a, 0xa6, 0x8d, 0x93, 0x2d, 0x2d, + 0x69, 0x44, 0x6c, 0xb5, 0x50, 0x24, 0x0a, 0x07, 0x92, 0xd8, 0x51, 0x57, 0xa4, 0x76, 0xb4, 0x76, + 0x2b, 0x41, 0x85, 0x56, 0x9b, 0xf5, 0xd4, 0x59, 0xb2, 0xde, 0xd9, 0xee, 0x8c, 0xd3, 0xa4, 0x12, + 0x12, 0x70, 0x42, 0x08, 0x09, 0x24, 0x4e, 0x48, 0x1c, 0x7a, 0xe4, 0xd8, 0x43, 0xaf, 0x08, 0xb8, + 0xf5, 0x58, 0xf5, 0x84, 0x38, 0x44, 0x28, 0x3d, 0x94, 0x7f, 0x02, 0x09, 0xcd, 0xc7, 0x3a, 0x9b, + 0x76, 0x53, 0x5a, 0x35, 0x5c, 0xda, 0xcc, 0x7b, 0xbf, 0xf7, 0xfd, 0x9b, 0x37, 0x5e, 0x38, 0x85, + 0xb7, 0x89, 0x43, 0x42, 0x5c, 0x21, 0x01, 0x0e, 0x6d, 0x46, 0xc2, 0xca, 0xd6, 0x85, 0x0a, 0xdb, + 0x2e, 0x07, 0x21, 0x61, 0x04, 0x4d, 0x2a, 0x6d, 0x39, 0xd2, 0x96, 0xb7, 0x2e, 0x14, 0x27, 0xec, + 0xae, 0xeb, 0x93, 0x8a, 0xf8, 0x57, 0xe2, 0x8a, 0x27, 0x1d, 0x42, 0xbb, 0x84, 0x56, 0xba, 0xb4, + 0xc3, 0xed, 0xbb, 0xb4, 0xa3, 0x14, 0x6f, 0x28, 0x05, 0x65, 0xf6, 0xa6, 0xeb, 0x73, 0xe5, 0x3a, + 0x66, 0xf6, 0x85, 0xe8, 0xac, 0x50, 0x53, 0x12, 0x65, 0x89, 0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x41, 0x48, 0x02, + 0x12, 0x72, 0xf9, 0x91, 0x6c, 0xe2, 0x71, 0xe1, 0x75, 0xad, 0xef, 0x14, 0x7d, 0x0a, 0x59, 0x19, + 0xe8, 0xe8, 0x28, 0x03, 0xc2, 0xa1, 0x78, 0x4c, 0xd0, 0x0d, 0x98, 0x94, 0xee, 0x7b, 0x31, 0xce, + 0xd0, 0x42, 0x5a, 0x6c, 0xf5, 0xf9, 0xc4, 0x65, 0x92, 0x48, 0x33, 0x13, 0x09, 0x37, 0x71, 0x11, + 0x45, 0x2d, 0x98, 0x90, 0xce, 0xc5, 0x88, 0xa8, 0x15, 0x10, 0xe2, 0x15, 0x06, 0x85, 0xeb, 0xb9, + 0xe7, 0xbb, 0xde, 0x1f, 0xbf, 0xea, 0xc8, 0xbe, 0x40, 0xff, 0x67, 0x80, 0x5f, 0x55, 0x69, 0x24, + 0x0c, 0x5e, 0x66, 0xa3, 0x9c, 0x87, 0x3c, 0xed, 0xad, 0x77, 0x5d, 0xc6, 0xb7, 0x45, 0x6c, 0xa5, + 0xa4, 0xcd, 0xf1, 0xbe, 0x5c, 0xad, 0x8a, 0x59, 0xc8, 0xe1, 0x2d, 0xbe, 0x6d, 0x63, 0x0b, 0x25, + 0x6d, 0x66, 0x85, 0x4c, 0x41, 0x5e, 0x87, 0x8c, 0x4b, 0xad, 0x2d, 0xcc, 0x48, 0x7f, 0xa1, 0x8c, + 0xba, 0xf4, 0xba, 0x38, 0x27, 0x52, 0x64, 0xe8, 0xff, 0xa0, 0xc8, 0x69, 0x90, 0x13, 0xb5, 0xb8, + 0x45, 0x61, 0x78, 0x46, 0x9b, 0x1b, 0x33, 0x33, 0x42, 0xd2, 0xda, 0x09, 0x30, 0xaa, 0xc3, 0x31, + 0x1c, 0x71, 0x57, 0x3e, 0x30, 0x23, 0x62, 0x99, 0xbf, 0x79, 0xf8, 0x08, 0x0e, 0x70, 0xdd, 0x1c, + 0xc3, 0xf1, 0xa3, 0xfe, 0xab, 0x06, 0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d, 0x4a, 0xf4, 0xb9, 0xb5, 0xbd, 0xff, 0xc1, 0x25, 0x16, 0xdb, 0xfa, 0xb0, 0xf8, 0xb2, + 0x79, 0xfb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xd0, 0x41, 0x68, 0x91, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1303,6 +1479,164 @@ func (m *OptedInAssetState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SlashFromUndelegation) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashFromUndelegation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashFromUndelegation) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintTx(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0x12 + } + if len(m.StakerID) > 0 { + i -= len(m.StakerID) + copy(dAtA[i:], m.StakerID) + i = encodeVarintTx(dAtA, i, uint64(len(m.StakerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlashFromAssetsPool) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashFromAssetsPool) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashFromAssetsPool) 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 = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.AssetID) > 0 { + i -= len(m.AssetID) + copy(dAtA[i:], m.AssetID) + i = encodeVarintTx(dAtA, i, uint64(len(m.AssetID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SlashExecutionInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SlashExecutionInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SlashExecutionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SlashAssetsPool) > 0 { + for iNdEx := len(m.SlashAssetsPool) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SlashAssetsPool[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.SlashUndelegations) > 0 { + for iNdEx := len(m.SlashUndelegations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SlashUndelegations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size := m.SlashValue.Size() + i -= size + if _, err := m.SlashValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size := m.SlashProportion.Size() + i -= size + if _, err := m.SlashProportion.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *OperatorSlashInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1323,10 +1657,22 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ExecutionInfo != nil { + { + size, err := m.ExecutionInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } if m.SlashType != 0 { i = encodeVarintTx(dAtA, i, uint64(m.SlashType)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } { size := m.SlashProportion.Size() @@ -1337,7 +1683,7 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x2a if m.IsVetoed { i-- if m.IsVetoed { @@ -1346,11 +1692,6 @@ func (m *OperatorSlashInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0 } i-- - dAtA[i] = 0x28 - } - if m.ProcessedHeight != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ProcessedHeight)) - i-- dAtA[i] = 0x20 } if m.EventHeight != 0 { @@ -1680,24 +2021,80 @@ func (m *OptedInAssetState) Size() (n int) { return n } -func (m *OperatorSlashInfo) Size() (n int) { +func (m *SlashFromUndelegation) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SlashContract) + l = len(m.StakerID) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.SubmittedHeight != 0 { - n += 1 + sovTx(uint64(m.SubmittedHeight)) + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - if m.EventHeight != 0 { - n += 1 + sovTx(uint64(m.EventHeight)) + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *SlashFromAssetsPool) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AssetID) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *SlashExecutionInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.SlashProportion.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.SlashValue.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.SlashUndelegations) > 0 { + for _, e := range m.SlashUndelegations { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.SlashAssetsPool) > 0 { + for _, e := range m.SlashAssetsPool { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *OperatorSlashInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SlashContract) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.SubmittedHeight != 0 { + n += 1 + sovTx(uint64(m.SubmittedHeight)) } - if m.ProcessedHeight != 0 { - n += 1 + sovTx(uint64(m.ProcessedHeight)) + if m.EventHeight != 0 { + n += 1 + sovTx(uint64(m.EventHeight)) } if m.IsVetoed { n += 2 @@ -1707,6 +2104,10 @@ func (m *OperatorSlashInfo) Size() (n int) { if m.SlashType != 0 { n += 1 + sovTx(uint64(m.SlashType)) } + if m.ExecutionInfo != nil { + l = m.ExecutionInfo.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2540,7 +2941,7 @@ func (m *OptedInAssetState) Unmarshal(dAtA []byte) error { } return nil } -func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { +func (m *SlashFromUndelegation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2563,15 +2964,15 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OperatorSlashInfo: wiretype end group for non-group") + return fmt.Errorf("proto: SlashFromUndelegation: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OperatorSlashInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SlashFromUndelegation: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashContract", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StakerID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2599,13 +3000,13 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SlashContract = string(dAtA[iNdEx:postIndex]) + m.StakerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SubmittedHeight", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", wireType) } - m.SubmittedHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2615,16 +3016,29 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SubmittedHeight |= int64(b&0x7F) << shift + 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.AssetID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EventHeight", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) } - m.EventHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2634,16 +3048,81 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.EventHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessedHeight", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := 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 *SlashFromAssetsPool) Unmarshal(dAtA []byte) 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: SlashFromAssetsPool: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashFromAssetsPool: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetID", wireType) } - m.ProcessedHeight = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2653,16 +3132,29 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ProcessedHeight |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsVetoed", wireType) + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx } - var v int + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetID = 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 ErrIntOverflowTx @@ -2672,13 +3164,77 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - m.IsVetoed = bool(v != 0) - case 6: + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + 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 := 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 *SlashExecutionInfo) Unmarshal(dAtA []byte) 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: SlashExecutionInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SlashExecutionInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SlashProportion", wireType) } @@ -2712,11 +3268,11 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashType", wireType) + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashValue", wireType) } - m.SlashType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2726,11 +3282,323 @@ func (m *OperatorSlashInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.SlashType |= SlashType(b&0x7F) << shift + 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 + } + if err := m.SlashValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashUndelegations", 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.SlashUndelegations = append(m.SlashUndelegations, &SlashFromUndelegation{}) + if err := m.SlashUndelegations[len(m.SlashUndelegations)-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 SlashAssetsPool", 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.SlashAssetsPool = append(m.SlashAssetsPool, &SlashFromAssetsPool{}) + if err := m.SlashAssetsPool[len(m.SlashAssetsPool)-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 *OperatorSlashInfo) Unmarshal(dAtA []byte) 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: OperatorSlashInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OperatorSlashInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashContract", 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.SlashContract = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SubmittedHeight", wireType) + } + m.SubmittedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SubmittedHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EventHeight", wireType) + } + m.EventHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EventHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsVetoed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsVetoed = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashProportion", 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 + } + if err := m.SlashProportion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashType", wireType) + } + m.SlashType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SlashType |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExecutionInfo", 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.ExecutionInfo == nil { + m.ExecutionInfo = &SlashExecutionInfo{} + } + if err := m.ExecutionInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/reward/types/query.pb.gw.go b/x/reward/types/query.pb.gw.go index 17252797c..67784ea28 100644 --- a/x/reward/types/query.pb.gw.go +++ b/x/reward/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ 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 @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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 { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) diff --git a/x/slash/types/query.pb.gw.go b/x/slash/types/query.pb.gw.go index 9edbdedb6..82bdc46cb 100644 --- a/x/slash/types/query.pb.gw.go +++ b/x/slash/types/query.pb.gw.go @@ -20,6 +20,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -30,6 +31,7 @@ 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 @@ -52,12 +54,14 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// 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 { @@ -65,6 +69,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) From 85a772bfffa026e520137688d4de967622e11c32 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Mon, 20 May 2024 14:15:15 +0800 Subject: [PATCH 02/13] fix the protobuf lint error --- proto/exocore/operator/v1/tx.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/proto/exocore/operator/v1/tx.proto b/proto/exocore/operator/v1/tx.proto index 0257be234..4de218eec 100644 --- a/proto/exocore/operator/v1/tx.proto +++ b/proto/exocore/operator/v1/tx.proto @@ -108,6 +108,7 @@ message SlashFromUndelegation { } // SlashFromAssetsPool records the slash detail from the operator assets pool message SlashFromAssetsPool { + // asset_id is the asset id. string asset_id = 1 [(gogoproto.customname) = "AssetID"]; // amount is the slashed amount from the assets pool. string amount = 2 From 22319327d80648d517caaca1734efdb9986785a4 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Thu, 23 May 2024 10:21:26 +0800 Subject: [PATCH 03/13] fix the issue #58 regarding voting power not taking effect --- testutil/utils.go | 2 +- x/operator/keeper/usd_value.go | 2 +- x/operator/keeper/usd_value_test.go | 51 +++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/testutil/utils.go b/testutil/utils.go index d387efbb9..82a4d53bd 100644 --- a/testutil/utils.go +++ b/testutil/utils.go @@ -236,7 +236,7 @@ func (suite *BaseTestSuite) SetupWithGenesisValSet(genAccs []authtypes.GenesisAc Power: 1, }, { - PublicKey: hexutil.Encode(pubKey.Bytes()), + PublicKey: hexutil.Encode(pubKey2.Bytes()), Power: 1, }, }, diff --git a/x/operator/keeper/usd_value.go b/x/operator/keeper/usd_value.go index 3b9011989..dd282566e 100644 --- a/x/operator/keeper/usd_value.go +++ b/x/operator/keeper/usd_value.go @@ -217,7 +217,7 @@ func (k Keeper) GetAvgDelegatedValue( } ret := make([]int64, 0) for _, operator := range operators { - usdValue, err := k.GetOperatorUSDValue(ctx, operator.String(), avsAddr) + usdValue, err := k.GetOperatorUSDValue(ctx, avsAddr, operator.String()) if err != nil { return nil, err } diff --git a/x/operator/keeper/usd_value_test.go b/x/operator/keeper/usd_value_test.go index 071d7580b..6eb92aa50 100644 --- a/x/operator/keeper/usd_value_test.go +++ b/x/operator/keeper/usd_value_test.go @@ -99,3 +99,54 @@ func (suite *OperatorTestSuite) TestAVSUSDValue() { suite.NoError(err) suite.Equal(expectedUSDvalue, operatorUSDValue) } + +func (suite *OperatorTestSuite) TestVotingPowerForDogFood() { + initialPower := int64(1) + initialAVSUSDValue := sdkmath.LegacyNewDec(2) + initialOperatorUSDValue := sdkmath.LegacyNewDec(1) + addPower := 1 + addUSDValue := sdkmath.LegacyNewDec(1) + + validators := suite.App.StakingKeeper.GetAllExocoreValidators(suite.Ctx) + for _, validator := range validators { + _, isFound := suite.App.StakingKeeper.GetValidatorByConsAddr(suite.Ctx, validator.Address) + suite.True(isFound) + suite.Equal(initialPower, validator.Power) + } + + operators, _ := suite.App.OperatorKeeper.GetActiveOperatorsForChainID(suite.Ctx, suite.Ctx.ChainID()) + allAssets, err := suite.App.AssetsKeeper.GetAllStakingAssetsInfo(suite.Ctx) + suite.NoError(err) + suite.Equal(1, len(allAssets)) + var asset assetstype.AssetInfo + for _, value := range allAssets { + asset = *value.AssetBasicInfo + } + + assetAddr := common.HexToAddress(asset.Address) + depositAmount := sdkmath.NewIntWithDecimal(2, int(asset.Decimals)) + delegationAmount := sdkmath.NewIntWithDecimal(int64(addPower), int(asset.Decimals)) + suite.prepareDeposit(assetAddr, depositAmount) + suite.operatorAddr = operators[0] + suite.prepareDelegation(true, assetAddr, delegationAmount) + + suite.App.OperatorKeeper.EndBlock(suite.Ctx, abci.RequestEndBlock{}) + avsUSDValue, err := suite.App.OperatorKeeper.GetAVSUSDValue(suite.Ctx, suite.Ctx.ChainID()) + suite.NoError(err) + suite.Equal(initialAVSUSDValue.Add(addUSDValue), avsUSDValue) + operatorUSDValue, err := suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, suite.Ctx.ChainID(), suite.operatorAddr.String()) + suite.NoError(err) + suite.Equal(initialOperatorUSDValue.Add(addUSDValue), operatorUSDValue) + + found, consensusKey, err := suite.App.OperatorKeeper.GetOperatorConsKeyForChainID(suite.Ctx, suite.operatorAddr, suite.Ctx.ChainID()) + suite.NoError(err) + suite.True(found) + + suite.App.StakingKeeper.MarkEpochEnd(suite.Ctx) + validatorUpdates := suite.App.StakingKeeper.EndBlock(suite.Ctx) + suite.Equal(1, len(validatorUpdates)) + for _, update := range validatorUpdates { + suite.Equal(*consensusKey, update.PubKey) + suite.Equal(initialPower+int64(addPower), update.Power) + } +} From 1d86096b937adef48fe59180084f6bf35297e332 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Thu, 30 May 2024 14:35:27 +0800 Subject: [PATCH 04/13] remove the useless expected interfaces --- x/operator/keeper/keeper.go | 15 ++++++++-- x/operator/keeper/usd_value.go | 5 ++++ x/operator/types/expected_keepers.go | 42 ---------------------------- 3 files changed, 18 insertions(+), 44 deletions(-) diff --git a/x/operator/keeper/keeper.go b/x/operator/keeper/keeper.go index 11e019bba..dd7336bac 100644 --- a/x/operator/keeper/keeper.go +++ b/x/operator/keeper/keeper.go @@ -2,10 +2,11 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/ExocoreNetwork/exocore/x/assets/types" - sdkmath "cosmossdk.io/math" operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -69,5 +70,15 @@ type OperatorKeeper interface { OptOut(ctx sdk.Context, OperatorAddress sdk.AccAddress, AVSAddr string) error - NoInstantaneousSlash(ctx sdk.Context, operatorAddress sdk.AccAddress, AVSAddr, slashContract, slashID string, occurredSateHeight int64, slashProportion sdkmath.LegacyDec) error + Slash(ctx sdk.Context, parameter *SlashInputInfo) error + + SlashWithInfractionReason( + ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, + slashFactor sdk.Dec, infraction stakingtypes.Infraction, + ) sdkmath.Int + + OptInToCosmosChain( + goCtx context.Context, + req *operatortypes.OptInToCosmosChainRequest, + ) (*operatortypes.OptInToCosmosChainResponse, error) } diff --git a/x/operator/keeper/usd_value.go b/x/operator/keeper/usd_value.go index dd282566e..55516f2bc 100644 --- a/x/operator/keeper/usd_value.go +++ b/x/operator/keeper/usd_value.go @@ -83,6 +83,11 @@ func (k *Keeper) DeleteOperatorUSDValue(ctx sdk.Context, avsAddr, operatorAddr s // of Avs should decrease the USD share of the opted-out operator // This function can also serve as an RPC in the future. func (k *Keeper) GetOperatorUSDValue(ctx sdk.Context, avsAddr, operatorAddr string) (sdkmath.LegacyDec, error) { + // return zero if the operator has opted-out of the AVS + if !k.IsOptedIn(ctx, operatorAddr, avsAddr) { + return sdkmath.LegacyNewDec(0), nil + } + store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixVotingPowerForAVSOperator) var ret operatortypes.DecValueField var key []byte diff --git a/x/operator/types/expected_keepers.go b/x/operator/types/expected_keepers.go index 4867c4622..8d9ab8039 100644 --- a/x/operator/types/expected_keepers.go +++ b/x/operator/types/expected_keepers.go @@ -26,33 +26,12 @@ type AssetsKeeper interface { f func(assetID string, state *assetstype.OperatorAssetInfo) error, ) error AppChainInfoIsExist(ctx sdk.Context, chainID string) bool - GetOperatorAssetInfos( - ctx sdk.Context, operatorAddr sdk.Address, assetsFilter map[string]interface{}, - ) (assetsInfo map[string]*assetstype.OperatorAssetInfo, err error) - GetOperatorSpecifiedAssetInfo(ctx sdk.Context, operatorAddr sdk.Address, assetID string) (info *assetstype.OperatorAssetInfo, err error) - UpdateStakerAssetState( - ctx sdk.Context, stakerID string, assetID string, - changeAmount assetstype.DeltaStakerSingleAsset, - ) (err error) - UpdateOperatorAssetState( - ctx sdk.Context, operatorAddr sdk.Address, assetID string, - changeAmount assetstype.DeltaOperatorSingleAsset, - ) (err error) GetAllStakingAssetsInfo(ctx sdk.Context) (allAssets map[string]*assetstype.StakingAssetInfo, err error) } var _ DelegationKeeper = &keeper.Keeper{} type DelegationKeeper interface { - GetSingleDelegationInfo( - ctx sdk.Context, stakerID, assetID, operatorAddr string, - ) (*delegationtype.DelegationAmounts, error) - DelegationStateByOperatorAssets( - ctx sdk.Context, operatorAddr string, assetsFilter map[string]interface{}, - ) (map[string]map[string]delegationtype.DelegationAmounts, error) - UpdateDelegationState( - ctx sdk.Context, stakerID, assetID, opAddr string, deltaAmounts *delegationtype.DeltaDelegationAmounts, - ) (bool, error) IterateUndelegationsByOperator( ctx sdk.Context, operator string, heightFilter *uint64, isUpdate bool, opFunc func(undelegation *delegationtype.UndelegationRecord) error) error @@ -63,19 +42,6 @@ type DelegationKeeper interface { ctx sdk.Context, operator, assetID string, stakerList delegationtype.StakerList, ) error DeleteStakersListForOperator(ctx sdk.Context, operator, assetID string) error - GetStakerUndelegationRecords( - ctx sdk.Context, stakerID, assetID string, - ) (records []*delegationtype.UndelegationRecord, err error) - SetSingleUndelegationRecord( - ctx sdk.Context, record *delegationtype.UndelegationRecord, - ) (recordKey []byte, err error) - CalculateSlashShare( - ctx sdk.Context, operator sdk.AccAddress, stakerID, assetID string, slashAmount sdkmath.Int, - ) (share sdkmath.LegacyDec, err error) - RemoveShare( - ctx sdk.Context, isUndelegation bool, operator sdk.AccAddress, - stakerID, assetID string, share sdkmath.LegacyDec, - ) (removeToken sdkmath.Int, err error) } type PriceChange struct { @@ -101,11 +67,6 @@ type OracleKeeper interface { // GetMultipleAssetsPrices is a function to retrieve multiple assets prices according to the // assetID. GetMultipleAssetsPrices(ctx sdk.Context, assets map[string]interface{}) (map[string]Price, error) - // GetPriceChangeAssets the operator module expect a function that can retrieve all - // information about assets price change. Then it can update the USD share state according - // to the change information. This function need to return a map, the key is assetID and the - // value is PriceChange - GetPriceChangeAssets(ctx sdk.Context) (map[string]*PriceChange, error) } type MockOracle struct{} @@ -195,9 +156,6 @@ type AVSKeeper interface { // todo: maybe the epoch of different AVSs should be implemented in the AVS module,then // the other modules implement the EpochsHooks to trigger state updating. GetEpochEndAVSs(ctx sdk.Context) ([]string, error) - // GetHeightForVotingPower retrieves the height of the last block in the epoch - // where the voting power used at the current height resides - GetHeightForVotingPower(ctx sdk.Context, avsAddr string, height int64) (int64, error) } // add for dogfood From 64d7c9fc6aae30ad3f157df1e2985235860953b5 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Thu, 30 May 2024 16:10:53 +0800 Subject: [PATCH 05/13] fix the issues caused by merge conflict --- precompiles/avsTask/task_test.go | 3 +- x/avs/keeper/avs_test.go | 14 +- x/avs/types/tx.pb.go | 800 +++++- x/delegation/types/query.pb.go | 478 +++- x/delegation/types/query.pb.gw.go | 101 + x/operator/keeper/keeper.go | 6 +- x/operator/keeper/opt.go | 3 +- x/operator/keeper/opt_test.go | 4 +- x/operator/types/codec.go | 8 + x/operator/types/expected_keepers.go | 13 - x/operator/types/query.pb.go | 3893 +++++++++++++++++++++----- x/operator/types/query.pb.gw.go | 530 +++- x/operator/types/tx.pb.go | 1243 ++++++-- x/oracle/types/params.pb.go | 2 +- 14 files changed, 5920 insertions(+), 1178 deletions(-) diff --git a/precompiles/avsTask/task_test.go b/precompiles/avsTask/task_test.go index 125710751..614f1e43c 100644 --- a/precompiles/avsTask/task_test.go +++ b/precompiles/avsTask/task_test.go @@ -2,9 +2,10 @@ package task_test import ( "encoding/hex" + "math/big" + "github.com/ExocoreNetwork/exocore/x/avs/types" sdk "github.com/cosmos/cosmos-sdk/types" - "math/big" "github.com/ExocoreNetwork/exocore/app" "github.com/ExocoreNetwork/exocore/precompiles/avsTask" diff --git a/x/avs/keeper/avs_test.go b/x/avs/keeper/avs_test.go index 74b8a2ff6..c3a298a9f 100644 --- a/x/avs/keeper/avs_test.go +++ b/x/avs/keeper/avs_test.go @@ -63,8 +63,8 @@ func (suite *AVSTestSuite) TestAVSInfoUpdate_Register() { err = suite.App.AVSManagerKeeper.AVSInfoUpdate(suite.Ctx, avsParams) suite.Error(err) suite.Contains(err.Error(), types.ErrAlreadyRegistered.Error()) - } + func (suite *AVSTestSuite) TestAVSInfoUpdate_DeRegister() { // Test case setup avsName, avsAddres, slashAddress := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutash" @@ -99,7 +99,6 @@ func (suite *AVSTestSuite) TestAVSInfoUpdate_DeRegister() { info, err = suite.App.AVSManagerKeeper.GetAVSInfo(suite.Ctx, avsAddres) suite.Error(err) suite.Contains(err.Error(), types.ErrNoKeyInTheStore.Error()) - } func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { @@ -115,7 +114,7 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { suite.Error(err) suite.Contains(err.Error(), delegationtypes.ErrOperatorNotExist.Error()) - //register operator but avs not register + // register operator but avs not register info := &operatortype.OperatorInfo{ EarningsAddr: suite.AccAddress.String(), ApproveAddr: "", @@ -134,7 +133,7 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { suite.Error(err) suite.Contains(err.Error(), types.ErrNoKeyInTheStore.Error()) - //register avs + // register avs avsName, avsAddres, slashAddress := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutash" avsOwnerAddress := []string{"exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkj1", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkj2"} assetID := []string{"11", "22", "33"} @@ -157,19 +156,18 @@ func (suite *AVSTestSuite) TestAVSInfoUpdateWithOperator_Register() { operatorParams.AvsAddress = avsAddres err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.NoError(err) - //duplicate register operator + // duplicate register operator err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.Error(err) suite.Contains(err.Error(), types.ErrAlreadyRegistered.Error()) - //deregister operator + // deregister operator operatorParams.Action = avstypes.DeRegisterAction err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.NoError(err) - //duplicate deregister operator + // duplicate deregister operator operatorParams.Action = avstypes.DeRegisterAction err = suite.App.AVSManagerKeeper.AVSInfoUpdateWithOperator(suite.Ctx, operatorParams) suite.Error(err) suite.Contains(err.Error(), types.ErrUnregisterNonExistent.Error()) - } diff --git a/x/avs/types/tx.pb.go b/x/avs/types/tx.pb.go index ecf1d43ab..058d79d49 100644 --- a/x/avs/types/tx.pb.go +++ b/x/avs/types/tx.pb.go @@ -7,21 +7,28 @@ import ( context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" + _ "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. @@ -35,12 +42,20 @@ type AVSInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // address of avs AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` - // registered operator of avs - OperatorAddress []string `protobuf:"bytes,3,rep,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + // slash address of avs + SlashAddr string `protobuf:"bytes,3,opt,name=slash_addr,json=slashAddr,proto3" json:"slash_addr,omitempty"` // the owner who has permission for avs - AvsOwnerAddress string `protobuf:"bytes,4,opt,name=avs_owner_address,json=avsOwnerAddress,proto3" json:"avs_owner_address,omitempty"` + AvsOwnerAddress []string `protobuf:"bytes,4,rep,name=avs_owner_address,json=avsOwnerAddress,proto3" json:"avs_owner_address,omitempty"` // asset_basic_info is all the basic asset information of the avs. AssetId []string `protobuf:"bytes,5,rep,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + // unbonding duration of avs. + AvsUnbondingPeriod uint32 `protobuf:"varint,6,opt,name=avs_unbonding_period,json=avsUnbondingPeriod,proto3" json:"avs_unbonding_period,omitempty"` + // the operator minimum delegation amount. + MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation"` + //avs epoch ,Subsequently will be handled by the epochs module. + AvsEpoch *EpochInfo `protobuf:"bytes,8,opt,name=avs_epoch,json=avsEpoch,proto3" json:"avs_epoch,omitempty"` + // registered operator of avs + OperatorAddress []string `protobuf:"bytes,9,rep,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` } func (m *AVSInfo) Reset() { *m = AVSInfo{} } @@ -90,18 +105,18 @@ func (m *AVSInfo) GetAvsAddress() string { return "" } -func (m *AVSInfo) GetOperatorAddress() []string { +func (m *AVSInfo) GetSlashAddr() string { if m != nil { - return m.OperatorAddress + return m.SlashAddr } - return nil + return "" } -func (m *AVSInfo) GetAvsOwnerAddress() string { +func (m *AVSInfo) GetAvsOwnerAddress() []string { if m != nil { return m.AvsOwnerAddress } - return "" + return nil } func (m *AVSInfo) GetAssetId() []string { @@ -111,6 +126,128 @@ func (m *AVSInfo) GetAssetId() []string { return nil } +func (m *AVSInfo) GetAvsUnbondingPeriod() uint32 { + if m != nil { + return m.AvsUnbondingPeriod + } + return 0 +} + +func (m *AVSInfo) GetAvsEpoch() *EpochInfo { + if m != nil { + return m.AvsEpoch + } + return nil +} + +func (m *AVSInfo) GetOperatorAddress() []string { + if m != nil { + return m.OperatorAddress + } + return nil +} + +// EpochInfo defines the message interface containing the relevant informations aboutt +// an epoch. +type EpochInfo struct { + // identifier of the epoch + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + // start_time of the epoch + StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` + // duration of the epoch + Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` + // current_epoch is the integer identifier of the epoch + CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + // current_epoch_start_time defines the timestamp of the start of the epoch + CurrentEpochStartTime time.Time `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3,stdtime" json:"current_epoch_start_time" yaml:"current_epoch_start_time"` + // epoch_counting_started reflects if the counting for the epoch has started + EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` + // current_epoch_start_height of the epoch + CurrentEpochStartHeight int64 `protobuf:"varint,7,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` +} + +func (m *EpochInfo) Reset() { *m = EpochInfo{} } +func (m *EpochInfo) String() string { return proto.CompactTextString(m) } +func (*EpochInfo) ProtoMessage() {} +func (*EpochInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c92b5dfe90086a66, []int{1} +} +func (m *EpochInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EpochInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EpochInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EpochInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochInfo.Merge(m, src) +} +func (m *EpochInfo) XXX_Size() int { + return m.Size() +} +func (m *EpochInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EpochInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochInfo proto.InternalMessageInfo + +func (m *EpochInfo) GetIdentifier() string { + if m != nil { + return m.Identifier + } + return "" +} + +func (m *EpochInfo) GetStartTime() time.Time { + if m != nil { + return m.StartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetDuration() time.Duration { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpoch() int64 { + if m != nil { + return m.CurrentEpoch + } + return 0 +} + +func (m *EpochInfo) GetCurrentEpochStartTime() time.Time { + if m != nil { + return m.CurrentEpochStartTime + } + return time.Time{} +} + +func (m *EpochInfo) GetEpochCountingStarted() bool { + if m != nil { + return m.EpochCountingStarted + } + return false +} + +func (m *EpochInfo) GetCurrentEpochStartHeight() int64 { + if m != nil { + return m.CurrentEpochStartHeight + } + return 0 +} + // RegisterAVSReq is requst to register avs type RegisterAVSReq struct { // from_address is the source @@ -123,7 +260,7 @@ func (m *RegisterAVSReq) Reset() { *m = RegisterAVSReq{} } func (m *RegisterAVSReq) String() string { return proto.CompactTextString(m) } func (*RegisterAVSReq) ProtoMessage() {} func (*RegisterAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{1} + return fileDescriptor_c92b5dfe90086a66, []int{2} } func (m *RegisterAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -178,7 +315,7 @@ func (m *RegisterAVSResponse) Reset() { *m = RegisterAVSResponse{} } func (m *RegisterAVSResponse) String() string { return proto.CompactTextString(m) } func (*RegisterAVSResponse) ProtoMessage() {} func (*RegisterAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{2} + return fileDescriptor_c92b5dfe90086a66, []int{3} } func (m *RegisterAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,7 +370,7 @@ func (m *DeRegisterAVSReq) Reset() { *m = DeRegisterAVSReq{} } func (m *DeRegisterAVSReq) String() string { return proto.CompactTextString(m) } func (*DeRegisterAVSReq) ProtoMessage() {} func (*DeRegisterAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{3} + return fileDescriptor_c92b5dfe90086a66, []int{4} } func (m *DeRegisterAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -288,7 +425,7 @@ func (m *DeRegisterAVSResponse) Reset() { *m = DeRegisterAVSResponse{} } func (m *DeRegisterAVSResponse) String() string { return proto.CompactTextString(m) } func (*DeRegisterAVSResponse) ProtoMessage() {} func (*DeRegisterAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{4} + return fileDescriptor_c92b5dfe90086a66, []int{5} } func (m *DeRegisterAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -333,6 +470,7 @@ func (m *DeRegisterAVSResponse) GetInfo() *AVSInfo { func init() { proto.RegisterType((*AVSInfo)(nil), "exocore.avs.AVSInfo") + proto.RegisterType((*EpochInfo)(nil), "exocore.avs.EpochInfo") proto.RegisterType((*RegisterAVSReq)(nil), "exocore.avs.RegisterAVSReq") proto.RegisterType((*RegisterAVSResponse)(nil), "exocore.avs.RegisterAVSResponse") proto.RegisterType((*DeRegisterAVSReq)(nil), "exocore.avs.DeRegisterAVSReq") @@ -342,35 +480,60 @@ func init() { func init() { proto.RegisterFile("exocore/avs/tx.proto", fileDescriptor_c92b5dfe90086a66) } var fileDescriptor_c92b5dfe90086a66 = []byte{ - // 448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0xcd, 0x92, 0x94, 0xd2, 0x31, 0xd0, 0xb0, 0x04, 0x91, 0x1a, 0x61, 0x22, 0x9f, 0x42, 0xa4, - 0xda, 0xa2, 0xdc, 0xe0, 0x94, 0x8a, 0x0f, 0x55, 0xe2, 0x43, 0x72, 0xa4, 0x1e, 0xb8, 0x44, 0xdb, - 0x78, 0x63, 0x2c, 0x64, 0xaf, 0xd9, 0x59, 0xdc, 0x70, 0x43, 0xdc, 0x10, 0x12, 0xea, 0x2f, 0x41, - 0x39, 0xf0, 0x23, 0x38, 0x56, 0x9c, 0x38, 0xa2, 0xe4, 0xd0, 0xbf, 0x81, 0xbc, 0x6b, 0xb7, 0x75, - 0x25, 0xb8, 0xb6, 0x27, 0x7b, 0xe6, 0xbd, 0x7d, 0x9e, 0xf7, 0xac, 0x1d, 0xe8, 0xf0, 0x99, 0x98, - 0x08, 0xc9, 0x7d, 0x96, 0xa3, 0xaf, 0x66, 0x5e, 0x26, 0x85, 0x12, 0xd4, 0x2a, 0xbb, 0x1e, 0xcb, - 0xd1, 0xbe, 0x3d, 0x11, 0x98, 0x08, 0xf4, 0x13, 0x8c, 0xfc, 0xfc, 0x41, 0xf1, 0x30, 0x2c, 0x7b, - 0xc3, 0x00, 0x63, 0x5d, 0xf9, 0xa6, 0x30, 0x90, 0x3b, 0x27, 0xb0, 0x3a, 0xdc, 0x1d, 0xed, 0xa4, - 0x53, 0x41, 0x29, 0xb4, 0x52, 0x96, 0xf0, 0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77, 0x02, 0xcd, 0x97, - 0x18, 0xd1, 0x17, 0x60, 0x9d, 0x9a, 0x8b, 0xde, 0xa9, 0x89, 0xd4, 0xf3, 0xb3, 0x7b, 0xff, 0x06, - 0x4b, 0x3b, 0x01, 0x5c, 0xab, 0xf9, 0xa4, 0x77, 0x6b, 0x47, 0xce, 0xfe, 0x11, 0xdb, 0xfd, 0x1f, - 0x6c, 0x34, 0xed, 0x95, 0x4f, 0x47, 0xf3, 0x01, 0xd9, 0x7e, 0xfe, 0x73, 0xe1, 0x90, 0xc3, 0x85, - 0x43, 0xfe, 0x2c, 0x1c, 0x72, 0xb0, 0x74, 0x1a, 0x87, 0x4b, 0xa7, 0xf1, 0x7b, 0xe9, 0x34, 0xde, - 0x6c, 0x46, 0xb1, 0x7a, 0xfb, 0x61, 0xcf, 0x9b, 0x88, 0xc4, 0x7f, 0x6a, 0xe4, 0x5e, 0x71, 0xb5, - 0x2f, 0xe4, 0x3b, 0xbf, 0x5a, 0x16, 0x33, 0xb3, 0x2e, 0x3e, 0x66, 0x1c, 0xf7, 0x2e, 0xeb, 0x1b, - 0xff, 0xf0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x5f, 0x36, 0xdd, 0x4a, 0x04, 0x00, 0x00, + // 848 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x60, 0xa7, 0xb1, 0x9f, 0x1b, 0x9a, 0x4c, 0xdd, 0x76, 0x63, 0x14, 0xaf, 0x65, 0x24, + 0x64, 0x02, 0xd9, 0xa5, 0x29, 0xa7, 0x96, 0x4b, 0x4c, 0x0a, 0x44, 0xe2, 0x97, 0xd6, 0x50, 0x21, + 0x2e, 0xd6, 0xc4, 0x3b, 0x5e, 0x8f, 0xea, 0x9d, 0x31, 0x3b, 0x63, 0x37, 0xb9, 0x55, 0xdc, 0x00, + 0x09, 0xe5, 0xc8, 0x1f, 0xc0, 0x19, 0xf5, 0xd0, 0x3f, 0xa2, 0xc7, 0xaa, 0x27, 0xc4, 0xc1, 0xa0, + 0xe4, 0x50, 0x89, 0x63, 0xff, 0x02, 0x34, 0x3f, 0xd6, 0xb1, 0x53, 0x0a, 0xc7, 0xf6, 0xb4, 0x3b, + 0xef, 0x7b, 0xef, 0x9b, 0x37, 0xdf, 0xfb, 0x76, 0x16, 0xaa, 0xf4, 0x50, 0xf4, 0x44, 0x46, 0x43, + 0x32, 0x91, 0xa1, 0x3a, 0x0c, 0x46, 0x99, 0x50, 0x02, 0x57, 0x5c, 0x34, 0x20, 0x13, 0x59, 0xbb, + 0xd6, 0x13, 0x32, 0x15, 0x32, 0x4c, 0x65, 0x12, 0x4e, 0xae, 0xeb, 0x87, 0xcd, 0xaa, 0x6d, 0x58, + 0xa0, 0x6b, 0x56, 0xa1, 0x5d, 0x38, 0xa8, 0x9a, 0x88, 0x44, 0xd8, 0xb8, 0x7e, 0x73, 0xd1, 0x7a, + 0x22, 0x44, 0x32, 0xa4, 0xa1, 0x59, 0x1d, 0x8c, 0xfb, 0x61, 0x3c, 0xce, 0x88, 0x62, 0x82, 0x3b, + 0xdc, 0x3f, 0x8f, 0x2b, 0x96, 0x52, 0xa9, 0x48, 0x3a, 0xb2, 0x09, 0xcd, 0x5f, 0x0b, 0xb0, 0xb2, + 0x7b, 0xa7, 0xb3, 0xcf, 0xfb, 0x02, 0x63, 0x28, 0x72, 0x92, 0x52, 0x0f, 0x35, 0x50, 0xab, 0x1c, + 0x99, 0x77, 0xec, 0x43, 0x85, 0x4c, 0x64, 0x97, 0xc4, 0x71, 0x46, 0xa5, 0xf4, 0x5e, 0x33, 0x10, + 0x90, 0x89, 0xdc, 0xb5, 0x11, 0xbc, 0x09, 0x20, 0x87, 0x44, 0x0e, 0x4c, 0x8a, 0x57, 0x30, 0x78, + 0xd9, 0x44, 0x74, 0x06, 0xde, 0x82, 0x75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x3a, 0x3e, 0xad, 0x2f, 0x3d, 0x3e, 0xad, + 0x2f, 0xfd, 0x7e, 0x5a, 0x5f, 0xfa, 0x76, 0x7b, 0xee, 0xfa, 0xbe, 0x6d, 0xe9, 0x3e, 0xa7, 0xea, + 0x9e, 0xc8, 0xee, 0x86, 0xf9, 0x4f, 0xf8, 0xd0, 0xfe, 0x86, 0xf5, 0x4d, 0x7e, 0x70, 0xc1, 0x5c, + 0x01, 0x37, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x28, 0xfc, 0x29, 0x81, 0xa2, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -513,6 +676,42 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.OperatorAddress) > 0 { + for iNdEx := len(m.OperatorAddress) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperatorAddress[iNdEx]) + copy(dAtA[i:], m.OperatorAddress[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if m.AvsEpoch != nil { + { + size, err := m.AvsEpoch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + { + size := m.MinSelfDelegation.Size() + i -= size + if _, err := m.MinSelfDelegation.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if m.AvsUnbondingPeriod != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.AvsUnbondingPeriod)) + i-- + dAtA[i] = 0x30 + } if len(m.AssetId) > 0 { for iNdEx := len(m.AssetId) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.AssetId[iNdEx]) @@ -523,21 +722,21 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } if len(m.AvsOwnerAddress) > 0 { - i -= len(m.AvsOwnerAddress) - copy(dAtA[i:], m.AvsOwnerAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.AvsOwnerAddress))) - i-- - dAtA[i] = 0x22 - } - if len(m.OperatorAddress) > 0 { - for iNdEx := len(m.OperatorAddress) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.OperatorAddress[iNdEx]) - copy(dAtA[i:], m.OperatorAddress[iNdEx]) - i = encodeVarintTx(dAtA, i, uint64(len(m.OperatorAddress[iNdEx]))) + for iNdEx := len(m.AvsOwnerAddress) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AvsOwnerAddress[iNdEx]) + copy(dAtA[i:], m.AvsOwnerAddress[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.AvsOwnerAddress[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(m.SlashAddr) > 0 { + i -= len(m.SlashAddr) + copy(dAtA[i:], m.SlashAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.SlashAddr))) + i-- + dAtA[i] = 0x1a + } if len(m.AvsAddress) > 0 { i -= len(m.AvsAddress) copy(dAtA[i:], m.AvsAddress) @@ -555,6 +754,80 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EpochInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EpochInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CurrentEpochStartHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CurrentEpochStartHeight)) + i-- + dAtA[i] = 0x38 + } + if m.EpochCountingStarted { + i-- + if m.EpochCountingStarted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.CurrentEpochStartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintTx(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a + if m.CurrentEpoch != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x20 + } + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintTx(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x1a + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintTx(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x12 + if len(m.Identifier) > 0 { + i -= len(m.Identifier) + copy(dAtA[i:], m.Identifier) + i = encodeVarintTx(dAtA, i, uint64(len(m.Identifier))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *RegisterAVSReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -748,22 +1021,65 @@ func (m *AVSInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if len(m.OperatorAddress) > 0 { - for _, s := range m.OperatorAddress { + l = len(m.SlashAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.AvsOwnerAddress) > 0 { + for _, s := range m.AvsOwnerAddress { l = len(s) n += 1 + l + sovTx(uint64(l)) } } - l = len(m.AvsOwnerAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } if len(m.AssetId) > 0 { for _, s := range m.AssetId { l = len(s) n += 1 + l + sovTx(uint64(l)) } } + if m.AvsUnbondingPeriod != 0 { + n += 1 + sovTx(uint64(m.AvsUnbondingPeriod)) + } + l = m.MinSelfDelegation.Size() + n += 1 + l + sovTx(uint64(l)) + if m.AvsEpoch != nil { + l = m.AvsEpoch.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.OperatorAddress) > 0 { + for _, s := range m.OperatorAddress { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *EpochInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Identifier) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovTx(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.Duration) + n += 1 + l + sovTx(uint64(l)) + if m.CurrentEpoch != 0 { + n += 1 + sovTx(uint64(m.CurrentEpoch)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.CurrentEpochStartTime) + n += 1 + l + sovTx(uint64(l)) + if m.EpochCountingStarted { + n += 2 + } + if m.CurrentEpochStartHeight != 0 { + n += 1 + sovTx(uint64(m.CurrentEpochStartHeight)) + } return n } @@ -936,7 +1252,7 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SlashAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -964,7 +1280,7 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddress = append(m.OperatorAddress, string(dAtA[iNdEx:postIndex])) + m.SlashAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { @@ -996,7 +1312,7 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AvsOwnerAddress = string(dAtA[iNdEx:postIndex]) + m.AvsOwnerAddress = append(m.AvsOwnerAddress, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { @@ -1030,6 +1346,366 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { } m.AssetId = append(m.AssetId, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AvsUnbondingPeriod", wireType) + } + m.AvsUnbondingPeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AvsUnbondingPeriod |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinSelfDelegation", 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 + } + if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AvsEpoch", 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.AvsEpoch == nil { + m.AvsEpoch = &EpochInfo{} + } + if err := m.AvsEpoch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + 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 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.OperatorAddress = append(m.OperatorAddress, 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 *EpochInfo) Unmarshal(dAtA []byte) 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: EpochInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EpochInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Identifier", 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.Identifier = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", 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 := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + } + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartTime", 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 := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.CurrentEpochStartTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EpochCountingStarted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EpochCountingStarted = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) + } + m.CurrentEpochStartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpochStartHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/delegation/types/query.pb.go b/x/delegation/types/query.pb.go index c163893be..3c785e28b 100644 --- a/x/delegation/types/query.pb.go +++ b/x/delegation/types/query.pb.go @@ -296,6 +296,98 @@ func (m *SingleDelegationInfoReq) GetAssetID() string { return "" } +// UndelegationHoldCountReq is the request to obtain the undelegation hold count. +type UndelegationHoldCountReq struct { + // record_key is the record key of the undelegation record. + RecordKey string `protobuf:"bytes,1,opt,name=record_key,json=recordKey,proto3" json:"record_key,omitempty"` +} + +func (m *UndelegationHoldCountReq) Reset() { *m = UndelegationHoldCountReq{} } +func (m *UndelegationHoldCountReq) String() string { return proto.CompactTextString(m) } +func (*UndelegationHoldCountReq) ProtoMessage() {} +func (*UndelegationHoldCountReq) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{5} +} +func (m *UndelegationHoldCountReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationHoldCountReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationHoldCountReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationHoldCountReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationHoldCountReq.Merge(m, src) +} +func (m *UndelegationHoldCountReq) XXX_Size() int { + return m.Size() +} +func (m *UndelegationHoldCountReq) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationHoldCountReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationHoldCountReq proto.InternalMessageInfo + +func (m *UndelegationHoldCountReq) GetRecordKey() string { + if m != nil { + return m.RecordKey + } + return "" +} + +// UndelegationHoldCountResponse is the response for the undelegation hold count. +type UndelegationHoldCountResponse struct { + // hold_count is the number of undelegations that are on hold. + HoldCount uint64 `protobuf:"varint,1,opt,name=hold_count,json=holdCount,proto3" json:"hold_count,omitempty"` +} + +func (m *UndelegationHoldCountResponse) Reset() { *m = UndelegationHoldCountResponse{} } +func (m *UndelegationHoldCountResponse) String() string { return proto.CompactTextString(m) } +func (*UndelegationHoldCountResponse) ProtoMessage() {} +func (*UndelegationHoldCountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_aab345e1cf20490c, []int{6} +} +func (m *UndelegationHoldCountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *UndelegationHoldCountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_UndelegationHoldCountResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *UndelegationHoldCountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationHoldCountResponse.Merge(m, src) +} +func (m *UndelegationHoldCountResponse) XXX_Size() int { + return m.Size() +} +func (m *UndelegationHoldCountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationHoldCountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_UndelegationHoldCountResponse proto.InternalMessageInfo + +func (m *UndelegationHoldCountResponse) GetHoldCount() uint64 { + if m != nil { + return m.HoldCount + } + return 0 +} + // UndelegationsReq is the request to obtain all delegations // by staker id and asset id. type UndelegationsReq struct { @@ -309,7 +401,7 @@ func (m *UndelegationsReq) Reset() { *m = UndelegationsReq{} } func (m *UndelegationsReq) String() string { return proto.CompactTextString(m) } func (*UndelegationsReq) ProtoMessage() {} func (*UndelegationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_aab345e1cf20490c, []int{5} + return fileDescriptor_aab345e1cf20490c, []int{7} } func (m *UndelegationsReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -363,7 +455,7 @@ func (m *WaitCompleteUndelegationsReq) Reset() { *m = WaitCompleteUndele func (m *WaitCompleteUndelegationsReq) String() string { return proto.CompactTextString(m) } func (*WaitCompleteUndelegationsReq) ProtoMessage() {} func (*WaitCompleteUndelegationsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_aab345e1cf20490c, []int{6} + return fileDescriptor_aab345e1cf20490c, []int{8} } func (m *WaitCompleteUndelegationsReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -409,7 +501,7 @@ func (m *UndelegationRecordList) Reset() { *m = UndelegationRecordList{} func (m *UndelegationRecordList) String() string { return proto.CompactTextString(m) } func (*UndelegationRecordList) ProtoMessage() {} func (*UndelegationRecordList) Descriptor() ([]byte, []int) { - return fileDescriptor_aab345e1cf20490c, []int{7} + return fileDescriptor_aab345e1cf20490c, []int{9} } func (m *UndelegationRecordList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,6 +544,8 @@ func init() { proto.RegisterType((*QueryDelegationInfoResponse)(nil), "exocore.delegation.v1.QueryDelegationInfoResponse") proto.RegisterMapType((map[string]*DelegationAmounts)(nil), "exocore.delegation.v1.QueryDelegationInfoResponse.DelegationInfosEntry") proto.RegisterType((*SingleDelegationInfoReq)(nil), "exocore.delegation.v1.SingleDelegationInfoReq") + proto.RegisterType((*UndelegationHoldCountReq)(nil), "exocore.delegation.v1.UndelegationHoldCountReq") + proto.RegisterType((*UndelegationHoldCountResponse)(nil), "exocore.delegation.v1.UndelegationHoldCountResponse") proto.RegisterType((*UndelegationsReq)(nil), "exocore.delegation.v1.UndelegationsReq") proto.RegisterType((*WaitCompleteUndelegationsReq)(nil), "exocore.delegation.v1.WaitCompleteUndelegationsReq") proto.RegisterType((*UndelegationRecordList)(nil), "exocore.delegation.v1.UndelegationRecordList") @@ -460,56 +554,62 @@ func init() { func init() { proto.RegisterFile("exocore/delegation/v1/query.proto", fileDescriptor_aab345e1cf20490c) } var fileDescriptor_aab345e1cf20490c = []byte{ - // 780 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x4f, 0x13, 0x4d, - 0x1c, 0xee, 0xc0, 0xcb, 0x0b, 0x4c, 0x21, 0x2f, 0xef, 0xc0, 0xcb, 0x5b, 0x0a, 0xd9, 0xc2, 0x1e, - 0xb0, 0x60, 0xba, 0x2b, 0x45, 0xd4, 0x18, 0x31, 0x29, 0x96, 0x60, 0x13, 0x83, 0x71, 0x1b, 0x63, - 0xe2, 0xa5, 0xd9, 0x76, 0x87, 0xed, 0xa6, 0xdb, 0x9d, 0xb2, 0x33, 0x2d, 0xf4, 0xea, 0xc9, 0xa3, - 0x89, 0x5f, 0xc1, 0x93, 0x5e, 0x3c, 0xf0, 0x21, 0x38, 0x12, 0xbc, 0x18, 0x13, 0x1b, 0x53, 0x4c, - 0xfc, 0x0e, 0x5e, 0x34, 0x3b, 0x3b, 0xd0, 0x2d, 0x74, 0x2b, 0xc4, 0x78, 0xea, 0xce, 0xef, 0xcf, - 0xf3, 0x7b, 0x66, 0x9e, 0x67, 0x3a, 0x70, 0x01, 0xef, 0x93, 0x12, 0x71, 0xb1, 0x6a, 0x60, 0x1b, - 0x9b, 0x3a, 0xb3, 0x88, 0xa3, 0x36, 0x56, 0xd4, 0xdd, 0x3a, 0x76, 0x9b, 0x4a, 0xcd, 0x25, 0x8c, - 0xa0, 0xff, 0x44, 0x89, 0xd2, 0x29, 0x51, 0x1a, 0x2b, 0xf1, 0xd9, 0x12, 0xa1, 0x55, 0x42, 0xfd, - 0xd2, 0x73, 0x3d, 0xf1, 0x19, 0x3f, 0x59, 0xe0, 0x2b, 0xd5, 0x5f, 0x88, 0x94, 0xd4, 0x7b, 0x22, - 0xdb, 0x17, 0xf9, 0x29, 0x93, 0x98, 0xc4, 0xef, 0xf3, 0xbe, 0x44, 0x74, 0xce, 0x24, 0xc4, 0xb4, - 0xb1, 0xaa, 0xd7, 0x2c, 0x55, 0x77, 0x1c, 0xc2, 0x78, 0xa3, 0xc0, 0x94, 0x77, 0xe0, 0xbf, 0xd9, - 0x33, 0xb4, 0x9c, 0xb3, 0x43, 0x34, 0xbc, 0x8b, 0x96, 0xe0, 0x28, 0x65, 0x7a, 0x05, 0xbb, 0x05, - 0xcb, 0x88, 0x81, 0x79, 0x90, 0x1c, 0xdd, 0x18, 0x6b, 0xb7, 0x12, 0x23, 0x79, 0x1e, 0xcc, 0x65, - 0xb5, 0x11, 0x3f, 0x9d, 0x33, 0xd0, 0x22, 0x1c, 0xd1, 0x29, 0xc5, 0xcc, 0xab, 0x1c, 0xe0, 0x95, - 0xd1, 0x76, 0x2b, 0x31, 0x9c, 0xf1, 0x62, 0xb9, 0xac, 0x36, 0xcc, 0x93, 0x39, 0x43, 0x5e, 0x84, - 0xd0, 0xef, 0x7e, 0x64, 0x51, 0x86, 0x62, 0x70, 0xd8, 0x47, 0xa0, 0x31, 0x30, 0x3f, 0x98, 0x1c, - 0xd5, 0x4e, 0x97, 0xf2, 0x77, 0x10, 0x24, 0x94, 0xa9, 0x92, 0xba, 0xc3, 0x28, 0xaa, 0xc2, 0xc9, - 0xba, 0x23, 0x76, 0xad, 0x17, 0x6d, 0x5c, 0xa0, 0x65, 0xdd, 0xc5, 0x82, 0xda, 0xbd, 0xc3, 0x56, - 0x22, 0xf2, 0xa9, 0x95, 0x58, 0x34, 0x2d, 0x56, 0xae, 0x17, 0x95, 0x12, 0xa9, 0x8a, 0x73, 0x13, - 0x3f, 0x29, 0x6a, 0x54, 0x54, 0xd6, 0xac, 0x61, 0xaa, 0x64, 0x71, 0xe9, 0xf8, 0x20, 0x05, 0xc5, - 0xb1, 0x66, 0x71, 0x49, 0x43, 0x5d, 0xc0, 0x79, 0x0f, 0x17, 0x35, 0x60, 0x6c, 0x4f, 0xb7, 0x58,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 0x7d, 0xd8, - 0x96, 0xc0, 0x51, 0x5b, 0x02, 0x5f, 0xda, 0x12, 0x78, 0x75, 0x22, 0x45, 0x8e, 0x4e, 0xa4, 0xc8, - 0xc7, 0x13, 0x29, 0xf2, 0xfc, 0x66, 0xe0, 0x31, 0xd8, 0xf4, 0xa1, 0xb7, 0x31, 0xdb, 0x23, 0x6e, - 0xe5, 0x6c, 0xd2, 0x7e, 0x70, 0x16, 0x7f, 0x1e, 0x8a, 0x7f, 0xf3, 0x87, 0x78, 0xf5, 0x67, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x6e, 0xb7, 0xe8, 0x4f, 0x50, 0x08, 0x00, 0x00, + // 872 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5f, 0x6f, 0xdb, 0x54, + 0x14, 0xef, 0x6d, 0x19, 0x6d, 0x4e, 0x3b, 0x51, 0xee, 0xca, 0xc8, 0xbc, 0xd5, 0xdd, 0xfc, 0x50, + 0xda, 0xa1, 0xda, 0x2c, 0xdb, 0xf8, 0x27, 0x56, 0xd1, 0x2e, 0xd3, 0x16, 0x0d, 0x0d, 0xe1, 0x08, + 0x21, 0xf1, 0x62, 0x39, 0xf6, 0xad, 0x63, 0xc5, 0xf1, 0xcd, 0x7c, 0x6f, 0xb2, 0x46, 0x88, 0x17, + 0x9e, 0x78, 0x44, 0xe2, 0x2b, 0xf0, 0x04, 0x2f, 0x7b, 0xe8, 0x87, 0xe8, 0x63, 0x55, 0x5e, 0x10, + 0x0f, 0x11, 0x4a, 0x91, 0xf8, 0x0e, 0xbc, 0x80, 0x7c, 0x7d, 0xd3, 0x38, 0x8d, 0x1d, 0x12, 0xa1, + 0x3d, 0xc5, 0xf7, 0xfc, 0xf9, 0x9d, 0xdf, 0x3d, 0xe7, 0x77, 0xec, 0xc0, 0x2d, 0x72, 0x48, 0x1d, + 0x1a, 0x11, 0xc3, 0x25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, 0x10, 0x8b, 0xd5, 0xed, 0x88, + 0x48, 0x6a, 0x9f, 0x1c, 0xf7, 0x36, 0xe6, 0x7e, 0xef, 0x6d, 0x6c, 0x7a, 0x3e, 0xaf, 0xb7, 0x6b, + 0xba, 0x43, 0x9b, 0xb2, 0x6f, 0xf2, 0x67, 0x87, 0xb9, 0x0d, 0x83, 0x77, 0x5b, 0x84, 0xe9, 0x65, + 0xe2, 0x9c, 0x1e, 0xed, 0x80, 0x6c, 0x6b, 0x99, 0x38, 0x26, 0x1e, 0x01, 0xae, 0xc6, 0xb8, 0xb8, + 0x03, 0xc5, 0x17, 0xb6, 0xcf, 0xad, 0x73, 0x97, 0x4f, 0x43, 0xcb, 0x16, 0x5c, 0xe4, 0x25, 0x67, + 0xa9, 0x59, 0x09, 0x79, 0xaa, 0x66, 0x25, 0xe4, 0xe6, 0xd5, 0x18, 0xfd, 0xcb, 0x14, 0x78, 0x72, + 0x4f, 0xed, 0x1f, 0x04, 0xd7, 0xbf, 0x88, 0xb5, 0x70, 0x71, 0x24, 0xac, 0x45, 0x43, 0x46, 0x70, + 0x04, 0xab, 0x29, 0x42, 0x7e, 0x78, 0x40, 0x93, 0xfe, 0x2d, 0x97, 0x1e, 0xeb, 0x99, 0x52, 0xd3, + 0x27, 0xa0, 0xe9, 0xa3, 0x66, 0xf6, 0x28, 0xe4, 0x51, 0xd7, 0x7c, 0xc3, 0x1d, 0xb5, 0x2a, 0x01, + 0xac, 0x65, 0x05, 0xe2, 0x55, 0x58, 0x68, 0x90, 0x6e, 0x32, 0x02, 0x33, 0x7e, 0xc4, 0xbb, 0x70, + 0xa9, 0x63, 0x07, 0x6d, 0x22, 0x5a, 0xb4, 0x5c, 0xda, 0xca, 0xa1, 0x34, 0x36, 0x5d, 0x33, 0x49, + 0xfb, 0x78, 0xfe, 0x43, 0xa4, 0xfd, 0x82, 0xe0, 0xed, 0xaa, 0x1f, 0x7a, 0x01, 0xf9, 0x5f, 0xaa, + 0x7c, 0x00, 0x97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a, 0x87, 0xe9, + 0x5a, 0xe2, 0x63, 0x5b, 0x7b, 0x5d, 0xfc, 0xad, 0xb9, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xd6, 0x0c, 0x0c, 0x89, 0x9e, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -529,6 +629,8 @@ type QueryClient interface { // SingleDelegationInfo queries the single delegation information for // {chain, staker, asset, operator}. QuerySingleDelegationInfo(ctx context.Context, in *SingleDelegationInfoReq, opts ...grpc.CallOption) (*DelegationAmounts, error) + // QueryUndelegationHoldCount queries the undelegation hold count. + QueryUndelegationHoldCount(ctx context.Context, in *UndelegationHoldCountReq, opts ...grpc.CallOption) (*UndelegationHoldCountResponse, error) // QueryUndelegations queries all undelegations for // {staker, asset}. QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) @@ -563,6 +665,15 @@ func (c *queryClient) QuerySingleDelegationInfo(ctx context.Context, in *SingleD return out, nil } +func (c *queryClient) QueryUndelegationHoldCount(ctx context.Context, in *UndelegationHoldCountReq, opts ...grpc.CallOption) (*UndelegationHoldCountResponse, error) { + out := new(UndelegationHoldCountResponse) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegationHoldCount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { out := new(UndelegationRecordList) err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegations", in, out, opts...) @@ -588,6 +699,8 @@ type QueryServer interface { // SingleDelegationInfo queries the single delegation information for // {chain, staker, asset, operator}. QuerySingleDelegationInfo(context.Context, *SingleDelegationInfoReq) (*DelegationAmounts, error) + // QueryUndelegationHoldCount queries the undelegation hold count. + QueryUndelegationHoldCount(context.Context, *UndelegationHoldCountReq) (*UndelegationHoldCountResponse, error) // QueryUndelegations queries all undelegations for // {staker, asset}. QueryUndelegations(context.Context, *UndelegationsReq) (*UndelegationRecordList, error) @@ -606,6 +719,9 @@ func (*UnimplementedQueryServer) QueryDelegationInfo(ctx context.Context, req *D func (*UnimplementedQueryServer) QuerySingleDelegationInfo(ctx context.Context, req *SingleDelegationInfoReq) (*DelegationAmounts, error) { return nil, status.Errorf(codes.Unimplemented, "method QuerySingleDelegationInfo not implemented") } +func (*UnimplementedQueryServer) QueryUndelegationHoldCount(ctx context.Context, req *UndelegationHoldCountReq) (*UndelegationHoldCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegationHoldCount not implemented") +} func (*UnimplementedQueryServer) QueryUndelegations(ctx context.Context, req *UndelegationsReq) (*UndelegationRecordList, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegations not implemented") } @@ -653,6 +769,24 @@ func _Query_QuerySingleDelegationInfo_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_QueryUndelegationHoldCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndelegationHoldCountReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryUndelegationHoldCount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.delegation.v1.Query/QueryUndelegationHoldCount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryUndelegationHoldCount(ctx, req.(*UndelegationHoldCountReq)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_QueryUndelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UndelegationsReq) if err := dec(in); err != nil { @@ -701,6 +835,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QuerySingleDelegationInfo", Handler: _Query_QuerySingleDelegationInfo_Handler, }, + { + MethodName: "QueryUndelegationHoldCount", + Handler: _Query_QueryUndelegationHoldCount_Handler, + }, { MethodName: "QueryUndelegations", Handler: _Query_QueryUndelegations_Handler, @@ -919,6 +1057,64 @@ func (m *SingleDelegationInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *UndelegationHoldCountReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationHoldCountReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationHoldCountReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RecordKey) > 0 { + i -= len(m.RecordKey) + copy(dAtA[i:], m.RecordKey) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RecordKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *UndelegationHoldCountResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *UndelegationHoldCountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UndelegationHoldCountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.HoldCount != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.HoldCount)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *UndelegationsReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1120,6 +1316,31 @@ func (m *SingleDelegationInfoReq) Size() (n int) { return n } +func (m *UndelegationHoldCountReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecordKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *UndelegationHoldCountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HoldCount != 0 { + n += 1 + sovQuery(uint64(m.HoldCount)) + } + return n +} + func (m *UndelegationsReq) Size() (n int) { if m == nil { return 0 @@ -1809,6 +2030,157 @@ func (m *SingleDelegationInfoReq) Unmarshal(dAtA []byte) error { } return nil } +func (m *UndelegationHoldCountReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationHoldCountReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationHoldCountReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordKey", 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.RecordKey = 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 *UndelegationHoldCountResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: UndelegationHoldCountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: UndelegationHoldCountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HoldCount", wireType) + } + m.HoldCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HoldCount |= 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 *UndelegationsReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go index 629be28c6..4fd0f08a4 100644 --- a/x/delegation/types/query.pb.gw.go +++ b/x/delegation/types/query.pb.gw.go @@ -105,6 +105,60 @@ func local_request_Query_QuerySingleDelegationInfo_0(ctx context.Context, marsha } +func request_Query_QueryUndelegationHoldCount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationHoldCountReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["record_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "record_key") + } + + protoReq.RecordKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "record_key", err) + } + + msg, err := client.QueryUndelegationHoldCount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryUndelegationHoldCount_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationHoldCountReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["record_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "record_key") + } + + protoReq.RecordKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "record_key", err) + } + + msg, err := server.QueryUndelegationHoldCount(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_QueryUndelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -229,6 +283,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryUndelegationHoldCount_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_QueryUndelegationHoldCount_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_QueryUndelegationHoldCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -356,6 +433,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryUndelegationHoldCount_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_QueryUndelegationHoldCount_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_QueryUndelegationHoldCount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -404,6 +501,8 @@ var ( pattern_Query_QuerySingleDelegationInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QuerySingleDelegationInfo"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryUndelegationHoldCount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "delegation", "v1", "QueryUndelegationHoldCount", "record_key"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryWaitCompleteUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryWaitCompleteUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) @@ -414,6 +513,8 @@ var ( forward_Query_QuerySingleDelegationInfo_0 = runtime.ForwardResponseMessage + forward_Query_QueryUndelegationHoldCount_0 = runtime.ForwardResponseMessage + forward_Query_QueryUndelegations_0 = runtime.ForwardResponseMessage forward_Query_QueryWaitCompleteUndelegations_0 = runtime.ForwardResponseMessage diff --git a/x/operator/keeper/keeper.go b/x/operator/keeper/keeper.go index 520ef6934..a4e743dae 100644 --- a/x/operator/keeper/keeper.go +++ b/x/operator/keeper/keeper.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdkmath "cosmossdk.io/math" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -76,11 +77,6 @@ type OperatorKeeper interface { ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, slashFactor sdk.Dec, infraction stakingtypes.Infraction, ) sdkmath.Int - - OptInToCosmosChain( - goCtx context.Context, - req *operatortypes.OptInToCosmosChainRequest, - ) (*operatortypes.OptInToCosmosChainResponse, error) } // SetHooks stores the given hooks implementations. diff --git a/x/operator/keeper/opt.go b/x/operator/keeper/opt.go index 2bfcff6b0..b752b1958 100644 --- a/x/operator/keeper/opt.go +++ b/x/operator/keeper/opt.go @@ -83,7 +83,8 @@ func (k *Keeper) OptOut(ctx sdk.Context, operatorAddress sdk.AccAddress, avsAddr // DeleteOperatorUSDValue, delete the operator voting power, it can facilitate to // update the voting powers of all opted-in operators at the end of epoch. - // there isn't going to be any reward for the operator in this opted-out epoch. + // There might still be a reward for the operator in this opted-out epoch, + // which is determined by the reward logic. err := k.DeleteOperatorUSDValue(ctx, avsAddr, operatorAddress.String()) if err != nil { return err diff --git a/x/operator/keeper/opt_test.go b/x/operator/keeper/opt_test.go index 3414969d5..3b2ea59ed 100644 --- a/x/operator/keeper/opt_test.go +++ b/x/operator/keeper/opt_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "fmt" "strings" abci "github.com/cometbft/cometbft/abci/types" @@ -109,6 +110,7 @@ func (suite *OperatorTestSuite) CheckState(expectedState *StateForCheck) { value, err = suite.App.OperatorKeeper.GetOperatorUSDValue(suite.Ctx, suite.avsAddr, suite.operatorAddr.String()) if expectedState.AVSOperatorShare.IsNil() { + fmt.Println("the err is:", err) suite.True(strings.Contains(err.Error(), operatorTypes.ErrNoKeyInTheStore.Error())) } else { suite.NoError(err) @@ -160,7 +162,7 @@ func (suite *OperatorTestSuite) TestOptOut() { OptedOutHeight: uint64(suite.Ctx.BlockHeight()), }, AVSTotalShare: sdkmath.LegacyNewDec(0), - AVSOperatorShare: sdkmath.LegacyDec{}, + AVSOperatorShare: sdkmath.LegacyNewDec(0), AssetState: nil, OperatorShare: sdkmath.LegacyDec{}, StakerShare: sdkmath.LegacyDec{}, diff --git a/x/operator/types/codec.go b/x/operator/types/codec.go index 52413a50f..b0603ed5a 100644 --- a/x/operator/types/codec.go +++ b/x/operator/types/codec.go @@ -1,11 +1,19 @@ package types import ( + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" ) +// ModuleCdc references the global erc20 module codec. Note, the codec should +// ONLY be used in certain instances of tests and for JSON encoding. +// +// The actual codec used for serialization should be provided to modules/erc20 and +// defined at the application level. +var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + // RegisterInterfaces register implementations func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( diff --git a/x/operator/types/expected_keepers.go b/x/operator/types/expected_keepers.go index d00535542..f6a1b6a2f 100644 --- a/x/operator/types/expected_keepers.go +++ b/x/operator/types/expected_keepers.go @@ -26,19 +26,6 @@ type AssetsKeeper interface { ctx sdk.Context, isUpdate bool, operator string, assetsFilter map[string]interface{}, f func(assetID string, state *assetstype.OperatorAssetInfo) error, ) error - AppChainInfoIsExist(ctx sdk.Context, chainID string) bool - GetOperatorAssetInfos( - ctx sdk.Context, operatorAddr sdk.Address, assetsFilter map[string]interface{}, - ) (assetsInfo map[string]*assetstype.OperatorAssetInfo, err error) - GetOperatorSpecifiedAssetInfo(ctx sdk.Context, operatorAddr sdk.Address, assetID string) (info *assetstype.OperatorAssetInfo, err error) - UpdateStakerAssetState( - ctx sdk.Context, stakerID string, assetID string, - changeAmount assetstype.DeltaStakerSingleAsset, - ) (err error) - UpdateOperatorAssetState( - ctx sdk.Context, operatorAddr sdk.Address, assetID string, - changeAmount assetstype.DeltaOperatorSingleAsset, - ) (err error) ClientChainExists(ctx sdk.Context, index uint64) bool GetAllStakingAssetsInfo(ctx sdk.Context) (allAssets map[string]*assetstype.StakingAssetInfo, err error) } diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index 76baeefe8..b28268fc5 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" _ "github.com/cosmos/cosmos-proto" + 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" @@ -77,6 +78,108 @@ func (m *GetOperatorInfoReq) GetOperatorAddr() string { return "" } +// QueryAllOperatorsRequest is the request to obtain all operators. +type QueryAllOperatorsRequest struct { + // pagination related options. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllOperatorsRequest) Reset() { *m = QueryAllOperatorsRequest{} } +func (m *QueryAllOperatorsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllOperatorsRequest) ProtoMessage() {} +func (*QueryAllOperatorsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{1} +} +func (m *QueryAllOperatorsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllOperatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllOperatorsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorsRequest.Merge(m, src) +} +func (m *QueryAllOperatorsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllOperatorsRequest proto.InternalMessageInfo + +func (m *QueryAllOperatorsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryAllOperatorsResponse is the response containing all operator account addresses. +type QueryAllOperatorsResponse struct { + // operators is a list of all operators. + OperatorAccAddrs []string `protobuf:"bytes,1,rep,name=operator_acc_addrs,json=operatorAccAddrs,proto3" json:"operator_acc_addrs,omitempty"` + // pagination related response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllOperatorsResponse) Reset() { *m = QueryAllOperatorsResponse{} } +func (m *QueryAllOperatorsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllOperatorsResponse) ProtoMessage() {} +func (*QueryAllOperatorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{2} +} +func (m *QueryAllOperatorsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllOperatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllOperatorsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorsResponse.Merge(m, src) +} +func (m *QueryAllOperatorsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllOperatorsResponse proto.InternalMessageInfo + +func (m *QueryAllOperatorsResponse) GetOperatorAccAddrs() []string { + if m != nil { + return m.OperatorAccAddrs + } + return nil +} + +func (m *QueryAllOperatorsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. type QueryOperatorUSDValueRequest struct { // operator_addr is the operator address,its type should be a sdk.AccAddress @@ -89,7 +192,7 @@ func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDVa func (m *QueryOperatorUSDValueRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorUSDValueRequest) ProtoMessage() {} func (*QueryOperatorUSDValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{1} + return fileDescriptor_f91e795a3cecbdbf, []int{3} } func (m *QueryOperatorUSDValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -142,7 +245,7 @@ func (m *QueryAVSUSDValueRequest) Reset() { *m = QueryAVSUSDValueRequest func (m *QueryAVSUSDValueRequest) String() string { return proto.CompactTextString(m) } func (*QueryAVSUSDValueRequest) ProtoMessage() {} func (*QueryAVSUSDValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{2} + return fileDescriptor_f91e795a3cecbdbf, []int{4} } func (m *QueryAVSUSDValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -191,7 +294,7 @@ func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlas func (m *QueryOperatorSlashInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorSlashInfoRequest) ProtoMessage() {} func (*QueryOperatorSlashInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{3} + return fileDescriptor_f91e795a3cecbdbf, []int{5} } func (m *QueryOperatorSlashInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +349,7 @@ func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSla func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{4} + return fileDescriptor_f91e795a3cecbdbf, []int{6} } func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,17 +387,19 @@ func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() map[string]*OperatorS // QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator type QueryOperatorConsKeyRequest struct { - // addr is the ACC address of operator - Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` - // chain_id is the id of the chain served by the operator - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // operator_acc_addr is the operator account address. + OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` + // chain is the id of the chain served by the operator. here chain_id is not used since the + // Linter complains about capitalization, which can be set with a gogoproto.custom_name but + // that is not compatible with google.api.http.get in the Query service below. + Chain string `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` } func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKeyRequest{} } func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{5} + return fileDescriptor_f91e795a3cecbdbf, []int{7} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,23 +428,23 @@ func (m *QueryOperatorConsKeyRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorConsKeyRequest proto.InternalMessageInfo -func (m *QueryOperatorConsKeyRequest) GetAddr() string { +func (m *QueryOperatorConsKeyRequest) GetOperatorAccAddr() string { if m != nil { - return m.Addr + return m.OperatorAccAddr } return "" } -func (m *QueryOperatorConsKeyRequest) GetChainId() string { +func (m *QueryOperatorConsKeyRequest) GetChain() string { if m != nil { - return m.ChainId + return m.Chain } return "" } -// QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest +// QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest. type QueryOperatorConsKeyResponse struct { - // public_key is the consensus public key of the operator + // public_key is the consensus public key of the operator. PublicKey crypto.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key"` } @@ -347,7 +452,7 @@ func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsK func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{6} + return fileDescriptor_f91e795a3cecbdbf, []int{8} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -383,684 +488,2882 @@ func (m *QueryOperatorConsKeyResponse) GetPublicKey() crypto.PublicKey { return crypto.PublicKey{} } -func init() { - proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") - proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") - proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") - proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") - proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") - proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") - proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") - proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") +// QueryOperatorConsAddressRequest is the request to obtain the consensus address of the operator +// for a specific chain ID. +type QueryOperatorConsAddressRequest struct { + // operator_acc_addr is the operator account address. + OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` + // chain is the id of the chain served by the operator. here chain_id is not used since the + // Linter complains about capitalization, which can be set with a gogoproto.custom_name but + // that is not compatible with google.api.http.get in the Query service below. + Chain string `protobuf:"bytes,2,opt,name=chain,proto3" json:"chain,omitempty"` } -func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } - -var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 730 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x95, 0x4d, 0x4f, 0xd4, 0x4e, - 0x1c, 0xc7, 0x77, 0x78, 0xfa, 0xff, 0x99, 0x45, 0xc4, 0x11, 0x75, 0x59, 0xb1, 0x60, 0xa3, 0x40, - 0x14, 0x5a, 0x29, 0x17, 0x1f, 0x0f, 0xcb, 0x93, 0x41, 0x88, 0x0f, 0xdd, 0xc8, 0xc1, 0xcb, 0xa6, - 0xb4, 0x43, 0x69, 0xb6, 0x74, 0x4a, 0x67, 0x76, 0xa5, 0x21, 0x5c, 0xbc, 0x9a, 0xa8, 0x09, 0xef, - 0xc0, 0xd7, 0x60, 0x7c, 0x0d, 0x1c, 0x89, 0x7a, 0xf0, 0x44, 0xcc, 0xe2, 0x6b, 0xf0, 0x6c, 0x3a, - 0x6d, 0x17, 0xe8, 0x76, 0x59, 0xd0, 0x83, 0xb7, 0xe9, 0xcc, 0xef, 0xf7, 0x9d, 0xcf, 0x7c, 0x67, - 0x7e, 0xbf, 0xc2, 0x21, 0xbc, 0x49, 0x74, 0xe2, 0x61, 0x99, 0xb8, 0xd8, 0xd3, 0x18, 0xf1, 0xe4, - 0xea, 0xa4, 0xbc, 0x51, 0xc1, 0x9e, 0x2f, 0xb9, 0x1e, 0x61, 0x04, 0x5d, 0x8c, 0x02, 0xa4, 0x38, - 0x40, 0xaa, 0x4e, 0xe6, 0x07, 0x74, 0x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 0x99, 0x57, 0x8a, 0x69, 0xb1, 0xb5, - 0xca, 0x8a, 0xa4, 0x93, 0x75, 0x79, 0x2e, 0x14, 0x7c, 0x8a, 0xd9, 0x6b, 0xe2, 0x95, 0xeb, 0xfa, - 0x9b, 0x87, 0x3b, 0x30, 0xdf, 0xc5, 0x74, 0xa5, 0x8b, 0xff, 0x19, 0xa7, 0x7e, 0x07, 0x00, 0x00, - 0xff, 0xff, 0x3b, 0x0d, 0x08, 0x4a, 0xdc, 0x07, 0x00, 0x00, +func (m *QueryOperatorConsAddressRequest) Reset() { *m = QueryOperatorConsAddressRequest{} } +func (m *QueryOperatorConsAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorConsAddressRequest) ProtoMessage() {} +func (*QueryOperatorConsAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{9} +} +func (m *QueryOperatorConsAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorConsAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorConsAddressRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorConsAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorConsAddressRequest.Merge(m, src) +} +func (m *QueryOperatorConsAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorConsAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorConsAddressRequest.DiscardUnknown(m) } -// 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 +var xxx_messageInfo_QueryOperatorConsAddressRequest proto.InternalMessageInfo -// 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 { - // OperatorInfo queries the operator information. - GetOperatorInfo(ctx context.Context, in *GetOperatorInfoReq, opts ...grpc.CallOption) (*OperatorInfo, error) - // QueryOperatorConsKeyForChainID queries the consensus public key for the operator - QueryOperatorConsKeyForChainID(ctx context.Context, in *QueryOperatorConsKeyRequest, opts ...grpc.CallOption) (*QueryOperatorConsKeyResponse, error) - // QueryOperatorUSDValue queries the opted-in USD value for the operator - QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) - // QueryAVSUSDValue queries the USD value for the AVS - QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) - // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS - QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) +func (m *QueryOperatorConsAddressRequest) GetOperatorAccAddr() string { + if m != nil { + return m.OperatorAccAddr + } + return "" } -type queryClient struct { - cc grpc1.ClientConn +func (m *QueryOperatorConsAddressRequest) GetChain() string { + if m != nil { + return m.Chain + } + return "" } -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} +// QueryOperatorConsAddressResponse is the response for QueryOperatorConsAddressRequest. +type QueryOperatorConsAddressResponse struct { + // cons_addr is the consensus address corresponding to the consensus public key + // currently in use by the operator. + ConsAddr string `protobuf:"bytes,1,opt,name=cons_addr,json=consAddr,proto3" json:"cons_addr,omitempty"` } -func (c *queryClient) GetOperatorInfo(ctx context.Context, in *GetOperatorInfoReq, opts ...grpc.CallOption) (*OperatorInfo, error) { - out := new(OperatorInfo) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/GetOperatorInfo", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryOperatorConsAddressResponse) Reset() { *m = QueryOperatorConsAddressResponse{} } +func (m *QueryOperatorConsAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorConsAddressResponse) ProtoMessage() {} +func (*QueryOperatorConsAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{10} +} +func (m *QueryOperatorConsAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorConsAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorConsAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryOperatorConsAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorConsAddressResponse.Merge(m, src) +} +func (m *QueryOperatorConsAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorConsAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorConsAddressResponse.DiscardUnknown(m) } -func (c *queryClient) QueryOperatorConsKeyForChainID(ctx context.Context, in *QueryOperatorConsKeyRequest, opts ...grpc.CallOption) (*QueryOperatorConsKeyResponse, error) { - out := new(QueryOperatorConsKeyResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorConsKeyForChainID", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryOperatorConsAddressResponse proto.InternalMessageInfo + +func (m *QueryOperatorConsAddressResponse) GetConsAddr() string { + if m != nil { + return m.ConsAddr } - return out, nil + return "" } -func (c *queryClient) QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { - out := new(DecValueField) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorUSDValue", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +// QueryAllOperatorConsKeysByChainIDRequest is the request to obtain all operator addresses +// and consensus keys for a specific chain ID, with pagination. +type QueryAllOperatorConsKeysByChainIDRequest struct { + // chain for which the cons keys are being queried. here chain_id is not used since the + // Linter complains about capitalization, which can be set with a gogoproto.custom_name but + // that is not compatible with google.api.http.get in the Query service below. + Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + // pagination related options. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (c *queryClient) QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { - out := new(DecValueField) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAVSUSDValue", in, out, opts...) - if err != nil { - return nil, err +func (m *QueryAllOperatorConsKeysByChainIDRequest) Reset() { + *m = QueryAllOperatorConsKeysByChainIDRequest{} +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllOperatorConsKeysByChainIDRequest) ProtoMessage() {} +func (*QueryAllOperatorConsKeysByChainIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{11} +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorConsKeysByChainIDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return out, nil +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorConsKeysByChainIDRequest.Merge(m, src) +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorConsKeysByChainIDRequest.DiscardUnknown(m) } -func (c *queryClient) QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) { - out := new(QueryOperatorSlashInfoResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorSlashInfo", in, out, opts...) - if err != nil { - return nil, err +var xxx_messageInfo_QueryAllOperatorConsKeysByChainIDRequest proto.InternalMessageInfo + +func (m *QueryAllOperatorConsKeysByChainIDRequest) GetChain() string { + if m != nil { + return m.Chain } - return out, nil + return "" } -// QueryServer is the server API for Query service. -type QueryServer interface { - // OperatorInfo queries the operator information. - GetOperatorInfo(context.Context, *GetOperatorInfoReq) (*OperatorInfo, error) - // QueryOperatorConsKeyForChainID queries the consensus public key for the operator - QueryOperatorConsKeyForChainID(context.Context, *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) - // QueryOperatorUSDValue queries the opted-in USD value for the operator - QueryOperatorUSDValue(context.Context, *QueryOperatorUSDValueRequest) (*DecValueField, error) - // QueryAVSUSDValue queries the USD value for the AVS - QueryAVSUSDValue(context.Context, *QueryAVSUSDValueRequest) (*DecValueField, error) - // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS - QueryOperatorSlashInfo(context.Context, *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) +func (m *QueryAllOperatorConsKeysByChainIDRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { +// QueryAllOperatorConsKeysByChainIDResponse is the response that includes a list of all operators +// and their consensus keys for a specified chain ID. +type QueryAllOperatorConsKeysByChainIDResponse struct { + // operator_cons_keys is a list of operator addresses and their consensus public keys. + OperatorConsKeys []*OperatorConsKeyPair `protobuf:"bytes,1,rep,name=operator_cons_keys,json=operatorConsKeys,proto3" json:"operator_cons_keys,omitempty"` + // pagination related response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (*UnimplementedQueryServer) GetOperatorInfo(ctx context.Context, req *GetOperatorInfoReq) (*OperatorInfo, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOperatorInfo not implemented") +func (m *QueryAllOperatorConsKeysByChainIDResponse) Reset() { + *m = QueryAllOperatorConsKeysByChainIDResponse{} } -func (*UnimplementedQueryServer) QueryOperatorConsKeyForChainID(ctx context.Context, req *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorConsKeyForChainID not implemented") +func (m *QueryAllOperatorConsKeysByChainIDResponse) String() string { + return proto.CompactTextString(m) } -func (*UnimplementedQueryServer) QueryOperatorUSDValue(ctx context.Context, req *QueryOperatorUSDValueRequest) (*DecValueField, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorUSDValue not implemented") +func (*QueryAllOperatorConsKeysByChainIDResponse) ProtoMessage() {} +func (*QueryAllOperatorConsKeysByChainIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{12} } -func (*UnimplementedQueryServer) QueryAVSUSDValue(ctx context.Context, req *QueryAVSUSDValueRequest) (*DecValueField, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAVSUSDValue not implemented") +func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } -func (*UnimplementedQueryServer) QueryOperatorSlashInfo(ctx context.Context, req *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorSlashInfo not implemented") +func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorConsKeysByChainIDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } } - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) +func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorConsKeysByChainIDResponse.Merge(m, src) +} +func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorConsKeysByChainIDResponse.DiscardUnknown(m) } -func _Query_GetOperatorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperatorInfoReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).GetOperatorInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Query/GetOperatorInfo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).GetOperatorInfo(ctx, req.(*GetOperatorInfoReq)) +var xxx_messageInfo_QueryAllOperatorConsKeysByChainIDResponse proto.InternalMessageInfo + +func (m *QueryAllOperatorConsKeysByChainIDResponse) GetOperatorConsKeys() []*OperatorConsKeyPair { + if m != nil { + return m.OperatorConsKeys } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_QueryOperatorConsKeyForChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOperatorConsKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryOperatorConsKeyForChainID(ctx, in) +func (m *QueryAllOperatorConsKeysByChainIDResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Query/QueryOperatorConsKeyForChainID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryOperatorConsKeyForChainID(ctx, req.(*QueryOperatorConsKeyRequest)) - } - return interceptor(ctx, in, info, handler) + return nil } -func _Query_QueryOperatorUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOperatorUSDValueRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryOperatorUSDValue(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Query/QueryOperatorUSDValue", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryOperatorUSDValue(ctx, req.(*QueryOperatorUSDValueRequest)) - } - return interceptor(ctx, in, info, handler) +// OperatorConsKeyPair holds the operator address and the consensus public key currently in +// use by the operator. +type OperatorConsKeyPair struct { + // operator_acc_addr is the operator account address. + OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` + // public_key is the consensus public key of the operator. + PublicKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } -func _Query_QueryAVSUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAVSUSDValueRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAVSUSDValue(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Query/QueryAVSUSDValue", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAVSUSDValue(ctx, req.(*QueryAVSUSDValueRequest)) +func (m *OperatorConsKeyPair) Reset() { *m = OperatorConsKeyPair{} } +func (m *OperatorConsKeyPair) String() string { return proto.CompactTextString(m) } +func (*OperatorConsKeyPair) ProtoMessage() {} +func (*OperatorConsKeyPair) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{13} +} +func (m *OperatorConsKeyPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperatorConsKeyPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperatorConsKeyPair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return interceptor(ctx, in, info, handler) +} +func (m *OperatorConsKeyPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorConsKeyPair.Merge(m, src) +} +func (m *OperatorConsKeyPair) XXX_Size() int { + return m.Size() +} +func (m *OperatorConsKeyPair) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorConsKeyPair.DiscardUnknown(m) } -func _Query_QueryOperatorSlashInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOperatorSlashInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryOperatorSlashInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Query/QueryOperatorSlashInfo", +var xxx_messageInfo_OperatorConsKeyPair proto.InternalMessageInfo + +func (m *OperatorConsKeyPair) GetOperatorAccAddr() string { + if m != nil { + return m.OperatorAccAddr } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryOperatorSlashInfo(ctx, req.(*QueryOperatorSlashInfoRequest)) + return "" +} + +func (m *OperatorConsKeyPair) GetPublicKey() *crypto.PublicKey { + if m != nil { + return m.PublicKey } - return interceptor(ctx, in, info, handler) + return nil } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.operator.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetOperatorInfo", - Handler: _Query_GetOperatorInfo_Handler, - }, - { - MethodName: "QueryOperatorConsKeyForChainID", - Handler: _Query_QueryOperatorConsKeyForChainID_Handler, - }, - { - MethodName: "QueryOperatorUSDValue", - Handler: _Query_QueryOperatorUSDValue_Handler, - }, - { - MethodName: "QueryAVSUSDValue", - Handler: _Query_QueryAVSUSDValue_Handler, - }, - { - MethodName: "QueryOperatorSlashInfo", - Handler: _Query_QueryOperatorSlashInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/operator/v1/query.proto", +// QueryAllOperatorConsAddrsByChainIDRequest is the request to obtain all operator addresses +// and consensus addresses for a specific chain ID, with pagination. +type QueryAllOperatorConsAddrsByChainIDRequest struct { + // chain for which the cons addrs are being queried. here chain_id is not used since the + // Linter complains about capitalization, which can be set with a gogoproto.custom_name but + // that is not compatible with google.api.http.get in the Query service below. + Chain string `protobuf:"bytes,1,opt,name=chain,proto3" json:"chain,omitempty"` + // pagination related options. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *GetOperatorInfoReq) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Reset() { + *m = QueryAllOperatorConsAddrsByChainIDRequest{} +} +func (m *QueryAllOperatorConsAddrsByChainIDRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllOperatorConsAddrsByChainIDRequest) ProtoMessage() {} +func (*QueryAllOperatorConsAddrsByChainIDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{14} +} +func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *GetOperatorInfoReq) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDRequest.Merge(m, src) +} +func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDRequest.DiscardUnknown(m) } -func (m *GetOperatorInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.OperatorAddr) > 0 { - i -= len(m.OperatorAddr) - copy(dAtA[i:], m.OperatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) - i-- - dAtA[i] = 0xa +var xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDRequest proto.InternalMessageInfo + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) GetChain() string { + if m != nil { + return m.Chain } - return len(dAtA) - i, nil + return "" } -func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllOperatorConsAddrsByChainIDRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// QueryAllOperatorConsAddrsByChainIDResponse is the response that includes a list of all operators +// and their consensus addresses for a specified chain ID. +type QueryAllOperatorConsAddrsByChainIDResponse struct { + // operator_cons_addrs is a list of operator account addresses and the consensus addresses. + OperatorConsAddrs []*OperatorConsAddrPair `protobuf:"bytes,1,rep,name=operator_cons_addrs,json=operatorConsAddrs,proto3" json:"operator_cons_addrs,omitempty"` + // pagination related response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) - i-- - dAtA[i] = 0x12 +func (m *QueryAllOperatorConsAddrsByChainIDResponse) Reset() { + *m = QueryAllOperatorConsAddrsByChainIDResponse{} +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryAllOperatorConsAddrsByChainIDResponse) ProtoMessage() {} +func (*QueryAllOperatorConsAddrsByChainIDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{15} +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if len(m.OperatorAddr) > 0 { - i -= len(m.OperatorAddr) - copy(dAtA[i:], m.OperatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) - i-- - dAtA[i] = 0xa +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDResponse.Merge(m, src) +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllOperatorConsAddrsByChainIDResponse proto.InternalMessageInfo + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) GetOperatorConsAddrs() []*OperatorConsAddrPair { + if m != nil { + return m.OperatorConsAddrs } - return len(dAtA) - i, nil + return nil } -func (m *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *QueryAllOperatorConsAddrsByChainIDResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination } - return dAtA[:n], nil + return nil } -func (m *QueryAVSUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// OperatorConsAddrPair holds the operator address and the corresponding consensus address. +type OperatorConsAddrPair struct { + // operator_acc_addr is the operator account address. + OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` + // cons_addr is the consensus address corresponding to the consensus public key + // currently in use by the operator. + ConsAddr string `protobuf:"bytes,2,opt,name=cons_addr,json=consAddr,proto3" json:"cons_addr,omitempty"` } -func (m *QueryAVSUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) - i-- - dAtA[i] = 0xa +func (m *OperatorConsAddrPair) Reset() { *m = OperatorConsAddrPair{} } +func (m *OperatorConsAddrPair) String() string { return proto.CompactTextString(m) } +func (*OperatorConsAddrPair) ProtoMessage() {} +func (*OperatorConsAddrPair) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{16} +} +func (m *OperatorConsAddrPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperatorConsAddrPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperatorConsAddrPair.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return len(dAtA) - i, nil +} +func (m *OperatorConsAddrPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorConsAddrPair.Merge(m, src) +} +func (m *OperatorConsAddrPair) XXX_Size() int { + return m.Size() +} +func (m *OperatorConsAddrPair) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorConsAddrPair.DiscardUnknown(m) } -func (m *QueryOperatorSlashInfoRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_OperatorConsAddrPair proto.InternalMessageInfo + +func (m *OperatorConsAddrPair) GetOperatorAccAddr() string { + if m != nil { + return m.OperatorAccAddr } - return dAtA[:n], nil + return "" } -func (m *QueryOperatorSlashInfoRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *OperatorConsAddrPair) GetConsAddr() string { + if m != nil { + return m.ConsAddr + } + return "" } -func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.OperatorAddr) > 0 { - i -= len(m.OperatorAddr) - copy(dAtA[i:], m.OperatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) - i-- - dAtA[i] = 0xa +func init() { + proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") + proto.RegisterType((*QueryAllOperatorsRequest)(nil), "exocore.operator.v1.QueryAllOperatorsRequest") + proto.RegisterType((*QueryAllOperatorsResponse)(nil), "exocore.operator.v1.QueryAllOperatorsResponse") + proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") + proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") + proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") + proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") + proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") + proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") + proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") + proto.RegisterType((*QueryOperatorConsAddressRequest)(nil), "exocore.operator.v1.QueryOperatorConsAddressRequest") + proto.RegisterType((*QueryOperatorConsAddressResponse)(nil), "exocore.operator.v1.QueryOperatorConsAddressResponse") + proto.RegisterType((*QueryAllOperatorConsKeysByChainIDRequest)(nil), "exocore.operator.v1.QueryAllOperatorConsKeysByChainIDRequest") + proto.RegisterType((*QueryAllOperatorConsKeysByChainIDResponse)(nil), "exocore.operator.v1.QueryAllOperatorConsKeysByChainIDResponse") + proto.RegisterType((*OperatorConsKeyPair)(nil), "exocore.operator.v1.OperatorConsKeyPair") + proto.RegisterType((*QueryAllOperatorConsAddrsByChainIDRequest)(nil), "exocore.operator.v1.QueryAllOperatorConsAddrsByChainIDRequest") + proto.RegisterType((*QueryAllOperatorConsAddrsByChainIDResponse)(nil), "exocore.operator.v1.QueryAllOperatorConsAddrsByChainIDResponse") + proto.RegisterType((*OperatorConsAddrPair)(nil), "exocore.operator.v1.OperatorConsAddrPair") +} + +func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } + +var fileDescriptor_f91e795a3cecbdbf = []byte{ + // 1148 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xef, 0x64, 0x59, 0x44, 0x5e, 0x77, 0x97, 0x76, 0x5a, 0xa0, 0xeb, 0x2d, 0x69, 0xd7, 0x82, + 0x6d, 0xb7, 0xb4, 0x36, 0x4d, 0xbb, 0x08, 0xed, 0x1f, 0x56, 0x4d, 0xff, 0xac, 0x76, 0x8b, 0xa0, + 0x38, 0xa2, 0x12, 0x5c, 0x22, 0xc7, 0x99, 0x4d, 0xad, 0xba, 0x9e, 0xd4, 0xe3, 0x84, 0x46, 0xab, + 0x72, 0xe0, 0x04, 0x17, 0x40, 0xec, 0x11, 0x89, 0x03, 0x9f, 0x01, 0xc1, 0x57, 0xd8, 0x03, 0x87, + 0x02, 0x17, 0x4e, 0x05, 0xb5, 0x7c, 0x06, 0xce, 0xc8, 0xe3, 0x71, 0x62, 0x3b, 0x4e, 0xe2, 0x94, + 0x0a, 0x6e, 0xb1, 0x3d, 0xef, 0xbd, 0xdf, 0xef, 0xbd, 0xdf, 0xbc, 0xf7, 0x02, 0x53, 0xe4, 0x80, + 0x1a, 0xd4, 0x21, 0x2a, 0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b, 0x75, 0xc2, 0x5c, 0xbc, 0x01, 0xd0, 0xce, + 0x07, 0xf7, 0x3b, 0x9c, 0xbf, 0xa1, 0x08, 0xa7, 0x5e, 0xf2, 0x14, 0x3f, 0xd5, 0x22, 0x79, 0xca, + 0x96, 0x5e, 0x25, 0xc2, 0x56, 0x0b, 0x59, 0xca, 0xdf, 0x20, 0xb8, 0x9a, 0x10, 0x84, 0xd5, 0xa8, + 0xcd, 0x08, 0x9e, 0x07, 0xdc, 0x26, 0x60, 0x18, 0x9c, 0x04, 0x9b, 0x40, 0xd3, 0x17, 0x66, 0xb3, + 0xda, 0x48, 0x0b, 0xab, 0x61, 0x78, 0x70, 0x19, 0x7e, 0x10, 0xc1, 0x94, 0xe1, 0x98, 0x66, 0xfa, + 0x62, 0xf2, 0x43, 0x45, 0x40, 0x7d, 0x89, 0x60, 0x92, 0x83, 0x0a, 0x10, 0x7d, 0x58, 0x5c, 0xdb, + 0xd6, 0xad, 0x7a, 0xc0, 0xe0, 0x5f, 0x26, 0x16, 0xab, 0x30, 0xac, 0x37, 0x18, 0xb7, 0x24, 0x8c, + 0x71, 0xa4, 0xd9, 0xc2, 0x95, 0x93, 0xe3, 0x29, 0x58, 0xd9, 0x2e, 0x0a, 0x43, 0x0d, 0xf4, 0x06, + 0x13, 0xbf, 0xe5, 0x47, 0xf0, 0x8a, 0x9f, 0xa4, 0xed, 0x62, 0x1c, 0x4a, 0xcc, 0x17, 0xea, 0xeb, + 0xeb, 0x2b, 0x04, 0xaf, 0x46, 0xc8, 0x15, 0x2d, 0x9d, 0xed, 0x08, 0xc9, 0xfc, 0x2f, 0xec, 0xfe, + 0x46, 0x90, 0xeb, 0x86, 0x48, 0x08, 0x61, 0x17, 0xae, 0xe8, 0x96, 0x55, 0x62, 0xde, 0x87, 0x92, + 0x69, 0x3f, 0xa6, 0x5c, 0x04, 0xc3, 0xf9, 0x75, 0x25, 0xe1, 0x12, 0x2b, 0xbd, 0x9d, 0x29, 0x2b, + 0x96, 0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 0x23, 0x5c, 0x3a, 0xc3, 0xae, 0x2c, 0x2f, 0x71, 0xc8, 0x0b, 0xf8, 0x8d, 0xfe, + 0xd9, 0x6c, 0xa3, 0x3b, 0x0d, 0xae, 0x6d, 0xcf, 0x39, 0x88, 0xd3, 0xeb, 0x32, 0x71, 0x98, 0x4b, + 0xf7, 0xcf, 0x6c, 0x2f, 0xc8, 0xdd, 0xe5, 0xe4, 0xde, 0xc2, 0xcb, 0x29, 0x85, 0xcd, 0xe7, 0x73, + 0xa0, 0xec, 0xc2, 0xbb, 0xcf, 0x4e, 0x72, 0xe8, 0xe8, 0x24, 0x87, 0xfe, 0x3c, 0xc9, 0xa1, 0xaf, + 0x4f, 0x73, 0x43, 0x47, 0xa7, 0xb9, 0xa1, 0xdf, 0x4f, 0x73, 0x43, 0x1f, 0xe7, 0xab, 0xa6, 0xbb, + 0x53, 0x2f, 0x2b, 0x06, 0xdd, 0x53, 0xd7, 0x7d, 0xcf, 0xef, 0x11, 0xf7, 0x13, 0xea, 0xec, 0xb6, + 0x02, 0x1d, 0xb4, 0x43, 0xb9, 0xcd, 0x1a, 0x61, 0xe5, 0xe7, 0xf9, 0x1f, 0xf9, 0xa5, 0x7f, 0x02, + 0x00, 0x00, 0xff, 0xff, 0x1c, 0xac, 0xe2, 0x03, 0xb7, 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 + +// 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 { + // QueryOperatorInfo queries the operator information. + QueryOperatorInfo(ctx context.Context, in *GetOperatorInfoReq, opts ...grpc.CallOption) (*OperatorInfo, error) + // QueryAllOperators queries all operators. + QueryAllOperators(ctx context.Context, in *QueryAllOperatorsRequest, opts ...grpc.CallOption) (*QueryAllOperatorsResponse, error) + // QueryOperatorConsKeyForChainID queries the consensus public key for the operator + QueryOperatorConsKeyForChainID(ctx context.Context, in *QueryOperatorConsKeyRequest, opts ...grpc.CallOption) (*QueryOperatorConsKeyResponse, error) + // QueryOperatorConsAddressForChainID queries the consensus address for the operator. + QueryOperatorConsAddressForChainID(ctx context.Context, in *QueryOperatorConsAddressRequest, opts ...grpc.CallOption) (*QueryOperatorConsAddressResponse, error) + // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys + // for a specific chain ID + QueryAllOperatorConsKeysByChainID(ctx context.Context, in *QueryAllOperatorConsKeysByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) + // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses + // for a specific chain ID + QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) QueryOperatorInfo(ctx context.Context, in *GetOperatorInfoReq, opts ...grpc.CallOption) (*OperatorInfo, error) { + out := new(OperatorInfo) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorInfo", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) QueryAllOperators(ctx context.Context, in *QueryAllOperatorsRequest, opts ...grpc.CallOption) (*QueryAllOperatorsResponse, error) { + out := new(QueryAllOperatorsResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAllOperators", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *QueryOperatorSlashInfoResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) QueryOperatorConsKeyForChainID(ctx context.Context, in *QueryOperatorConsKeyRequest, opts ...grpc.CallOption) (*QueryOperatorConsKeyResponse, error) { + out := new(QueryOperatorConsKeyResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorConsKeyForChainID", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AllSlashInfo) > 0 { - for k := range m.AllSlashInfo { - v := m.AllSlashInfo[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } +func (c *queryClient) QueryOperatorConsAddressForChainID(ctx context.Context, in *QueryOperatorConsAddressRequest, opts ...grpc.CallOption) (*QueryOperatorConsAddressResponse, error) { + out := new(QueryOperatorConsAddressResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorConsAddressForChainID", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) QueryAllOperatorConsKeysByChainID(ctx context.Context, in *QueryAllOperatorConsKeysByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsKeysByChainIDResponse, error) { + out := new(QueryAllOperatorConsKeysByChainIDResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAllOperatorConsKeysByChainID", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 +func (c *queryClient) QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAVSUSDValue", in, out, opts...) + if err != nil { + return nil, err } - if len(m.Addr) > 0 { - i -= len(m.Addr) - copy(dAtA[i:], m.Addr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Addr))) - i-- - dAtA[i] = 0xa + return out, nil +} + +func (c *queryClient) QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) { + out := new(QueryOperatorSlashInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorSlashInfo", in, out, opts...) + if err != nil { + return nil, err } - return len(dAtA) - i, nil + return out, nil } -func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) +func (c *queryClient) QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { + out := new(QueryAllOperatorConsAddrsByChainIDResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", in, out, opts...) if err != nil { return nil, err } - return dAtA[:n], nil + return out, nil } -func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// QueryServer is the server API for Query service. +type QueryServer interface { + // QueryOperatorInfo queries the operator information. + QueryOperatorInfo(context.Context, *GetOperatorInfoReq) (*OperatorInfo, error) + // QueryAllOperators queries all operators. + QueryAllOperators(context.Context, *QueryAllOperatorsRequest) (*QueryAllOperatorsResponse, error) + // QueryOperatorConsKeyForChainID queries the consensus public key for the operator + QueryOperatorConsKeyForChainID(context.Context, *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) + // QueryOperatorConsAddressForChainID queries the consensus address for the operator. + QueryOperatorConsAddressForChainID(context.Context, *QueryOperatorConsAddressRequest) (*QueryOperatorConsAddressResponse, error) + // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys + // for a specific chain ID + QueryAllOperatorConsKeysByChainID(context.Context, *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(context.Context, *QueryOperatorUSDValueRequest) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(context.Context, *QueryAVSUSDValueRequest) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(context.Context, *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) + // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses + // for a specific chain ID + QueryAllOperatorConsAddrsByChainID(context.Context, *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) } -func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PublicKey.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 +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { } -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 (*UnimplementedQueryServer) QueryOperatorInfo(ctx context.Context, req *GetOperatorInfoReq) (*OperatorInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorInfo not implemented") } -func (m *GetOperatorInfoReq) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (*UnimplementedQueryServer) QueryAllOperators(ctx context.Context, req *QueryAllOperatorsRequest) (*QueryAllOperatorsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperators not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorConsKeyForChainID(ctx context.Context, req *QueryOperatorConsKeyRequest) (*QueryOperatorConsKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorConsKeyForChainID not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorConsAddressForChainID(ctx context.Context, req *QueryOperatorConsAddressRequest) (*QueryOperatorConsAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorConsAddressForChainID not implemented") +} +func (*UnimplementedQueryServer) QueryAllOperatorConsKeysByChainID(ctx context.Context, req *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsKeysByChainID not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorUSDValue(ctx context.Context, req *QueryOperatorUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryAVSUSDValue(ctx context.Context, req *QueryAVSUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAVSUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorSlashInfo(ctx context.Context, req *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorSlashInfo not implemented") +} +func (*UnimplementedQueryServer) QueryAllOperatorConsAddrsByChainID(ctx context.Context, req *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsAddrsByChainID not implemented") } -func (m *QueryOperatorUSDValueRequest) Size() (n int) { - if m == nil { - return 0 +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_QueryOperatorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetOperatorInfoReq) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).QueryOperatorInfo(ctx, in) } - l = len(m.AVSAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorInfo", } - return n + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorInfo(ctx, req.(*GetOperatorInfoReq)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryAVSUSDValueRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_QueryAllOperators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllOperatorsRequest) + if err := dec(in); err != nil { + return nil, err } - var l int - _ = l - l = len(m.AVSAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if interceptor == nil { + return srv.(QueryServer).QueryAllOperators(ctx, in) } - return n + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAllOperators", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllOperators(ctx, req.(*QueryAllOperatorsRequest)) + } + return interceptor(ctx, in, info, handler) } -func (m *QueryOperatorSlashInfoRequest) Size() (n int) { - if m == nil { - return 0 +func _Query_QueryOperatorConsKeyForChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorConsKeyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorConsKeyForChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorConsKeyForChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorConsKeyForChainID(ctx, req.(*QueryOperatorConsKeyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorConsAddressForChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorConsAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorConsAddressForChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorConsAddressForChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorConsAddressForChainID(ctx, req.(*QueryOperatorConsAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllOperatorConsKeysByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllOperatorConsKeysByChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllOperatorConsKeysByChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAllOperatorConsKeysByChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllOperatorConsKeysByChainID(ctx, req.(*QueryAllOperatorConsKeysByChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, req.(*QueryOperatorUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAVSUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAVSUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAVSUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAVSUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAVSUSDValue(ctx, req.(*QueryAVSUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorSlashInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorSlashInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorSlashInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, req.(*QueryOperatorSlashInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllOperatorConsAddrsByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllOperatorConsAddrsByChainIDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllOperatorConsAddrsByChainID(ctx, req.(*QueryAllOperatorConsAddrsByChainIDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "exocore.operator.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryOperatorInfo", + Handler: _Query_QueryOperatorInfo_Handler, + }, + { + MethodName: "QueryAllOperators", + Handler: _Query_QueryAllOperators_Handler, + }, + { + MethodName: "QueryOperatorConsKeyForChainID", + Handler: _Query_QueryOperatorConsKeyForChainID_Handler, + }, + { + MethodName: "QueryOperatorConsAddressForChainID", + Handler: _Query_QueryOperatorConsAddressForChainID_Handler, + }, + { + MethodName: "QueryAllOperatorConsKeysByChainID", + Handler: _Query_QueryAllOperatorConsKeysByChainID_Handler, + }, + { + MethodName: "QueryOperatorUSDValue", + Handler: _Query_QueryOperatorUSDValue_Handler, + }, + { + MethodName: "QueryAVSUSDValue", + Handler: _Query_QueryAVSUSDValue_Handler, + }, + { + MethodName: "QueryOperatorSlashInfo", + Handler: _Query_QueryOperatorSlashInfo_Handler, + }, + { + MethodName: "QueryAllOperatorConsAddrsByChainID", + Handler: _Query_QueryAllOperatorConsAddrsByChainID_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "exocore/operator/v1/query.proto", +} + +func (m *GetOperatorInfoReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *GetOperatorInfoReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetOperatorInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + i-- + dAtA[i] = 0xa } - l = len(m.AVSAddress) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - return n + return dAtA[:n], nil } -func (m *QueryOperatorSlashInfoResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryAllOperatorsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorsRequest) 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 *QueryAllOperatorsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.AllSlashInfo) > 0 { - for k, v := range m.AllSlashInfo { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(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.OperatorAccAddrs) > 0 { + for iNdEx := len(m.OperatorAccAddrs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.OperatorAccAddrs[iNdEx]) + copy(dAtA[i:], m.OperatorAccAddrs[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddrs[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAVSUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAVSUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorSlashInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorSlashInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorSlashInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k := range m.AllSlashInfo { + v := m.AllSlashInfo[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PublicKey.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 *QueryOperatorConsAddressRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsAddr) > 0 { + i -= len(m.ConsAddr) + copy(dAtA[i:], m.ConsAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsKeysByChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsKeysByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsKeysByChainIDRequest) 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.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsKeysByChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsKeysByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsKeysByChainIDResponse) 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.OperatorConsKeys) > 0 { + for iNdEx := len(m.OperatorConsKeys) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OperatorConsKeys[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 *OperatorConsKeyPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OperatorConsKeyPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperatorConsKeyPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PublicKey != nil { + { + size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) 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.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllOperatorConsAddrsByChainIDResponse) 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.OperatorConsAddrs) > 0 { + for iNdEx := len(m.OperatorConsAddrs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OperatorConsAddrs[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 *OperatorConsAddrPair) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OperatorConsAddrPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OperatorConsAddrPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ConsAddr) > 0 { + i -= len(m.ConsAddr) + copy(dAtA[i:], m.ConsAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ConsAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + 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 *GetOperatorInfoReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllOperatorsRequest) 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 *QueryAllOperatorsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OperatorAccAddrs) > 0 { + for _, s := range m.OperatorAccAddrs { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAVSUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k, v := range m.AllSlashInfo { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + +func (m *QueryOperatorConsKeyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorConsKeyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PublicKey.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryOperatorConsAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Chain) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorConsAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConsAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllOperatorConsKeysByChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Chain) + 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 *QueryAllOperatorConsKeysByChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OperatorConsKeys) > 0 { + for _, e := range m.OperatorConsKeys { + 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 *OperatorConsKeyPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.PublicKey != nil { + l = m.PublicKey.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Chain) + 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 *QueryAllOperatorConsAddrsByChainIDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.OperatorConsAddrs) > 0 { + for _, e := range m.OperatorConsAddrs { + 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 *OperatorConsAddrPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAccAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ConsAddr) + 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 *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = 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 *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: 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 *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddrs", 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.OperatorAccAddrs = append(m.OperatorAccAddrs, 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.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 *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = 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 *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllSlashInfo", 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.AllSlashInfo == nil { + m.AllSlashInfo = make(map[string]*OperatorSlashInfo) + } + var mapkey string + var mapvalue *OperatorSlashInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &OperatorSlashInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllSlashInfo[mapkey] = mapvalue + 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 *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorConsKeyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorConsKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddr", 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.OperatorAccAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", 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.Chain = 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 *QueryOperatorConsKeyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorConsKeyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorConsKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + 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.PublicKey.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 } } - return n -} - -func (m *QueryOperatorConsKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Addr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func (m *QueryOperatorConsKeyResponse) Size() (n int) { - if m == nil { - return 0 + if iNdEx > l { + return io.ErrUnexpectedEOF } - var l int - _ = l - l = m.PublicKey.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)))) + return nil } -func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { +func (m *QueryOperatorConsAddressRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1083,15 +3386,15 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOperatorConsAddressRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOperatorConsAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1119,7 +3422,39 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.OperatorAccAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Chain", 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.Chain = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1142,7 +3477,7 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { +func (m *QueryOperatorConsAddressResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1165,15 +3500,15 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOperatorConsAddressResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOperatorConsAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1201,11 +3536,61 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.ConsAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 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 *QueryAllOperatorConsKeysByChainIDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorConsKeysByChainIDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorConsKeysByChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Chain", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1233,7 +3618,43 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + m.Chain = 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 @@ -1256,7 +3677,7 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllOperatorConsKeysByChainIDResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1269,27 +3690,61 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { if iNdEx >= l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorConsKeysByChainIDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorConsKeysByChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorConsKeys", 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.OperatorConsKeys = append(m.OperatorConsKeys, &OperatorConsKeyPair{}) + if err := m.OperatorConsKeys[len(m.OperatorConsKeys)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1299,23 +3754,27 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + 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 @@ -1338,7 +3797,7 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { +func (m *OperatorConsKeyPair) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1361,15 +3820,15 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: OperatorConsKeyPair: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OperatorConsKeyPair: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1397,13 +3856,13 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.OperatorAccAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1413,23 +3872,27 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + if m.PublicKey == nil { + m.PublicKey = &crypto.PublicKey{} + } + if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -1452,7 +3915,7 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllOperatorConsAddrsByChainIDRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1475,15 +3938,47 @@ func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllOperatorConsAddrsByChainIDRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllOperatorConsAddrsByChainIDRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AllSlashInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Chain", 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.Chain = 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 { @@ -1510,105 +4005,12 @@ func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllSlashInfo == nil { - m.AllSlashInfo = make(map[string]*OperatorSlashInfo) + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} } - var mapkey string - var mapvalue *OperatorSlashInfo - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthQuery - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthQuery - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &OperatorSlashInfo{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.AllSlashInfo[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -1631,7 +4033,7 @@ func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllOperatorConsAddrsByChainIDResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1654,17 +4056,17 @@ func (m *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorConsKeyRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllOperatorConsAddrsByChainIDResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorConsKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllOperatorConsAddrsByChainIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorConsAddrs", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1674,29 +4076,31 @@ func (m *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Addr = string(dAtA[iNdEx:postIndex]) + m.OperatorConsAddrs = append(m.OperatorConsAddrs, &OperatorConsAddrPair{}) + if err := m.OperatorConsAddrs[len(m.OperatorConsAddrs)-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 ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1706,23 +4110,27 @@ func (m *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + 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 @@ -1745,7 +4153,7 @@ func (m *QueryOperatorConsKeyRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorConsKeyResponse) Unmarshal(dAtA []byte) error { +func (m *OperatorConsAddrPair) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1768,17 +4176,17 @@ func (m *QueryOperatorConsKeyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorConsKeyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: OperatorConsAddrPair: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorConsKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OperatorConsAddrPair: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddr", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1788,24 +4196,55 @@ func (m *QueryOperatorConsKeyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.OperatorAccAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsAddr", 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.ConsAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/operator/types/query.pb.gw.go b/x/operator/types/query.pb.gw.go index c46f12cc7..dd2a98902 100644 --- a/x/operator/types/query.pb.gw.go +++ b/x/operator/types/query.pb.gw.go @@ -33,38 +33,92 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join +func request_Query_QueryOperatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetOperatorInfoReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_addr") + } + + protoReq.OperatorAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_addr", err) + } + + msg, err := client.QueryOperatorInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetOperatorInfoReq + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_addr") + } + + protoReq.OperatorAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_addr", err) + } + + msg, err := server.QueryOperatorInfo(ctx, &protoReq) + return msg, metadata, err + +} + var ( - filter_Query_GetOperatorInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_QueryAllOperators_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_GetOperatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOperatorInfoReq +func request_Query_QueryAllOperators_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorsRequest 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_GetOperatorInfo_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllOperators_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetOperatorInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.QueryAllOperators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_GetOperatorInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetOperatorInfoReq +func local_request_Query_QueryAllOperators_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorsRequest 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_GetOperatorInfo_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAllOperators_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetOperatorInfo(ctx, &protoReq) + msg, err := server.QueryAllOperators(ctx, &protoReq) return msg, metadata, err } @@ -80,26 +134,26 @@ func request_Query_QueryOperatorConsKeyForChainID_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["addr"] + val, ok = pathParams["operator_acc_addr"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "addr") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_acc_addr") } - protoReq.Addr, err = runtime.String(val) + protoReq.OperatorAccAddr, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "addr", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_acc_addr", err) } - val, ok = pathParams["chain_id"] + val, ok = pathParams["chain"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") } - protoReq.ChainId, err = runtime.String(val) + protoReq.Chain, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) } msg, err := client.QueryOperatorConsKeyForChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -118,26 +172,26 @@ func local_request_Query_QueryOperatorConsKeyForChainID_0(ctx context.Context, m _ = err ) - val, ok = pathParams["addr"] + val, ok = pathParams["operator_acc_addr"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "addr") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_acc_addr") } - protoReq.Addr, err = runtime.String(val) + protoReq.OperatorAccAddr, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "addr", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_acc_addr", err) } - val, ok = pathParams["chain_id"] + val, ok = pathParams["chain"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") } - protoReq.ChainId, err = runtime.String(val) + protoReq.Chain, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) } msg, err := server.QueryOperatorConsKeyForChainID(ctx, &protoReq) @@ -145,6 +199,154 @@ func local_request_Query_QueryOperatorConsKeyForChainID_0(ctx context.Context, m } +func request_Query_QueryOperatorConsAddressForChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorConsAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_acc_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_acc_addr") + } + + protoReq.OperatorAccAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_acc_addr", err) + } + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) + } + + msg, err := client.QueryOperatorConsAddressForChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryOperatorConsAddressForChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryOperatorConsAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["operator_acc_addr"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "operator_acc_addr") + } + + protoReq.OperatorAccAddr, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "operator_acc_addr", err) + } + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", err) + } + + msg, err := server.QueryOperatorConsAddressForChainID(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryAllOperatorConsKeysByChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllOperatorConsKeysByChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorConsKeysByChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", 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_QueryAllOperatorConsKeysByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllOperatorConsKeysByChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllOperatorConsKeysByChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorConsKeysByChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", 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_QueryAllOperatorConsKeysByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllOperatorConsKeysByChainID(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_QueryOperatorUSDValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -253,13 +455,108 @@ func local_request_Query_QueryOperatorSlashInfo_0(ctx context.Context, marshaler } +var ( + filter_Query_QueryAllOperatorConsAddrsByChainID_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_QueryAllOperatorConsAddrsByChainID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorConsAddrsByChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", 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_QueryAllOperatorConsAddrsByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAllOperatorConsAddrsByChainID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllOperatorConsAddrsByChainID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllOperatorConsAddrsByChainIDRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain") + } + + protoReq.Chain, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain", 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_QueryAllOperatorConsAddrsByChainID_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAllOperatorConsAddrsByChainID(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_GetOperatorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryOperatorInfo_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_QueryOperatorInfo_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_QueryOperatorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllOperators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -270,7 +567,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_GetOperatorInfo_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_QueryAllOperators_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 { @@ -278,7 +575,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_GetOperatorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryAllOperators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -305,6 +602,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryOperatorConsAddressForChainID_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_QueryOperatorConsAddressForChainID_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_QueryOperatorConsAddressForChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllOperatorConsKeysByChainID_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_QueryAllOperatorConsKeysByChainID_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_QueryAllOperatorConsKeysByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -374,6 +717,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryAllOperatorConsAddrsByChainID_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_QueryAllOperatorConsAddrsByChainID_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_QueryAllOperatorConsAddrsByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -415,7 +781,27 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_GetOperatorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryOperatorInfo_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_QueryOperatorInfo_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_QueryOperatorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllOperators_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) @@ -424,14 +810,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_GetOperatorInfo_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_QueryAllOperators_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_GetOperatorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryAllOperators_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -455,6 +841,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryOperatorConsAddressForChainID_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_QueryOperatorConsAddressForChainID_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_QueryOperatorConsAddressForChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllOperatorConsKeysByChainID_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_QueryAllOperatorConsKeysByChainID_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_QueryAllOperatorConsKeysByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_QueryOperatorUSDValue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -515,29 +941,65 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryAllOperatorConsAddrsByChainID_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_QueryAllOperatorConsAddrsByChainID_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_QueryAllOperatorConsAddrsByChainID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_GetOperatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "GetOperatorInfo"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryOperatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "operator", "v1", "operator_info", "operator_addr"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllOperators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "all_operators"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOperatorConsKeyForChainID_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{"exocore", "operator", "v1", "operator_cons_key", "operator_acc_addr", "chain"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryOperatorConsAddressForChainID_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{"exocore", "operator", "v1", "operator_cons_addr", "operator_acc_addr", "chain"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryOperatorConsKeyForChainID_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{"exocore", "operator", "v1", "GetOperatorConsKey", "addr", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAllOperatorConsKeysByChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "operator", "v1", "all_operator_cons_keys", "chain"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryOperatorUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryAVSUSDValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryAVSUSDValue"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryOperatorSlashInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "operator", "v1", "QueryOperatorSlashInfo"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryAllOperatorConsAddrsByChainID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"exocore", "operator", "v1", "all_operator_cons_addrs", "chain"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( - forward_Query_GetOperatorInfo_0 = runtime.ForwardResponseMessage + forward_Query_QueryOperatorInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllOperators_0 = runtime.ForwardResponseMessage forward_Query_QueryOperatorConsKeyForChainID_0 = runtime.ForwardResponseMessage + forward_Query_QueryOperatorConsAddressForChainID_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllOperatorConsKeysByChainID_0 = runtime.ForwardResponseMessage + forward_Query_QueryOperatorUSDValue_0 = runtime.ForwardResponseMessage forward_Query_QueryAVSUSDValue_0 = runtime.ForwardResponseMessage forward_Query_QueryOperatorSlashInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllOperatorConsAddrsByChainID_0 = runtime.ForwardResponseMessage ) diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index 01fa6297d..4ae412de9 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -219,7 +219,8 @@ type OperatorInfo struct { OperatorMetaInfo string `protobuf:"bytes,3,opt,name=operator_meta_info,json=operatorMetaInfo,proto3" json:"operator_meta_info,omitempty"` // client_chain_earning_addr_list is the client chain earning address list. ClientChainEarningsAddr *ClientChainEarningAddrList `protobuf:"bytes,4,opt,name=client_chain_earnings_addr,json=clientChainEarningsAddr,proto3" json:"client_chain_earnings_addr,omitempty"` - // commission defines the commission parameters. + // commission defines the commission parameters. it includes the time at which the commission + // was last updated. Commission types.Commission `protobuf:"bytes,5,opt,name=commission,proto3" json:"commission"` } @@ -464,6 +465,7 @@ func (m *SlashFromUndelegation) GetAssetID() string { // SlashFromAssetsPool records the slash detail from the operator assets pool type SlashFromAssetsPool struct { + // asset_id is the asset id. AssetID string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` // amount is the slashed amount from the assets pool. Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` @@ -739,31 +741,26 @@ func (m *RegisterOperatorResponse) XXX_DiscardUnknown() { var xxx_messageInfo_RegisterOperatorResponse proto.InternalMessageInfo -// OptInToCosmosChainRequest defines the OptInToCosmosChain request. -type OptInToCosmosChainRequest struct { - // address is the operator address - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // chain_id is the identifier for the chain that wants to opt in. - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - // `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}` - // there is no need to check for knowledge of the corresponding private key since this is ED25519 - // and not BLS key, where a rogue key attack can take place. however, we should still check for - // overlap with another operator's key. - PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +// OptIntoAVSReq is the request to opt into an AVS. +type OptIntoAVSReq struct { + // from_address is the address of the operator (sdk.AccAddress). + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs_address is the address of the AVS - either an 0x address or a chainID. + AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` } -func (m *OptInToCosmosChainRequest) Reset() { *m = OptInToCosmosChainRequest{} } -func (m *OptInToCosmosChainRequest) String() string { return proto.CompactTextString(m) } -func (*OptInToCosmosChainRequest) ProtoMessage() {} -func (*OptInToCosmosChainRequest) Descriptor() ([]byte, []int) { +func (m *OptIntoAVSReq) Reset() { *m = OptIntoAVSReq{} } +func (m *OptIntoAVSReq) String() string { return proto.CompactTextString(m) } +func (*OptIntoAVSReq) ProtoMessage() {} +func (*OptIntoAVSReq) Descriptor() ([]byte, []int) { return fileDescriptor_b229d5663e4df167, []int{12} } -func (m *OptInToCosmosChainRequest) XXX_Unmarshal(b []byte) error { +func (m *OptIntoAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OptInToCosmosChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OptIntoAVSReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OptInToCosmosChainRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_OptIntoAVSReq.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -773,55 +770,112 @@ func (m *OptInToCosmosChainRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *OptInToCosmosChainRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_OptInToCosmosChainRequest.Merge(m, src) +func (m *OptIntoAVSReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptIntoAVSReq.Merge(m, src) } -func (m *OptInToCosmosChainRequest) XXX_Size() int { +func (m *OptIntoAVSReq) XXX_Size() int { return m.Size() } -func (m *OptInToCosmosChainRequest) XXX_DiscardUnknown() { - xxx_messageInfo_OptInToCosmosChainRequest.DiscardUnknown(m) +func (m *OptIntoAVSReq) XXX_DiscardUnknown() { + xxx_messageInfo_OptIntoAVSReq.DiscardUnknown(m) } -var xxx_messageInfo_OptInToCosmosChainRequest proto.InternalMessageInfo +var xxx_messageInfo_OptIntoAVSReq proto.InternalMessageInfo -func (m *OptInToCosmosChainRequest) GetAddress() string { - if m != nil { - return m.Address - } - return "" +// OptIntoAVSResponse is the response to a opt into an AVS request. +type OptIntoAVSResponse struct { } -func (m *OptInToCosmosChainRequest) GetChainId() string { - if m != nil { - return m.ChainId +func (m *OptIntoAVSResponse) Reset() { *m = OptIntoAVSResponse{} } +func (m *OptIntoAVSResponse) String() string { return proto.CompactTextString(m) } +func (*OptIntoAVSResponse) ProtoMessage() {} +func (*OptIntoAVSResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{13} +} +func (m *OptIntoAVSResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OptIntoAVSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OptIntoAVSResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return "" +} +func (m *OptIntoAVSResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptIntoAVSResponse.Merge(m, src) +} +func (m *OptIntoAVSResponse) XXX_Size() int { + return m.Size() +} +func (m *OptIntoAVSResponse) XXX_DiscardUnknown() { + xxx_messageInfo_OptIntoAVSResponse.DiscardUnknown(m) } -func (m *OptInToCosmosChainRequest) GetPublicKey() string { - if m != nil { - return m.PublicKey +var xxx_messageInfo_OptIntoAVSResponse proto.InternalMessageInfo + +// OptOutOfAVSReq is the request to opt out from an AVS. +type OptOutOfAVSReq struct { + // from_address is the address of the operator (sdk.AccAddress). + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + // avs_address is the address of the AVS - either an 0x address or a chainID. + AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *OptOutOfAVSReq) Reset() { *m = OptOutOfAVSReq{} } +func (m *OptOutOfAVSReq) String() string { return proto.CompactTextString(m) } +func (*OptOutOfAVSReq) ProtoMessage() {} +func (*OptOutOfAVSReq) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{14} +} +func (m *OptOutOfAVSReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OptOutOfAVSReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OptOutOfAVSReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return "" } +func (m *OptOutOfAVSReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptOutOfAVSReq.Merge(m, src) +} +func (m *OptOutOfAVSReq) XXX_Size() int { + return m.Size() +} +func (m *OptOutOfAVSReq) XXX_DiscardUnknown() { + xxx_messageInfo_OptOutOfAVSReq.DiscardUnknown(m) +} + +var xxx_messageInfo_OptOutOfAVSReq proto.InternalMessageInfo -// OptInToCosmosChainResponse defines the OptInToCosmosChain response. -type OptInToCosmosChainResponse struct { +// OptOutOfAVSResponse is the response to a opt out of an AVS request. +type OptOutOfAVSResponse struct { } -func (m *OptInToCosmosChainResponse) Reset() { *m = OptInToCosmosChainResponse{} } -func (m *OptInToCosmosChainResponse) String() string { return proto.CompactTextString(m) } -func (*OptInToCosmosChainResponse) ProtoMessage() {} -func (*OptInToCosmosChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{13} +func (m *OptOutOfAVSResponse) Reset() { *m = OptOutOfAVSResponse{} } +func (m *OptOutOfAVSResponse) String() string { return proto.CompactTextString(m) } +func (*OptOutOfAVSResponse) ProtoMessage() {} +func (*OptOutOfAVSResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{15} } -func (m *OptInToCosmosChainResponse) XXX_Unmarshal(b []byte) error { +func (m *OptOutOfAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *OptInToCosmosChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OptOutOfAVSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_OptInToCosmosChainResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_OptOutOfAVSResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -831,38 +885,43 @@ func (m *OptInToCosmosChainResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *OptInToCosmosChainResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_OptInToCosmosChainResponse.Merge(m, src) +func (m *OptOutOfAVSResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_OptOutOfAVSResponse.Merge(m, src) } -func (m *OptInToCosmosChainResponse) XXX_Size() int { +func (m *OptOutOfAVSResponse) XXX_Size() int { return m.Size() } -func (m *OptInToCosmosChainResponse) XXX_DiscardUnknown() { - xxx_messageInfo_OptInToCosmosChainResponse.DiscardUnknown(m) +func (m *OptOutOfAVSResponse) XXX_DiscardUnknown() { + xxx_messageInfo_OptOutOfAVSResponse.DiscardUnknown(m) } -var xxx_messageInfo_OptInToCosmosChainResponse proto.InternalMessageInfo +var xxx_messageInfo_OptOutOfAVSResponse proto.InternalMessageInfo -// InitOptOutFromCosmosChainRequest defines the InitOptOutFromCosmosChain request. -type InitOptOutFromCosmosChainRequest struct { +// SetConsKeyReq is the request to set the operator's consensus key for a chain. +type SetConsKeyReq struct { // address is the operator address Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // chain_id is the identifier for the chain that wants to opt out. - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // chain_id is the identifier for the chain that wants to opt in. + ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}` + // there is no need to check for knowledge of the corresponding private key since this is ED25519 + // and not BLS key, where a rogue key attack can take place. however, we should still check for + // overlap with another operator's key. + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } -func (m *InitOptOutFromCosmosChainRequest) Reset() { *m = InitOptOutFromCosmosChainRequest{} } -func (m *InitOptOutFromCosmosChainRequest) String() string { return proto.CompactTextString(m) } -func (*InitOptOutFromCosmosChainRequest) ProtoMessage() {} -func (*InitOptOutFromCosmosChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{14} +func (m *SetConsKeyReq) Reset() { *m = SetConsKeyReq{} } +func (m *SetConsKeyReq) String() string { return proto.CompactTextString(m) } +func (*SetConsKeyReq) ProtoMessage() {} +func (*SetConsKeyReq) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{16} } -func (m *InitOptOutFromCosmosChainRequest) XXX_Unmarshal(b []byte) error { +func (m *SetConsKeyReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *InitOptOutFromCosmosChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SetConsKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_InitOptOutFromCosmosChainRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_SetConsKeyReq.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -872,48 +931,114 @@ func (m *InitOptOutFromCosmosChainRequest) XXX_Marshal(b []byte, deterministic b return b[:n], nil } } -func (m *InitOptOutFromCosmosChainRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitOptOutFromCosmosChainRequest.Merge(m, src) +func (m *SetConsKeyReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConsKeyReq.Merge(m, src) } -func (m *InitOptOutFromCosmosChainRequest) XXX_Size() int { +func (m *SetConsKeyReq) XXX_Size() int { return m.Size() } -func (m *InitOptOutFromCosmosChainRequest) XXX_DiscardUnknown() { - xxx_messageInfo_InitOptOutFromCosmosChainRequest.DiscardUnknown(m) +func (m *SetConsKeyReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetConsKeyReq.DiscardUnknown(m) } -var xxx_messageInfo_InitOptOutFromCosmosChainRequest proto.InternalMessageInfo +var xxx_messageInfo_SetConsKeyReq proto.InternalMessageInfo -func (m *InitOptOutFromCosmosChainRequest) GetAddress() string { - if m != nil { - return m.Address +// SetConsKeyResponse is the response to SetConsKeyReq. +type SetConsKeyResponse struct { +} + +func (m *SetConsKeyResponse) Reset() { *m = SetConsKeyResponse{} } +func (m *SetConsKeyResponse) String() string { return proto.CompactTextString(m) } +func (*SetConsKeyResponse) ProtoMessage() {} +func (*SetConsKeyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{17} +} +func (m *SetConsKeyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SetConsKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SetConsKeyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return "" +} +func (m *SetConsKeyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetConsKeyResponse.Merge(m, src) +} +func (m *SetConsKeyResponse) XXX_Size() int { + return m.Size() +} +func (m *SetConsKeyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SetConsKeyResponse.DiscardUnknown(m) } -func (m *InitOptOutFromCosmosChainRequest) GetChainId() string { - if m != nil { - return m.ChainId +var xxx_messageInfo_SetConsKeyResponse proto.InternalMessageInfo + +// InitConsKeyRemovalReq is the request for an operator to stop validating on a chain. It +// allows the operator to remove their consensus key from the specified chain. It must be +// followed by a separate call to OptOutOfAVS to remove the operator from the AVS. +type InitConsKeyRemovalReq struct { + // address is the operator address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // chain_id is the identifier for the chain that wants to opt out. + ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *InitConsKeyRemovalReq) Reset() { *m = InitConsKeyRemovalReq{} } +func (m *InitConsKeyRemovalReq) String() string { return proto.CompactTextString(m) } +func (*InitConsKeyRemovalReq) ProtoMessage() {} +func (*InitConsKeyRemovalReq) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{18} +} +func (m *InitConsKeyRemovalReq) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InitConsKeyRemovalReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InitConsKeyRemovalReq.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return "" +} +func (m *InitConsKeyRemovalReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitConsKeyRemovalReq.Merge(m, src) +} +func (m *InitConsKeyRemovalReq) XXX_Size() int { + return m.Size() +} +func (m *InitConsKeyRemovalReq) XXX_DiscardUnknown() { + xxx_messageInfo_InitConsKeyRemovalReq.DiscardUnknown(m) } -// InitOptOutFromCosmosChainResponse defines the InitOptOutFromCosmosChain response. -type InitOptOutFromCosmosChainResponse struct { +var xxx_messageInfo_InitConsKeyRemovalReq proto.InternalMessageInfo + +// InitConsKeyRemovalResponse defines the InitConsKeyRemovalReq response. +type InitConsKeyRemovalResponse struct { } -func (m *InitOptOutFromCosmosChainResponse) Reset() { *m = InitOptOutFromCosmosChainResponse{} } -func (m *InitOptOutFromCosmosChainResponse) String() string { return proto.CompactTextString(m) } -func (*InitOptOutFromCosmosChainResponse) ProtoMessage() {} -func (*InitOptOutFromCosmosChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{15} +func (m *InitConsKeyRemovalResponse) Reset() { *m = InitConsKeyRemovalResponse{} } +func (m *InitConsKeyRemovalResponse) String() string { return proto.CompactTextString(m) } +func (*InitConsKeyRemovalResponse) ProtoMessage() {} +func (*InitConsKeyRemovalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b229d5663e4df167, []int{19} } -func (m *InitOptOutFromCosmosChainResponse) XXX_Unmarshal(b []byte) error { +func (m *InitConsKeyRemovalResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *InitOptOutFromCosmosChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InitConsKeyRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_InitOptOutFromCosmosChainResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_InitConsKeyRemovalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -923,17 +1048,17 @@ func (m *InitOptOutFromCosmosChainResponse) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *InitOptOutFromCosmosChainResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitOptOutFromCosmosChainResponse.Merge(m, src) +func (m *InitConsKeyRemovalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InitConsKeyRemovalResponse.Merge(m, src) } -func (m *InitOptOutFromCosmosChainResponse) XXX_Size() int { +func (m *InitConsKeyRemovalResponse) XXX_Size() int { return m.Size() } -func (m *InitOptOutFromCosmosChainResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InitOptOutFromCosmosChainResponse.DiscardUnknown(m) +func (m *InitConsKeyRemovalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InitConsKeyRemovalResponse.DiscardUnknown(m) } -var xxx_messageInfo_InitOptOutFromCosmosChainResponse proto.InternalMessageInfo +var xxx_messageInfo_InitConsKeyRemovalResponse proto.InternalMessageInfo func init() { proto.RegisterEnum("exocore.operator.v1.SlashType", SlashType_name, SlashType_value) @@ -949,98 +1074,110 @@ func init() { proto.RegisterType((*OperatorSlashInfo)(nil), "exocore.operator.v1.OperatorSlashInfo") proto.RegisterType((*RegisterOperatorReq)(nil), "exocore.operator.v1.RegisterOperatorReq") proto.RegisterType((*RegisterOperatorResponse)(nil), "exocore.operator.v1.RegisterOperatorResponse") - proto.RegisterType((*OptInToCosmosChainRequest)(nil), "exocore.operator.v1.OptInToCosmosChainRequest") - proto.RegisterType((*OptInToCosmosChainResponse)(nil), "exocore.operator.v1.OptInToCosmosChainResponse") - proto.RegisterType((*InitOptOutFromCosmosChainRequest)(nil), "exocore.operator.v1.InitOptOutFromCosmosChainRequest") - proto.RegisterType((*InitOptOutFromCosmosChainResponse)(nil), "exocore.operator.v1.InitOptOutFromCosmosChainResponse") + proto.RegisterType((*OptIntoAVSReq)(nil), "exocore.operator.v1.OptIntoAVSReq") + proto.RegisterType((*OptIntoAVSResponse)(nil), "exocore.operator.v1.OptIntoAVSResponse") + proto.RegisterType((*OptOutOfAVSReq)(nil), "exocore.operator.v1.OptOutOfAVSReq") + proto.RegisterType((*OptOutOfAVSResponse)(nil), "exocore.operator.v1.OptOutOfAVSResponse") + proto.RegisterType((*SetConsKeyReq)(nil), "exocore.operator.v1.SetConsKeyReq") + proto.RegisterType((*SetConsKeyResponse)(nil), "exocore.operator.v1.SetConsKeyResponse") + proto.RegisterType((*InitConsKeyRemovalReq)(nil), "exocore.operator.v1.InitConsKeyRemovalReq") + proto.RegisterType((*InitConsKeyRemovalResponse)(nil), "exocore.operator.v1.InitConsKeyRemovalResponse") } func init() { proto.RegisterFile("exocore/operator/v1/tx.proto", fileDescriptor_b229d5663e4df167) } var fileDescriptor_b229d5663e4df167 = []byte{ - // 1312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xc6, 0xf9, 0xf2, 0xb3, 0xd3, 0x38, 0x93, 0xd2, 0x3a, 0xa6, 0x8d, 0x93, 0x2d, 0x2d, - 0x69, 0x44, 0x6c, 0xb5, 0x50, 0x24, 0x0a, 0x07, 0x92, 0xd8, 0x51, 0x57, 0xa4, 0x76, 0xb4, 0x76, - 0x2b, 0x41, 0x85, 0x56, 0x9b, 0xf5, 0xd4, 0x59, 0xb2, 0xde, 0xd9, 0xee, 0x8c, 0xd3, 0xa4, 0x12, - 0x12, 0x70, 0x42, 0x08, 0x09, 0x24, 0x4e, 0x48, 0x1c, 0x7a, 0xe4, 0xd8, 0x43, 0xaf, 0x08, 0xb8, - 0xf5, 0x58, 0xf5, 0x84, 0x38, 0x44, 0x28, 0x3d, 0x94, 0x7f, 0x02, 0x09, 0xcd, 0xc7, 0x3a, 0x9b, - 0x76, 0x53, 0x5a, 0x35, 0x5c, 0xda, 0xcc, 0x7b, 0xbf, 0xf7, 0xfd, 0x9b, 0x37, 0x5e, 0x38, 0x85, - 0xb7, 0x89, 0x43, 0x42, 0x5c, 0x21, 0x01, 0x0e, 0x6d, 0x46, 0xc2, 0xca, 0xd6, 0x85, 0x0a, 0xdb, - 0x2e, 0x07, 0x21, 0x61, 0x04, 0x4d, 0x2a, 0x6d, 0x39, 0xd2, 0x96, 0xb7, 0x2e, 0x14, 0x27, 0xec, - 0xae, 0xeb, 0x93, 0x8a, 0xf8, 0x57, 0xe2, 0x8a, 0x27, 0x1d, 0x42, 0xbb, 0x84, 0x56, 0xba, 0xb4, - 0xc3, 0xed, 0xbb, 0xb4, 0xa3, 0x14, 0x6f, 0x28, 0x05, 0x65, 0xf6, 0xa6, 0xeb, 0x73,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xb6, 0x8d, 0x9d, 0x1e, 0xef, 0xa8, 0x20, 0x70, 0x07, 0xf2, 0x92, 0xc0, 0x41, 0x48, 0x02, - 0x12, 0x72, 0xf9, 0x91, 0x6c, 0xe2, 0x71, 0xe1, 0x75, 0xad, 0xef, 0x14, 0x7d, 0x0a, 0x59, 0x19, - 0xe8, 0xe8, 0x28, 0x03, 0xc2, 0xa1, 0x78, 0x4c, 0xd0, 0x0d, 0x98, 0x94, 0xee, 0x7b, 0x31, 0xce, - 0xd0, 0x42, 0x5a, 0x6c, 0xf5, 0xf9, 0xc4, 0x65, 0x92, 0x48, 0x33, 0x13, 0x09, 0x37, 0x71, 0x11, - 0x45, 0x2d, 0x98, 0x90, 0xce, 0xc5, 0x88, 0xa8, 0x15, 0x10, 0xe2, 0x15, 0x06, 0x85, 0xeb, 0xb9, - 0xe7, 0xbb, 0xde, 0x1f, 0xbf, 0xea, 0xc8, 0xbe, 0x40, 0xff, 0x67, 0x80, 0x5f, 0x55, 0x69, 0x24, - 0x0c, 0x5e, 0x66, 0xa3, 0x9c, 0x87, 0x3c, 0xed, 0xad, 0x77, 0x5d, 0xc6, 0xb7, 0x45, 0x6c, 0xa5, - 0xa4, 0xcd, 0xf1, 0xbe, 0x5c, 0xad, 0x8a, 0x59, 0xc8, 0xe1, 0x2d, 0xbe, 0x6d, 0x63, 0x0b, 0x25, - 0x6d, 0x66, 0x85, 0x4c, 0x41, 0x5e, 0x87, 0x8c, 0x4b, 0xad, 0x2d, 0xcc, 0x48, 0x7f, 0xa1, 0x8c, - 0xba, 0xf4, 0xba, 0x38, 0x27, 0x52, 0x64, 0xe8, 0xff, 0xa0, 0xc8, 0x69, 0x90, 0x13, 0xb5, 0xb8, - 0x45, 0x61, 0x78, 0x46, 0x9b, 0x1b, 0x33, 0x33, 0x42, 0xd2, 0xda, 0x09, 0x30, 0xaa, 0xc3, 0x31, - 0x1c, 0x71, 0x57, 0x3e, 0x30, 0x23, 0x62, 0x99, 0xbf, 0x79, 0xf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27, 0x17, 0x63, 0x8b, 0xac, 0x26, 0x83, 0xd4, 0x31, 0xbb, 0x4d, - 0xc2, 0xcd, 0x4a, 0xf4, 0xb9, 0xb5, 0xbd, 0xff, 0xc1, 0x25, 0x16, 0xdb, 0xfa, 0xb0, 0xf8, 0xb2, - 0x79, 0xfb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xd0, 0x41, 0x68, 0x91, 0x0d, 0x00, 0x00, + // 1428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcb, 0x6f, 0x1b, 0x55, + 0x17, 0xf7, 0xc4, 0x79, 0xf9, 0x38, 0xce, 0xe3, 0xa6, 0x0f, 0xd7, 0x5f, 0x1b, 0x27, 0xd3, 0xaf, + 0x6d, 0x1a, 0x11, 0x5b, 0x09, 0x14, 0xa9, 0x81, 0x05, 0x79, 0xaa, 0x56, 0xd3, 0x38, 0x1a, 0xa7, + 0x95, 0x4a, 0x41, 0xa3, 0xc9, 0xf8, 0xc6, 0x19, 0x32, 0x9e, 0x3b, 0xcc, 0xbd, 0x36, 0x49, 0x57, + 0x08, 0xb1, 0x40, 0x6c, 0x40, 0x62, 0x85, 0xc4, 0xa2, 0x0b, 0x84, 0x58, 0xa1, 0x2e, 0xba, 0xad, + 0x80, 0x5d, 0x97, 0x55, 0x57, 0x88, 0x45, 0x84, 0xd2, 0x45, 0xf9, 0x27, 0x90, 0xd0, 0x7d, 0x8c, + 0x33, 0x6e, 0x26, 0x6d, 0xaa, 0xa6, 0x6c, 0x12, 0xdf, 0x73, 0x7e, 0xe7, 0xdc, 0xdf, 0x79, 0xdc, + 0x73, 0xef, 0xc0, 0x59, 0xbc, 0x4d, 0x6c, 0x12, 0xe0, 0x22, 0xf1, 0x71, 0x60, 0x31, 0x12, 0x14, + 0x9b, 0x53, 0x45, 0xb6, 0x5d, 0xf0, 0x03, 0xc2, 0x08, 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 0xed, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x9a, 0x3d, 0xa1, + 0x0d, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1057,17 +1194,14 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // RegisterOperator registers a new operator. RegisterOperator(ctx context.Context, in *RegisterOperatorReq, opts ...grpc.CallOption) (*RegisterOperatorResponse, error) - // add services for dogfood - // OptInToCosmosChain acts as opt in method for an operator to - // start validatring on a chain. The operator must sign the request with - // the key with which they registered in the system. - OptInToCosmosChain(ctx context.Context, in *OptInToCosmosChainRequest, opts ...grpc.CallOption) (*OptInToCosmosChainResponse, error) - // InitOptOutFromCosmosChain is a method with which an operator can initiate - // the opt out process from a chain. The operator must sign the request with - // the key with which they registered in the system. The opt-out process takes - // as long as the chain's unbonding period to complete, plus some loose change - // for message relaying across chains. - InitOptOutFromCosmosChain(ctx context.Context, in *InitOptOutFromCosmosChainRequest, opts ...grpc.CallOption) (*InitOptOutFromCosmosChainResponse, error) + // SetConsKey sets the operator's consensus key for a chain. + SetConsKey(ctx context.Context, in *SetConsKeyReq, opts ...grpc.CallOption) (*SetConsKeyResponse, error) + // InitConsKeyRemoval removes the operator's consensus key for a chain. + InitConsKeyRemoval(ctx context.Context, in *InitConsKeyRemovalReq, opts ...grpc.CallOption) (*InitConsKeyRemovalResponse, error) + // OptIntoAVS opts an operator into an AVS. + OptIntoAVS(ctx context.Context, in *OptIntoAVSReq, opts ...grpc.CallOption) (*OptIntoAVSResponse, error) + // OptOutOfAVS opts an operator out of an AVS. + OptOutOfAVS(ctx context.Context, in *OptOutOfAVSReq, opts ...grpc.CallOption) (*OptOutOfAVSResponse, error) } type msgClient struct { @@ -1087,18 +1221,36 @@ func (c *msgClient) RegisterOperator(ctx context.Context, in *RegisterOperatorRe return out, nil } -func (c *msgClient) OptInToCosmosChain(ctx context.Context, in *OptInToCosmosChainRequest, opts ...grpc.CallOption) (*OptInToCosmosChainResponse, error) { - out := new(OptInToCosmosChainResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptInToCosmosChain", in, out, opts...) +func (c *msgClient) SetConsKey(ctx context.Context, in *SetConsKeyReq, opts ...grpc.CallOption) (*SetConsKeyResponse, error) { + out := new(SetConsKeyResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/SetConsKey", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) InitConsKeyRemoval(ctx context.Context, in *InitConsKeyRemovalReq, opts ...grpc.CallOption) (*InitConsKeyRemovalResponse, error) { + out := new(InitConsKeyRemovalResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/InitConsKeyRemoval", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) OptIntoAVS(ctx context.Context, in *OptIntoAVSReq, opts ...grpc.CallOption) (*OptIntoAVSResponse, error) { + out := new(OptIntoAVSResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptIntoAVS", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *msgClient) InitOptOutFromCosmosChain(ctx context.Context, in *InitOptOutFromCosmosChainRequest, opts ...grpc.CallOption) (*InitOptOutFromCosmosChainResponse, error) { - out := new(InitOptOutFromCosmosChainResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/InitOptOutFromCosmosChain", in, out, opts...) +func (c *msgClient) OptOutOfAVS(ctx context.Context, in *OptOutOfAVSReq, opts ...grpc.CallOption) (*OptOutOfAVSResponse, error) { + out := new(OptOutOfAVSResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptOutOfAVS", in, out, opts...) if err != nil { return nil, err } @@ -1109,17 +1261,14 @@ func (c *msgClient) InitOptOutFromCosmosChain(ctx context.Context, in *InitOptOu type MsgServer interface { // RegisterOperator registers a new operator. RegisterOperator(context.Context, *RegisterOperatorReq) (*RegisterOperatorResponse, error) - // add services for dogfood - // OptInToCosmosChain acts as opt in method for an operator to - // start validatring on a chain. The operator must sign the request with - // the key with which they registered in the system. - OptInToCosmosChain(context.Context, *OptInToCosmosChainRequest) (*OptInToCosmosChainResponse, error) - // InitOptOutFromCosmosChain is a method with which an operator can initiate - // the opt out process from a chain. The operator must sign the request with - // the key with which they registered in the system. The opt-out process takes - // as long as the chain's unbonding period to complete, plus some loose change - // for message relaying across chains. - InitOptOutFromCosmosChain(context.Context, *InitOptOutFromCosmosChainRequest) (*InitOptOutFromCosmosChainResponse, error) + // SetConsKey sets the operator's consensus key for a chain. + SetConsKey(context.Context, *SetConsKeyReq) (*SetConsKeyResponse, error) + // InitConsKeyRemoval removes the operator's consensus key for a chain. + InitConsKeyRemoval(context.Context, *InitConsKeyRemovalReq) (*InitConsKeyRemovalResponse, error) + // OptIntoAVS opts an operator into an AVS. + OptIntoAVS(context.Context, *OptIntoAVSReq) (*OptIntoAVSResponse, error) + // OptOutOfAVS opts an operator out of an AVS. + OptOutOfAVS(context.Context, *OptOutOfAVSReq) (*OptOutOfAVSResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1129,11 +1278,17 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) RegisterOperator(ctx context.Context, req *RegisterOperatorReq) (*RegisterOperatorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterOperator not implemented") } -func (*UnimplementedMsgServer) OptInToCosmosChain(ctx context.Context, req *OptInToCosmosChainRequest) (*OptInToCosmosChainResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OptInToCosmosChain not implemented") +func (*UnimplementedMsgServer) SetConsKey(ctx context.Context, req *SetConsKeyReq) (*SetConsKeyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetConsKey not implemented") +} +func (*UnimplementedMsgServer) InitConsKeyRemoval(ctx context.Context, req *InitConsKeyRemovalReq) (*InitConsKeyRemovalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitConsKeyRemoval not implemented") +} +func (*UnimplementedMsgServer) OptIntoAVS(ctx context.Context, req *OptIntoAVSReq) (*OptIntoAVSResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptIntoAVS not implemented") } -func (*UnimplementedMsgServer) InitOptOutFromCosmosChain(ctx context.Context, req *InitOptOutFromCosmosChainRequest) (*InitOptOutFromCosmosChainResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitOptOutFromCosmosChain not implemented") +func (*UnimplementedMsgServer) OptOutOfAVS(ctx context.Context, req *OptOutOfAVSReq) (*OptOutOfAVSResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OptOutOfAVS not implemented") } func RegisterMsgServer(s grpc1.Server, srv MsgServer) { @@ -1158,38 +1313,74 @@ func _Msg_RegisterOperator_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Msg_OptInToCosmosChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OptInToCosmosChainRequest) +func _Msg_SetConsKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetConsKeyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetConsKey(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Msg/SetConsKey", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetConsKey(ctx, req.(*SetConsKeyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_InitConsKeyRemoval_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InitConsKeyRemovalReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InitConsKeyRemoval(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Msg/InitConsKeyRemoval", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitConsKeyRemoval(ctx, req.(*InitConsKeyRemovalReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_OptIntoAVS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OptIntoAVSReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).OptInToCosmosChain(ctx, in) + return srv.(MsgServer).OptIntoAVS(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.operator.v1.Msg/OptInToCosmosChain", + FullMethod: "/exocore.operator.v1.Msg/OptIntoAVS", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).OptInToCosmosChain(ctx, req.(*OptInToCosmosChainRequest)) + return srv.(MsgServer).OptIntoAVS(ctx, req.(*OptIntoAVSReq)) } return interceptor(ctx, in, info, handler) } -func _Msg_InitOptOutFromCosmosChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitOptOutFromCosmosChainRequest) +func _Msg_OptOutOfAVS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OptOutOfAVSReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MsgServer).InitOptOutFromCosmosChain(ctx, in) + return srv.(MsgServer).OptOutOfAVS(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.operator.v1.Msg/InitOptOutFromCosmosChain", + FullMethod: "/exocore.operator.v1.Msg/OptOutOfAVS", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InitOptOutFromCosmosChain(ctx, req.(*InitOptOutFromCosmosChainRequest)) + return srv.(MsgServer).OptOutOfAVS(ctx, req.(*OptOutOfAVSReq)) } return interceptor(ctx, in, info, handler) } @@ -1203,12 +1394,20 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Handler: _Msg_RegisterOperator_Handler, }, { - MethodName: "OptInToCosmosChain", - Handler: _Msg_OptInToCosmosChain_Handler, + MethodName: "SetConsKey", + Handler: _Msg_SetConsKey_Handler, + }, + { + MethodName: "InitConsKeyRemoval", + Handler: _Msg_InitConsKeyRemoval_Handler, }, { - MethodName: "InitOptOutFromCosmosChain", - Handler: _Msg_InitOptOutFromCosmosChain_Handler, + MethodName: "OptIntoAVS", + Handler: _Msg_OptIntoAVS_Handler, + }, + { + MethodName: "OptOutOfAVS", + Handler: _Msg_OptOutOfAVS_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -1779,7 +1978,127 @@ func (m *RegisterOperatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *OptInToCosmosChainRequest) Marshal() (dAtA []byte, err error) { +func (m *OptIntoAVSReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptIntoAVSReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OptIntoAVSReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AvsAddress) > 0 { + i -= len(m.AvsAddress) + copy(dAtA[i:], m.AvsAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AvsAddress))) + 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 *OptIntoAVSResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptIntoAVSResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OptIntoAVSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *OptOutOfAVSReq) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptOutOfAVSReq) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OptOutOfAVSReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AvsAddress) > 0 { + i -= len(m.AvsAddress) + copy(dAtA[i:], m.AvsAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AvsAddress))) + 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 *OptOutOfAVSResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OptOutOfAVSResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OptOutOfAVSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *SetConsKeyReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1789,12 +2108,12 @@ func (m *OptInToCosmosChainRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OptInToCosmosChainRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *SetConsKeyReq) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OptInToCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SetConsKeyReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1806,10 +2125,10 @@ func (m *OptInToCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro i-- dAtA[i] = 0x1a } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainID))) i-- dAtA[i] = 0x12 } @@ -1823,7 +2142,7 @@ func (m *OptInToCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *OptInToCosmosChainResponse) Marshal() (dAtA []byte, err error) { +func (m *SetConsKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1833,12 +2152,12 @@ func (m *OptInToCosmosChainResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *OptInToCosmosChainResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SetConsKeyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *OptInToCosmosChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SetConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1846,7 +2165,7 @@ func (m *OptInToCosmosChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *InitOptOutFromCosmosChainRequest) Marshal() (dAtA []byte, err error) { +func (m *InitConsKeyRemovalReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1856,20 +2175,20 @@ func (m *InitOptOutFromCosmosChainRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *InitOptOutFromCosmosChainRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *InitConsKeyRemovalReq) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *InitOptOutFromCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitConsKeyRemovalReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainId))) + if len(m.ChainID) > 0 { + i -= len(m.ChainID) + copy(dAtA[i:], m.ChainID) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChainID))) i-- dAtA[i] = 0x12 } @@ -1883,7 +2202,7 @@ func (m *InitOptOutFromCosmosChainRequest) MarshalToSizedBuffer(dAtA []byte) (in return len(dAtA) - i, nil } -func (m *InitOptOutFromCosmosChainResponse) Marshal() (dAtA []byte, err error) { +func (m *InitConsKeyRemovalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1893,12 +2212,12 @@ func (m *InitOptOutFromCosmosChainResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *InitOptOutFromCosmosChainResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *InitConsKeyRemovalResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *InitOptOutFromCosmosChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InitConsKeyRemovalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2137,17 +2456,69 @@ func (m *RegisterOperatorResponse) Size() (n int) { return n } -func (m *OptInToCosmosChainRequest) Size() (n int) { +func (m *OptIntoAVSReq) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Address) + l = len(m.FromAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ChainId) + l = len(m.AvsAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *OptIntoAVSResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *OptOutOfAVSReq) 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.AvsAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *OptOutOfAVSResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *SetConsKeyReq) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChainID) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2158,7 +2529,7 @@ func (m *OptInToCosmosChainRequest) Size() (n int) { return n } -func (m *OptInToCosmosChainResponse) Size() (n int) { +func (m *SetConsKeyResponse) Size() (n int) { if m == nil { return 0 } @@ -2167,7 +2538,7 @@ func (m *OptInToCosmosChainResponse) Size() (n int) { return n } -func (m *InitOptOutFromCosmosChainRequest) Size() (n int) { +func (m *InitConsKeyRemovalReq) Size() (n int) { if m == nil { return 0 } @@ -2177,14 +2548,14 @@ func (m *InitOptOutFromCosmosChainRequest) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.ChainId) + l = len(m.ChainID) if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n } -func (m *InitOptOutFromCosmosChainResponse) Size() (n int) { +func (m *InitConsKeyRemovalResponse) Size() (n int) { if m == nil { return 0 } @@ -3788,7 +4159,335 @@ func (m *RegisterOperatorResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { +func (m *OptIntoAVSReq) Unmarshal(dAtA []byte) 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: OptIntoAVSReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptIntoAVSReq: 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 AvsAddress", 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.AvsAddress = 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 *OptIntoAVSResponse) Unmarshal(dAtA []byte) 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: OptIntoAVSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptIntoAVSResponse: 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 *OptOutOfAVSReq) Unmarshal(dAtA []byte) 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: OptOutOfAVSReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptOutOfAVSReq: 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 AvsAddress", 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.AvsAddress = 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 *OptOutOfAVSResponse) Unmarshal(dAtA []byte) 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: OptOutOfAVSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OptOutOfAVSResponse: 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 *SetConsKeyReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3811,10 +4510,10 @@ func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OptInToCosmosChainRequest: wiretype end group for non-group") + return fmt.Errorf("proto: SetConsKeyReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OptInToCosmosChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SetConsKeyReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3851,7 +4550,7 @@ func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3879,7 +4578,7 @@ func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ChainID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -3934,7 +4633,7 @@ func (m *OptInToCosmosChainRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *OptInToCosmosChainResponse) Unmarshal(dAtA []byte) error { +func (m *SetConsKeyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3957,10 +4656,10 @@ func (m *OptInToCosmosChainResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: OptInToCosmosChainResponse: wiretype end group for non-group") + return fmt.Errorf("proto: SetConsKeyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: OptInToCosmosChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SetConsKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -3984,7 +4683,7 @@ func (m *OptInToCosmosChainResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { +func (m *InitConsKeyRemovalReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4007,10 +4706,10 @@ func (m *InitOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitOptOutFromCosmosChainRequest: wiretype end group for non-group") + return fmt.Errorf("proto: InitConsKeyRemovalReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitOptOutFromCosmosChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitConsKeyRemovalReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4047,7 +4746,7 @@ func (m *InitOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4075,7 +4774,7 @@ func (m *InitOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ChainId = string(dAtA[iNdEx:postIndex]) + m.ChainID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4098,7 +4797,7 @@ func (m *InitOptOutFromCosmosChainRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitOptOutFromCosmosChainResponse) Unmarshal(dAtA []byte) error { +func (m *InitConsKeyRemovalResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4121,10 +4820,10 @@ func (m *InitOptOutFromCosmosChainResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitOptOutFromCosmosChainResponse: wiretype end group for non-group") + return fmt.Errorf("proto: InitConsKeyRemovalResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitOptOutFromCosmosChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitConsKeyRemovalResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/oracle/types/params.pb.go b/x/oracle/types/params.pb.go index a5eb2565e..bbfb6facc 100644 --- a/x/oracle/types/params.pb.go +++ b/x/oracle/types/params.pb.go @@ -43,7 +43,7 @@ type Params struct { ThresholdB int32 `protobuf:"varint,8,opt,name=threshold_b,json=thresholdB,proto3" json:"threshold_b,omitempty"` // for v1, mode=1, get final price as soon as voting power reach threshold_a/threshold_b Mode int32 `protobuf:"varint,9,opt,name=mode,proto3" json:"mode,omitempty"` - // for each round, a validator only allowed to provide at most max_det_id continuos rounds of prices from deterministic source + // for each round, a validator only allowed to provide at most max_det_id continuos rounds of prices for DS MaxDetId int32 `protobuf:"varint,10,opt,name=max_det_id,json=maxDetId,proto3" json:"max_det_id,omitempty"` } From e004f5f22df7f0f3afc6f767c73b2a27001cc51a Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Tue, 11 Jun 2024 11:14:40 +0800 Subject: [PATCH 06/13] resolve the problems identified by code review in #PR61 --- proto/exocore/delegation/v1/query.proto | 10 +- proto/exocore/operator/v1/query.proto | 42 +-- x/delegation/client/cli/query.go | 12 +- x/delegation/keeper/grpc_query.go | 2 +- x/delegation/types/query.pb.go | 189 +++++----- x/delegation/types/query.pb.gw.go | 34 +- x/operator/client/cli/query.go | 12 +- x/operator/keeper/grpc_query.go | 4 +- x/operator/keeper/slash.go | 11 +- x/operator/types/query.pb.go | 461 +++++++++++++++--------- 10 files changed, 458 insertions(+), 319 deletions(-) diff --git a/proto/exocore/delegation/v1/query.proto b/proto/exocore/delegation/v1/query.proto index 5763edae0..36ca12c5a 100644 --- a/proto/exocore/delegation/v1/query.proto +++ b/proto/exocore/delegation/v1/query.proto @@ -91,9 +91,9 @@ message UndelegationsReq { string asset_id = 2 [(gogoproto.customname) = "AssetID"]; } -// UndelegationsReq is the request to obtain all undelegations waiting to be completed +// UndelegationsByHeightReq is the request to obtain all undelegations waiting to be completed // by height. -message WaitCompleteUndelegationsReq { +message UndelegationsByHeightReq { // block_height is the block height to query. uint64 block_height = 1; } @@ -131,11 +131,11 @@ service Query { option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegations"; } - // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by // {height}. - rpc QueryWaitCompleteUndelegations(WaitCompleteUndelegationsReq) returns (UndelegationRecordList) { + rpc QueryUndelegationsByHeight(UndelegationsByHeightReq) returns (UndelegationRecordList) { option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/exocore/delegation/v1/QueryWaitCompleteUndelegations"; + option (google.api.http).get = "/exocore/delegation/v1/QueryUndelegationsByHeight"; } } diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index b014bd70f..a29c8bc2b 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -31,15 +31,19 @@ message QueryAllOperatorsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +// AddressInfo includes the address of operator and AVS +message AddressInfo { + // operator_addr is the operator address,its type should be a sdk.AccAddress + string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs_address is the AVS address opted-in by the operator + string avs_address = 2 [(gogoproto.customname) = "AVSAddress"]; +} + // QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. message QueryOperatorUSDValueRequest { - // operator_addr is the operator address,its type should be a sdk.AccAddress - string operator_addr = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // avs_address is the AVS address opted-in by the operator - string avs_address = 2 - [(gogoproto.customname) = "AVSAddress"]; + // address_info is the operator and AVS address + AddressInfo address_info = 1; } // QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. @@ -52,12 +56,8 @@ message QueryAVSUSDValueRequest { // QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified // operator and AVS message QueryOperatorSlashInfoRequest { - // operator_addr is the operator address,its type should be a sdk.AccAddress - string operator_addr = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // avs_address is the AVS address opted-in by the operator - string avs_address = 2 - [(gogoproto.customname) = "AVSAddress"]; + // address_info is the operator and AVS address + AddressInfo address_info = 1; } // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest @@ -81,7 +81,7 @@ message QueryOperatorConsKeyRequest { // QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest. message QueryOperatorConsKeyResponse { // public_key is the consensus public key of the operator. - tendermint.crypto.PublicKey public_key = 1 [ (gogoproto.nullable) = false ]; + tendermint.crypto.PublicKey public_key = 1 [(gogoproto.nullable) = false]; } // QueryOperatorConsAddressRequest is the request to obtain the consensus address of the operator @@ -176,8 +176,8 @@ service Query { // QueryOperatorConsKeyForChainID queries the consensus public key for the operator rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns ( - QueryOperatorConsKeyResponse - ) { + QueryOperatorConsKeyResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_key/{operator_acc_addr}/{chain}" }; @@ -185,8 +185,8 @@ service Query { // QueryOperatorConsAddressForChainID queries the consensus address for the operator. rpc QueryOperatorConsAddressForChainID(QueryOperatorConsAddressRequest) returns ( - QueryOperatorConsAddressResponse - ) { + QueryOperatorConsAddressResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_addr/{operator_acc_addr}/{chain}" }; @@ -195,8 +195,8 @@ service Query { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID rpc QueryAllOperatorConsKeysByChainID(QueryAllOperatorConsKeysByChainIDRequest) returns ( - QueryAllOperatorConsKeysByChainIDResponse - ) { + QueryAllOperatorConsKeysByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_keys/{chain}" }; @@ -220,8 +220,8 @@ service Query { // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID rpc QueryAllOperatorConsAddrsByChainID(QueryAllOperatorConsAddrsByChainIDRequest) returns ( - QueryAllOperatorConsAddrsByChainIDResponse - ) { + QueryAllOperatorConsAddrsByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_addrs/{chain}" }; diff --git a/x/delegation/client/cli/query.go b/x/delegation/client/cli/query.go index 3a23a7377..aa8a37b72 100644 --- a/x/delegation/client/cli/query.go +++ b/x/delegation/client/cli/query.go @@ -29,7 +29,7 @@ func GetQueryCmd() *cobra.Command { QuerySingleDelegationInfo(), QueryDelegationInfo(), QueryUndelegations(), - QueryWaitCompleteUndelegations(), + QueryUndelegationsByHeight(), QueryUndelegationHoldCount(), ) return cmd @@ -142,10 +142,10 @@ func QueryUndelegations() *cobra.Command { return cmd } -// QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by height -func QueryWaitCompleteUndelegations() *cobra.Command { +// QueryUndelegationsByHeight queries all undelegations waiting to be completed by height +func QueryUndelegationsByHeight() *cobra.Command { cmd := &cobra.Command{ - Use: "QueryWaitCompleteUndelegations height", + Use: "QueryUndelegationsByHeight height", Short: "Get undelegations waiting to be completed", Long: "Get undelegations waiting to be completed", Args: cobra.ExactArgs(1), @@ -159,10 +159,10 @@ func QueryWaitCompleteUndelegations() *cobra.Command { return err } queryClient := delegationtype.NewQueryClient(clientCtx) - req := &delegationtype.WaitCompleteUndelegationsReq{ + req := &delegationtype.UndelegationsByHeightReq{ BlockHeight: height, } - res, err := queryClient.QueryWaitCompleteUndelegations(context.Background(), req) + res, err := queryClient.QueryUndelegationsByHeight(context.Background(), req) if err != nil { return err } diff --git a/x/delegation/keeper/grpc_query.go b/x/delegation/keeper/grpc_query.go index 04bb3e57d..96515407d 100644 --- a/x/delegation/keeper/grpc_query.go +++ b/x/delegation/keeper/grpc_query.go @@ -30,7 +30,7 @@ func (k *Keeper) QueryUndelegations(ctx context.Context, req *delegationtype.Und }, nil } -func (k *Keeper) QueryWaitCompleteUndelegations(ctx context.Context, req *delegationtype.WaitCompleteUndelegationsReq) (*delegationtype.UndelegationRecordList, error) { +func (k *Keeper) QueryUndelegationsByHeight(ctx context.Context, req *delegationtype.UndelegationsByHeightReq) (*delegationtype.UndelegationRecordList, error) { c := sdk.UnwrapSDKContext(ctx) undelegations, err := k.GetWaitCompleteUndelegationRecords(c, req.BlockHeight) if err != nil { diff --git a/x/delegation/types/query.pb.go b/x/delegation/types/query.pb.go index 3c785e28b..c429a4626 100644 --- a/x/delegation/types/query.pb.go +++ b/x/delegation/types/query.pb.go @@ -444,25 +444,25 @@ func (m *UndelegationsReq) GetAssetID() string { return "" } -// UndelegationsReq is the request to obtain all undelegations waiting to be completed +// UndelegationsByHeightReq is the request to obtain all undelegations waiting to be completed // by height. -type WaitCompleteUndelegationsReq struct { +type UndelegationsByHeightReq struct { // block_height is the block height to query. BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` } -func (m *WaitCompleteUndelegationsReq) Reset() { *m = WaitCompleteUndelegationsReq{} } -func (m *WaitCompleteUndelegationsReq) String() string { return proto.CompactTextString(m) } -func (*WaitCompleteUndelegationsReq) ProtoMessage() {} -func (*WaitCompleteUndelegationsReq) Descriptor() ([]byte, []int) { +func (m *UndelegationsByHeightReq) Reset() { *m = UndelegationsByHeightReq{} } +func (m *UndelegationsByHeightReq) String() string { return proto.CompactTextString(m) } +func (*UndelegationsByHeightReq) ProtoMessage() {} +func (*UndelegationsByHeightReq) Descriptor() ([]byte, []int) { return fileDescriptor_aab345e1cf20490c, []int{8} } -func (m *WaitCompleteUndelegationsReq) XXX_Unmarshal(b []byte) error { +func (m *UndelegationsByHeightReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *WaitCompleteUndelegationsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *UndelegationsByHeightReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_WaitCompleteUndelegationsReq.Marshal(b, m, deterministic) + return xxx_messageInfo_UndelegationsByHeightReq.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -472,19 +472,19 @@ func (m *WaitCompleteUndelegationsReq) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *WaitCompleteUndelegationsReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_WaitCompleteUndelegationsReq.Merge(m, src) +func (m *UndelegationsByHeightReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UndelegationsByHeightReq.Merge(m, src) } -func (m *WaitCompleteUndelegationsReq) XXX_Size() int { +func (m *UndelegationsByHeightReq) XXX_Size() int { return m.Size() } -func (m *WaitCompleteUndelegationsReq) XXX_DiscardUnknown() { - xxx_messageInfo_WaitCompleteUndelegationsReq.DiscardUnknown(m) +func (m *UndelegationsByHeightReq) XXX_DiscardUnknown() { + xxx_messageInfo_UndelegationsByHeightReq.DiscardUnknown(m) } -var xxx_messageInfo_WaitCompleteUndelegationsReq proto.InternalMessageInfo +var xxx_messageInfo_UndelegationsByHeightReq proto.InternalMessageInfo -func (m *WaitCompleteUndelegationsReq) GetBlockHeight() uint64 { +func (m *UndelegationsByHeightReq) GetBlockHeight() uint64 { if m != nil { return m.BlockHeight } @@ -547,69 +547,68 @@ func init() { proto.RegisterType((*UndelegationHoldCountReq)(nil), "exocore.delegation.v1.UndelegationHoldCountReq") proto.RegisterType((*UndelegationHoldCountResponse)(nil), "exocore.delegation.v1.UndelegationHoldCountResponse") proto.RegisterType((*UndelegationsReq)(nil), "exocore.delegation.v1.UndelegationsReq") - proto.RegisterType((*WaitCompleteUndelegationsReq)(nil), "exocore.delegation.v1.WaitCompleteUndelegationsReq") + proto.RegisterType((*UndelegationsByHeightReq)(nil), "exocore.delegation.v1.UndelegationsByHeightReq") proto.RegisterType((*UndelegationRecordList)(nil), "exocore.delegation.v1.UndelegationRecordList") } func init() { proto.RegisterFile("exocore/delegation/v1/query.proto", fileDescriptor_aab345e1cf20490c) } var fileDescriptor_aab345e1cf20490c = []byte{ - // 872 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5f, 0x6f, 0xdb, 0x54, - 0x14, 0xef, 0x6d, 0x19, 0x6d, 0x4e, 0x3b, 0x51, 0xee, 0xca, 0xc8, 0xbc, 0xd5, 0xdd, 0xfc, 0x50, - 0xda, 0xa1, 0xda, 0x2c, 0xdb, 0xf8, 0x27, 0x56, 0xd1, 0x2e, 0xd3, 0x16, 0x0d, 0x0d, 0xe1, 0x08, - 0x21, 0xf1, 0x62, 0x39, 0xf6, 0xad, 0x63, 0xc5, 0xf1, 0xcd, 0x7c, 0x6f, 0xb2, 0x46, 0x88, 0x17, - 0x9e, 0x78, 0x44, 0xe2, 0x2b, 0xf0, 0x04, 0x2f, 0x7b, 0xe8, 0x87, 0xe8, 0x63, 0x55, 0x5e, 0x10, - 0x0f, 0x11, 0x4a, 0x91, 0xf8, 0x0e, 0xbc, 0x80, 0x7c, 0x7d, 0xd3, 0x38, 0x8d, 0x1d, 0x12, 0xa1, - 0x3d, 0xc5, 0xf7, 0xfc, 0xf9, 0x9d, 0xdf, 0x3d, 0xe7, 0x77, 0xec, 0xc0, 0x2d, 0x72, 0x48, 0x1d, - 0x1a, 0x11, 0xc3, 0x25, 0x01, 0xf1, 0x6c, 0xee, 0xd3, 0xd0, 0xe8, 0xdc, 0x31, 0x9e, 0xb7, 0x49, - 0xd4, 0xd5, 0x5b, 0x11, 0xe5, 0x14, 0xbf, 0x25, 0x43, 0xf4, 0x61, 0x88, 0xde, 0xb9, 0xa3, 0x5c, - 0x77, 0x28, 0x6b, 0x52, 0x96, 0x84, 0x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, 0x84, 0xe9, 0x65, - 0xe2, 0x9c, 0x1e, 0xed, 0x80, 0x6c, 0x6b, 0x99, 0x38, 0x26, 0x1e, 0x01, 0xae, 0xc6, 0xb8, 0xb8, - 0x03, 0xc5, 0x17, 0xb6, 0xcf, 0xad, 0x73, 0x97, 0x4f, 0x43, 0xcb, 0x16, 0x5c, 0xe4, 0x25, 0x67, - 0xa9, 0x59, 0x09, 0x79, 0xaa, 0x66, 0x25, 0xe4, 0xe6, 0xd5, 0x18, 0xfd, 0xcb, 0x14, 0x78, 0x72, - 0x4f, 0xed, 0x1f, 0x04, 0xd7, 0xbf, 0x88, 0xb5, 0x70, 0x71, 0x24, 0xac, 0x45, 0x43, 0x46, 0x70, - 0x04, 0xab, 0x29, 0x42, 0x7e, 0x78, 0x40, 0x93, 0xfe, 0x2d, 0x97, 0x1e, 0xeb, 0x99, 0x52, 0xd3, - 0x27, 0xa0, 0xe9, 0xa3, 0x66, 0xf6, 0x28, 0xe4, 0x51, 0xd7, 0x7c, 0xc3, 0x1d, 0xb5, 0x2a, 0x01, - 0xac, 0x65, 0x05, 0xe2, 0x55, 0x58, 0x68, 0x90, 0x6e, 0x32, 0x02, 0x33, 0x7e, 0xc4, 0xbb, 0x70, - 0xa9, 0x63, 0x07, 0x6d, 0x22, 0x5a, 0xb4, 0x5c, 0xda, 0xca, 0xa1, 0x34, 0x36, 0x5d, 0x33, 0x49, - 0xfb, 0x78, 0xfe, 0x43, 0xa4, 0xfd, 0x82, 0xe0, 0xed, 0xaa, 0x1f, 0x7a, 0x01, 0xf9, 0x5f, 0xaa, - 0x7c, 0x00, 0x97, 0x69, 0x8b, 0x44, 0x36, 0xa7, 0x91, 0x65, 0xbb, 0x6e, 0x24, 0xa7, 0x56, 0x3c, - 0x3d, 0xda, 0x59, 0x93, 0x73, 0xd8, 0x73, 0xdd, 0x88, 0x30, 0x56, 0xe5, 0x91, 0x1f, 0x7a, 0xe6, - 0xca, 0x20, 0x3c, 0x36, 0x8f, 0x88, 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a, 0xf8, 0x04, 0x55, 0x6e, 0x2a, 0x22, + 0x11, 0x47, 0xfb, 0x7a, 0xb2, 0xa1, 0xdf, 0xa0, 0x13, 0x09, 0xd0, 0xb5, 0x58, 0x8a, 0xde, 0x9e, + 0x83, 0x59, 0xb8, 0x7d, 0x72, 0x69, 0x6e, 0xe9, 0x86, 0x0b, 0xa0, 0xbc, 0x3f, 0xe1, 0xfe, 0x0e, + 0xda, 0x9a, 0x97, 0x3b, 0x45, 0xbf, 0x24, 0x75, 0x7e, 0xbc, 0x97, 0x73, 0x75, 0x3e, 0xbe, 0xc5, + 0x8b, 0xd2, 0xae, 0x4c, 0x68, 0x3f, 0x46, 0xdb, 0x73, 0xd3, 0x1e, 0xdd, 0xb8, 0xb7, 0x7f, 0x36, + 0xcc, 0x4b, 0xe7, 0xc3, 0xbc, 0xf4, 0xc7, 0x30, 0x2f, 0x7d, 0x7f, 0x99, 0x4f, 0x9d, 0x5f, 0xe6, + 0x53, 0xbf, 0x5d, 0xe6, 0x53, 0x5f, 0x3d, 0x89, 0x7d, 0x4a, 0x9f, 0x46, 0xb0, 0xfb, 0x98, 0x1d, + 0x91, 0xa0, 0x35, 0xbe, 0xe5, 0x38, 0x7e, 0x0f, 0xff, 0xb8, 0x36, 0x5e, 0xe5, 0x7f, 0x63, 0x1e, + 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x58, 0xb3, 0xa5, 0x8e, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -634,9 +633,9 @@ type QueryClient interface { // QueryUndelegations queries all undelegations for // {staker, asset}. QueryUndelegations(ctx context.Context, in *UndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) - // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by // {height}. - QueryWaitCompleteUndelegations(ctx context.Context, in *WaitCompleteUndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) + QueryUndelegationsByHeight(ctx context.Context, in *UndelegationsByHeightReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) } type queryClient struct { @@ -683,9 +682,9 @@ func (c *queryClient) QueryUndelegations(ctx context.Context, in *UndelegationsR return out, nil } -func (c *queryClient) QueryWaitCompleteUndelegations(ctx context.Context, in *WaitCompleteUndelegationsReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { +func (c *queryClient) QueryUndelegationsByHeight(ctx context.Context, in *UndelegationsByHeightReq, opts ...grpc.CallOption) (*UndelegationRecordList, error) { out := new(UndelegationRecordList) - err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryWaitCompleteUndelegations", in, out, opts...) + err := c.cc.Invoke(ctx, "/exocore.delegation.v1.Query/QueryUndelegationsByHeight", in, out, opts...) if err != nil { return nil, err } @@ -704,9 +703,9 @@ type QueryServer interface { // QueryUndelegations queries all undelegations for // {staker, asset}. QueryUndelegations(context.Context, *UndelegationsReq) (*UndelegationRecordList, error) - // QueryWaitCompleteUndelegations queries all undelegations waiting to be completed by + // QueryUndelegationsByHeight queries all undelegations waiting to be completed by // {height}. - QueryWaitCompleteUndelegations(context.Context, *WaitCompleteUndelegationsReq) (*UndelegationRecordList, error) + QueryUndelegationsByHeight(context.Context, *UndelegationsByHeightReq) (*UndelegationRecordList, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -725,8 +724,8 @@ func (*UnimplementedQueryServer) QueryUndelegationHoldCount(ctx context.Context, func (*UnimplementedQueryServer) QueryUndelegations(ctx context.Context, req *UndelegationsReq) (*UndelegationRecordList, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegations not implemented") } -func (*UnimplementedQueryServer) QueryWaitCompleteUndelegations(ctx context.Context, req *WaitCompleteUndelegationsReq) (*UndelegationRecordList, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryWaitCompleteUndelegations not implemented") +func (*UnimplementedQueryServer) QueryUndelegationsByHeight(ctx context.Context, req *UndelegationsByHeightReq) (*UndelegationRecordList, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUndelegationsByHeight not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -805,20 +804,20 @@ func _Query_QueryUndelegations_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Query_QueryWaitCompleteUndelegations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WaitCompleteUndelegationsReq) +func _Query_QueryUndelegationsByHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UndelegationsByHeightReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).QueryWaitCompleteUndelegations(ctx, in) + return srv.(QueryServer).QueryUndelegationsByHeight(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.delegation.v1.Query/QueryWaitCompleteUndelegations", + FullMethod: "/exocore.delegation.v1.Query/QueryUndelegationsByHeight", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryWaitCompleteUndelegations(ctx, req.(*WaitCompleteUndelegationsReq)) + return srv.(QueryServer).QueryUndelegationsByHeight(ctx, req.(*UndelegationsByHeightReq)) } return interceptor(ctx, in, info, handler) } @@ -844,8 +843,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_QueryUndelegations_Handler, }, { - MethodName: "QueryWaitCompleteUndelegations", - Handler: _Query_QueryWaitCompleteUndelegations_Handler, + MethodName: "QueryUndelegationsByHeight", + Handler: _Query_QueryUndelegationsByHeight_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -1152,7 +1151,7 @@ func (m *UndelegationsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *WaitCompleteUndelegationsReq) Marshal() (dAtA []byte, err error) { +func (m *UndelegationsByHeightReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1162,12 +1161,12 @@ func (m *WaitCompleteUndelegationsReq) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *WaitCompleteUndelegationsReq) MarshalTo(dAtA []byte) (int, error) { +func (m *UndelegationsByHeightReq) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *WaitCompleteUndelegationsReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *UndelegationsByHeightReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1358,7 +1357,7 @@ func (m *UndelegationsReq) Size() (n int) { return n } -func (m *WaitCompleteUndelegationsReq) Size() (n int) { +func (m *UndelegationsByHeightReq) Size() (n int) { if m == nil { return 0 } @@ -2295,7 +2294,7 @@ func (m *UndelegationsReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *WaitCompleteUndelegationsReq) Unmarshal(dAtA []byte) error { +func (m *UndelegationsByHeightReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2318,10 +2317,10 @@ func (m *WaitCompleteUndelegationsReq) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: WaitCompleteUndelegationsReq: wiretype end group for non-group") + return fmt.Errorf("proto: UndelegationsByHeightReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: WaitCompleteUndelegationsReq: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: UndelegationsByHeightReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/delegation/types/query.pb.gw.go b/x/delegation/types/query.pb.gw.go index 4fd0f08a4..da415c8ec 100644 --- a/x/delegation/types/query.pb.gw.go +++ b/x/delegation/types/query.pb.gw.go @@ -196,37 +196,37 @@ func local_request_Query_QueryUndelegations_0(ctx context.Context, marshaler run } var ( - filter_Query_QueryWaitCompleteUndelegations_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_QueryUndelegationsByHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_QueryWaitCompleteUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq WaitCompleteUndelegationsReq +func request_Query_QueryUndelegationsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsByHeightReq 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_QueryWaitCompleteUndelegations_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegationsByHeight_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.QueryWaitCompleteUndelegations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.QueryUndelegationsByHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_QueryWaitCompleteUndelegations_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq WaitCompleteUndelegationsReq +func local_request_Query_QueryUndelegationsByHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UndelegationsByHeightReq 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_QueryWaitCompleteUndelegations_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryUndelegationsByHeight_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.QueryWaitCompleteUndelegations(ctx, &protoReq) + msg, err := server.QueryUndelegationsByHeight(ctx, &protoReq) return msg, metadata, err } @@ -329,7 +329,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_QueryWaitCompleteUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryUndelegationsByHeight_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -340,7 +340,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_QueryWaitCompleteUndelegations_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_QueryUndelegationsByHeight_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 { @@ -348,7 +348,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_QueryWaitCompleteUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryUndelegationsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -473,7 +473,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_QueryWaitCompleteUndelegations_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryUndelegationsByHeight_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) @@ -482,14 +482,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_QueryWaitCompleteUndelegations_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_QueryUndelegationsByHeight_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_QueryWaitCompleteUndelegations_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryUndelegationsByHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -505,7 +505,7 @@ var ( pattern_Query_QueryUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryWaitCompleteUndelegations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryWaitCompleteUndelegations"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryUndelegationsByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"exocore", "delegation", "v1", "QueryUndelegationsByHeight"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -517,5 +517,5 @@ var ( forward_Query_QueryUndelegations_0 = runtime.ForwardResponseMessage - forward_Query_QueryWaitCompleteUndelegations_0 = runtime.ForwardResponseMessage + forward_Query_QueryUndelegationsByHeight_0 = runtime.ForwardResponseMessage ) diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index fedba9637..9b0358cc3 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -243,8 +243,10 @@ func QueryOperatorUSDValue() *cobra.Command { } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorUSDValueRequest{ - OperatorAddr: args[0], - AVSAddress: args[1], + AddressInfo: &operatortypes.AddressInfo{ + OperatorAddr: args[0], + AVSAddress: args[1], + }, } res, err := queryClient.QueryOperatorUSDValue(context.Background(), req) if err != nil { @@ -300,8 +302,10 @@ func QueryOperatorSlashInfo() *cobra.Command { } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorSlashInfoRequest{ - OperatorAddr: args[0], - AVSAddress: args[1], + AddressInfo: &operatortypes.AddressInfo{ + OperatorAddr: args[0], + AVSAddress: args[1], + }, } res, err := queryClient.QueryOperatorSlashInfo(context.Background(), req) if err != nil { diff --git a/x/operator/keeper/grpc_query.go b/x/operator/keeper/grpc_query.go index 8f457a5e2..038cc1c14 100644 --- a/x/operator/keeper/grpc_query.go +++ b/x/operator/keeper/grpc_query.go @@ -171,7 +171,7 @@ func (k Keeper) QueryAllOperatorConsAddrsByChainID( func (k *Keeper) QueryOperatorUSDValue(ctx context.Context, req *operatortypes.QueryOperatorUSDValueRequest) (*operatortypes.DecValueField, error) { c := sdk.UnwrapSDKContext(ctx) - usdValue, err := k.GetOperatorUSDValue(c, req.OperatorAddr, req.AVSAddress) + usdValue, err := k.GetOperatorUSDValue(c, req.AddressInfo.OperatorAddr, req.AddressInfo.AVSAddress) if err != nil { return nil, err } @@ -193,7 +193,7 @@ func (k *Keeper) QueryAVSUSDValue(ctx context.Context, req *operatortypes.QueryA func (k *Keeper) QueryOperatorSlashInfo(ctx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { c := sdk.UnwrapSDKContext(ctx) - slashInfo, err := k.AllOperatorSlashInfo(c, req.OperatorAddr, req.AVSAddress) + slashInfo, err := k.AllOperatorSlashInfo(c, req.AddressInfo.OperatorAddr, req.AddressInfo.AVSAddress) if err != nil { return nil, err } diff --git a/x/operator/keeper/slash.go b/x/operator/keeper/slash.go index 1e8ad27fc..c8f2887c9 100644 --- a/x/operator/keeper/slash.go +++ b/x/operator/keeper/slash.go @@ -34,9 +34,9 @@ func GetSlashIDForDogfood(infraction stakingtypes.Infraction, infractionHeight i } // SlashFromUndelegation executes the slash from an undelegation -func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slashProportion sdkmath.LegacyDec) (*types.SlashFromUndelegation, error) { +func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slashProportion sdkmath.LegacyDec) *types.SlashFromUndelegation { if undelegation.ActualCompletedAmount.IsZero() { - return nil, nil + return nil } slashAmount := slashProportion.MulInt(undelegation.Amount).TruncateInt() // reduce the actual_completed_amount in the record @@ -51,7 +51,7 @@ func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slas StakerID: undelegation.StakerID, AssetID: undelegation.AssetID, Amount: slashAmount, - }, nil + } } func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *SlashInputInfo) error { @@ -100,10 +100,7 @@ func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *SlashInputInfo) (*types if parameter.SlashEventHeight < ctx.BlockHeight() { // get the undelegations that are submitted after the slash. opFunc := func(undelegation *delegationtype.UndelegationRecord) error { - slashFromUndelegation, err := SlashFromUndelegation(undelegation, newSlashProportion) - if err != nil { - return err - } + slashFromUndelegation := SlashFromUndelegation(undelegation, newSlashProportion) if slashFromUndelegation != nil { executionInfo.SlashUndelegations = append(executionInfo.SlashUndelegations, slashFromUndelegation) } diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index b28268fc5..1fa476ab8 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -179,20 +179,73 @@ func (m *QueryAllOperatorsResponse) GetPagination() *query.PageResponse { return nil } -// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. -// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. -type QueryOperatorUSDValueRequest struct { +// AddressInfo includes the address of operator and AVS +type AddressInfo struct { // operator_addr is the operator address,its type should be a sdk.AccAddress OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` // avs_address is the AVS address opted-in by the operator AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` } +func (m *AddressInfo) Reset() { *m = AddressInfo{} } +func (m *AddressInfo) String() string { return proto.CompactTextString(m) } +func (*AddressInfo) ProtoMessage() {} +func (*AddressInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{3} +} +func (m *AddressInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddressInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressInfo.Merge(m, src) +} +func (m *AddressInfo) XXX_Size() int { + return m.Size() +} +func (m *AddressInfo) XXX_DiscardUnknown() { + xxx_messageInfo_AddressInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressInfo proto.InternalMessageInfo + +func (m *AddressInfo) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + +func (m *AddressInfo) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +type QueryOperatorUSDValueRequest struct { + // address_info is the operator and AVS address + AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` +} + func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDValueRequest{} } func (m *QueryOperatorUSDValueRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorUSDValueRequest) ProtoMessage() {} func (*QueryOperatorUSDValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{3} + return fileDescriptor_f91e795a3cecbdbf, []int{4} } func (m *QueryOperatorUSDValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -221,18 +274,11 @@ func (m *QueryOperatorUSDValueRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorUSDValueRequest proto.InternalMessageInfo -func (m *QueryOperatorUSDValueRequest) GetOperatorAddr() string { - if m != nil { - return m.OperatorAddr - } - return "" -} - -func (m *QueryOperatorUSDValueRequest) GetAVSAddress() string { +func (m *QueryOperatorUSDValueRequest) GetAddressInfo() *AddressInfo { if m != nil { - return m.AVSAddress + return m.AddressInfo } - return "" + return nil } // QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. @@ -245,7 +291,7 @@ func (m *QueryAVSUSDValueRequest) Reset() { *m = QueryAVSUSDValueRequest func (m *QueryAVSUSDValueRequest) String() string { return proto.CompactTextString(m) } func (*QueryAVSUSDValueRequest) ProtoMessage() {} func (*QueryAVSUSDValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{4} + return fileDescriptor_f91e795a3cecbdbf, []int{5} } func (m *QueryAVSUSDValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,17 +330,15 @@ func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { // QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified // operator and AVS type QueryOperatorSlashInfoRequest struct { - // operator_addr is the operator address,its type should be a sdk.AccAddress - OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` - // avs_address is the AVS address opted-in by the operator - AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` + // address_info is the operator and AVS address + AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` } func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } func (m *QueryOperatorSlashInfoRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorSlashInfoRequest) ProtoMessage() {} func (*QueryOperatorSlashInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{5} + return fileDescriptor_f91e795a3cecbdbf, []int{6} } func (m *QueryOperatorSlashInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -323,18 +367,11 @@ func (m *QueryOperatorSlashInfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorSlashInfoRequest proto.InternalMessageInfo -func (m *QueryOperatorSlashInfoRequest) GetOperatorAddr() string { - if m != nil { - return m.OperatorAddr - } - return "" -} - -func (m *QueryOperatorSlashInfoRequest) GetAVSAddress() string { +func (m *QueryOperatorSlashInfoRequest) GetAddressInfo() *AddressInfo { if m != nil { - return m.AVSAddress + return m.AddressInfo } - return "" + return nil } // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest @@ -349,7 +386,7 @@ func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSla func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{6} + return fileDescriptor_f91e795a3cecbdbf, []int{7} } func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +436,7 @@ func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKe func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{7} + return fileDescriptor_f91e795a3cecbdbf, []int{8} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,7 +489,7 @@ func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsK func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{8} + return fileDescriptor_f91e795a3cecbdbf, []int{9} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -503,7 +540,7 @@ func (m *QueryOperatorConsAddressRequest) Reset() { *m = QueryOperatorCo func (m *QueryOperatorConsAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressRequest) ProtoMessage() {} func (*QueryOperatorConsAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{9} + return fileDescriptor_f91e795a3cecbdbf, []int{10} } func (m *QueryOperatorConsAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -557,7 +594,7 @@ func (m *QueryOperatorConsAddressResponse) Reset() { *m = QueryOperatorC func (m *QueryOperatorConsAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressResponse) ProtoMessage() {} func (*QueryOperatorConsAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{10} + return fileDescriptor_f91e795a3cecbdbf, []int{11} } func (m *QueryOperatorConsAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -610,7 +647,7 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) Reset() { func (m *QueryAllOperatorConsKeysByChainIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllOperatorConsKeysByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{11} + return fileDescriptor_f91e795a3cecbdbf, []int{12} } func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -670,7 +707,7 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) String() string { } func (*QueryAllOperatorConsKeysByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{12} + return fileDescriptor_f91e795a3cecbdbf, []int{13} } func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -726,7 +763,7 @@ func (m *OperatorConsKeyPair) Reset() { *m = OperatorConsKeyPair{} } func (m *OperatorConsKeyPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsKeyPair) ProtoMessage() {} func (*OperatorConsKeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{13} + return fileDescriptor_f91e795a3cecbdbf, []int{14} } func (m *OperatorConsKeyPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -788,7 +825,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) String() string { } func (*QueryAllOperatorConsAddrsByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{14} + return fileDescriptor_f91e795a3cecbdbf, []int{15} } func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -848,7 +885,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) String() string { } func (*QueryAllOperatorConsAddrsByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{15} + return fileDescriptor_f91e795a3cecbdbf, []int{16} } func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -904,7 +941,7 @@ func (m *OperatorConsAddrPair) Reset() { *m = OperatorConsAddrPair{} } func (m *OperatorConsAddrPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsAddrPair) ProtoMessage() {} func (*OperatorConsAddrPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{16} + return fileDescriptor_f91e795a3cecbdbf, []int{17} } func (m *OperatorConsAddrPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -951,6 +988,7 @@ func init() { proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") proto.RegisterType((*QueryAllOperatorsRequest)(nil), "exocore.operator.v1.QueryAllOperatorsRequest") proto.RegisterType((*QueryAllOperatorsResponse)(nil), "exocore.operator.v1.QueryAllOperatorsResponse") + proto.RegisterType((*AddressInfo)(nil), "exocore.operator.v1.AddressInfo") proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") @@ -971,79 +1009,80 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 1148 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xef, 0x64, 0x59, 0x44, 0x5e, 0x77, 0x97, 0x76, 0x5a, 0xa0, 0xeb, 0x2d, 0x69, 0xd7, 0x82, - 0x6d, 0xb7, 0xb4, 0x36, 0x4d, 0xbb, 0x08, 0xed, 0x1f, 0x56, 0x4d, 0xff, 0xac, 0x76, 0x8b, 0xa0, - 0x38, 0xa2, 0x12, 0x5c, 0x22, 0xc7, 0x99, 0x4d, 0xad, 0xba, 0x9e, 0xd4, 0xe3, 0x84, 0x46, 0xab, - 0x72, 0xe0, 0x04, 0x17, 0x40, 0xec, 0x11, 0x89, 0x03, 0x9f, 0x01, 0xc1, 0x57, 0xd8, 0x03, 0x87, - 0x02, 0x17, 0x4e, 0x05, 0xb5, 0x7c, 0x06, 0xce, 0xc8, 0xe3, 0x71, 0x62, 0x3b, 0x4e, 0xe2, 0x94, - 0x0a, 0x6e, 0xb1, 0x3d, 0xef, 0xbd, 0xdf, 0xef, 0xbd, 0xdf, 0xbc, 0xf7, 0x02, 0x53, 0xe4, 0x80, - 0x1a, 0xd4, 0x21, 0x2a, 0xad, 0x11, 0x47, 0x77, 0xa9, 0xa3, 0x36, 0x16, 0xd5, 0xfd, 0x3a, 0x71, - 0x9a, 0x4a, 0xcd, 0xa1, 0x2e, 0xc5, 0x63, 0xe2, 0x80, 0x12, 0x1c, 0x50, 0x1a, 0x8b, 0xd2, 0x9c, - 0x41, 0xd9, 0x1e, 0x65, 0x6a, 0x59, 0x67, 0xc4, 0x3f, 0xad, 0x36, 0x16, 0xcb, 0xc4, 0xd5, 0x17, - 0xd5, 0x9a, 0x5e, 0x35, 0x6d, 0xdd, 0x35, 0xa9, 0xed, 0x3b, 0x90, 0x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0xda, 0x48, 0x0b, 0xab, 0x61, 0x78, 0x70, 0x19, 0x7e, 0x10, 0xc1, 0x94, 0xe1, 0x98, 0x66, 0xfa, - 0x62, 0xf2, 0x43, 0x45, 0x40, 0x7d, 0x89, 0x60, 0x92, 0x83, 0x0a, 0x10, 0x7d, 0x58, 0x5c, 0xdb, - 0xd6, 0xad, 0x7a, 0xc0, 0xe0, 0x5f, 0x26, 0x16, 0xab, 0x30, 0xac, 0x37, 0x18, 0xb7, 0x24, 0x8c, - 0x71, 0xa4, 0xd9, 0xc2, 0x95, 0x93, 0xe3, 0x29, 0x58, 0xd9, 0x2e, 0x0a, 0x43, 0x0d, 0xf4, 0x06, - 0x13, 0xbf, 0xe5, 0x47, 0xf0, 0x8a, 0x9f, 0xa4, 0xed, 0x62, 0x1c, 0x4a, 0xcc, 0x17, 0xea, 0xeb, - 0xeb, 0x2b, 0x04, 0xaf, 0x46, 0xc8, 0x15, 0x2d, 0x9d, 0xed, 0x08, 0xc9, 0xfc, 0x2f, 0xec, 0xfe, - 0x46, 0x90, 0xeb, 0x86, 0x48, 0x08, 0x61, 0x17, 0xae, 0xe8, 0x96, 0x55, 0x62, 0xde, 0x87, 0x92, - 0x69, 0x3f, 0xa6, 0x5c, 0x04, 0xc3, 0xf9, 0x75, 0x25, 0xe1, 0x12, 0x2b, 0xbd, 0x9d, 0x29, 0x2b, - 0x96, 0xd5, 0x7a, 0xb9, 0x6e, 0xbb, 0x4e, 0x53, 0xbb, 0xa4, 0x87, 0x5e, 0x49, 0x55, 0x18, 0xed, - 0x38, 0x82, 0x47, 0xe0, 0xc2, 0x2e, 0x69, 0xfa, 0xa9, 0xd0, 0xbc, 0x9f, 0xf8, 0x2e, 0x5c, 0x6c, - 0x78, 0x95, 0x10, 0x4a, 0xbb, 0x91, 0x08, 0xa5, 0x13, 0x85, 0x6f, 0x74, 0x3b, 0xf3, 0x36, 0x92, - 0x4b, 0x70, 0x2d, 0x02, 0x75, 0x95, 0xda, 0x6c, 0x93,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, 0x24, 0x87, 0xfe, 0x3c, 0xc9, 0xa1, 0xaf, - 0x4f, 0x73, 0x43, 0x47, 0xa7, 0xb9, 0xa1, 0xdf, 0x4f, 0x73, 0x43, 0x1f, 0xe7, 0xab, 0xa6, 0xbb, - 0x53, 0x2f, 0x2b, 0x06, 0xdd, 0x53, 0xd7, 0x7d, 0xcf, 0xef, 0x11, 0xf7, 0x13, 0xea, 0xec, 0xb6, - 0x02, 0x1d, 0xb4, 0x43, 0xb9, 0xcd, 0x1a, 0x61, 0xe5, 0xe7, 0xf9, 0x1f, 0xf9, 0xa5, 0x7f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x1c, 0xac, 0xe2, 0x03, 0xb7, 0x10, 0x00, 0x00, + // 1168 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xef, 0xa4, 0x14, 0x91, 0x97, 0xee, 0xd2, 0x4e, 0x0b, 0x74, 0xbd, 0x25, 0xed, 0x5a, 0xb0, + 0xed, 0x96, 0xd6, 0xa6, 0x69, 0x17, 0xa1, 0xfd, 0xc3, 0xaa, 0xe9, 0x9f, 0xd5, 0x6e, 0x11, 0x14, + 0x47, 0x54, 0x82, 0x4b, 0xe4, 0x38, 0xb3, 0xa9, 0x55, 0xd7, 0x93, 0x7a, 0xdc, 0xd0, 0x68, 0x55, + 0x0e, 0x9c, 0xe0, 0x86, 0xd8, 0x23, 0x12, 0x07, 0x3e, 0x03, 0x82, 0xaf, 0xb0, 0x07, 0x0e, 0x05, + 0x2e, 0x9c, 0x0a, 0x6a, 0xf9, 0x0c, 0x9c, 0x91, 0xc7, 0xe3, 0xc4, 0x76, 0x9c, 0xc4, 0x2d, 0xd5, + 0xde, 0x62, 0xfb, 0xfd, 0xf9, 0xfd, 0x7e, 0xf3, 0xe6, 0xbd, 0x17, 0x98, 0x22, 0x87, 0xd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x99, 0x69, 0x64, 0xff, 0x80, 0x30, 0x17, 0x6f, 0x00, 0xb4, 0xf5, 0xe0, 0x71, + 0x73, 0x85, 0x9b, 0x8a, 0x08, 0xea, 0x89, 0xa7, 0xf8, 0x52, 0x0b, 0xf1, 0x94, 0x2d, 0xbd, 0x46, + 0x84, 0xaf, 0x16, 0xf2, 0x94, 0xbf, 0x43, 0x70, 0x2d, 0x21, 0x09, 0xab, 0x53, 0x9b, 0x11, 0x3c, + 0x0f, 0xb8, 0x4d, 0xc0, 0x30, 0x38, 0x09, 0x36, 0x81, 0xa6, 0x07, 0x67, 0xb3, 0xda, 0x48, 0x0b, + 0xab, 0x61, 0x78, 0x70, 0x19, 0x7e, 0x18, 0xc1, 0x94, 0xe1, 0x98, 0x66, 0xfa, 0x62, 0xf2, 0x53, + 0x45, 0x40, 0x1d, 0x41, 0x4e, 0xe8, 0xe2, 0x29, 0xf9, 0x3f, 0x65, 0xc4, 0x2a, 0xe4, 0xf4, 0x06, + 0xe3, 0x9e, 0x84, 0x31, 0x8e, 0x2b, 0x5b, 0xbc, 0x7a, 0x7a, 0x32, 0x05, 0x2b, 0xdb, 0x25, 0xe1, + 0xa8, 0x81, 0xde, 0x60, 0xe2, 0xb7, 0x6c, 0xc0, 0x24, 0x97, 0x24, 0xd0, 0xe3, 0xd3, 0xd2, 0xda, + 0xb6, 0x6e, 0x1d, 0x04, 0xfa, 0xe1, 0x55, 0x18, 0x16, 0xc1, 0xca, 0xa6, 0xfd, 0x84, 0x0a, 0xf5, + 0xa7, 0x95, 0x84, 0x7a, 0x56, 0x42, 0x3c, 0xb4, 0x9c, 0xde, 0x7e, 0x90, 0x1f, 0xc3, 0x1b, 0xbe, + 0xee, 0xdb, 0xa5, 0x78, 0xfc, 0x18, 0x60, 0xd4, 0x17, 0x70, 0x15, 0xde, 0x8c, 0x00, 0x2e, 0x59, + 0x3a, 0xdb, 0x11, 0x45, 0x78, 0x79, 0x88, 0xff, 0x45, 0x90, 0xef, 0x96, 0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0xd6, 0xb1, 0x5b, 0xa7, + 0x82, 0xb6, 0xc0, 0xa1, 0xcd, 0xe0, 0xb7, 0xbb, 0x43, 0x0b, 0x03, 0xf8, 0x19, 0xc1, 0xeb, 0xc9, + 0xab, 0x2c, 0x2e, 0x9c, 0x6b, 0xef, 0xf5, 0x11, 0x2e, 0x5d, 0x60, 0x57, 0x96, 0x97, 0x38, 0xe4, + 0x05, 0xfc, 0x4e, 0x7f, 0x35, 0xdb, 0xe8, 0xce, 0x82, 0x6b, 0xdb, 0x73, 0x0e, 0xe2, 0xf4, 0x75, + 0x99, 0x38, 0xcc, 0xa5, 0x07, 0x17, 0xf6, 0x17, 0xe4, 0xee, 0x71, 0x72, 0xef, 0xe1, 0xe5, 0x94, + 0x85, 0xcd, 0xe7, 0x73, 0x50, 0xd9, 0xc5, 0x0f, 0x9f, 0x9f, 0xe6, 0xd1, 0xf1, 0x69, 0x1e, 0xfd, + 0x7d, 0x9a, 0x47, 0xdf, 0x9e, 0xe5, 0x07, 0x8e, 0xcf, 0xf2, 0x03, 0x7f, 0x9e, 0xe5, 0x07, 0x3e, + 0x2f, 0xd4, 0x4c, 0x77, 0xe7, 0xa0, 0xa2, 0x18, 0x74, 0x4f, 0x5d, 0xf7, 0x23, 0x7f, 0x44, 0xdc, + 0x2f, 0xa8, 0xb3, 0xdb, 0x4a, 0x74, 0xd8, 0x4e, 0xe5, 0x36, 0xeb, 0x84, 0x55, 0x5e, 0xe6, 0xff, + 0xf7, 0x97, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa2, 0x37, 0x62, 0x0d, 0xde, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1545,7 +1584,7 @@ func (m *QueryAllOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { +func (m *AddressInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1555,12 +1594,12 @@ func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AddressInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AddressInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1582,6 +1621,41 @@ func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressInfo != nil { + { + size, err := m.AddressInfo.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 *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1632,17 +1706,15 @@ func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.OperatorAddr) > 0 { - i -= len(m.OperatorAddr) - copy(dAtA[i:], m.OperatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + if m.AddressInfo != nil { + { + size, err := m.AddressInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0xa } @@ -2152,7 +2224,7 @@ func (m *QueryAllOperatorsResponse) Size() (n int) { return n } -func (m *QueryOperatorUSDValueRequest) Size() (n int) { +func (m *AddressInfo) Size() (n int) { if m == nil { return 0 } @@ -2169,6 +2241,19 @@ func (m *QueryOperatorUSDValueRequest) Size() (n int) { return n } +func (m *QueryOperatorUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressInfo != nil { + l = m.AddressInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryAVSUSDValueRequest) Size() (n int) { if m == nil { return 0 @@ -2188,12 +2273,8 @@ func (m *QueryOperatorSlashInfoRequest) Size() (n int) { } var l int _ = l - l = len(m.OperatorAddr) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AVSAddress) - if l > 0 { + if m.AddressInfo != nil { + l = m.AddressInfo.Size() n += 1 + l + sovQuery(uint64(l)) } return n @@ -2677,7 +2758,7 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { +func (m *AddressInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2700,10 +2781,10 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") + return fmt.Errorf("proto: AddressInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AddressInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2791,7 +2872,7 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { +func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2814,17 +2895,17 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2834,23 +2915,27 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + if m.AddressInfo == nil { + m.AddressInfo = &AddressInfo{} + } + if err := m.AddressInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2873,7 +2958,7 @@ func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2896,15 +2981,15 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2932,13 +3017,63 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.AVSAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 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 *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2948,23 +3083,27 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + if m.AddressInfo == nil { + m.AddressInfo = &AddressInfo{} + } + if err := m.AddressInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex From b2e34e34278c656eb5cfc40033ba108b4cb7bf76 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Tue, 11 Jun 2024 11:31:18 +0800 Subject: [PATCH 07/13] update go to v1.21.11 to fix the vulnerability --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 81e9db711..35933663c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ExocoreNetwork/exocore -go 1.21.9 +go 1.21.11 require ( cosmossdk.io/errors v1.0.1 From 10e1ac976f2f4a9235f98902067f1228e2de3506 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Mon, 17 Jun 2024 16:21:44 +0800 Subject: [PATCH 08/13] update the proto after merging develop --- x/operator/types/query.pb.go | 1573 +++++++++++++++++++++++++++++++--- x/operator/types/tx.pb.go | 603 +++---------- 2 files changed, 1607 insertions(+), 569 deletions(-) diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index 8c82284c4..3ffa3d2eb 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -179,7 +179,250 @@ func (m *QueryAllOperatorsResponse) GetPagination() *query.PageResponse { return nil } +// AddressInfo includes the address of operator and AVS +type AddressInfo struct { + // operator_addr is the operator address,its type should be a sdk.AccAddress + OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *AddressInfo) Reset() { *m = AddressInfo{} } +func (m *AddressInfo) String() string { return proto.CompactTextString(m) } +func (*AddressInfo) ProtoMessage() {} +func (*AddressInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{3} +} +func (m *AddressInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AddressInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AddressInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressInfo.Merge(m, src) +} +func (m *AddressInfo) XXX_Size() int { + return m.Size() +} +func (m *AddressInfo) XXX_DiscardUnknown() { + xxx_messageInfo_AddressInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressInfo proto.InternalMessageInfo + +func (m *AddressInfo) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + +func (m *AddressInfo) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + // QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. +// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. +type QueryOperatorUSDValueRequest struct { + // address_info is the operator and AVS address + AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` +} + +func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDValueRequest{} } +func (m *QueryOperatorUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorUSDValueRequest) ProtoMessage() {} +func (*QueryOperatorUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{4} +} +func (m *QueryOperatorUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorUSDValueRequest.Merge(m, src) +} +func (m *QueryOperatorUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorUSDValueRequest proto.InternalMessageInfo + +func (m *QueryOperatorUSDValueRequest) GetAddressInfo() *AddressInfo { + if m != nil { + return m.AddressInfo + } + return nil +} + +// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. +type QueryAVSUSDValueRequest struct { + // avs_address is the AVS address opted-in by the operator + AVSAddress string `protobuf:"bytes,1,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` +} + +func (m *QueryAVSUSDValueRequest) Reset() { *m = QueryAVSUSDValueRequest{} } +func (m *QueryAVSUSDValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAVSUSDValueRequest) ProtoMessage() {} +func (*QueryAVSUSDValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{5} +} +func (m *QueryAVSUSDValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAVSUSDValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAVSUSDValueRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAVSUSDValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAVSUSDValueRequest.Merge(m, src) +} +func (m *QueryAVSUSDValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAVSUSDValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAVSUSDValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAVSUSDValueRequest proto.InternalMessageInfo + +func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { + if m != nil { + return m.AVSAddress + } + return "" +} + +// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified +// operator and AVS +type QueryOperatorSlashInfoRequest struct { + // address_info is the operator and AVS address + AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` +} + +func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } +func (m *QueryOperatorSlashInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoRequest) ProtoMessage() {} +func (*QueryOperatorSlashInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{6} +} +func (m *QueryOperatorSlashInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoRequest.Merge(m, src) +} +func (m *QueryOperatorSlashInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoRequest proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoRequest) GetAddressInfo() *AddressInfo { + if m != nil { + return m.AddressInfo + } + return nil +} + +// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest +type QueryOperatorSlashInfoResponse struct { + // AllSlashInfo the key is slashID, the value is the specified slash information + // It's okay to use a map here, because it won't be used to store state, only in + // the response to an RPC call + AllSlashInfo map[string]*OperatorSlashInfo `protobuf:"bytes,1,rep,name=all_slash_info,json=allSlashInfo,proto3" json:"all_slash_info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSlashInfoResponse{} } +func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} +func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{7} +} +func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryOperatorSlashInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryOperatorSlashInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryOperatorSlashInfoResponse.Merge(m, src) +} +func (m *QueryOperatorSlashInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryOperatorSlashInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryOperatorSlashInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryOperatorSlashInfoResponse proto.InternalMessageInfo + +func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() map[string]*OperatorSlashInfo { + if m != nil { + return m.AllSlashInfo + } + return nil +} + +// QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator type QueryOperatorConsKeyRequest struct { // operator_acc_addr is the operator account address. OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` @@ -193,7 +436,7 @@ func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKe func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{3} + return fileDescriptor_f91e795a3cecbdbf, []int{8} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,13 +483,15 @@ func (m *QueryOperatorConsKeyRequest) GetChain() string { type QueryOperatorConsKeyResponse struct { // public_key is the consensus public key of the operator. PublicKey crypto.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key"` + // opting_out is a flag to indicate if the operator is opting out of consensus. + OptingOut bool `protobuf:"varint,2,opt,name=opting_out,json=optingOut,proto3" json:"opting_out,omitempty"` } func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsKeyResponse{} } func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{4} + return fileDescriptor_f91e795a3cecbdbf, []int{9} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -282,6 +527,13 @@ func (m *QueryOperatorConsKeyResponse) GetPublicKey() crypto.PublicKey { return crypto.PublicKey{} } +func (m *QueryOperatorConsKeyResponse) GetOptingOut() bool { + if m != nil { + return m.OptingOut + } + return false +} + // QueryOperatorConsAddressRequest is the request to obtain the consensus address of the operator // for a specific chain ID. type QueryOperatorConsAddressRequest struct { @@ -297,7 +549,7 @@ func (m *QueryOperatorConsAddressRequest) Reset() { *m = QueryOperatorCo func (m *QueryOperatorConsAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressRequest) ProtoMessage() {} func (*QueryOperatorConsAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{5} + return fileDescriptor_f91e795a3cecbdbf, []int{10} } func (m *QueryOperatorConsAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -345,13 +597,15 @@ type QueryOperatorConsAddressResponse struct { // cons_addr is the consensus address corresponding to the consensus public key // currently in use by the operator. ConsAddr string `protobuf:"bytes,1,opt,name=cons_addr,json=consAddr,proto3" json:"cons_addr,omitempty"` + // opting_out is a flag to indicate if the operator is opting out of consensus. + OptingOut bool `protobuf:"varint,2,opt,name=opting_out,json=optingOut,proto3" json:"opting_out,omitempty"` } func (m *QueryOperatorConsAddressResponse) Reset() { *m = QueryOperatorConsAddressResponse{} } func (m *QueryOperatorConsAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressResponse) ProtoMessage() {} func (*QueryOperatorConsAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{6} + return fileDescriptor_f91e795a3cecbdbf, []int{11} } func (m *QueryOperatorConsAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,6 +641,13 @@ func (m *QueryOperatorConsAddressResponse) GetConsAddr() string { return "" } +func (m *QueryOperatorConsAddressResponse) GetOptingOut() bool { + if m != nil { + return m.OptingOut + } + return false +} + // QueryAllOperatorConsKeysByChainIDRequest is the request to obtain all operator addresses // and consensus keys for a specific chain ID, with pagination. type QueryAllOperatorConsKeysByChainIDRequest struct { @@ -404,7 +665,7 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) Reset() { func (m *QueryAllOperatorConsKeysByChainIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllOperatorConsKeysByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{7} + return fileDescriptor_f91e795a3cecbdbf, []int{12} } func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +725,7 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) String() string { } func (*QueryAllOperatorConsKeysByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{8} + return fileDescriptor_f91e795a3cecbdbf, []int{13} } func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -514,13 +775,15 @@ type OperatorConsKeyPair struct { OperatorAccAddr string `protobuf:"bytes,1,opt,name=operator_acc_addr,json=operatorAccAddr,proto3" json:"operator_acc_addr,omitempty"` // public_key is the consensus public key of the operator. PublicKey *crypto.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` + // opting_out is a flag to indicate if the operator is opting out of consensus. + OptingOut bool `protobuf:"varint,3,opt,name=opting_out,json=optingOut,proto3" json:"opting_out,omitempty"` } func (m *OperatorConsKeyPair) Reset() { *m = OperatorConsKeyPair{} } func (m *OperatorConsKeyPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsKeyPair) ProtoMessage() {} func (*OperatorConsKeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{9} + return fileDescriptor_f91e795a3cecbdbf, []int{14} } func (m *OperatorConsKeyPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,6 +826,13 @@ func (m *OperatorConsKeyPair) GetPublicKey() *crypto.PublicKey { return nil } +func (m *OperatorConsKeyPair) GetOptingOut() bool { + if m != nil { + return m.OptingOut + } + return false +} + // QueryAllOperatorConsAddrsByChainIDRequest is the request to obtain all operator addresses // and consensus addresses for a specific chain ID, with pagination. type QueryAllOperatorConsAddrsByChainIDRequest struct { @@ -582,7 +852,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) String() string { } func (*QueryAllOperatorConsAddrsByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{10} + return fileDescriptor_f91e795a3cecbdbf, []int{15} } func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -642,7 +912,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) String() string { } func (*QueryAllOperatorConsAddrsByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{11} + return fileDescriptor_f91e795a3cecbdbf, []int{16} } func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,13 +962,15 @@ type OperatorConsAddrPair struct { // cons_addr is the consensus address corresponding to the consensus public key // currently in use by the operator. ConsAddr string `protobuf:"bytes,2,opt,name=cons_addr,json=consAddr,proto3" json:"cons_addr,omitempty"` + // opting_out is a flag to indicate if the operator is opting out of consensus. + OptingOut bool `protobuf:"varint,3,opt,name=opting_out,json=optingOut,proto3" json:"opting_out,omitempty"` } func (m *OperatorConsAddrPair) Reset() { *m = OperatorConsAddrPair{} } func (m *OperatorConsAddrPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsAddrPair) ProtoMessage() {} func (*OperatorConsAddrPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{12} + return fileDescriptor_f91e795a3cecbdbf, []int{17} } func (m *OperatorConsAddrPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -741,10 +1013,23 @@ func (m *OperatorConsAddrPair) GetConsAddr() string { return "" } +func (m *OperatorConsAddrPair) GetOptingOut() bool { + if m != nil { + return m.OptingOut + } + return false +} + func init() { proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") proto.RegisterType((*QueryAllOperatorsRequest)(nil), "exocore.operator.v1.QueryAllOperatorsRequest") proto.RegisterType((*QueryAllOperatorsResponse)(nil), "exocore.operator.v1.QueryAllOperatorsResponse") + proto.RegisterType((*AddressInfo)(nil), "exocore.operator.v1.AddressInfo") + proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") + proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") + proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") + proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") + proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") proto.RegisterType((*QueryOperatorConsAddressRequest)(nil), "exocore.operator.v1.QueryOperatorConsAddressRequest") @@ -760,63 +1045,82 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 891 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdf, 0x4f, 0xd3, 0x50, - 0x14, 0x5e, 0xa7, 0x18, 0x77, 0xd1, 0x28, 0x97, 0x3d, 0x8c, 0x42, 0x06, 0x34, 0x46, 0xc6, 0x22, - 0xad, 0x1b, 0xe0, 0x83, 0x88, 0x84, 0xf1, 0x2b, 0x88, 0x51, 0x2c, 0x89, 0x89, 0xbe, 0x2c, 0x5d, - 0x77, 0x29, 0x0d, 0xa3, 0xb7, 0xb4, 0x1d, 0xd2, 0x10, 0x7c, 0xf0, 0x49, 0xdf, 0x8c, 0x3e, 0x9a, - 0xf8, 0x57, 0xf8, 0x1f, 0xf8, 0xc2, 0x83, 0x0f, 0xa8, 0x2f, 0x3e, 0xa1, 0x61, 0xfe, 0x21, 0xa6,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 0x14, 0x49, 0x66, - 0xb5, 0xa7, 0xb2, 0xf0, 0xf8, 0xe8, 0x34, 0xcd, 0x1c, 0x9f, 0xa6, 0x99, 0x3f, 0xa7, 0x69, 0xe6, - 0x7d, 0x2d, 0x1d, 0x3b, 0xae, 0xa5, 0x63, 0xbf, 0x6a, 0xe9, 0xd8, 0xcb, 0xbc, 0xa2, 0x5a, 0x5b, - 0xd5, 0x12, 0x2f, 0xe3, 0x1d, 0x61, 0xc9, 0xcd, 0xfc, 0x04, 0x59, 0xaf, 0xb0, 0xb1, 0x5d, 0x07, - 0xda, 0x6f, 0x40, 0x59, 0xb6, 0x8e, 0xcc, 0xd2, 0x15, 0xf2, 0x67, 0x7b, 0xf2, 0x5f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xae, 0x71, 0x00, 0xfa, 0x5b, 0x0c, 0x00, 0x00, + // 1200 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xef, 0xa4, 0x14, 0x6d, 0x5e, 0xba, 0x4b, 0x3b, 0x2d, 0xd0, 0xcd, 0x76, 0xd3, 0xae, 0x05, + 0xdb, 0x6e, 0x69, 0x6d, 0x9a, 0x76, 0x11, 0xda, 0x3f, 0xa0, 0xa6, 0x7f, 0x56, 0xbb, 0x45, 0x6c, + 0x71, 0x44, 0x25, 0x38, 0x10, 0x39, 0xce, 0x6c, 0x6a, 0xd5, 0xf5, 0xa4, 0x1e, 0x27, 0x34, 0x5a, + 0x15, 0x21, 0x4e, 0x70, 0x43, 0xec, 0x11, 0xc1, 0x81, 0xcf, 0x80, 0xe0, 0x2b, 0xec, 0x81, 0x43, + 0x81, 0x0b, 0xa7, 0x82, 0x5a, 0x3e, 0x03, 0x67, 0xe4, 0xf1, 0x38, 0xb1, 0x1d, 0x27, 0x71, 0x4b, + 0xc5, 0x2d, 0xb6, 0xe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 0x36, 0x2c, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x45, 0xa4, 0x16, 0x4e, 0x5c, 0x11, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -842,6 +1146,12 @@ type QueryClient interface { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID QueryAllOperatorConsKeysByChainID(ctx context.Context, in *QueryAllOperatorConsKeysByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) @@ -900,6 +1210,33 @@ func (c *queryClient) QueryAllOperatorConsKeysByChainID(ctx context.Context, in return out, nil } +func (c *queryClient) QueryOperatorUSDValue(ctx context.Context, in *QueryOperatorUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAVSUSDValue(ctx context.Context, in *QueryAVSUSDValueRequest, opts ...grpc.CallOption) (*DecValueField, error) { + out := new(DecValueField) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAVSUSDValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryOperatorSlashInfo(ctx context.Context, in *QueryOperatorSlashInfoRequest, opts ...grpc.CallOption) (*QueryOperatorSlashInfoResponse, error) { + out := new(QueryOperatorSlashInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryOperatorSlashInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) QueryAllOperatorConsAddrsByChainID(ctx context.Context, in *QueryAllOperatorConsAddrsByChainIDRequest, opts ...grpc.CallOption) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { out := new(QueryAllOperatorConsAddrsByChainIDResponse) err := c.cc.Invoke(ctx, "/exocore.operator.v1.Query/QueryAllOperatorConsAddrsByChainID", in, out, opts...) @@ -922,6 +1259,12 @@ type QueryServer interface { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID QueryAllOperatorConsKeysByChainID(context.Context, *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) + // QueryOperatorUSDValue queries the opted-in USD value for the operator + QueryOperatorUSDValue(context.Context, *QueryOperatorUSDValueRequest) (*DecValueField, error) + // QueryAVSUSDValue queries the USD value for the AVS + QueryAVSUSDValue(context.Context, *QueryAVSUSDValueRequest) (*DecValueField, error) + // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS + QueryOperatorSlashInfo(context.Context, *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID QueryAllOperatorConsAddrsByChainID(context.Context, *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) @@ -946,6 +1289,15 @@ func (*UnimplementedQueryServer) QueryOperatorConsAddressForChainID(ctx context. func (*UnimplementedQueryServer) QueryAllOperatorConsKeysByChainID(ctx context.Context, req *QueryAllOperatorConsKeysByChainIDRequest) (*QueryAllOperatorConsKeysByChainIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsKeysByChainID not implemented") } +func (*UnimplementedQueryServer) QueryOperatorUSDValue(ctx context.Context, req *QueryOperatorUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryAVSUSDValue(ctx context.Context, req *QueryAVSUSDValueRequest) (*DecValueField, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAVSUSDValue not implemented") +} +func (*UnimplementedQueryServer) QueryOperatorSlashInfo(ctx context.Context, req *QueryOperatorSlashInfoRequest) (*QueryOperatorSlashInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOperatorSlashInfo not implemented") +} func (*UnimplementedQueryServer) QueryAllOperatorConsAddrsByChainID(ctx context.Context, req *QueryAllOperatorConsAddrsByChainIDRequest) (*QueryAllOperatorConsAddrsByChainIDResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryAllOperatorConsAddrsByChainID not implemented") } @@ -1044,6 +1396,60 @@ func _Query_QueryAllOperatorConsKeysByChainID_Handler(srv interface{}, ctx conte return interceptor(ctx, in, info, handler) } +func _Query_QueryOperatorUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorUSDValue(ctx, req.(*QueryOperatorUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAVSUSDValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAVSUSDValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAVSUSDValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryAVSUSDValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAVSUSDValue(ctx, req.(*QueryAVSUSDValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryOperatorSlashInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOperatorSlashInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/exocore.operator.v1.Query/QueryOperatorSlashInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryOperatorSlashInfo(ctx, req.(*QueryOperatorSlashInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_QueryAllOperatorConsAddrsByChainID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAllOperatorConsAddrsByChainIDRequest) if err := dec(in); err != nil { @@ -1086,6 +1492,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryAllOperatorConsKeysByChainID", Handler: _Query_QueryAllOperatorConsKeysByChainID_Handler, }, + { + MethodName: "QueryOperatorUSDValue", + Handler: _Query_QueryOperatorUSDValue_Handler, + }, + { + MethodName: "QueryAVSUSDValue", + Handler: _Query_QueryAVSUSDValue_Handler, + }, + { + MethodName: "QueryOperatorSlashInfo", + Handler: _Query_QueryOperatorSlashInfo_Handler, + }, { MethodName: "QueryAllOperatorConsAddrsByChainID", Handler: _Query_QueryAllOperatorConsAddrsByChainID_Handler, @@ -1204,7 +1622,7 @@ func (m *QueryAllOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { +func (m *AddressInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1214,34 +1632,220 @@ func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *AddressInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AddressInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Chain) > 0 { - i -= len(m.Chain) - copy(dAtA[i:], m.Chain) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) i-- dAtA[i] = 0x12 } - if len(m.OperatorAccAddr) > 0 { - i -= len(m.OperatorAccAddr) - copy(dAtA[i:], m.OperatorAccAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryOperatorUSDValueRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressInfo != nil { + { + size, err := m.AddressInfo.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 *QueryAVSUSDValueRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAVSUSDValueRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAVSUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AVSAddress) > 0 { + i -= len(m.AVSAddress) + copy(dAtA[i:], m.AVSAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorSlashInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorSlashInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.AddressInfo != nil { + { + size, err := m.AddressInfo.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 *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorSlashInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k := range m.AllSlashInfo { + v := m.AllSlashInfo[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintQuery(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryOperatorConsKeyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryOperatorConsKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Chain) > 0 { + i -= len(m.Chain) + copy(dAtA[i:], m.Chain) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Chain))) + i-- + dAtA[i] = 0x12 + } + if len(m.OperatorAccAddr) > 0 { + i -= len(m.OperatorAccAddr) + copy(dAtA[i:], m.OperatorAccAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAccAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryOperatorConsKeyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1261,6 +1865,16 @@ func (m *QueryOperatorConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } { size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1331,6 +1945,16 @@ func (m *QueryOperatorConsAddressResponse) MarshalToSizedBuffer(dAtA []byte) (in _ = i var l int _ = l + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } if len(m.ConsAddr) > 0 { i -= len(m.ConsAddr) copy(dAtA[i:], m.ConsAddr) @@ -1452,6 +2076,16 @@ func (m *OperatorConsKeyPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if m.PublicKey != nil { { size, err := m.PublicKey.MarshalToSizedBuffer(dAtA[:i]) @@ -1585,6 +2219,16 @@ func (m *OperatorConsAddrPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.OptingOut { + i-- + if m.OptingOut { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } if len(m.ConsAddr) > 0 { i -= len(m.ConsAddr) copy(dAtA[i:], m.ConsAddr) @@ -1658,6 +2302,84 @@ func (m *QueryAllOperatorsResponse) Size() (n int) { return n } +func (m *AddressInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressInfo != nil { + l = m.AddressInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAVSUSDValueRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AVSAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AddressInfo != nil { + l = m.AddressInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryOperatorSlashInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllSlashInfo) > 0 { + for k, v := range m.AllSlashInfo { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovQuery(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l + n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + } + } + return n +} + func (m *QueryOperatorConsKeyRequest) Size() (n int) { if m == nil { return 0 @@ -1683,6 +2405,9 @@ func (m *QueryOperatorConsKeyResponse) Size() (n int) { _ = l l = m.PublicKey.Size() n += 1 + l + sovQuery(uint64(l)) + if m.OptingOut { + n += 2 + } return n } @@ -1713,6 +2438,9 @@ func (m *QueryOperatorConsAddressResponse) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.OptingOut { + n += 2 + } return n } @@ -1766,6 +2494,9 @@ func (m *OperatorConsKeyPair) Size() (n int) { l = m.PublicKey.Size() n += 1 + l + sovQuery(uint64(l)) } + if m.OptingOut { + n += 2 + } return n } @@ -1819,16 +2550,305 @@ func (m *OperatorConsAddrPair) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - return n -} + if m.OptingOut { + n += 2 + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = 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 *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsRequest: 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 *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddrs", 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.OperatorAccAddrs = append(m.OperatorAccAddrs, 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.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 + } + } -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)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { +func (m *AddressInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1851,10 +2871,10 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetOperatorInfoReq: wiretype end group for non-group") + return fmt.Errorf("proto: AddressInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetOperatorInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: AddressInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1889,6 +2909,38 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { } m.OperatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -1910,7 +2962,7 @@ func (m *GetOperatorInfoReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1933,15 +2985,15 @@ func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllOperatorsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllOperatorsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryOperatorUSDValueRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1968,10 +3020,10 @@ func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} + if m.AddressInfo == nil { + m.AddressInfo = &AddressInfo{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AddressInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1996,7 +3048,7 @@ func (m *QueryAllOperatorsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAVSUSDValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2019,15 +3071,15 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllOperatorsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAVSUSDValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllOperatorsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAVSUSDValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAccAddrs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2055,11 +3107,61 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAccAddrs = append(m.OperatorAccAddrs, string(dAtA[iNdEx:postIndex])) + m.AVSAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 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 *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoRequest: 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) + return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2086,12 +3188,191 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.AddressInfo == nil { + m.AddressInfo = &AddressInfo{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.AddressInfo.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 *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryOperatorSlashInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllSlashInfo", 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.AllSlashInfo == nil { + m.AllSlashInfo = make(map[string]*OperatorSlashInfo) + } + var mapkey string + var mapvalue *OperatorSlashInfo + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthQuery + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthQuery + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthQuery + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthQuery + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &OperatorSlashInfo{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.AllSlashInfo[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -2290,6 +3571,26 @@ func (m *QueryOperatorConsKeyResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OptingOut", 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.OptingOut = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2486,6 +3787,26 @@ func (m *QueryOperatorConsAddressResponse) Unmarshal(dAtA []byte) error { } m.ConsAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OptingOut", 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.OptingOut = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2842,6 +4163,26 @@ func (m *OperatorConsKeyPair) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OptingOut", 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.OptingOut = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3194,6 +4535,26 @@ func (m *OperatorConsAddrPair) Unmarshal(dAtA []byte) error { } m.ConsAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OptingOut", 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.OptingOut = bool(v != 0) default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index 4ae412de9..e6b2b5655 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -747,6 +747,9 @@ type OptIntoAVSReq struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` // avs_address is the address of the AVS - either an 0x address or a chainID. AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` + // optional parameter to provide the consensus key or the BLS key, depending + // on the AVS. we still have to design this fully. + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` } func (m *OptIntoAVSReq) Reset() { *m = OptIntoAVSReq{} } @@ -980,86 +983,6 @@ func (m *SetConsKeyResponse) XXX_DiscardUnknown() { var xxx_messageInfo_SetConsKeyResponse proto.InternalMessageInfo -// InitConsKeyRemovalReq is the request for an operator to stop validating on a chain. It -// allows the operator to remove their consensus key from the specified chain. It must be -// followed by a separate call to OptOutOfAVS to remove the operator from the AVS. -type InitConsKeyRemovalReq struct { - // address is the operator address - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // chain_id is the identifier for the chain that wants to opt out. - ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *InitConsKeyRemovalReq) Reset() { *m = InitConsKeyRemovalReq{} } -func (m *InitConsKeyRemovalReq) String() string { return proto.CompactTextString(m) } -func (*InitConsKeyRemovalReq) ProtoMessage() {} -func (*InitConsKeyRemovalReq) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{18} -} -func (m *InitConsKeyRemovalReq) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InitConsKeyRemovalReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InitConsKeyRemovalReq.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InitConsKeyRemovalReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitConsKeyRemovalReq.Merge(m, src) -} -func (m *InitConsKeyRemovalReq) XXX_Size() int { - return m.Size() -} -func (m *InitConsKeyRemovalReq) XXX_DiscardUnknown() { - xxx_messageInfo_InitConsKeyRemovalReq.DiscardUnknown(m) -} - -var xxx_messageInfo_InitConsKeyRemovalReq proto.InternalMessageInfo - -// InitConsKeyRemovalResponse defines the InitConsKeyRemovalReq response. -type InitConsKeyRemovalResponse struct { -} - -func (m *InitConsKeyRemovalResponse) Reset() { *m = InitConsKeyRemovalResponse{} } -func (m *InitConsKeyRemovalResponse) String() string { return proto.CompactTextString(m) } -func (*InitConsKeyRemovalResponse) ProtoMessage() {} -func (*InitConsKeyRemovalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b229d5663e4df167, []int{19} -} -func (m *InitConsKeyRemovalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *InitConsKeyRemovalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_InitConsKeyRemovalResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *InitConsKeyRemovalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_InitConsKeyRemovalResponse.Merge(m, src) -} -func (m *InitConsKeyRemovalResponse) XXX_Size() int { - return m.Size() -} -func (m *InitConsKeyRemovalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_InitConsKeyRemovalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_InitConsKeyRemovalResponse proto.InternalMessageInfo - func init() { proto.RegisterEnum("exocore.operator.v1.SlashType", SlashType_name, SlashType_value) proto.RegisterType((*DecValueField)(nil), "exocore.operator.v1.DecValueField") @@ -1080,104 +1003,99 @@ func init() { proto.RegisterType((*OptOutOfAVSResponse)(nil), "exocore.operator.v1.OptOutOfAVSResponse") proto.RegisterType((*SetConsKeyReq)(nil), "exocore.operator.v1.SetConsKeyReq") proto.RegisterType((*SetConsKeyResponse)(nil), "exocore.operator.v1.SetConsKeyResponse") - proto.RegisterType((*InitConsKeyRemovalReq)(nil), "exocore.operator.v1.InitConsKeyRemovalReq") - proto.RegisterType((*InitConsKeyRemovalResponse)(nil), "exocore.operator.v1.InitConsKeyRemovalResponse") } func init() { proto.RegisterFile("exocore/operator/v1/tx.proto", fileDescriptor_b229d5663e4df167) } var fileDescriptor_b229d5663e4df167 = []byte{ - // 1428 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcb, 0x6f, 0x1b, 0x55, - 0x17, 0xf7, 0xc4, 0x79, 0xf9, 0x38, 0xce, 0xe3, 0xa6, 0x0f, 0xd7, 0x5f, 0x1b, 0x27, 0xd3, 0xaf, - 0x6d, 0x1a, 0x11, 0x5b, 0x09, 0x14, 0xa9, 0x81, 0x05, 0x79, 0xaa, 0x56, 0xd3, 0x38, 0x1a, 0xa7, - 0x95, 0x4a, 0x41, 0xa3, 0xc9, 0xf8, 0xc6, 0x19, 0x32, 0x9e, 0x3b, 0xcc, 0xbd, 0x36, 0x49, 0x57, - 0x08, 0xb1, 0x40, 0x6c, 0x40, 0x62, 0x85, 0xc4, 0xa2, 0x0b, 0x84, 0x58, 0xa1, 0x2e, 0xba, 0xad, - 0x80, 0x5d, 0x97, 0x55, 0x57, 0x88, 0x45, 0x84, 0xd2, 0x45, 0xf9, 0x27, 0x90, 0xd0, 0x7d, 0x8c, - 0x33, 0x6e, 0x26, 0x6d, 0xaa, 0xa6, 0x6c, 0x12, 0xdf, 0x73, 0x7e, 0xe7, 0xdc, 0xdf, 0x79, 0xdc, - 0x73, 0xef, 0xc0, 0x59, 0xbc, 0x4d, 0x6c, 0x12, 0xe0, 0x22, 0xf1, 0x71, 0x60, 0x31, 0x12, 0x14, - 0x9b, 0x53, 0x45, 0xb6, 0x5d, 0xf0, 0x03, 0xc2, 0x08, 0x1a, 0x56, 0xda, 0x42, 0xa8, 0x2d, 0x34, - 0xa7, 0x72, 0x43, 0x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a1, - 0x0d, 0x10, 0x00, 0x00, + // 1382 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0xcb, 0x6f, 0x13, 0x57, + 0x17, 0xf7, 0xc4, 0x79, 0xf9, 0x38, 0x4e, 0x9c, 0x1b, 0x1e, 0xc6, 0x1f, 0xc4, 0x64, 0xf8, 0x80, + 0x10, 0x7d, 0xb1, 0x95, 0x7c, 0xa5, 0x52, 0x69, 0x17, 0x75, 0x62, 0x47, 0x58, 0x04, 0x3b, 0x1a, + 0x07, 0x24, 0x4a, 0xab, 0xd1, 0x64, 0x7c, 0xe3, 0x4c, 0x33, 0x9e, 0x3b, 0x9d, 0x7b, 0xed, 0x26, + 0xac, 0xaa, 0xae, 0xaa, 0x6e, 0xa8, 0xd4, 0x55, 0xa5, 0x2e, 0x58, 0x55, 0x5d, 0xb2, 0x60, 0x8b, + 0xda, 0xaa, 0x1b, 0x96, 0x88, 0x55, 0xd5, 0x45, 0x54, 0x85, 0x05, 0xfd, 0x27, 0x2a, 0x55, 0xf7, + 0x31, 0xce, 0x18, 0x1c, 0x1e, 0x22, 0xed, 0x06, 0x72, 0x7f, 0xf7, 0x77, 0x7e, 0xf7, 0x9c, 0x73, + 0xcf, 0x39, 0x77, 0x0c, 0xa7, 0xf1, 0x0e, 0xb1, 0x49, 0x80, 0x0b, 0xc4, 0xc7, 0x81, 0xc5, 0x48, + 0x50, 0xe8, 0x2c, 0x14, 0xd8, 0x4e, 0xde, 0x0f, 0x08, 0x23, 0x68, 0x4a, 0xed, 0xe6, 0xc3, 0xdd, + 0x7c, 0x67, 0x21, 0x3b, 0x69, 0xb5, 0x1c, 0x8f, 0x14, 0xc4, 0xbf, 0x92, 0x97, 0x3d, 0x69, 0x13, + 0xda, 0x22, 0xb4, 0xd0, 0xa2, 0x4d, 0x6e, 0xdf, 0xa2, 0x4d, 0xb5, 0xf1, 0x5f, 0xb5, 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b1, 0x0f, 0x2e, 0x4d, 0xed, 0xef, 0xe5, 0x26, 0x56, 0xef, 0x44, 0xac, 0x2b, 0x25, + 0x63, 0xc2, 0xed, 0x01, 0x1a, 0xe8, 0x3d, 0x38, 0xd5, 0x63, 0x1e, 0x86, 0x62, 0x35, 0x1a, 0x41, + 0x66, 0x80, 0x27, 0xd1, 0x38, 0x61, 0xf7, 0x75, 0x40, 0xff, 0x65, 0x00, 0xc6, 0x6a, 0x2a, 0x2e, + 0xe1, 0xcd, 0x39, 0x48, 0x29, 0x73, 0x2a, 0xed, 0xc5, 0x25, 0x18, 0x63, 0x21, 0xc8, 0xad, 0xd0, + 0x0c, 0x8c, 0x59, 0xbe, 0x1f, 0x90, 0x0e, 0x8e, 0x9e, 0x91, 0x54, 0x98, 0xa0, 0xfc, 0x0f, 0x50, + 0x98, 0x2f, 0xb3, 0x85, 0x99, 0x25, 0xf2, 0x9a, 0x89, 0x0b, 0x62, 0x3a, 0xdc, 0xb9, 0x8e, 0x99, + 0x25, 0x4e, 0x75, 0x21, 0xdb, 0x2f, 0x02, 0xe5, 0xc2, 0xe0, 0x59, 0xed, 0x0d, 0x2f, 0x82, 0xe7, + 0xdd, 0x38, 0xf9, 0x62, 0xcc, 0xd2, 0xfd, 0xeb, 0x00, 0x36, 0x69, 0xb5, 0x1c, 0x4a, 0x1d, 0xe2, + 0x65, 0x86, 0x84, 0xba, 0x9e, 0x57, 0x45, 0x13, 0x96, 0xb3, 0x2a, 0xef, 0xfc, 0x72, 0x97, 0xb9, + 0x94, 0xe0, 0x95, 0xf8, 0xe3, 0xb3, 0xfb, 0x73, 0x9a, 0x11, 0x11, 0xd0, 0xbf, 0xd7, 0x20, 0x51, + 0xf3, 0x19, 0x6e, 0x88, 0x50, 0xce, 0xc3, 0x38, 0x75, 0x2d, 0xba, 0x65, 0xda, 0xc4, 0x63, 0x81, + 0x65, 0xab, 0x32, 0x36, 0x52, 0x02, 0x5d, 0x56, 0x20, 0xba, 0x00, 0x13, 0x84, 0xdb, 0x98, 0x8e, + 0x67, 0x6e, 0x61, 0xa7, 0xb9, 0xc5, 0x44, 0x16, 0x07, 0x8d, 0x14, 0x91, 0x52, 0x57, 0x05, 0x88, + 0x66, 0x21, 0x2d, 0x79, 0xa4, 0xcd, 0x42, 0x62, 0x5c, 0x10, 0xc7, 0x05, 0x5e, 0x6b, 0x33, 0xc5, + 0x3c, 0x01, 0xc3, 0x9f, 0x5a, 0x8e, 0x8b, 0x1b, 0x22, 0x5f, 0xa3, 0x86, 0x5a, 0xe9, 0x0f, 0x35, + 0x98, 0x54, 0xee, 0x15, 0x29, 0xc5, 0xac, 0xce, 0x2c, 0x86, 0xdf, 0xaa, 0xcb, 0x2a, 0x1e, 0x8b, + 0x74, 0x59, 0xc5, 0x63, 0x61, 0x97, 0x21, 0x03, 0x86, 0x3a, 0xbc, 0x93, 0x65, 0x45, 0xbc, 0x65, + 0xeb, 0x4a, 0x29, 0xfd, 0x67, 0x0d, 0x8e, 0xd7, 0x79, 0xee, 0x56, 0x02, 0xd2, 0xba, 0xe1, 0x35, + 0xb0, 0x8b, 0x9b, 0x16, 0x73, 0x88, 0x87, 0x2e, 0x41, 0x82, 0xdf, 0x16, 0x0e, 0xc2, 0x86, 0x49, + 0x2c, 0x8d, 0xed, 0xef, 0xe5, 0x46, 0xeb, 0x02, 0xac, 0x94, 0x8c, 0x51, 0xb9, 0x5d, 0x69, 0xa0, + 0x0b, 0x30, 0x6a, 0xf1, 0xe0, 0x39, 0x53, 0xfa, 0x96, 0xdc, 0xdf, 0xcb, 0x8d, 0x88, 0x84, 0x54, + 0x4a, 0xc6, 0x88, 0xd8, 0xac, 0x44, 0x87, 0x4f, 0xfc, 0xe8, 0xd2, 0xa2, 0x7f, 0xab, 0xc1, 0x54, + 0x37, 0x04, 0x71, 0x26, 0x5d, 0x23, 0xc4, 0xed, 0xf1, 0x4a, 0x7b, 0x2d, 0xaf, 0x06, 0x8e, 0xd0, + 0xab, 0xbb, 0x71, 0x40, 0xc2, 0xab, 0xf2, 0x0e, 0xb6, 0xdb, 0x3c, 0xa3, 0xa2, 0x80, 0x9b, 0x90, + 0x96, 0x05, 0xec, 0x07, 0xc4, 0x27, 0x01, 0xc7, 0x8f, 0x64, 0x12, 0x4f, 0x08, 0xd5, 0xb5, 0xae, + 0x28, 0xfa, 0x04, 0x92, 0xf2, 0xa0, 0xa3, 0x2b, 0x19, 0x10, 0x82, 0xe2, 0x31, 0x41, 0xb7, 0x61, + 0x4a, 0xca, 0xb7, 0x23, 0x35, 0x43, 0x33, 0x71, 0x31, 0xd5, 0xe7, 0xfa, 0x0e, 0x93, 0xbe, 0x65, + 0x66, 0x20, 0x21, 0x13, 0x85, 0x28, 0x5a, 0x87, 0x49, 0x29, 0x2e, 0xae, 0x88, 0x9a, 0x3e, 0x21, + 0x6e, 0x66, 0x50, 0x48, 0xcf, 0xbe, 0x5c, 0xfa, 0xe0, 0xfa, 0x55, 0x46, 0x0e, 0x00, 0xfd, 0xaf, + 0x01, 0xde, 0xaa, 0xd2, 0x48, 0x18, 0xbc, 0xc9, 0x44, 0xb9, 0x04, 0x69, 0xda, 0xde, 0x68, 0x39, + 0x8c, 0x4f, 0x8b, 0xc8, 0x48, 0x89, 0x1b, 0x13, 0x5d, 0x5c, 0x8d, 0x8a, 0x19, 0x18, 0xc3, 0x1d, + 0x3e, 0x6d, 0x23, 0x03, 0x25, 0x6e, 0x24, 0x05, 0xa6, 0x28, 0xff, 0x81, 0x84, 0x43, 0xcd, 0x0e, + 0x66, 0xa4, 0x3b, 0x50, 0x46, 0x1d, 0x7a, 0x53, 0xac, 0xfb, 0x96, 0xc8, 0xd0, 0x3f, 0x51, 0x22, + 0x67, 0x40, 0xde, 0xa8, 0xc9, 0x2d, 0x32, 0xc3, 0x67, 0xb5, 0xd9, 0x94, 0x91, 0x10, 0xc8, 0xfa, + 0xae, 0x8f, 0x51, 0x15, 0xc6, 0x71, 0x58, 0xbb, 0xf2, 0x81, 0x19, 0x11, 0xc3, 0xfc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x44, 0x0c, 0xdd, 0x02, 0x38, 0xa8, 0xf5, 0x43, + 0xc4, 0x7b, 0xba, 0xe3, 0x10, 0xf1, 0x17, 0x1b, 0x06, 0x7d, 0x0c, 0xc9, 0x48, 0x1d, 0xa2, 0x73, + 0x87, 0xd9, 0x45, 0x6a, 0x37, 0x3b, 0xfb, 0x6a, 0x92, 0x54, 0xcf, 0x0e, 0x7d, 0xc1, 0xbf, 0x92, + 0x97, 0x56, 0x1f, 0xed, 0x4f, 0x6b, 0x8f, 0xf7, 0xa7, 0xb5, 0x3f, 0xf6, 0xa7, 0xb5, 0x6f, 0x9e, + 0x4e, 0xc7, 0x1e, 0x3f, 0x9d, 0x8e, 0xfd, 0xf6, 0x74, 0x3a, 0xf6, 0xd1, 0x62, 0xe4, 0x7d, 0x28, + 0x4b, 0xd1, 0x2a, 0x66, 0x9f, 0x93, 0x60, 0xbb, 0x10, 0xfe, 0x8a, 0xdd, 0x39, 0xf8, 0x1d, 0x2b, + 0xde, 0x8b, 0x8d, 0x61, 0xf1, 0x83, 0xf1, 0xff, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xe3, + 0x84, 0x58, 0xe8, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1194,10 +1112,10 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // RegisterOperator registers a new operator. RegisterOperator(ctx context.Context, in *RegisterOperatorReq, opts ...grpc.CallOption) (*RegisterOperatorResponse, error) - // SetConsKey sets the operator's consensus key for a chain. + // SetConsKey sets the operator's consensus key for a chain. To do this, the operator + // must have previously opted into the chain. + // TODO; rationalize this with non-chain AVSs wherein other keys can be set. SetConsKey(ctx context.Context, in *SetConsKeyReq, opts ...grpc.CallOption) (*SetConsKeyResponse, error) - // InitConsKeyRemoval removes the operator's consensus key for a chain. - InitConsKeyRemoval(ctx context.Context, in *InitConsKeyRemovalReq, opts ...grpc.CallOption) (*InitConsKeyRemovalResponse, error) // OptIntoAVS opts an operator into an AVS. OptIntoAVS(ctx context.Context, in *OptIntoAVSReq, opts ...grpc.CallOption) (*OptIntoAVSResponse, error) // OptOutOfAVS opts an operator out of an AVS. @@ -1230,15 +1148,6 @@ func (c *msgClient) SetConsKey(ctx context.Context, in *SetConsKeyReq, opts ...g return out, nil } -func (c *msgClient) InitConsKeyRemoval(ctx context.Context, in *InitConsKeyRemovalReq, opts ...grpc.CallOption) (*InitConsKeyRemovalResponse, error) { - out := new(InitConsKeyRemovalResponse) - err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/InitConsKeyRemoval", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) OptIntoAVS(ctx context.Context, in *OptIntoAVSReq, opts ...grpc.CallOption) (*OptIntoAVSResponse, error) { out := new(OptIntoAVSResponse) err := c.cc.Invoke(ctx, "/exocore.operator.v1.Msg/OptIntoAVS", in, out, opts...) @@ -1261,10 +1170,10 @@ func (c *msgClient) OptOutOfAVS(ctx context.Context, in *OptOutOfAVSReq, opts .. type MsgServer interface { // RegisterOperator registers a new operator. RegisterOperator(context.Context, *RegisterOperatorReq) (*RegisterOperatorResponse, error) - // SetConsKey sets the operator's consensus key for a chain. + // SetConsKey sets the operator's consensus key for a chain. To do this, the operator + // must have previously opted into the chain. + // TODO; rationalize this with non-chain AVSs wherein other keys can be set. SetConsKey(context.Context, *SetConsKeyReq) (*SetConsKeyResponse, error) - // InitConsKeyRemoval removes the operator's consensus key for a chain. - InitConsKeyRemoval(context.Context, *InitConsKeyRemovalReq) (*InitConsKeyRemovalResponse, error) // OptIntoAVS opts an operator into an AVS. OptIntoAVS(context.Context, *OptIntoAVSReq) (*OptIntoAVSResponse, error) // OptOutOfAVS opts an operator out of an AVS. @@ -1281,9 +1190,6 @@ func (*UnimplementedMsgServer) RegisterOperator(ctx context.Context, req *Regist func (*UnimplementedMsgServer) SetConsKey(ctx context.Context, req *SetConsKeyReq) (*SetConsKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetConsKey not implemented") } -func (*UnimplementedMsgServer) InitConsKeyRemoval(ctx context.Context, req *InitConsKeyRemovalReq) (*InitConsKeyRemovalResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitConsKeyRemoval not implemented") -} func (*UnimplementedMsgServer) OptIntoAVS(ctx context.Context, req *OptIntoAVSReq) (*OptIntoAVSResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OptIntoAVS not implemented") } @@ -1331,24 +1237,6 @@ func _Msg_SetConsKey_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Msg_InitConsKeyRemoval_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitConsKeyRemovalReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).InitConsKeyRemoval(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.operator.v1.Msg/InitConsKeyRemoval", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).InitConsKeyRemoval(ctx, req.(*InitConsKeyRemovalReq)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_OptIntoAVS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(OptIntoAVSReq) if err := dec(in); err != nil { @@ -1397,10 +1285,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SetConsKey", Handler: _Msg_SetConsKey_Handler, }, - { - MethodName: "InitConsKeyRemoval", - Handler: _Msg_InitConsKeyRemoval_Handler, - }, { MethodName: "OptIntoAVS", Handler: _Msg_OptIntoAVS_Handler, @@ -1998,6 +1882,13 @@ func (m *OptIntoAVSReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x1a + } if len(m.AvsAddress) > 0 { i -= len(m.AvsAddress) copy(dAtA[i:], m.AvsAddress) @@ -2165,66 +2056,6 @@ func (m *SetConsKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *InitConsKeyRemovalReq) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InitConsKeyRemovalReq) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InitConsKeyRemovalReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *InitConsKeyRemovalResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *InitConsKeyRemovalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *InitConsKeyRemovalResponse) 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 @@ -2470,6 +2301,10 @@ func (m *OptIntoAVSReq) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2538,32 +2373,6 @@ func (m *SetConsKeyResponse) Size() (n int) { return n } -func (m *InitConsKeyRemovalReq) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *InitConsKeyRemovalResponse) 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 } @@ -4252,6 +4061,38 @@ func (m *OptIntoAVSReq) Unmarshal(dAtA []byte) error { } m.AvsAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", 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.PublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -4683,170 +4524,6 @@ func (m *SetConsKeyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitConsKeyRemovalReq) Unmarshal(dAtA []byte) 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: InitConsKeyRemovalReq: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InitConsKeyRemovalReq: 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 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.Address = string(dAtA[iNdEx:postIndex]) - 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 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.ChainID = 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 *InitConsKeyRemovalResponse) Unmarshal(dAtA []byte) 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: InitConsKeyRemovalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InitConsKeyRemovalResponse: 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 From 066b0afa78fe72d3612f583f6e7d23933f429e48 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Wed, 19 Jun 2024 16:58:09 +0800 Subject: [PATCH 09/13] fix the issues identified by code review in #PR61 --- proto/exocore/operator/v1/query.proto | 20 +- proto/exocore/operator/v1/tx.proto | 2 +- x/assets/types/codec.go | 4 +- x/avstask/types/codec.go | 4 +- x/delegation/client/cli/query.go | 12 +- x/delegation/keeper/abci.go | 4 +- x/delegation/keeper/delegation_op_test.go | 4 +- x/delegation/keeper/grpc_query.go | 2 +- x/delegation/keeper/un_delegation_state.go | 40 +- x/delegation/types/codec.go | 4 +- x/delegation/types/keys.go | 8 +- x/deposit/types/codec.go | 4 +- x/operator/client/cli/query.go | 4 +- x/operator/keeper/abci.go | 12 +- x/operator/keeper/grpc_query.go | 4 +- x/operator/keeper/keeper.go | 2 +- x/operator/keeper/operator_slash_state.go | 20 +- x/operator/keeper/slash.go | 20 +- x/operator/types/codec.go | 4 +- x/operator/types/general.go | 23 ++ x/operator/types/query.pb.go | 449 ++++++++++++++------- x/operator/types/tx.pb.go | 2 +- x/reward/types/codec.go | 4 +- x/slash/types/codec.go | 4 +- 24 files changed, 423 insertions(+), 233 deletions(-) diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index acdcf9e5d..efe064d46 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -31,19 +31,19 @@ message QueryAllOperatorsResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// AddressInfo includes the address of operator and AVS -message AddressInfo { - // operator_addr is the operator address,its type should be a sdk.AccAddress +// OperatorAVSAddressDetails includes the address of operator and AVS +message OperatorAVSAddressDetails { + // operator_addr should be the string type of sdk.AccAddress string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // avs_address is the AVS address opted-in by the operator + // avs_address is the address of the AVS - either an 0x address or a chainID. string avs_address = 2 [(gogoproto.customname) = "AVSAddress"]; } // QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. message QueryOperatorUSDValueRequest { - // address_info is the operator and AVS address - AddressInfo address_info = 1; + // details is the operator and AVS address + OperatorAVSAddressDetails details = 1; } // QueryAVSUSDValueRequest is the request to obtain the USD value for AVS. @@ -56,8 +56,12 @@ message QueryAVSUSDValueRequest { // QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified // operator and AVS message QueryOperatorSlashInfoRequest { - // address_info is the operator and AVS address - AddressInfo address_info = 1; + // details is the operator and AVS address + OperatorAVSAddressDetails details = 1; +} + +message TestScalar { + string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos."]; } // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest diff --git a/proto/exocore/operator/v1/tx.proto b/proto/exocore/operator/v1/tx.proto index 0c5534954..8fab56906 100644 --- a/proto/exocore/operator/v1/tx.proto +++ b/proto/exocore/operator/v1/tx.proto @@ -121,7 +121,7 @@ message SlashFromAssetsPool { } -// SlashAssetsInfo is the slashed assets information +// SlashExecutionInfo is the actual execution state for a slash event message SlashExecutionInfo { // slash_proportion is the new calculated proportion when execute the slash string slash_proportion = 1 diff --git a/x/assets/types/codec.go b/x/assets/types/codec.go index 7900dd893..8a4a2b2cc 100644 --- a/x/assets/types/codec.go +++ b/x/assets/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/avstask/types/codec.go b/x/avstask/types/codec.go index 373487f3a..d4b79d95f 100644 --- a/x/avstask/types/codec.go +++ b/x/avstask/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/delegation/client/cli/query.go b/x/delegation/client/cli/query.go index aa8a37b72..b404283e4 100644 --- a/x/delegation/client/cli/query.go +++ b/x/delegation/client/cli/query.go @@ -126,9 +126,17 @@ func QueryUndelegations() *cobra.Command { } queryClient := delegationtype.NewQueryClient(clientCtx) + _, _, err = types.ValidateID(args[0], false, false) + if err != nil { + return err + } + _, _, err = types.ValidateID(args[1], false, false) + if err != nil { + return err + } req := &delegationtype.UndelegationsReq{ - StakerID: args[0], - AssetID: args[1], + StakerID: strings.ToLower(args[0]), + AssetID: strings.ToLower(args[1]), } res, err := queryClient.QueryUndelegations(context.Background(), req) if err != nil { diff --git a/x/delegation/keeper/abci.go b/x/delegation/keeper/abci.go index 9075fe220..6f54e2237 100644 --- a/x/delegation/keeper/abci.go +++ b/x/delegation/keeper/abci.go @@ -10,7 +10,7 @@ import ( // EndBlock : completed Undelegation events according to the canCompleted blockHeight // This function will be triggered at the end of every block, it will query the undelegation state to get the records that need to be handled and try to complete the undelegation task. func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - records, err := k.GetWaitCompleteUndelegationRecords(ctx, uint64(ctx.BlockHeight())) + records, err := k.GetPendingUndelegationRecords(ctx, uint64(ctx.BlockHeight())) if err != nil { panic(err) } @@ -45,7 +45,7 @@ func (k *Keeper) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Valida panic(err) } // and the other is the fact that it matures at the next block - err = k.StoreWaitCompleteRecord(ctx, recordKey, record) + err = k.StorePendingUndelegationRecord(ctx, recordKey, record) if err != nil { panic(err) } diff --git a/x/delegation/keeper/delegation_op_test.go b/x/delegation/keeper/delegation_op_test.go index 6baaea248..dcdb52f61 100644 --- a/x/delegation/keeper/delegation_op_test.go +++ b/x/delegation/keeper/delegation_op_test.go @@ -184,7 +184,7 @@ func (suite *DelegationTestSuite) TestUndelegateFrom() { suite.Equal(UndelegationRecord, records[0]) suite.Ctx.Logger().Info("the complete block number is:", "height", UndelegationRecord.CompleteBlockNumber) - waitUndelegationRecords, err := suite.App.DelegationKeeper.GetWaitCompleteUndelegationRecords(suite.Ctx, UndelegationRecord.CompleteBlockNumber) + waitUndelegationRecords, err := suite.App.DelegationKeeper.GetPendingUndelegationRecords(suite.Ctx, UndelegationRecord.CompleteBlockNumber) suite.NoError(err) suite.Equal(1, len(waitUndelegationRecords)) suite.Equal(UndelegationRecord, waitUndelegationRecords[0]) @@ -241,7 +241,7 @@ func (suite *DelegationTestSuite) TestCompleteUndelegation() { suite.NoError(err) suite.Equal(0, len(records)) - waitUndelegationRecords, err := suite.App.DelegationKeeper.GetWaitCompleteUndelegationRecords(suite.Ctx, uint64(completeBlockNumber)) + waitUndelegationRecords, err := suite.App.DelegationKeeper.GetPendingUndelegationRecords(suite.Ctx, uint64(completeBlockNumber)) suite.NoError(err) suite.Equal(0, len(waitUndelegationRecords)) } diff --git a/x/delegation/keeper/grpc_query.go b/x/delegation/keeper/grpc_query.go index 96515407d..a97b14c34 100644 --- a/x/delegation/keeper/grpc_query.go +++ b/x/delegation/keeper/grpc_query.go @@ -32,7 +32,7 @@ func (k *Keeper) QueryUndelegations(ctx context.Context, req *delegationtype.Und func (k *Keeper) QueryUndelegationsByHeight(ctx context.Context, req *delegationtype.UndelegationsByHeightReq) (*delegationtype.UndelegationRecordList, error) { c := sdk.UnwrapSDKContext(ctx) - undelegations, err := k.GetWaitCompleteUndelegationRecords(c, req.BlockHeight) + undelegations, err := k.GetPendingUndelegationRecords(c, req.BlockHeight) if err != nil { return nil, err } diff --git a/x/delegation/keeper/un_delegation_state.go b/x/delegation/keeper/un_delegation_state.go index 0f731e6ea..8853817d7 100644 --- a/x/delegation/keeper/un_delegation_state.go +++ b/x/delegation/keeper/un_delegation_state.go @@ -14,11 +14,11 @@ import ( ) // SetUndelegationRecords function saves the undelegation records to be handled when the handle time expires. -// When we save the undelegation records, we save them in three kv stores which are `KeyPrefixUndelegationInfo` `KeyPrefixStakerUndelegationInfo` and `KeyPrefixWaitCompleteUndelegations` +// When we save the undelegation records, we save them in three kv stores which are `KeyPrefixUndelegationInfo` `KeyPrefixStakerUndelegationInfo` and `KeyPrefixPendingUndelegations` func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.UndelegationRecord) error { singleRecordStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixUndelegationInfo) stakerUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStakerUndelegationInfo) - waitCompleteStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) + pendingUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) // key := common.HexToAddress(incentive.Contract) for _, record := range records { bz := k.cdc.MustMarshal(record) @@ -30,8 +30,8 @@ func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.Undele stakerKey := types.GetStakerUndelegationRecordKey(record.StakerID, record.AssetID, record.LzTxNonce) stakerUndelegationStore.Set(stakerKey, singleRecKey) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - waitCompleteStore.Set(waitCompleteKey, singleRecKey) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + pendingUndelegationStore.Set(pendingUndelegationKey, singleRecKey) } return nil } @@ -39,7 +39,7 @@ func (k *Keeper) SetUndelegationRecords(ctx sdk.Context, records []*types.Undele func (k *Keeper) DeleteUndelegationRecord(ctx sdk.Context, record *types.UndelegationRecord) error { singleRecordStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixUndelegationInfo) stakerUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixStakerUndelegationInfo) - waitCompleteStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) + pendingUndelegationStore := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) singleRecKey := types.GetUndelegationRecordKey(record.BlockNumber, record.LzTxNonce, record.TxHash, record.OperatorAddr) singleRecordStore.Delete(singleRecKey) @@ -47,8 +47,8 @@ func (k *Keeper) DeleteUndelegationRecord(ctx sdk.Context, record *types.Undeleg stakerKey := types.GetStakerUndelegationRecordKey(record.StakerID, record.AssetID, record.LzTxNonce) stakerUndelegationStore.Delete(stakerKey) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - waitCompleteStore.Delete(waitCompleteKey) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + pendingUndelegationStore.Delete(pendingUndelegationKey) return nil } @@ -60,13 +60,13 @@ func (k *Keeper) SetSingleUndelegationRecord(ctx sdk.Context, record *types.Unde return key, nil } -// StoreWaitCompleteRecord add it to handle the delay of completing undelegation caused by onHoldCount +// StorePendingUndelegationRecord add it to handle the delay of completing undelegation caused by onHoldCount // In the event that the undelegation is held by another module, this function is used within the EndBlocker to increment the scheduled completion block number by 1. // Then the completion time of the undelegation will be delayed to the next block. -func (k *Keeper) StoreWaitCompleteRecord(ctx sdk.Context, singleRecKey []byte, record *types.UndelegationRecord) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) - waitCompleteKey := types.GetWaitCompleteRecordKey(record.CompleteBlockNumber, record.LzTxNonce) - store.Set(waitCompleteKey, singleRecKey) +func (k *Keeper) StorePendingUndelegationRecord(ctx sdk.Context, singleRecKey []byte, record *types.UndelegationRecord) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) + pendingUndelegationKey := types.GetPendingUndelegationRecordKey(record.CompleteBlockNumber, record.LzTxNonce) + store.Set(pendingUndelegationKey, singleRecKey) return nil } @@ -150,15 +150,15 @@ func (k *Keeper) GetStakerUndelegationRecords(ctx sdk.Context, stakerID, assetID return k.GetUndelegationRecords(ctx, recordKeys) } -func (k *Keeper) SetWaitCompleteUndelegationInfo(ctx sdk.Context, height, lzNonce uint64, recordKey string) error { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) - key := types.GetWaitCompleteRecordKey(height, lzNonce) +func (k *Keeper) SetPendingUndelegationInfo(ctx sdk.Context, height, lzNonce uint64, recordKey string) error { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) + key := types.GetPendingUndelegationRecordKey(height, lzNonce) store.Set(key, []byte(recordKey)) return nil } -func (k *Keeper) GetWaitCompleteUndelegationRecKeys(ctx sdk.Context, height uint64) (recordKeyList []string, err error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixWaitCompleteUndelegations) +func (k *Keeper) GetPendingUndelegationRecKeys(ctx sdk.Context, height uint64) (recordKeyList []string, err error) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixPendingUndelegations) iterator := sdk.KVStorePrefixIterator(store, []byte(hexutil.EncodeUint64(height))) defer iterator.Close() @@ -169,8 +169,8 @@ func (k *Keeper) GetWaitCompleteUndelegationRecKeys(ctx sdk.Context, height uint return ret, nil } -func (k *Keeper) GetWaitCompleteUndelegationRecords(ctx sdk.Context, height uint64) (records []*types.UndelegationRecord, err error) { - recordKeys, err := k.GetWaitCompleteUndelegationRecKeys(ctx, height) +func (k *Keeper) GetPendingUndelegationRecords(ctx sdk.Context, height uint64) (records []*types.UndelegationRecord, err error) { + recordKeys, err := k.GetPendingUndelegationRecKeys(ctx, height) if err != nil { return nil, err } @@ -178,7 +178,7 @@ func (k *Keeper) GetWaitCompleteUndelegationRecords(ctx sdk.Context, height uint records = make([]*types.UndelegationRecord, 0) return records, nil } - // The states of records stored by WaitCompleteUndelegations kvStore should always be IsPending,so using AllRecords as getType here is ok. + // The states of records stored by KeyPrefixPendingUndelegations kvStore should always be IsPending,so using AllRecords as getType here is ok. return k.GetUndelegationRecords(ctx, recordKeys) } diff --git a/x/delegation/types/codec.go b/x/delegation/types/codec.go index 740b222ea..1c18cb390 100644 --- a/x/delegation/types/codec.go +++ b/x/delegation/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/delegation/types/keys.go b/x/delegation/types/keys.go index 9fb5ba84a..1bd4ab109 100644 --- a/x/delegation/types/keys.go +++ b/x/delegation/types/keys.go @@ -36,7 +36,7 @@ const ( prefixStakerUndelegationInfo - prefixWaitCompleteUndelegations + prefixPendingUndelegations // used to store the undelegation hold count prefixUndelegationOnHold @@ -57,8 +57,8 @@ var ( KeyPrefixUndelegationInfo = []byte{prefixUndelegationInfo} // KeyPrefixStakerUndelegationInfo restakerID+'/'+assetID+'/'+LzNonce -> singleRecordKey KeyPrefixStakerUndelegationInfo = []byte{prefixStakerUndelegationInfo} - // KeyPrefixWaitCompleteUndelegations completeHeight +'/'+LzNonce -> singleRecordKey - KeyPrefixWaitCompleteUndelegations = []byte{prefixWaitCompleteUndelegations} + // KeyPrefixPendingUndelegations completeHeight +'/'+LzNonce -> singleRecordKey + KeyPrefixPendingUndelegations = []byte{prefixPendingUndelegations} ) func GetDelegationStateIteratorPrefix(stakerID, assetID string) []byte { @@ -118,7 +118,7 @@ func GetStakerUndelegationRecordKey(stakerID, assetID string, lzNonce uint64) [] return []byte(strings.Join([]string{stakerID, assetID, hexutil.EncodeUint64(lzNonce)}, "/")) } -func GetWaitCompleteRecordKey(height, lzNonce uint64) []byte { +func GetPendingUndelegationRecordKey(height, lzNonce uint64) []byte { return []byte(strings.Join([]string{hexutil.EncodeUint64(height), hexutil.EncodeUint64(lzNonce)}, "/")) } diff --git a/x/deposit/types/codec.go b/x/deposit/types/codec.go index 5f5da9a15..b1789ef2a 100644 --- a/x/deposit/types/codec.go +++ b/x/deposit/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index 9b0358cc3..c66a6efa3 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -243,7 +243,7 @@ func QueryOperatorUSDValue() *cobra.Command { } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorUSDValueRequest{ - AddressInfo: &operatortypes.AddressInfo{ + Details: &operatortypes.OperatorAVSAddressDetails{ OperatorAddr: args[0], AVSAddress: args[1], }, @@ -302,7 +302,7 @@ func QueryOperatorSlashInfo() *cobra.Command { } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorSlashInfoRequest{ - AddressInfo: &operatortypes.AddressInfo{ + Details: &operatortypes.OperatorAVSAddressDetails{ OperatorAddr: args[0], AVSAddress: args[1], }, diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index 8e129ad53..4a8ed1f92 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -9,12 +9,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type OperatorUSDValue struct { - Staking sdkmath.LegacyDec - SelfStaking sdkmath.LegacyDec - StakingAndWaitUnbonding sdkmath.LegacyDec -} - // CalculateUSDValueForOperator calculates the total and self usd value for the // operator according to the input assets filter and prices. func (k *Keeper) CalculateUSDValueForOperator( @@ -24,9 +18,9 @@ func (k *Keeper) CalculateUSDValueForOperator( assetsFilter map[string]interface{}, decimals map[string]uint32, prices map[string]operatortypes.Price, -) (OperatorUSDValue, error) { +) (operatortypes.OperatorUSDValue, error) { var err error - ret := OperatorUSDValue{ + ret := operatortypes.OperatorUSDValue{ Staking: sdkmath.LegacyNewDec(0), SelfStaking: sdkmath.LegacyNewDec(0), StakingAndWaitUnbonding: sdkmath.LegacyNewDec(0), @@ -36,6 +30,8 @@ func (k *Keeper) CalculateUSDValueForOperator( var price operatortypes.Price var decimal uint32 if isForSlash { + // when calculated the USD value for slashing, the input prices map is null + // so the price needs to be retrieved here price, err = k.oracleKeeper.GetSpecifiedAssetsPrice(ctx, assetID) if err != nil { return err diff --git a/x/operator/keeper/grpc_query.go b/x/operator/keeper/grpc_query.go index ed1e2f607..309a9596e 100644 --- a/x/operator/keeper/grpc_query.go +++ b/x/operator/keeper/grpc_query.go @@ -175,7 +175,7 @@ func (k Keeper) QueryAllOperatorConsAddrsByChainID( func (k *Keeper) QueryOperatorUSDValue(ctx context.Context, req *operatortypes.QueryOperatorUSDValueRequest) (*operatortypes.DecValueField, error) { c := sdk.UnwrapSDKContext(ctx) - usdValue, err := k.GetOperatorUSDValue(c, req.AddressInfo.OperatorAddr, req.AddressInfo.AVSAddress) + usdValue, err := k.GetOperatorUSDValue(c, req.Details.OperatorAddr, req.Details.AVSAddress) if err != nil { return nil, err } @@ -197,7 +197,7 @@ func (k *Keeper) QueryAVSUSDValue(ctx context.Context, req *operatortypes.QueryA func (k *Keeper) QueryOperatorSlashInfo(ctx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { c := sdk.UnwrapSDKContext(ctx) - slashInfo, err := k.AllOperatorSlashInfo(c, req.AddressInfo.OperatorAddr, req.AddressInfo.AVSAddress) + slashInfo, err := k.AllOperatorSlashInfo(c, req.Details.OperatorAddr, req.Details.AVSAddress) if err != nil { return nil, err } diff --git a/x/operator/keeper/keeper.go b/x/operator/keeper/keeper.go index a4e743dae..bf0c0a0c9 100644 --- a/x/operator/keeper/keeper.go +++ b/x/operator/keeper/keeper.go @@ -71,7 +71,7 @@ type OperatorKeeper interface { OptOut(ctx sdk.Context, OperatorAddress sdk.AccAddress, AVSAddr string) error - Slash(ctx sdk.Context, parameter *SlashInputInfo) error + Slash(ctx sdk.Context, parameter *operatortypes.SlashInputInfo) error SlashWithInfractionReason( ctx sdk.Context, addr sdk.AccAddress, infractionHeight, power int64, diff --git a/x/operator/keeper/operator_slash_state.go b/x/operator/keeper/operator_slash_state.go index 7f9bd064b..4644b7645 100644 --- a/x/operator/keeper/operator_slash_state.go +++ b/x/operator/keeper/operator_slash_state.go @@ -1,8 +1,6 @@ package keeper import ( - "fmt" - assetstype "github.com/ExocoreNetwork/exocore/x/assets/types" errorsmod "cosmossdk.io/errors" @@ -27,22 +25,22 @@ func (k *Keeper) UpdateOperatorSlashInfo(ctx sdk.Context, operatorAddr, avsAddr, } slashInfoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr, slashID) if store.Has(slashInfoKey) { - return errorsmod.Wrap(operatortypes.ErrSlashInfoExist, fmt.Sprintf("slashInfoKey:%s", slashInfoKey)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfoExist, "slashInfoKey:%s", slashInfoKey) } // check the validation of slash info - getSlashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) + slashContract, err := k.avsKeeper.GetAVSSlashContract(ctx, avsAddr) if err != nil { return err } - if slashInfo.SlashContract != getSlashContract { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err slashContract:%s, stored contract:%s", slashInfo.SlashContract, getSlashContract)) + if slashInfo.SlashContract != slashContract { + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err slashContract:%s, stored contract:%s", slashInfo.SlashContract, slashContract) } if slashInfo.EventHeight > slashInfo.SubmittedHeight { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err SubmittedHeight:%v,EventHeight:%v", slashInfo.SubmittedHeight, slashInfo.EventHeight)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err SubmittedHeight:%v,EventHeight:%v", slashInfo.SubmittedHeight, slashInfo.EventHeight) } if slashInfo.SlashProportion.IsNil() || slashInfo.SlashProportion.IsNegative() || slashInfo.SlashProportion.GT(sdkmath.LegacyNewDec(1)) { - return errorsmod.Wrap(operatortypes.ErrSlashInfo, fmt.Sprintf("err SlashProportion:%v", slashInfo.SlashProportion)) + return errorsmod.Wrapf(operatortypes.ErrSlashInfo, "err SlashProportion:%v", slashInfo.SlashProportion) } // save single operator delegation state @@ -59,7 +57,7 @@ func (k *Keeper) GetOperatorSlashInfo(ctx sdk.Context, avsAddr, operatorAddr, sl slashInfoKey := assetstype.GetJoinedStoreKey(operatorAddr, avsAddr, slashID) value := store.Get(slashInfoKey) if value == nil { - return nil, errorsmod.Wrap(operatortypes.ErrNoKeyInTheStore, fmt.Sprintf("GetOperatorSlashInfo: key is %s", slashInfoKey)) + return nil, errorsmod.Wrapf(operatortypes.ErrNoKeyInTheStore, "GetOperatorSlashInfo: key is %s", slashInfoKey) } operatorSlashInfo := operatortypes.OperatorSlashInfo{} k.cdc.MustUnmarshal(value, &operatorSlashInfo) @@ -103,7 +101,7 @@ func (k *Keeper) UpdateSlashAssetsState(ctx sdk.Context, assetID, stakerOrOperat store := prefix.NewStore(ctx.KVStore(k.storeKey), operatortypes.KeyPrefixSlashAssetsState) var key []byte if stakerOrOperator == "" || assetID == "" { - return errorsmod.Wrap(operatortypes.ErrParameterInvalid, fmt.Sprintf("assetID:%s,stakerOrOperator:%s", assetID, stakerOrOperator)) + return errorsmod.Wrapf(operatortypes.ErrParameterInvalid, "assetID:%s,stakerOrOperator:%s", assetID, stakerOrOperator) } key = assetstype.GetJoinedStoreKey(hexutil.EncodeUint64(processedHeight), assetID, stakerOrOperator) @@ -150,7 +148,7 @@ func (k *Keeper) GetSlashAssetsState(ctx sdk.Context, assetID, stakerOrOperator } value := store.Get(key) if value == nil { - return sdkmath.Int{}, errorsmod.Wrap(operatortypes.ErrNoKeyInTheStore, fmt.Sprintf("GetSlashAssetsState: key is %s", key)) + return sdkmath.Int{}, errorsmod.Wrapf(operatortypes.ErrNoKeyInTheStore, "GetSlashAssetsState: key is %s", key) } var ret assetstype.ValueField k.cdc.MustUnmarshal(value, &ret) diff --git a/x/operator/keeper/slash.go b/x/operator/keeper/slash.go index c8f2887c9..82ce3bfee 100644 --- a/x/operator/keeper/slash.go +++ b/x/operator/keeper/slash.go @@ -15,18 +15,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -type SlashInputInfo struct { - IsDogFood bool - Power int64 - SlashType uint32 - Operator sdk.AccAddress - AVSAddr string - SlashContract string - SlashID string - SlashEventHeight int64 - SlashProportion sdkmath.LegacyDec -} - // GetSlashIDForDogfood It use infractionType+'/'+'infractionHeight' as the slashID, because the slash event occurs in dogfood doesn't have a TxID. It isn't submitted through an external transaction. func GetSlashIDForDogfood(infraction stakingtypes.Infraction, infractionHeight int64) string { // #nosec G701 @@ -54,7 +42,7 @@ func SlashFromUndelegation(undelegation *delegationtype.UndelegationRecord, slas } } -func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *SlashInputInfo) error { +func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *types.SlashInputInfo) error { height := ctx.BlockHeight() if parameter.SlashEventHeight > height { return errorsmod.Wrap(types.ErrSlashOccurredHeight, fmt.Sprintf("slashEventHeight:%d,curHeight:%d", parameter.SlashEventHeight, height)) @@ -78,7 +66,7 @@ func (k *Keeper) CheckSlashParameter(ctx sdk.Context, parameter *SlashInputInfo) // If the remaining amount of the assets pool after slash is zero, the share of related // stakers should be cleared, because the divisor will be zero when calculating the share // of new delegation after the slash. -func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *SlashInputInfo) (*types.SlashExecutionInfo, error) { +func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *types.SlashInputInfo) (*types.SlashExecutionInfo, error) { // calculate the new slash proportion according to the historical power and current assets state slashUSDValue := sdkmath.LegacyNewDec(parameter.Power).Mul(parameter.SlashProportion) // calculate the current usd value of all assets pool for the operator @@ -157,7 +145,7 @@ func (k *Keeper) SlashAssets(ctx sdk.Context, parameter *SlashInputInfo) (*types } // Slash performs all slash events and stores the execution result -func (k *Keeper) Slash(ctx sdk.Context, parameter *SlashInputInfo) error { +func (k *Keeper) Slash(ctx sdk.Context, parameter *types.SlashInputInfo) error { err := k.CheckSlashParameter(ctx, parameter) if err != nil { return err @@ -197,7 +185,7 @@ func (k Keeper) SlashWithInfractionReason( return sdkmath.NewInt(0) } slashID := GetSlashIDForDogfood(infraction, infractionHeight) - slashParam := &SlashInputInfo{ + slashParam := &types.SlashInputInfo{ IsDogFood: true, Power: power, SlashType: uint32(infraction), diff --git a/x/operator/types/codec.go b/x/operator/types/codec.go index 3ba05f774..3f42bd94b 100644 --- a/x/operator/types/codec.go +++ b/x/operator/types/codec.go @@ -7,10 +7,10 @@ import ( "github.com/cosmos/cosmos-sdk/types/msgservice" ) -// ModuleCdc references the global erc20 module codec. Note, the codec should +// ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // -// The actual codec used for serialization should be provided to modules/erc20 and +// The actual codec used for serialization should be provided to modules and // defined at the application level. var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/operator/types/general.go b/x/operator/types/general.go index b2a1404d6..dc9aa4ab9 100644 --- a/x/operator/types/general.go +++ b/x/operator/types/general.go @@ -1,4 +1,27 @@ package types +import ( + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" +) + // DeltaOptedInAssetState This is a struct to describe the desired change that matches with the OptedInAssetState type DeltaOptedInAssetState OptedInAssetState + +type OperatorUSDValue struct { + Staking sdkmath.LegacyDec + SelfStaking sdkmath.LegacyDec + StakingAndWaitUnbonding sdkmath.LegacyDec +} + +type SlashInputInfo struct { + IsDogFood bool + Power int64 + SlashType uint32 + Operator sdk.AccAddress + AVSAddr string + SlashContract string + SlashID string + SlashEventHeight int64 + SlashProportion sdkmath.LegacyDec +} diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index 3ffa3d2eb..f9f26a090 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -179,26 +179,26 @@ func (m *QueryAllOperatorsResponse) GetPagination() *query.PageResponse { return nil } -// AddressInfo includes the address of operator and AVS -type AddressInfo struct { - // operator_addr is the operator address,its type should be a sdk.AccAddress +// OperatorAVSAddressDetails includes the address of operator and AVS +type OperatorAVSAddressDetails struct { + // operator_addr should be the string type of sdk.AccAddress OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` - // avs_address is the AVS address opted-in by the operator + // avs_address is the address of the AVS - either an 0x address or a chainID. AVSAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` } -func (m *AddressInfo) Reset() { *m = AddressInfo{} } -func (m *AddressInfo) String() string { return proto.CompactTextString(m) } -func (*AddressInfo) ProtoMessage() {} -func (*AddressInfo) Descriptor() ([]byte, []int) { +func (m *OperatorAVSAddressDetails) Reset() { *m = OperatorAVSAddressDetails{} } +func (m *OperatorAVSAddressDetails) String() string { return proto.CompactTextString(m) } +func (*OperatorAVSAddressDetails) ProtoMessage() {} +func (*OperatorAVSAddressDetails) Descriptor() ([]byte, []int) { return fileDescriptor_f91e795a3cecbdbf, []int{3} } -func (m *AddressInfo) XXX_Unmarshal(b []byte) error { +func (m *OperatorAVSAddressDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OperatorAVSAddressDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_AddressInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_OperatorAVSAddressDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -208,26 +208,26 @@ func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *AddressInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressInfo.Merge(m, src) +func (m *OperatorAVSAddressDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorAVSAddressDetails.Merge(m, src) } -func (m *AddressInfo) XXX_Size() int { +func (m *OperatorAVSAddressDetails) XXX_Size() int { return m.Size() } -func (m *AddressInfo) XXX_DiscardUnknown() { - xxx_messageInfo_AddressInfo.DiscardUnknown(m) +func (m *OperatorAVSAddressDetails) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorAVSAddressDetails.DiscardUnknown(m) } -var xxx_messageInfo_AddressInfo proto.InternalMessageInfo +var xxx_messageInfo_OperatorAVSAddressDetails proto.InternalMessageInfo -func (m *AddressInfo) GetOperatorAddr() string { +func (m *OperatorAVSAddressDetails) GetOperatorAddr() string { if m != nil { return m.OperatorAddr } return "" } -func (m *AddressInfo) GetAVSAddress() string { +func (m *OperatorAVSAddressDetails) GetAVSAddress() string { if m != nil { return m.AVSAddress } @@ -237,8 +237,8 @@ func (m *AddressInfo) GetAVSAddress() string { // QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. type QueryOperatorUSDValueRequest struct { - // address_info is the operator and AVS address - AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` + // details is the operator and AVS address + Details *OperatorAVSAddressDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` } func (m *QueryOperatorUSDValueRequest) Reset() { *m = QueryOperatorUSDValueRequest{} } @@ -274,9 +274,9 @@ func (m *QueryOperatorUSDValueRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorUSDValueRequest proto.InternalMessageInfo -func (m *QueryOperatorUSDValueRequest) GetAddressInfo() *AddressInfo { +func (m *QueryOperatorUSDValueRequest) GetDetails() *OperatorAVSAddressDetails { if m != nil { - return m.AddressInfo + return m.Details } return nil } @@ -330,8 +330,8 @@ func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { // QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified // operator and AVS type QueryOperatorSlashInfoRequest struct { - // address_info is the operator and AVS address - AddressInfo *AddressInfo `protobuf:"bytes,1,opt,name=address_info,json=addressInfo,proto3" json:"address_info,omitempty"` + // details is the operator and AVS address + Details *OperatorAVSAddressDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` } func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } @@ -367,13 +367,57 @@ func (m *QueryOperatorSlashInfoRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorSlashInfoRequest proto.InternalMessageInfo -func (m *QueryOperatorSlashInfoRequest) GetAddressInfo() *AddressInfo { +func (m *QueryOperatorSlashInfoRequest) GetDetails() *OperatorAVSAddressDetails { if m != nil { - return m.AddressInfo + return m.Details } return nil } +type TestScalar struct { + OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` +} + +func (m *TestScalar) Reset() { *m = TestScalar{} } +func (m *TestScalar) String() string { return proto.CompactTextString(m) } +func (*TestScalar) ProtoMessage() {} +func (*TestScalar) Descriptor() ([]byte, []int) { + return fileDescriptor_f91e795a3cecbdbf, []int{7} +} +func (m *TestScalar) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TestScalar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TestScalar.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TestScalar) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestScalar.Merge(m, src) +} +func (m *TestScalar) XXX_Size() int { + return m.Size() +} +func (m *TestScalar) XXX_DiscardUnknown() { + xxx_messageInfo_TestScalar.DiscardUnknown(m) +} + +var xxx_messageInfo_TestScalar proto.InternalMessageInfo + +func (m *TestScalar) GetOperatorAddr() string { + if m != nil { + return m.OperatorAddr + } + return "" +} + // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest type QueryOperatorSlashInfoResponse struct { // AllSlashInfo the key is slashID, the value is the specified slash information @@ -386,7 +430,7 @@ func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSla func (m *QueryOperatorSlashInfoResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorSlashInfoResponse) ProtoMessage() {} func (*QueryOperatorSlashInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{7} + return fileDescriptor_f91e795a3cecbdbf, []int{8} } func (m *QueryOperatorSlashInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -436,7 +480,7 @@ func (m *QueryOperatorConsKeyRequest) Reset() { *m = QueryOperatorConsKe func (m *QueryOperatorConsKeyRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyRequest) ProtoMessage() {} func (*QueryOperatorConsKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{8} + return fileDescriptor_f91e795a3cecbdbf, []int{9} } func (m *QueryOperatorConsKeyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +535,7 @@ func (m *QueryOperatorConsKeyResponse) Reset() { *m = QueryOperatorConsK func (m *QueryOperatorConsKeyResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsKeyResponse) ProtoMessage() {} func (*QueryOperatorConsKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{9} + return fileDescriptor_f91e795a3cecbdbf, []int{10} } func (m *QueryOperatorConsKeyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -549,7 +593,7 @@ func (m *QueryOperatorConsAddressRequest) Reset() { *m = QueryOperatorCo func (m *QueryOperatorConsAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressRequest) ProtoMessage() {} func (*QueryOperatorConsAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{10} + return fileDescriptor_f91e795a3cecbdbf, []int{11} } func (m *QueryOperatorConsAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -605,7 +649,7 @@ func (m *QueryOperatorConsAddressResponse) Reset() { *m = QueryOperatorC func (m *QueryOperatorConsAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryOperatorConsAddressResponse) ProtoMessage() {} func (*QueryOperatorConsAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{11} + return fileDescriptor_f91e795a3cecbdbf, []int{12} } func (m *QueryOperatorConsAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -665,7 +709,7 @@ func (m *QueryAllOperatorConsKeysByChainIDRequest) Reset() { func (m *QueryAllOperatorConsKeysByChainIDRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllOperatorConsKeysByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{12} + return fileDescriptor_f91e795a3cecbdbf, []int{13} } func (m *QueryAllOperatorConsKeysByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +769,7 @@ func (m *QueryAllOperatorConsKeysByChainIDResponse) String() string { } func (*QueryAllOperatorConsKeysByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsKeysByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{13} + return fileDescriptor_f91e795a3cecbdbf, []int{14} } func (m *QueryAllOperatorConsKeysByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -783,7 +827,7 @@ func (m *OperatorConsKeyPair) Reset() { *m = OperatorConsKeyPair{} } func (m *OperatorConsKeyPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsKeyPair) ProtoMessage() {} func (*OperatorConsKeyPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{14} + return fileDescriptor_f91e795a3cecbdbf, []int{15} } func (m *OperatorConsKeyPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -852,7 +896,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDRequest) String() string { } func (*QueryAllOperatorConsAddrsByChainIDRequest) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{15} + return fileDescriptor_f91e795a3cecbdbf, []int{16} } func (m *QueryAllOperatorConsAddrsByChainIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -912,7 +956,7 @@ func (m *QueryAllOperatorConsAddrsByChainIDResponse) String() string { } func (*QueryAllOperatorConsAddrsByChainIDResponse) ProtoMessage() {} func (*QueryAllOperatorConsAddrsByChainIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{16} + return fileDescriptor_f91e795a3cecbdbf, []int{17} } func (m *QueryAllOperatorConsAddrsByChainIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -970,7 +1014,7 @@ func (m *OperatorConsAddrPair) Reset() { *m = OperatorConsAddrPair{} } func (m *OperatorConsAddrPair) String() string { return proto.CompactTextString(m) } func (*OperatorConsAddrPair) ProtoMessage() {} func (*OperatorConsAddrPair) Descriptor() ([]byte, []int) { - return fileDescriptor_f91e795a3cecbdbf, []int{17} + return fileDescriptor_f91e795a3cecbdbf, []int{18} } func (m *OperatorConsAddrPair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1024,10 +1068,11 @@ func init() { proto.RegisterType((*GetOperatorInfoReq)(nil), "exocore.operator.v1.GetOperatorInfoReq") proto.RegisterType((*QueryAllOperatorsRequest)(nil), "exocore.operator.v1.QueryAllOperatorsRequest") proto.RegisterType((*QueryAllOperatorsResponse)(nil), "exocore.operator.v1.QueryAllOperatorsResponse") - proto.RegisterType((*AddressInfo)(nil), "exocore.operator.v1.AddressInfo") + proto.RegisterType((*OperatorAVSAddressDetails)(nil), "exocore.operator.v1.OperatorAVSAddressDetails") proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") + proto.RegisterType((*TestScalar)(nil), "exocore.operator.v1.TestScalar") proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") @@ -1045,82 +1090,85 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 1200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4f, 0x6f, 0xe3, 0x44, - 0x14, 0xef, 0xa4, 0x14, 0x6d, 0x5e, 0xba, 0x4b, 0x3b, 0x2d, 0xd0, 0xcd, 0x76, 0xd3, 0xae, 0x05, - 0xdb, 0x6e, 0x69, 0x6d, 0x9a, 0x76, 0x11, 0xda, 0x3f, 0xa0, 0xa6, 0x7f, 0x56, 0xbb, 0x45, 0x6c, - 0x71, 0x44, 0x25, 0x38, 0x10, 0x39, 0xce, 0x6c, 0x6a, 0xd5, 0xf5, 0xa4, 0x1e, 0x27, 0x34, 0x5a, - 0x15, 0x21, 0x4e, 0x70, 0x43, 0xec, 0x11, 0xc1, 0x81, 0xcf, 0x80, 0xe0, 0x2b, 0xec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, 0xf7, 0x3c, 0xbf, 0x4f, 0x9c, - 0x4f, 0xa9, 0xbd, 0xdb, 0x0a, 0x74, 0xd0, 0x0e, 0xe5, 0x34, 0x6b, 0x84, 0x95, 0x5f, 0xe4, 0xff, - 0x36, 0x2c, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x45, 0xa4, 0x16, 0x4e, 0x5c, 0x11, 0x00, 0x00, + // 1234 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0x5d, 0x6f, 0x1b, 0x45, + 0x17, 0xc7, 0x33, 0xee, 0xd3, 0xa7, 0xf5, 0x71, 0x5b, 0x92, 0x49, 0x80, 0xc4, 0x4d, 0x9d, 0x74, + 0x05, 0x4d, 0x1a, 0x92, 0xdd, 0xc6, 0x49, 0x11, 0xea, 0x1b, 0x8a, 0xf3, 0x52, 0xda, 0x20, 0x1a, + 0xd6, 0x10, 0x09, 0x2e, 0xb0, 0xd6, 0xeb, 0xa9, 0xb3, 0xca, 0x66, 0xc7, 0xd9, 0x19, 0x9b, 0x58, + 0x55, 0x10, 0xe2, 0x0a, 0xc4, 0x0d, 0xa2, 0x97, 0x08, 0x2e, 0xf8, 0x0c, 0x15, 0x7c, 0x85, 0x5e, + 0x70, 0x11, 0xca, 0x0d, 0x57, 0x01, 0x25, 0x7c, 0x06, 0xae, 0xd1, 0xce, 0xce, 0xda, 0xde, 0xcd, + 0xfa, 0x25, 0x21, 0xe2, 0xce, 0xbb, 0x3b, 0x67, 0xce, 0xef, 0x7f, 0xce, 0x99, 0x73, 0x26, 0x81, + 0x31, 0xb2, 0x43, 0x4d, 0xea, 0x12, 0x8d, 0x56, 0x88, 0x6b, 0x70, 0xea, 0x6a, 0xb5, 0x59, 0x6d, + 0xbb, 0x4a, 0xdc, 0xba, 0x5a, 0x71, 0x29, 0xa7, 0x78, 0x50, 0x2e, 0x50, 0x83, 0x05, 0x6a, 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0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1622,7 +1670,7 @@ func (m *QueryAllOperatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *AddressInfo) Marshal() (dAtA []byte, err error) { +func (m *OperatorAVSAddressDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1632,12 +1680,12 @@ func (m *AddressInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *AddressInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *OperatorAVSAddressDetails) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *AddressInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OperatorAVSAddressDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1679,9 +1727,9 @@ func (m *QueryOperatorUSDValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, e _ = i var l int _ = l - if m.AddressInfo != nil { + if m.Details != nil { { - size, err := m.AddressInfo.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1744,9 +1792,9 @@ func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if m.AddressInfo != nil { + if m.Details != nil { { - size, err := m.AddressInfo.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1759,6 +1807,36 @@ func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *TestScalar) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TestScalar) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TestScalar) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OperatorAddr) > 0 { + i -= len(m.OperatorAddr) + copy(dAtA[i:], m.OperatorAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryOperatorSlashInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2302,7 +2380,7 @@ func (m *QueryAllOperatorsResponse) Size() (n int) { return n } -func (m *AddressInfo) Size() (n int) { +func (m *OperatorAVSAddressDetails) Size() (n int) { if m == nil { return 0 } @@ -2325,8 +2403,8 @@ func (m *QueryOperatorUSDValueRequest) Size() (n int) { } var l int _ = l - if m.AddressInfo != nil { - l = m.AddressInfo.Size() + if m.Details != nil { + l = m.Details.Size() n += 1 + l + sovQuery(uint64(l)) } return n @@ -2351,8 +2429,21 @@ func (m *QueryOperatorSlashInfoRequest) Size() (n int) { } var l int _ = l - if m.AddressInfo != nil { - l = m.AddressInfo.Size() + if m.Details != nil { + l = m.Details.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *TestScalar) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OperatorAddr) + if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n @@ -2848,7 +2939,7 @@ func (m *QueryAllOperatorsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *AddressInfo) Unmarshal(dAtA []byte) error { +func (m *OperatorAVSAddressDetails) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2871,10 +2962,10 @@ func (m *AddressInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: AddressInfo: wiretype end group for non-group") + return fmt.Errorf("proto: OperatorAVSAddressDetails: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: AddressInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OperatorAVSAddressDetails: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2993,7 +3084,7 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3020,10 +3111,10 @@ func (m *QueryOperatorUSDValueRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AddressInfo == nil { - m.AddressInfo = &AddressInfo{} + if m.Details == nil { + m.Details = &OperatorAVSAddressDetails{} } - if err := m.AddressInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Details.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3161,7 +3252,7 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddressInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3188,12 +3279,94 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AddressInfo == nil { - m.AddressInfo = &AddressInfo{} + if m.Details == nil { + m.Details = &OperatorAVSAddressDetails{} } - if err := m.AddressInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Details.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 *TestScalar) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TestScalar: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TestScalar: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", 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.OperatorAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/operator/types/tx.pb.go b/x/operator/types/tx.pb.go index e6b2b5655..bc37b3ce7 100644 --- a/x/operator/types/tx.pb.go +++ b/x/operator/types/tx.pb.go @@ -511,7 +511,7 @@ func (m *SlashFromAssetsPool) GetAssetID() string { return "" } -// SlashAssetsInfo is the slashed assets information +// SlashExecutionInfo is the actual execution state for a slash event type SlashExecutionInfo struct { // slash_proportion is the new calculated proportion when execute the slash SlashProportion github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=slash_proportion,json=slashProportion,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"slash_proportion"` diff --git a/x/reward/types/codec.go b/x/reward/types/codec.go index 19151ace3..5de656e44 100644 --- a/x/reward/types/codec.go +++ b/x/reward/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) diff --git a/x/slash/types/codec.go b/x/slash/types/codec.go index a9a1a9d9a..af71901aa 100644 --- a/x/slash/types/codec.go +++ b/x/slash/types/codec.go @@ -10,10 +10,10 @@ import ( var ( amino = codec.NewLegacyAmino() - // ModuleCdc references the global erc20 module codec. Note, the codec should + // ModuleCdc references the global module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding. // - // The actual codec used for serialization should be provided to modules/erc20 and + // The actual codec used for serialization should be provided to modules and // defined at the application level. ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) From 693c2e5781800769676af7e282f87535057002b4 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Wed, 19 Jun 2024 21:10:35 +0800 Subject: [PATCH 10/13] fix the protobuf lint error in #PR61 --- proto/exocore/operator/v1/query.proto | 4 ---- 1 file changed, 4 deletions(-) diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index efe064d46..114d66458 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -60,10 +60,6 @@ message QueryOperatorSlashInfoRequest { OperatorAVSAddressDetails details = 1; } -message TestScalar { - string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos."]; -} - // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest message QueryOperatorSlashInfoResponse{ // AllSlashInfo the key is slashID, the value is the specified slash information From 69317861c132127b7e9895ee5e1fb2f93feca078 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Fri, 21 Jun 2024 09:41:55 +0800 Subject: [PATCH 11/13] add detailed code comments for CalculateUSDValueForOperator and remove the useless code comment --- proto/exocore/operator/v1/query.proto | 1 - x/operator/keeper/abci.go | 12 ++++++++++++ x/operator/keeper/usd_value.go | 1 - 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index 114d66458..7dd6b8cf0 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -39,7 +39,6 @@ message OperatorAVSAddressDetails { string avs_address = 2 [(gogoproto.customname) = "AVSAddress"]; } -// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. message QueryOperatorUSDValueRequest { // details is the operator and AVS address diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index 4a8ed1f92..cde1a9a86 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -11,6 +11,18 @@ import ( // CalculateUSDValueForOperator calculates the total and self usd value for the // operator according to the input assets filter and prices. +// This function will be used in slashing calculations and voting power updates per epoch. +// The inputs/outputs and calculation logic for these two cases are different, +// so an `isForSlash` flag is used to distinguish between them. +// When it's called by the voting power update, the needed outputs are the current total +// staking amount and the self-staking amount of the operator. The current total +// staking amount excludes the pending unbonding amount, so it's used to calculate the voting power. +// The self-staking amount is also needed to check if the operator's self-staking is sufficient. +// At the same time, the prices of all assets have been retrieved in the caller's function, so they +// are inputted as a parameter. +// When it's called by the slash execution, the needed output is the sum of the current total amount and +// the pending unbonding amount, because the undelegation also needs to be slashed. And the prices of +// all assets haven't been prepared by the caller, so the prices should be retrieved in this function. func (k *Keeper) CalculateUSDValueForOperator( ctx sdk.Context, isForSlash bool, diff --git a/x/operator/keeper/usd_value.go b/x/operator/keeper/usd_value.go index 1538ea29f..5c11a717b 100644 --- a/x/operator/keeper/usd_value.go +++ b/x/operator/keeper/usd_value.go @@ -173,7 +173,6 @@ func (k *Keeper) BatchUpdateUSDValueForAVSAndOperator(ctx sdk.Context, avsOperat // GetAVSUSDValue is a function to retrieve the USD share of specified Avs, // The key and value to retrieve is: // AVSAddr -> types.DecValueField(the total USD share of specified Avs) -// It hasn't been used now. but it can serve as an RPC in the future. func (k *Keeper) GetAVSUSDValue(ctx sdk.Context, avsAddr string) (sdkmath.LegacyDec, error) { store := prefix.NewStore( ctx.KVStore(k.storeKey), From ea01e94ca43acd18e593cda249d901e9e73ca2b8 Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Fri, 21 Jun 2024 16:35:47 +0800 Subject: [PATCH 12/13] add the check for operator address in the commandline, and consider the pagination in the QueryOperatorSlashInfo RPC --- proto/exocore/operator/v1/query.proto | 37 +- x/assets/types/keys.go | 6 + x/operator/client/cli/query.go | 28 ++ x/operator/keeper/abci.go | 4 + x/operator/keeper/grpc_query.go | 29 +- x/operator/types/query.pb.go | 553 +++++++++++++++----------- 6 files changed, 396 insertions(+), 261 deletions(-) diff --git a/proto/exocore/operator/v1/query.proto b/proto/exocore/operator/v1/query.proto index 7dd6b8cf0..2a7794415 100644 --- a/proto/exocore/operator/v1/query.proto +++ b/proto/exocore/operator/v1/query.proto @@ -57,14 +57,25 @@ message QueryAVSUSDValueRequest { message QueryOperatorSlashInfoRequest { // details is the operator and AVS address OperatorAVSAddressDetails details = 1; + // pagination related options. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// OperatorSlashInfoByID includes the slash information and the slashID +message OperatorSlashInfoByID { + // slash_id is stored as the key of the slash information, + // so it will be parsed and padding here. + string slash_id = 1 [(gogoproto.customname) = "SlashID"]; + // info is the specified detailed information for the slashing event. + OperatorSlashInfo info = 2; } // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest message QueryOperatorSlashInfoResponse{ - // AllSlashInfo the key is slashID, the value is the specified slash information - // It's okay to use a map here, because it won't be used to store state, only in - // the response to an RPC call - map all_slash_info = 1; + // all_slash_info is a list of the slash information for the specified operator and AVS + repeated OperatorSlashInfoByID all_slash_info = 1; + // pagination related response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; } // QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator @@ -80,7 +91,7 @@ message QueryOperatorConsKeyRequest { // QueryOperatorConsKeyResponse is the response for QueryOperatorConsKeyRequest. message QueryOperatorConsKeyResponse { // public_key is the consensus public key of the operator. - tendermint.crypto.PublicKey public_key = 1 [ (gogoproto.nullable) = false ]; + tendermint.crypto.PublicKey public_key = 1 [(gogoproto.nullable) = false]; // opting_out is a flag to indicate if the operator is opting out of consensus. bool opting_out = 2; } @@ -183,8 +194,8 @@ service Query { // QueryOperatorConsKeyForChainID queries the consensus public key for the operator rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns ( - QueryOperatorConsKeyResponse - ) { + QueryOperatorConsKeyResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_key/{operator_acc_addr}/{chain}" }; @@ -192,8 +203,8 @@ service Query { // QueryOperatorConsAddressForChainID queries the consensus address for the operator. rpc QueryOperatorConsAddressForChainID(QueryOperatorConsAddressRequest) returns ( - QueryOperatorConsAddressResponse - ) { + QueryOperatorConsAddressResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/operator_cons_addr/{operator_acc_addr}/{chain}" }; @@ -202,8 +213,8 @@ service Query { // QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys // for a specific chain ID rpc QueryAllOperatorConsKeysByChainID(QueryAllOperatorConsKeysByChainIDRequest) returns ( - QueryAllOperatorConsKeysByChainIDResponse - ) { + QueryAllOperatorConsKeysByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_keys/{chain}" }; @@ -227,8 +238,8 @@ service Query { // QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses // for a specific chain ID rpc QueryAllOperatorConsAddrsByChainID(QueryAllOperatorConsAddrsByChainIDRequest) returns ( - QueryAllOperatorConsAddrsByChainIDResponse - ) { + QueryAllOperatorConsAddrsByChainIDResponse + ) { option (google.api.http) = { get: "/exocore/operator/v1/all_operator_cons_addrs/{chain}" }; diff --git a/x/assets/types/keys.go b/x/assets/types/keys.go index f0acdbbab..99f0caafb 100644 --- a/x/assets/types/keys.go +++ b/x/assets/types/keys.go @@ -87,6 +87,12 @@ func GetJoinedStoreKey(keys ...string) []byte { return []byte(strings.Join(keys, "/")) } +func GetJoinedStoreKeyForPrefix(keys ...string) []byte { + ret := []byte(strings.Join(keys, "/")) + ret = append(ret, '/') + return ret +} + func ParseJoinedKey(key []byte) (keys []string, err error) { stringList := strings.Split(string(key), "/") return stringList, nil diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index c66a6efa3..47a46f347 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -3,6 +3,9 @@ package cli import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" + "golang.org/x/xerrors" + operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/cosmos/cosmos-sdk/client" @@ -42,6 +45,10 @@ func GetOperatorInfo() *cobra.Command { Long: "Get operator info", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -103,6 +110,10 @@ func GetOperatorConsKey() *cobra.Command { Long: "Get operator consensus key for the provided chain ID", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -174,6 +185,10 @@ func GetOperatorConsAddress() *cobra.Command { if err != nil { return err } + _, err = sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorConsAddressRequest{ @@ -237,6 +252,10 @@ func QueryOperatorUSDValue() *cobra.Command { Long: "Get the opted-in USD value for the operator", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err @@ -296,16 +315,25 @@ func QueryOperatorSlashInfo() *cobra.Command { Long: "Get the the slash information for the operator", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return xerrors.Errorf("invalid operator address,err:%s", err.Error()) + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } queryClient := operatortypes.NewQueryClient(clientCtx) req := &operatortypes.QueryOperatorSlashInfoRequest{ Details: &operatortypes.OperatorAVSAddressDetails{ OperatorAddr: args[0], AVSAddress: args[1], }, + Pagination: pageReq, } res, err := queryClient.QueryOperatorSlashInfo(context.Background(), req) if err != nil { diff --git a/x/operator/keeper/abci.go b/x/operator/keeper/abci.go index cde1a9a86..340bec56f 100644 --- a/x/operator/keeper/abci.go +++ b/x/operator/keeper/abci.go @@ -7,6 +7,7 @@ import ( operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" abci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" + "golang.org/x/xerrors" ) // CalculateUSDValueForOperator calculates the total and self usd value for the @@ -55,6 +56,9 @@ func (k *Keeper) CalculateUSDValueForOperator( decimal = assetInfo.AssetBasicInfo.Decimals ret.StakingAndWaitUnbonding = ret.StakingAndWaitUnbonding.Add(CalculateUSDValue(state.TotalAmount.Add(state.WaitUnbondingAmount), price.Value, decimal, price.Decimal)) } else { + if prices == nil { + return xerrors.Errorf("CalculateUSDValueForOperator, the input prices map is nil") + } price = prices[assetID] decimal = decimals[assetID] ret.Staking = ret.Staking.Add(CalculateUSDValue(state.TotalAmount, price.Value, decimal, price.Decimal)) diff --git a/x/operator/keeper/grpc_query.go b/x/operator/keeper/grpc_query.go index 309a9596e..e838bbf3e 100644 --- a/x/operator/keeper/grpc_query.go +++ b/x/operator/keeper/grpc_query.go @@ -4,6 +4,8 @@ import ( "context" "errors" + assetstype "github.com/ExocoreNetwork/exocore/x/assets/types" + operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" "github.com/cosmos/cosmos-sdk/store/prefix" @@ -175,7 +177,7 @@ func (k Keeper) QueryAllOperatorConsAddrsByChainID( func (k *Keeper) QueryOperatorUSDValue(ctx context.Context, req *operatortypes.QueryOperatorUSDValueRequest) (*operatortypes.DecValueField, error) { c := sdk.UnwrapSDKContext(ctx) - usdValue, err := k.GetOperatorUSDValue(c, req.Details.OperatorAddr, req.Details.AVSAddress) + usdValue, err := k.GetOperatorUSDValue(c, req.Details.AVSAddress, req.Details.OperatorAddr) if err != nil { return nil, err } @@ -195,13 +197,30 @@ func (k *Keeper) QueryAVSUSDValue(ctx context.Context, req *operatortypes.QueryA }, nil } -func (k *Keeper) QueryOperatorSlashInfo(ctx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { - c := sdk.UnwrapSDKContext(ctx) - slashInfo, err := k.AllOperatorSlashInfo(c, req.Details.OperatorAddr, req.Details.AVSAddress) +func (k *Keeper) QueryOperatorSlashInfo(goCtx context.Context, req *operatortypes.QueryOperatorSlashInfoRequest) (*operatortypes.QueryOperatorSlashInfoResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + res := make([]*operatortypes.OperatorSlashInfoByID, 0) + + slashPrefix := operatortypes.AppendMany(operatortypes.KeyPrefixOperatorSlashInfo, assetstype.GetJoinedStoreKeyForPrefix(req.Details.OperatorAddr, req.Details.AVSAddress)) + store := prefix.NewStore(ctx.KVStore(k.storeKey), slashPrefix) + pageRes, err := query.Paginate(store, req.Pagination, func(key []byte, value []byte) error { + ret := &operatortypes.OperatorSlashInfo{} + // don't use MustUnmarshal to not panic for queries + if err := ret.Unmarshal(value); err != nil { + return err + } + + res = append(res, &operatortypes.OperatorSlashInfoByID{ + SlashID: string(key), + Info: ret, + }) + return nil + }) if err != nil { return nil, err } return &operatortypes.QueryOperatorSlashInfoResponse{ - AllSlashInfo: slashInfo, + AllSlashInfo: res, + Pagination: pageRes, }, nil } diff --git a/x/operator/types/query.pb.go b/x/operator/types/query.pb.go index f9f26a090..1a2147592 100644 --- a/x/operator/types/query.pb.go +++ b/x/operator/types/query.pb.go @@ -234,7 +234,6 @@ func (m *OperatorAVSAddressDetails) GetAVSAddress() string { return "" } -// QueryOperatorConsKeyRequest is a request to obtain the consensus public key of the operator. // QueryOperatorUSDValueRequest is the request to obtain the USD value for operator. type QueryOperatorUSDValueRequest struct { // details is the operator and AVS address @@ -332,6 +331,8 @@ func (m *QueryAVSUSDValueRequest) GetAVSAddress() string { type QueryOperatorSlashInfoRequest struct { // details is the operator and AVS address Details *OperatorAVSAddressDetails `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` + // pagination related options. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryOperatorSlashInfoRequest) Reset() { *m = QueryOperatorSlashInfoRequest{} } @@ -374,22 +375,34 @@ func (m *QueryOperatorSlashInfoRequest) GetDetails() *OperatorAVSAddressDetails return nil } -type TestScalar struct { - OperatorAddr string `protobuf:"bytes,1,opt,name=operator_addr,json=operatorAddr,proto3" json:"operator_addr,omitempty"` +func (m *QueryOperatorSlashInfoRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// OperatorSlashInfoByID includes the slash information and the slashID +type OperatorSlashInfoByID struct { + // slash_id is stored as the key of the slash information, + // so it will be parsed and padding here. + SlashID string `protobuf:"bytes,1,opt,name=slash_id,json=slashId,proto3" json:"slash_id,omitempty"` + // info is the specified detailed information for the slashing event. + Info *OperatorSlashInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } -func (m *TestScalar) Reset() { *m = TestScalar{} } -func (m *TestScalar) String() string { return proto.CompactTextString(m) } -func (*TestScalar) ProtoMessage() {} -func (*TestScalar) Descriptor() ([]byte, []int) { +func (m *OperatorSlashInfoByID) Reset() { *m = OperatorSlashInfoByID{} } +func (m *OperatorSlashInfoByID) String() string { return proto.CompactTextString(m) } +func (*OperatorSlashInfoByID) ProtoMessage() {} +func (*OperatorSlashInfoByID) Descriptor() ([]byte, []int) { return fileDescriptor_f91e795a3cecbdbf, []int{7} } -func (m *TestScalar) XXX_Unmarshal(b []byte) error { +func (m *OperatorSlashInfoByID) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestScalar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *OperatorSlashInfoByID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestScalar.Marshal(b, m, deterministic) + return xxx_messageInfo_OperatorSlashInfoByID.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -399,31 +412,38 @@ func (m *TestScalar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TestScalar) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestScalar.Merge(m, src) +func (m *OperatorSlashInfoByID) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperatorSlashInfoByID.Merge(m, src) } -func (m *TestScalar) XXX_Size() int { +func (m *OperatorSlashInfoByID) XXX_Size() int { return m.Size() } -func (m *TestScalar) XXX_DiscardUnknown() { - xxx_messageInfo_TestScalar.DiscardUnknown(m) +func (m *OperatorSlashInfoByID) XXX_DiscardUnknown() { + xxx_messageInfo_OperatorSlashInfoByID.DiscardUnknown(m) } -var xxx_messageInfo_TestScalar proto.InternalMessageInfo +var xxx_messageInfo_OperatorSlashInfoByID proto.InternalMessageInfo -func (m *TestScalar) GetOperatorAddr() string { +func (m *OperatorSlashInfoByID) GetSlashID() string { if m != nil { - return m.OperatorAddr + return m.SlashID } return "" } +func (m *OperatorSlashInfoByID) GetInfo() *OperatorSlashInfo { + if m != nil { + return m.Info + } + return nil +} + // QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest type QueryOperatorSlashInfoResponse struct { - // AllSlashInfo the key is slashID, the value is the specified slash information - // It's okay to use a map here, because it won't be used to store state, only in - // the response to an RPC call - AllSlashInfo map[string]*OperatorSlashInfo `protobuf:"bytes,1,rep,name=all_slash_info,json=allSlashInfo,proto3" json:"all_slash_info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // all_slash_info is a list of the slash information for the specified operator and AVS + AllSlashInfo []*OperatorSlashInfoByID `protobuf:"bytes,1,rep,name=all_slash_info,json=allSlashInfo,proto3" json:"all_slash_info,omitempty"` + // pagination related response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryOperatorSlashInfoResponse) Reset() { *m = QueryOperatorSlashInfoResponse{} } @@ -459,13 +479,20 @@ func (m *QueryOperatorSlashInfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryOperatorSlashInfoResponse proto.InternalMessageInfo -func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() map[string]*OperatorSlashInfo { +func (m *QueryOperatorSlashInfoResponse) GetAllSlashInfo() []*OperatorSlashInfoByID { if m != nil { return m.AllSlashInfo } return nil } +func (m *QueryOperatorSlashInfoResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + // QueryOperatorConsKeyRequest is the request to obtain the consensus public key of the operator type QueryOperatorConsKeyRequest struct { // operator_acc_addr is the operator account address. @@ -1072,9 +1099,8 @@ func init() { proto.RegisterType((*QueryOperatorUSDValueRequest)(nil), "exocore.operator.v1.QueryOperatorUSDValueRequest") proto.RegisterType((*QueryAVSUSDValueRequest)(nil), "exocore.operator.v1.QueryAVSUSDValueRequest") proto.RegisterType((*QueryOperatorSlashInfoRequest)(nil), "exocore.operator.v1.QueryOperatorSlashInfoRequest") - proto.RegisterType((*TestScalar)(nil), "exocore.operator.v1.TestScalar") + proto.RegisterType((*OperatorSlashInfoByID)(nil), "exocore.operator.v1.OperatorSlashInfoByID") proto.RegisterType((*QueryOperatorSlashInfoResponse)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse") - proto.RegisterMapType((map[string]*OperatorSlashInfo)(nil), "exocore.operator.v1.QueryOperatorSlashInfoResponse.AllSlashInfoEntry") proto.RegisterType((*QueryOperatorConsKeyRequest)(nil), "exocore.operator.v1.QueryOperatorConsKeyRequest") proto.RegisterType((*QueryOperatorConsKeyResponse)(nil), "exocore.operator.v1.QueryOperatorConsKeyResponse") proto.RegisterType((*QueryOperatorConsAddressRequest)(nil), "exocore.operator.v1.QueryOperatorConsAddressRequest") @@ -1090,85 +1116,84 @@ func init() { func init() { proto.RegisterFile("exocore/operator/v1/query.proto", fileDescriptor_f91e795a3cecbdbf) } var fileDescriptor_f91e795a3cecbdbf = []byte{ - // 1234 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0x5d, 0x6f, 0x1b, 0x45, - 0x17, 0xc7, 0x33, 0xee, 0xd3, 0xa7, 0xf5, 0x71, 0x5b, 0x92, 0x49, 0x80, 0xc4, 0x4d, 0x9d, 0x74, - 0x05, 0x4d, 0x1a, 0x92, 0xdd, 0xc6, 0x49, 0x11, 0xea, 0x1b, 0x8a, 0xf3, 0x52, 0xda, 0x20, 0x1a, - 0xd6, 0x10, 0x09, 0x2e, 0xb0, 0xd6, 0xeb, 0xa9, 0xb3, 0xca, 0x66, 0xc7, 0xd9, 0x19, 0x9b, 0x58, - 0x55, 0x10, 0xe2, 0x0a, 0xc4, 0x0d, 0xa2, 0x97, 0x08, 0x2e, 0xf8, 0x0c, 0x15, 0x7c, 0x85, 0x5e, - 0x70, 0x11, 0xca, 0x0d, 0x57, 0x01, 0x25, 0x7c, 0x06, 0xae, 0xd1, 0xce, 0xce, 0xda, 0xde, 0xcd, - 0xfa, 0x25, 0x21, 0xe2, 0xce, 0xbb, 0x3b, 0x67, 0xce, 0xef, 0x7f, 0xce, 0x99, 0x73, 0x26, 0x81, - 0x31, 0xb2, 0x43, 0x4d, 0xea, 0x12, 0x8d, 0x56, 0x88, 0x6b, 0x70, 0xea, 0x6a, 0xb5, 0x59, 0x6d, - 0xbb, 0x4a, 0xdc, 0xba, 0x5a, 0x71, 0x29, 0xa7, 0x78, 0x50, 0x2e, 0x50, 0x83, 0x05, 0x6a, 0x6d, - 0x36, 0x3d, 0x65, 0x52, 0xb6, 0x45, 0x99, 0x56, 0x34, 0x18, 0xf1, 0x57, 0x6b, 0xb5, 0xd9, 0x22, - 0xe1, 0xc6, 0xac, 0x56, 0x31, 0xca, 0x96, 0x63, 0x70, 0x8b, 0x3a, 0xfe, 0x06, 0xe9, 0x11, 0x7f, - 0x6d, 0x41, 0x3c, 0x69, 0xfe, 0x83, 0xfc, 0x34, 0x1a, 0xe7, 0x9c, 0xef, 0xc8, 0xaf, 0x43, 0x65, - 0x5a, 0xa6, 0xbe, 0x95, 0xf7, 0x2b, 0xb0, 0x29, 0x53, 0x5a, 0xb6, 0x89, 0x66, 0x54,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, 0x4d, 0x5d, 0x99, 0x13, - 0xc8, 0x33, 0xf8, 0x8d, 0xee, 0xd1, 0x6c, 0xd2, 0x1d, 0x06, 0xc7, 0xb6, 0xe3, 0x98, 0xc4, 0xbd, - 0xd7, 0x65, 0xec, 0xac, 0x4f, 0xbf, 0x7d, 0x62, 0x7b, 0x29, 0xee, 0x8e, 0x10, 0xf7, 0x26, 0x9e, - 0xef, 0xb1, 0xb0, 0xc5, 0xf8, 0x0e, 0x2a, 0x3b, 0xf7, 0xee, 0xf3, 0x83, 0x0c, 0xda, 0x3b, 0xc8, - 0xa0, 0x3f, 0x0f, 0x32, 0xe8, 0x9b, 0xc3, 0x4c, 0xdf, 0xde, 0x61, 0xa6, 0xef, 0xf7, 0xc3, 0x4c, - 0xdf, 0xc7, 0xd9, 0xb2, 0xc5, 0x37, 0xaa, 0x45, 0xd5, 0xa4, 0x5b, 0xda, 0xb2, 0xbf, 0xf3, 0x7b, - 0x84, 0x7f, 0x4a, 0xdd, 0xcd, 0x86, 0xa3, 0x9d, 0xa6, 0x2b, 0x5e, 0xaf, 0x10, 0x56, 0xfc, 0xbf, - 0xf8, 0x37, 0xc6, 0xdc, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xc3, 0x9b, 0x9a, 0xb5, 0x11, - 0x00, 0x00, + // 1219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x41, 0x73, 0xdb, 0xc4, + 0x17, 0xcf, 0xa6, 0xed, 0x3f, 0xf1, 0x4b, 0xdb, 0x7f, 0xb3, 0x49, 0x21, 0x71, 0x53, 0x27, 0xd5, + 0x40, 0x93, 0x9a, 0x44, 0x22, 0x4e, 0xca, 0xa1, 0xa5, 0x30, 0x71, 0xdc, 0x94, 0x34, 0x0c, 0x0d, + 0xf2, 0x90, 0x19, 0x38, 0xe0, 0x91, 0xe5, 0xad, 0xa3, 0x89, 0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x27, 0x28, 0xd4, 0x06, + 0xcd, 0x08, 0x42, 0x9c, 0x25, 0x80, 0x5a, 0xbd, 0x6c, 0x1a, 0x7a, 0x69, 0x8b, 0x34, 0x44, 0x45, + 0x4d, 0xc8, 0xad, 0x53, 0x53, 0xf6, 0x4e, 0x4d, 0x79, 0x9d, 0x1b, 0xad, 0x91, 0x46, 0xfe, 0xe2, + 0xf3, 0xa3, 0xc9, 0x3e, 0x35, 0x55, 0xf3, 0x17, 0xf0, 0x4d, 0x00, 0x5a, 0x73, 0x0c, 0xab, 0x5a, + 0xa2, 0x75, 0x87, 0x87, 0x1f, 0x54, 0x53, 0xde, 0xca, 0x93, 0xba, 0x23, 0xe9, 0x30, 0x79, 0x0a, + 0x81, 0x5f, 0xfa, 0x3d, 0xe3, 0xf9, 0x21, 0x4c, 0xc5, 0x07, 0x11, 0x54, 0x6f, 0x40, 0x4a, 0xa7, + 0x16, 0x6b, 0xdf, 0x7d, 0x50, 0x17, 0x76, 0xdd, 0x48, 0x7c, 0x86, 0x60, 0x26, 0x7c, 0xe0, 0x0a, + 0x29, 0x59, 0xbe, 0xb1, 0xec, 0x62, 0x58, 0x2d, 0xf8, 0x74, 0x9a, 0x10, 0x51, 0x1b, 0xc4, 0x9e, + 0xb5, 0xdb, 0x2f, 0x08, 0xee, 0x24, 0x80, 0x22, 0x48, 0x6f, 0xb4, 0xcd, 0x02, 0xce, 0xde, 0x1d, + 0x7f, 0xa2, 0x01, 0x66, 0x3a, 0x36, 0x80, 0xd8, 0x73, 0x5d, 0x33, 0xec, 0xd6, 0xd4, 0xf0, 0x03, + 0xf5, 0xae, 0x05, 0xbe, 0x41, 0x30, 0x12, 0x11, 0xf2, 0x4c, 0x35, 0x71, 0x3f, 0x50, 0xc4, 0xfd, + 0xdd, 0x8b, 0x38, 0xbe, 0x7c, 0x2f, 0x84, 0x33, 0xff, 0x79, 0x8c, 0xdc, 0x7c, 0x78, 0xfe, 0xc7, + 0xa9, 0x3f, 0x44, 0x90, 0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3f, 0xce, 0xa0, 0xc3, 0xe3, + 0x0c, 0xfa, 0xeb, 0x38, 0x83, 0xbe, 0x3c, 0xc9, 0xf4, 0x1d, 0x9e, 0x64, 0xfa, 0xfe, 0x38, 0xc9, + 0xf4, 0x7d, 0x90, 0xab, 0x1a, 0xce, 0x66, 0xbd, 0x2c, 0xeb, 0x74, 0x5b, 0x79, 0xe8, 0xed, 0xfc, + 0x0e, 0x71, 0x3e, 0xa2, 0xf6, 0x56, 0x33, 0xd0, 0x5e, 0x2b, 0x94, 0xd3, 0xa8, 0x11, 0x56, 0xfe, + 0x1f, 0xff, 0x47, 0x64, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x4c, 0xa4, 0xb2, 0x00, + 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1792,6 +1817,18 @@ func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, _ = 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.Details != nil { { size, err := m.Details.MarshalToSizedBuffer(dAtA[:i]) @@ -1807,7 +1844,7 @@ func (m *QueryOperatorSlashInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *TestScalar) Marshal() (dAtA []byte, err error) { +func (m *OperatorSlashInfoByID) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1817,20 +1854,32 @@ func (m *TestScalar) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestScalar) MarshalTo(dAtA []byte) (int, error) { +func (m *OperatorSlashInfoByID) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestScalar) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *OperatorSlashInfoByID) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.OperatorAddr) > 0 { - i -= len(m.OperatorAddr) - copy(dAtA[i:], m.OperatorAddr) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperatorAddr))) + 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] = 0x12 + } + if len(m.SlashID) > 0 { + i -= len(m.SlashID) + copy(dAtA[i:], m.SlashID) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SlashID))) i-- dAtA[i] = 0xa } @@ -1857,28 +1906,28 @@ func (m *QueryOperatorSlashInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = 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.AllSlashInfo) > 0 { - for k := range m.AllSlashInfo { - v := m.AllSlashInfo[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + for iNdEx := len(m.AllSlashInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllSlashInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -2433,19 +2482,27 @@ func (m *QueryOperatorSlashInfoRequest) Size() (n int) { l = m.Details.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 *TestScalar) Size() (n int) { +func (m *OperatorSlashInfoByID) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.OperatorAddr) + l = len(m.SlashID) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -2456,18 +2513,15 @@ func (m *QueryOperatorSlashInfoResponse) Size() (n int) { var l int _ = l if len(m.AllSlashInfo) > 0 { - for k, v := range m.AllSlashInfo { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovQuery(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + l - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) + for _, e := range m.AllSlashInfo { + 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 } @@ -3286,6 +3340,42 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { 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.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3307,7 +3397,7 @@ func (m *QueryOperatorSlashInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *TestScalar) Unmarshal(dAtA []byte) error { +func (m *OperatorSlashInfoByID) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3330,15 +3420,15 @@ func (m *TestScalar) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: TestScalar: wiretype end group for non-group") + return fmt.Errorf("proto: OperatorSlashInfoByID: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: TestScalar: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: OperatorSlashInfoByID: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperatorAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SlashID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3366,7 +3456,43 @@ func (m *TestScalar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OperatorAddr = string(dAtA[iNdEx:postIndex]) + m.SlashID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 = &OperatorSlashInfo{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3447,105 +3573,46 @@ func (m *QueryOperatorSlashInfoResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AllSlashInfo == nil { - m.AllSlashInfo = make(map[string]*OperatorSlashInfo) - } - var mapkey string - var mapvalue *OperatorSlashInfo - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.AllSlashInfo = append(m.AllSlashInfo, &OperatorSlashInfoByID{}) + if err := m.AllSlashInfo[len(m.AllSlashInfo)-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 } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthQuery - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthQuery - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &OperatorSlashInfo{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break } } - m.AllSlashInfo[mapkey] = mapvalue + 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 From be3b8e5322a63dae4a2fdbb20d21b6e4be439f6c Mon Sep 17 00:00:00 2001 From: TimmyExogenous Date: Fri, 21 Jun 2024 17:58:22 +0800 Subject: [PATCH 13/13] Fix the naming error in the QueryOperatorSlashInfo command line --- x/operator/client/cli/query.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/operator/client/cli/query.go b/x/operator/client/cli/query.go index 47a46f347..1537c1696 100644 --- a/x/operator/client/cli/query.go +++ b/x/operator/client/cli/query.go @@ -310,7 +310,7 @@ func QueryAVSUSDValue() *cobra.Command { // QueryOperatorSlashInfo queries the slash information for the specified operator and AVS func QueryOperatorSlashInfo() *cobra.Command { cmd := &cobra.Command{ - Use: "QueryOperatorUSDValue operatorAddr avsAddr", + Use: "QueryOperatorSlashInfo operatorAddr avsAddr", Short: "Get the the slash information for the operator", Long: "Get the the slash information for the operator", Args: cobra.ExactArgs(2),