Skip to content

Commit

Permalink
fix proto
Browse files Browse the repository at this point in the history
Signed-off-by: Shrenuj Bansal <shrenuj@dydx.exchange>
  • Loading branch information
shrenujb committed Jul 31, 2024
1 parent 50d8a52 commit bf21e78
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import { Rpc } from "../../helpers";
import * as _m0 from "protobufjs/minimal";
import { MsgSetMarketsHardCap, MsgSetMarketsHardCapResponse } from "./tx";
import { MsgSetMarketsHardCap, MsgSetMarketsHardCapResponse, MsgCreateMarketPermissionless, MsgCreateMarketPermissionlessResponse } from "./tx";
/** Msg defines the Msg service. */

export interface Msg {
/** SetMarketsHardCap sets a hard cap on the number of markets listed */
setMarketsHardCap(request: MsgSetMarketsHardCap): Promise<MsgSetMarketsHardCapResponse>;
/** CreateMarketPermissionless creates a new market without going through x/gov */

createMarketPermissionless(request: MsgCreateMarketPermissionless): Promise<MsgCreateMarketPermissionlessResponse>;
}
export class MsgClientImpl implements Msg {
private readonly rpc: Rpc;

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

setMarketsHardCap(request: MsgSetMarketsHardCap): Promise<MsgSetMarketsHardCapResponse> {
Expand All @@ -21,4 +25,10 @@ export class MsgClientImpl implements Msg {
return promise.then(data => MsgSetMarketsHardCapResponse.decode(new _m0.Reader(data)));
}

createMarketPermissionless(request: MsgCreateMarketPermissionless): Promise<MsgCreateMarketPermissionlessResponse> {
const data = MsgCreateMarketPermissionless.encode(request).finish();
const promise = this.rpc.request("dydxprotocol.listing.Msg", "CreateMarketPermissionless", data);
return promise.then(data => MsgCreateMarketPermissionlessResponse.decode(new _m0.Reader(data)));
}

}
4 changes: 4 additions & 0 deletions proto/dydxprotocol/listing/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ service Msg {
// SetMarketsHardCap sets a hard cap on the number of markets listed
rpc SetMarketsHardCap(MsgSetMarketsHardCap)
returns (MsgSetMarketsHardCapResponse);

// CreateMarketPermissionless creates a new market without going through x/gov
rpc CreateMarketPermissionless(MsgCreateMarketPermissionless)
returns (MsgCreateMarketPermissionlessResponse);
}

// MsgSetMarketsHardCap is used to set a hard cap on the number of markets
Expand Down
3 changes: 3 additions & 0 deletions protocol/app/module/interface_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func NewInterfaceRegistry(addrPrefix string, valAddrPrefix string) (types.Interf
"dydxprotocol.vault.MsgDepositToVault": getLegacyMsgSignerFn(
[]string{"subaccount_id", "owner"},
),
"dydxprotocol.listing.MsgCreateMarketPermissionless": getLegacyMsgSignerFn(
[]string{"subaccount_id", "owner"},
),

// App injected messages have no signers.
"dydxprotocol.bridge.MsgAcknowledgeBridges": noSigners,
Expand Down
103 changes: 71 additions & 32 deletions protocol/x/listing/types/tx.pb.go

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

0 comments on commit bf21e78

Please sign in to comment.