Skip to content

Commit

Permalink
Add switch to turn PML on/off via governance
Browse files Browse the repository at this point in the history
Signed-off-by: Shrenuj Bansal <[email protected]>
  • Loading branch information
shrenujb committed Jun 6, 2024
1 parent e673b9d commit 4392a22
Show file tree
Hide file tree
Showing 30 changed files with 1,727 additions and 483 deletions.
48 changes: 25 additions & 23 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,18 @@ import * as _150 from "./clob/tx.rpc.msg";
import * as _151 from "./delaymsg/tx.rpc.msg";
import * as _152 from "./feetiers/tx.rpc.msg";
import * as _153 from "./govplus/tx.rpc.msg";
import * as _154 from "./perpetuals/tx.rpc.msg";
import * as _155 from "./prices/tx.rpc.msg";
import * as _156 from "./ratelimit/tx.rpc.msg";
import * as _157 from "./rewards/tx.rpc.msg";
import * as _158 from "./sending/tx.rpc.msg";
import * as _159 from "./stats/tx.rpc.msg";
import * as _160 from "./vault/tx.rpc.msg";
import * as _161 from "./vest/tx.rpc.msg";
import * as _162 from "./lcd";
import * as _163 from "./rpc.query";
import * as _164 from "./rpc.tx";
import * as _154 from "./listing/tx.rpc.msg";
import * as _155 from "./perpetuals/tx.rpc.msg";
import * as _156 from "./prices/tx.rpc.msg";
import * as _157 from "./ratelimit/tx.rpc.msg";
import * as _158 from "./rewards/tx.rpc.msg";
import * as _159 from "./sending/tx.rpc.msg";
import * as _160 from "./stats/tx.rpc.msg";
import * as _161 from "./vault/tx.rpc.msg";
import * as _162 from "./vest/tx.rpc.msg";
import * as _163 from "./lcd";
import * as _164 from "./rpc.query";
import * as _165 from "./rpc.tx";
export namespace dydxprotocol {
export const assets = { ..._5,
..._6,
Expand Down Expand Up @@ -256,7 +257,8 @@ export namespace dydxprotocol {
export const listing = { ..._61,
..._62,
..._63,
..._138
..._138,
..._154
};
export const perpetuals = { ..._64,
..._65,
Expand All @@ -265,7 +267,7 @@ export namespace dydxprotocol {
..._68,
..._122,
..._139,
..._154
..._155
};
export const prices = { ..._69,
..._70,
Expand All @@ -274,7 +276,7 @@ export namespace dydxprotocol {
..._73,
..._123,
..._140,
..._155
..._156
};
export const ratelimit = { ..._74,
..._75,
Expand All @@ -284,7 +286,7 @@ export namespace dydxprotocol {
..._79,
..._124,
..._141,
..._156
..._157
};
export const rewards = { ..._80,
..._81,
Expand All @@ -293,14 +295,14 @@ export namespace dydxprotocol {
..._84,
..._125,
..._142,
..._157
..._158
};
export const sending = { ..._85,
..._86,
..._87,
..._88,
..._143,
..._158
..._159
};
export const stats = { ..._89,
..._90,
Expand All @@ -309,7 +311,7 @@ export namespace dydxprotocol {
..._93,
..._126,
..._144,
..._159
..._160
};
export const subaccounts = { ..._94,
..._95,
Expand All @@ -326,18 +328,18 @@ export namespace dydxprotocol {
..._103,
..._128,
..._146,
..._160
..._161
};
export const vest = { ..._104,
..._105,
..._106,
..._107,
..._129,
..._147,
..._161
..._162
};
export const ClientFactory = { ..._162,
..._163,
..._164
export const ClientFactory = { ..._163,
..._164,
..._165
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@ import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** GenesisState defines `x/listing`'s genesis state. */

export interface GenesisState {}
export interface GenesisState {
/** permissionless_listing_enabled defines whether permissionless listing is enabled. */
permissionlessListingEnabled: boolean;
}
/** GenesisState defines `x/listing`'s genesis state. */

export interface GenesisStateSDKType {}
export interface GenesisStateSDKType {
/** permissionless_listing_enabled defines whether permissionless listing is enabled. */
permissionless_listing_enabled: boolean;
}

function createBaseGenesisState(): GenesisState {
return {};
return {
permissionlessListingEnabled: false
};
}

export const GenesisState = {
encode(_: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.permissionlessListingEnabled === true) {
writer.uint32(8).bool(message.permissionlessListingEnabled);
}

return writer;
},

Expand All @@ -25,6 +37,10 @@ export const GenesisState = {
const tag = reader.uint32();

switch (tag >>> 3) {
case 1:
message.permissionlessListingEnabled = reader.bool();
break;

default:
reader.skipType(tag & 7);
break;
Expand All @@ -34,8 +50,9 @@ export const GenesisState = {
return message;
},

fromPartial(_: DeepPartial<GenesisState>): GenesisState {
fromPartial(object: DeepPartial<GenesisState>): GenesisState {
const message = createBaseGenesisState();
message.permissionlessListingEnabled = object.permissionlessListingEnabled ?? false;
return message;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryPermissionlessMarketListingStatus, QueryPermissionlessMarketListingStatusResponse } from "./query";
/** Query defines the gRPC querier service. */

export interface Query {}
export interface Query {
permissionlessMarketListingStatus(request?: QueryPermissionlessMarketListingStatus): Promise<QueryPermissionlessMarketListingStatusResponse>;
}
export class QueryClientImpl implements Query {
private readonly rpc: Rpc;

constructor(rpc: Rpc) {
this.rpc = rpc;
this.permissionlessMarketListingStatus = this.permissionlessMarketListingStatus.bind(this);
}

permissionlessMarketListingStatus(request: QueryPermissionlessMarketListingStatus = {}): Promise<QueryPermissionlessMarketListingStatusResponse> {
const data = QueryPermissionlessMarketListingStatus.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.listing.Query", "PermissionlessMarketListingStatus", data);
return promise.then(data => QueryPermissionlessMarketListingStatusResponse.decode(new _m0.Reader(data)));
}

}
export const createRpcQueryExtension = (base: QueryClient) => {
const rpc = createProtobufRpcClient(base);
const queryService = new QueryClientImpl(rpc);
return {};
return {
permissionlessMarketListingStatus(request?: QueryPermissionlessMarketListingStatus): Promise<QueryPermissionlessMarketListingStatusResponse> {
return queryService.permissionlessMarketListingStatus(request);
}

};
};
Original file line number Diff line number Diff line change
@@ -1 +1,97 @@
export {}
import * as _m0 from "protobufjs/minimal";
import { DeepPartial } from "../../helpers";
/** Queries if permissionless listings are enabled */

export interface QueryPermissionlessMarketListingStatus {}
/** Queries if permissionless listings are enabled */

export interface QueryPermissionlessMarketListingStatusSDKType {}
/** Response type indicating if permissionless listings are enabled */

export interface QueryPermissionlessMarketListingStatusResponse {
enabled: boolean;
}
/** Response type indicating if permissionless listings are enabled */

export interface QueryPermissionlessMarketListingStatusResponseSDKType {
enabled: boolean;
}

function createBaseQueryPermissionlessMarketListingStatus(): QueryPermissionlessMarketListingStatus {
return {};
}

export const QueryPermissionlessMarketListingStatus = {
encode(_: QueryPermissionlessMarketListingStatus, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): QueryPermissionlessMarketListingStatus {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryPermissionlessMarketListingStatus();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(_: DeepPartial<QueryPermissionlessMarketListingStatus>): QueryPermissionlessMarketListingStatus {
const message = createBaseQueryPermissionlessMarketListingStatus();
return message;
}

};

function createBaseQueryPermissionlessMarketListingStatusResponse(): QueryPermissionlessMarketListingStatusResponse {
return {
enabled: false
};
}

export const QueryPermissionlessMarketListingStatusResponse = {
encode(message: QueryPermissionlessMarketListingStatusResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
if (message.enabled === true) {
writer.uint32(8).bool(message.enabled);
}

return writer;
},

decode(input: _m0.Reader | Uint8Array, length?: number): QueryPermissionlessMarketListingStatusResponse {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseQueryPermissionlessMarketListingStatusResponse();

while (reader.pos < end) {
const tag = reader.uint32();

switch (tag >>> 3) {
case 1:
message.enabled = reader.bool();
break;

default:
reader.skipType(tag & 7);
break;
}
}

return message;
},

fromPartial(object: DeepPartial<QueryPermissionlessMarketListingStatusResponse>): QueryPermissionlessMarketListingStatusResponse {
const message = createBaseQueryPermissionlessMarketListingStatusResponse();
message.enabled = object.enabled ?? false;
return message;
}

};
Loading

0 comments on commit 4392a22

Please sign in to comment.