Skip to content

Commit

Permalink
include operator params in vault params query
Browse files Browse the repository at this point in the history
  • Loading branch information
tqin7 committed Sep 17, 2024
1 parent 4fc6109 commit 9c1da25
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 60 deletions.
16 changes: 14 additions & 2 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/vault/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VaultType, VaultTypeSDKType, VaultId, VaultIdSDKType } from "./vault";
import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../cosmos/base/query/v1beta1/pagination";
import { Params, ParamsSDKType, QuotingParams, QuotingParamsSDKType, VaultParams, VaultParamsSDKType } from "./params";
import { Params, ParamsSDKType, QuotingParams, QuotingParamsSDKType, OperatorParams, OperatorParamsSDKType, VaultParams, VaultParamsSDKType } from "./params";
import { SubaccountId, SubaccountIdSDKType } from "../subaccounts/subaccount";
import { NumShares, NumSharesSDKType, OwnerShare, OwnerShareSDKType } from "./share";
import * as _m0 from "protobufjs/minimal";
Expand All @@ -19,6 +19,7 @@ export interface QueryParamsResponse {
/** @deprecated */
params?: Params;
defaultQuotingParams?: QuotingParams;
operatorParams?: OperatorParams;
}
/** QueryParamsResponse is a response type for the Params RPC method. */

Expand All @@ -28,6 +29,7 @@ export interface QueryParamsResponseSDKType {
/** @deprecated */
params?: ParamsSDKType;
default_quoting_params?: QuotingParamsSDKType;
operator_params?: OperatorParamsSDKType;
}
/** QueryVaultRequest is a request type for the Vault RPC method. */

Expand Down Expand Up @@ -189,7 +191,8 @@ export const QueryParamsRequest = {
function createBaseQueryParamsResponse(): QueryParamsResponse {
return {
params: undefined,
defaultQuotingParams: undefined
defaultQuotingParams: undefined,
operatorParams: undefined
};
}

Expand All @@ -203,6 +206,10 @@ export const QueryParamsResponse = {
QuotingParams.encode(message.defaultQuotingParams, writer.uint32(18).fork()).ldelim();
}

if (message.operatorParams !== undefined) {
OperatorParams.encode(message.operatorParams, writer.uint32(26).fork()).ldelim();
}

return writer;
},

Expand All @@ -223,6 +230,10 @@ export const QueryParamsResponse = {
message.defaultQuotingParams = QuotingParams.decode(reader, reader.uint32());
break;

case 3:
message.operatorParams = OperatorParams.decode(reader, reader.uint32());
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -236,6 +247,7 @@ export const QueryParamsResponse = {
const message = createBaseQueryParamsResponse();
message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
message.defaultQuotingParams = object.defaultQuotingParams !== undefined && object.defaultQuotingParams !== null ? QuotingParams.fromPartial(object.defaultQuotingParams) : undefined;
message.operatorParams = object.operatorParams !== undefined && object.operatorParams !== null ? OperatorParams.fromPartial(object.operatorParams) : undefined;
return message;
}

Expand Down
1 change: 1 addition & 0 deletions proto/dydxprotocol/vault/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ message QueryParamsResponse {
// Deprecated since v6.x in favor of default_quoting_params.
Params params = 1 [ (gogoproto.nullable) = false, deprecated = true ];
QuotingParams default_quoting_params = 2 [ (gogoproto.nullable) = false ];
OperatorParams operator_params = 3 [ (gogoproto.nullable) = false ];
}

// QueryVaultRequest is a request type for the Vault RPC method.
Expand Down
1 change: 1 addition & 0 deletions protocol/x/vault/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*t

return &types.QueryParamsResponse{
DefaultQuotingParams: k.GetDefaultQuotingParams(ctx),
OperatorParams: k.GetOperatorParams(ctx),
}, nil
}
170 changes: 112 additions & 58 deletions protocol/x/vault/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c1da25

Please sign in to comment.