-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TRA-354] Add a hard cap to the number of markets listed for PML #1644
Merged
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4392a22
Add switch to turn PML on/off via governance
shrenujb 8396aa4
fix lint
shrenujb d00953c
fix more linting and some tests
shrenujb a282765
indexer gen
shrenujb 7116142
indexer proto gen maybe
shrenujb 399b82d
ugh more lint shit
shrenujb a28bc95
addess comments - add another test
shrenujb 9b1859d
Merge branch 'main' into tra353
shrenujb 444e687
Merge branch 'main' into tra353
shrenujb cd6e1cb
change on/off switch to using hard cap
shrenujb dc60411
Merge branch 'main' into tra353
shrenujb 8b74fa5
proto lint
shrenujb 5ae58c9
address comments
shrenujb 95e1288
address last nit ... hopefully
shrenujb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 19 additions & 2 deletions
21
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/query.rpc.Query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
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 { | ||
/** Queries if permissionless listings are enabled */ | ||
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); | ||
} | ||
|
||
}; | ||
}; |
100 changes: 99 additions & 1 deletion
100
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/query.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,99 @@ | ||
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 { | ||
/** Response type indicating if permissionless listings are enabled */ | ||
enabled: boolean; | ||
} | ||
/** Response type indicating if permissionless listings are enabled */ | ||
|
||
export interface QueryPermissionlessMarketListingStatusResponseSDKType { | ||
/** Response type indicating if permissionless listings are enabled */ | ||
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; | ||
} | ||
|
||
}; |
27 changes: 27 additions & 0 deletions
27
indexer/packages/v4-protos/src/codegen/dydxprotocol/listing/tx.rpc.msg.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Rpc } from "../../helpers"; | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { MsgEnablePermissionlessMarketListing, MsgEnablePermissionlessMarketListingResponse } from "./tx"; | ||
/** Msg defines the Msg service. */ | ||
|
||
export interface Msg { | ||
/** | ||
* EnablePermissionlessMarketListing enables/disables permissionless market | ||
* listing | ||
*/ | ||
enablePermissionlessMarketListing(request: MsgEnablePermissionlessMarketListing): Promise<MsgEnablePermissionlessMarketListingResponse>; | ||
} | ||
export class MsgClientImpl implements Msg { | ||
private readonly rpc: Rpc; | ||
|
||
constructor(rpc: Rpc) { | ||
this.rpc = rpc; | ||
this.enablePermissionlessMarketListing = this.enablePermissionlessMarketListing.bind(this); | ||
} | ||
|
||
enablePermissionlessMarketListing(request: MsgEnablePermissionlessMarketListing): Promise<MsgEnablePermissionlessMarketListingResponse> { | ||
const data = MsgEnablePermissionlessMarketListing.encode(request).finish(); | ||
const promise = this.rpc.request("dydxprotocol.listing.Msg", "EnablePermissionlessMarketListing", data); | ||
return promise.then(data => MsgEnablePermissionlessMarketListingResponse.decode(new _m0.Reader(data))); | ||
} | ||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling for the RPC request to manage potential failures gracefully.