-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scaffolding x/govplus module (#1011)
- Loading branch information
Showing
32 changed files
with
1,934 additions
and
181 deletions.
There are no files selected for viewing
341 changes: 175 additions & 166 deletions
341
indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Large diffs are not rendered by default.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
indexer/packages/v4-protos/src/codegen/dydxprotocol/govplus/genesis.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,42 @@ | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { DeepPartial } from "../../helpers"; | ||
/** GenesisState defines the govplus module's genesis state. */ | ||
|
||
export interface GenesisState {} | ||
/** GenesisState defines the govplus module's genesis state. */ | ||
|
||
export interface GenesisStateSDKType {} | ||
|
||
function createBaseGenesisState(): GenesisState { | ||
return {}; | ||
} | ||
|
||
export const GenesisState = { | ||
encode(_: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseGenesisState(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(_: DeepPartial<GenesisState>): GenesisState { | ||
const message = createBaseGenesisState(); | ||
return message; | ||
} | ||
|
||
}; |
18 changes: 18 additions & 0 deletions
18
indexer/packages/v4-protos/src/codegen/dydxprotocol/govplus/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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Rpc } from "../../helpers"; | ||
import { QueryClient, createProtobufRpcClient } from "@cosmjs/stargate"; | ||
/** Query defines the gRPC querier service. */ | ||
|
||
export interface Query {} | ||
export class QueryClientImpl implements Query { | ||
private readonly rpc: Rpc; | ||
|
||
constructor(rpc: Rpc) { | ||
this.rpc = rpc; | ||
} | ||
|
||
} | ||
export const createRpcQueryExtension = (base: QueryClient) => { | ||
const rpc = createProtobufRpcClient(base); | ||
const queryService = new QueryClientImpl(rpc); | ||
return {}; | ||
}; |
1 change: 1 addition & 0 deletions
1
indexer/packages/v4-protos/src/codegen/dydxprotocol/govplus/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export {} |
1 change: 1 addition & 0 deletions
1
indexer/packages/v4-protos/src/codegen/dydxprotocol/govplus/tx.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 @@ | ||
export {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as _95 from "./gogo"; | ||
export const gogoproto = { ..._95 | ||
import * as _98 from "./gogo"; | ||
export const gogoproto = { ..._98 | ||
}; |
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,16 +1,16 @@ | ||
import * as _96 from "./api/annotations"; | ||
import * as _97 from "./api/http"; | ||
import * as _98 from "./protobuf/descriptor"; | ||
import * as _99 from "./protobuf/duration"; | ||
import * as _100 from "./protobuf/timestamp"; | ||
import * as _101 from "./protobuf/any"; | ||
import * as _99 from "./api/annotations"; | ||
import * as _100 from "./api/http"; | ||
import * as _101 from "./protobuf/descriptor"; | ||
import * as _102 from "./protobuf/duration"; | ||
import * as _103 from "./protobuf/timestamp"; | ||
import * as _104 from "./protobuf/any"; | ||
export namespace google { | ||
export const api = { ..._96, | ||
..._97 | ||
export const api = { ..._99, | ||
..._100 | ||
}; | ||
export const protobuf = { ..._98, | ||
..._99, | ||
..._100, | ||
..._101 | ||
export const protobuf = { ..._101, | ||
..._102, | ||
..._103, | ||
..._104 | ||
}; | ||
} |
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,7 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.govplus; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; | ||
|
||
// GenesisState defines the govplus module's genesis state. | ||
message GenesisState {} |
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,7 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.govplus; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; | ||
|
||
// Query defines the gRPC querier service. | ||
service Query {} |
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,7 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.govplus; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/govplus/types"; | ||
|
||
// Msg defines the Msg service. | ||
service Msg {} |
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
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 |
---|---|---|
|
@@ -278,6 +278,7 @@ | |
}, | ||
"constitution": "" | ||
}, | ||
"govplus": {}, | ||
"ibc": { | ||
"client_genesis": { | ||
"clients": [], | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/dydxprotocol/v4-chain/protocol/x/govplus/types" | ||
) | ||
|
||
// GetQueryCmd returns the cli query commands for this module | ||
func GetQueryCmd(queryRoute string) *cobra.Command { | ||
// Group govplus queries under a subcommand | ||
cmd := &cobra.Command{ | ||
Use: types.ModuleName, | ||
Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), | ||
DisableFlagParsing: true, | ||
SuggestionsMinimumDistance: 2, | ||
RunE: client.ValidateCmd, | ||
} | ||
|
||
return cmd | ||
} |
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,28 @@ | ||
package cli | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/dydxprotocol/v4-chain/protocol/x/ratelimit/types" | ||
) | ||
|
||
var ( | ||
DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) | ||
) | ||
|
||
// GetTxCmd returns the transaction commands for this module | ||
func GetTxCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: types.ModuleName, | ||
Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), | ||
DisableFlagParsing: true, | ||
SuggestionsMinimumDistance: 2, | ||
RunE: client.ValidateCmd, | ||
} | ||
|
||
return cmd | ||
} |
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,15 @@ | ||
package govplus | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/dydxprotocol/v4-chain/protocol/x/govplus/keeper" | ||
"github.com/dydxprotocol/v4-chain/protocol/x/govplus/types" | ||
) | ||
|
||
// InitGenesis initializes the govplus module's state from a provided genesis state. | ||
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) {} | ||
|
||
// ExportGenesis returns the govplus module's exported genesis. | ||
func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { | ||
return &types.GenesisState{} | ||
} |
Oops, something went wrong.