Skip to content
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

feat: add queries for tss funds migrator info #2372

Merged
merged 6 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* [2319](https://github.com/zeta-chain/node/pull/2319) - use `CheckAuthorization` function in all messages
* [2325](https://github.com/zeta-chain/node/pull/2325) - revert telemetry server changes
* [2339](https://github.com/zeta-chain/node/pull/2339) - add binaries related question to syncing issue form
* [2372](https://github.com/zeta-chain/node/pull/2372) - add queries for tss fund migration info

### Refactor

Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/gen_pre_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var GenPrePramsCmd = &cobra.Command{
Use: "gen-pre-params <path>",
Short: "Generate pre parameters for TSS",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, args []string) error {
startTime := time.Now()
preParams, err := keygen.GeneratePreParams(time.Second * 300)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions docs/cli/zetacored/zetacored_query_observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ zetacored query observer [flags]
* [zetacored query observer list-node-account](zetacored_query_observer_list-node-account.md) - list all NodeAccount
* [zetacored query observer list-observer-set](zetacored_query_observer_list-observer-set.md) - Query observer set
* [zetacored query observer list-pending-nonces](zetacored_query_observer_list-pending-nonces.md) - shows a chainNonces
* [zetacored query observer list-tss-funds-migrator](zetacored_query_observer_list-tss-funds-migrator.md) - list all tss funds migrators
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
* [zetacored query observer list-tss-history](zetacored_query_observer_list-tss-history.md) - show historical list of TSS
* [zetacored query observer show-ballot](zetacored_query_observer_show-ballot.md) - Query BallotByIdentifier
* [zetacored query observer show-blame](zetacored_query_observer_show-blame.md) - Query BlameByIdentifier
Expand All @@ -46,4 +47,5 @@ zetacored query observer [flags]
* [zetacored query observer show-node-account](zetacored_query_observer_show-node-account.md) - shows a NodeAccount
* [zetacored query observer show-observer-count](zetacored_query_observer_show-observer-count.md) - Query show-observer-count
* [zetacored query observer show-tss](zetacored_query_observer_show-tss.md) - shows a TSS
* [zetacored query observer show-tss-funds-migrator](zetacored_query_observer_show-tss-funds-migrator.md) - show the tss funds migrator for a chain

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# query observer list-tss-funds-migrator

list all tss funds migrators

```
zetacored query observer list-tss-funds-migrator [flags]
```

### Options
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

```
--count-total count total number of records in list-tss-funds-migrator to query for
--grpc-addr string the gRPC endpoint to use for this chain
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS
--height int Use a specific height to query state at (this can error if the node is pruning state)
-h, --help help for list-tss-funds-migrator
--limit uint pagination limit of list-tss-funds-migrator to query for (default 100)
--node string [host]:[port] to Tendermint RPC interface for this chain
--offset uint pagination offset of list-tss-funds-migrator to query for
-o, --output string Output format (text|json)
--page uint pagination page of list-tss-funds-migrator to query for. This sets offset to a multiple of limit (default 1)
--page-key string pagination page-key of list-tss-funds-migrator to query for
--reverse results are sorted in descending order
```

### Options inherited from parent commands

```
--chain-id string The network chain ID
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--log_no_color Disable colored logs
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# query observer show-tss-funds-migrator

show the tss funds migrator for a chain

```
zetacored query observer show-tss-funds-migrator [chain-id] [flags]
```

### Options
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

```
--count-total count total number of records in show-tss-funds-migrator [chain-id] to query for
--grpc-addr string the gRPC endpoint to use for this chain
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS
--height int Use a specific height to query state at (this can error if the node is pruning state)
-h, --help help for show-tss-funds-migrator
--limit uint pagination limit of show-tss-funds-migrator [chain-id] to query for (default 100)
--node string [host]:[port] to Tendermint RPC interface for this chain
--offset uint pagination offset of show-tss-funds-migrator [chain-id] to query for
-o, --output string Output format (text|json)
--page uint pagination page of show-tss-funds-migrator [chain-id] to query for. This sets offset to a multiple of limit (default 1)
--page-key string pagination page-key of show-tss-funds-migrator [chain-id] to query for
--reverse results are sorted in descending order
```

### Options inherited from parent commands

```
--chain-id string The network chain ID
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--log_no_color Disable colored logs
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module

57 changes: 57 additions & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30170,6 +30170,21 @@ paths:
type: boolean
tags:
- Query
/zeta-chain/observer/get_all_tss_fund_migrators:
get:
summary: Queries all TssFundMigratorInfo
operationId: Query_TssFundsMigratorInfoAll
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/observerQueryTssFundsMigratorInfoAllResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/observer/get_chain_params:
get:
summary: Queries a list of GetChainParams items.
Expand Down Expand Up @@ -30252,6 +30267,27 @@ paths:
format: int64
tags:
- Query
/zeta-chain/observer/get_tss_fund_migrator:
get:
summary: Queries the TssFundMigratorInfo for a specific chain
operationId: Query_TssFundsMigratorInfo
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/observerQueryTssFundsMigratorInfoResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
parameters:
- name: chain_id
in: query
required: false
type: string
format: int64
tags:
- Query
/zeta-chain/observer/has_voted/{ballot_identifier}/{voter_address}:
get:
summary: Query if a voter has voted for a ballot
Expand Down Expand Up @@ -58111,6 +58147,19 @@ definitions:
items:
type: object
$ref: '#/definitions/chainsChain'
observerQueryTssFundsMigratorInfoAllResponse:
type: object
properties:
tss_funds_migrators:
type: array
items:
type: object
$ref: '#/definitions/observerTssFundMigratorInfo'
observerQueryTssFundsMigratorInfoResponse:
type: object
properties:
tss_funds_migrator:
$ref: '#/definitions/observerTssFundMigratorInfo'
observerQueryTssHistoryResponse:
type: object
properties:
Expand Down Expand Up @@ -58140,6 +58189,14 @@ definitions:
keyGenZetaHeight:
type: string
format: int64
observerTssFundMigratorInfo:
type: object
properties:
chain_id:
type: string
format: int64
migration_cctx_index:
type: string
observerVoteType:
type: string
enum:
Expand Down
25 changes: 25 additions & 0 deletions proto/zetachain/zetacore/observer/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "zetachain/zetacore/observer/pending_nonces.proto";
import "zetachain/zetacore/observer/tss.proto";
import "zetachain/zetacore/pkg/chains/chains.proto";
import "zetachain/zetacore/pkg/proofs/proofs.proto";
import "zetachain/zetacore/observer/tss_funds_migrator.proto";

option go_package = "github.com/zeta-chain/zetacore/x/observer/types";

Expand Down Expand Up @@ -150,6 +151,30 @@ service Query {
returns (QueryAllChainNoncesResponse) {
option (google.api.http).get = "/zeta-chain/observer/chainNonces";
}
// Queries the TssFundMigratorInfo for a specific chain
rpc TssFundsMigratorInfo(QueryTssFundsMigratorInfoRequest)
returns (QueryTssFundsMigratorInfoResponse) {
option (google.api.http).get = "/zeta-chain/observer/get_tss_fund_migrator";
}

// Queries all TssFundMigratorInfo
rpc TssFundsMigratorInfoAll(QueryTssFundsMigratorInfoAllRequest)
returns (QueryTssFundsMigratorInfoAllResponse) {
option (google.api.http).get =
"/zeta-chain/observer/get_all_tss_fund_migrators";
}
}

message QueryTssFundsMigratorInfoAllRequest {}

message QueryTssFundsMigratorInfoAllResponse {
repeated TssFundMigratorInfo tss_funds_migrators = 1
[ (gogoproto.nullable) = false ];
}

message QueryTssFundsMigratorInfoRequest { int64 chain_id = 1; }
message QueryTssFundsMigratorInfoResponse {
TssFundMigratorInfo tss_funds_migrator = 1 [ (gogoproto.nullable) = false ];
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
lumtis marked this conversation as resolved.
Show resolved Hide resolved
}

message QueryGetChainNoncesRequest { string index = 1; }
Expand Down
92 changes: 92 additions & 0 deletions typescript/zetachain/zetacore/observer/query_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { TssFundMigratorInfo } from "./tss_funds_migrator_pb.js";
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved
import type { ChainNonces } from "./chain_nonces_pb.js";
import type { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination_pb.js";
import type { PendingNonces } from "./pending_nonces_pb.js";
Expand All @@ -18,6 +19,97 @@ import type { CrosschainFlags } from "./crosschain_flags_pb.js";
import type { Keygen } from "./keygen_pb.js";
import type { Blame } from "./blame_pb.js";

/**
* @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllRequest
*/
export declare class QueryTssFundsMigratorInfoAllRequest extends Message<QueryTssFundsMigratorInfoAllRequest> {
constructor(data?: PartialMessage<QueryTssFundsMigratorInfoAllRequest>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllRequest";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryTssFundsMigratorInfoAllRequest;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoAllRequest;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoAllRequest;

static equals(a: QueryTssFundsMigratorInfoAllRequest | PlainMessage<QueryTssFundsMigratorInfoAllRequest> | undefined, b: QueryTssFundsMigratorInfoAllRequest | PlainMessage<QueryTssFundsMigratorInfoAllRequest> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllResponse
*/
export declare class QueryTssFundsMigratorInfoAllResponse extends Message<QueryTssFundsMigratorInfoAllResponse> {
/**
* @generated from field: repeated zetachain.zetacore.observer.TssFundMigratorInfo tss_funds_migrators = 1;
*/
tssFundsMigrators: TssFundMigratorInfo[];

constructor(data?: PartialMessage<QueryTssFundsMigratorInfoAllResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryTssFundsMigratorInfoAllResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoAllResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoAllResponse;

static equals(a: QueryTssFundsMigratorInfoAllResponse | PlainMessage<QueryTssFundsMigratorInfoAllResponse> | undefined, b: QueryTssFundsMigratorInfoAllResponse | PlainMessage<QueryTssFundsMigratorInfoAllResponse> | undefined): boolean;
}
kingpinXD marked this conversation as resolved.
Show resolved Hide resolved

/**
* @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoRequest
*/
export declare class QueryTssFundsMigratorInfoRequest extends Message<QueryTssFundsMigratorInfoRequest> {
/**
* @generated from field: int64 chain_id = 1;
*/
chainId: bigint;

constructor(data?: PartialMessage<QueryTssFundsMigratorInfoRequest>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoRequest";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryTssFundsMigratorInfoRequest;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoRequest;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoRequest;

static equals(a: QueryTssFundsMigratorInfoRequest | PlainMessage<QueryTssFundsMigratorInfoRequest> | undefined, b: QueryTssFundsMigratorInfoRequest | PlainMessage<QueryTssFundsMigratorInfoRequest> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoResponse
*/
export declare class QueryTssFundsMigratorInfoResponse extends Message<QueryTssFundsMigratorInfoResponse> {
/**
* @generated from field: zetachain.zetacore.observer.TssFundMigratorInfo tss_funds_migrator = 1;
*/
tssFundsMigrator?: TssFundMigratorInfo;

constructor(data?: PartialMessage<QueryTssFundsMigratorInfoResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): QueryTssFundsMigratorInfoResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): QueryTssFundsMigratorInfoResponse;

static equals(a: QueryTssFundsMigratorInfoResponse | PlainMessage<QueryTssFundsMigratorInfoResponse> | undefined, b: QueryTssFundsMigratorInfoResponse | PlainMessage<QueryTssFundsMigratorInfoResponse> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.QueryGetChainNoncesRequest
*/
Expand Down
2 changes: 2 additions & 0 deletions x/observer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ func GetQueryCmd(_ string) *cobra.Command {
CmdListChainNonces(),
CmdShowChainNonces(),
CmdListPendingNonces(),
CmdGetAllTssFundsMigrator(),
CmdGetTssFundsMigrator(),
lumtis marked this conversation as resolved.
Show resolved Hide resolved
)

return cmd
Expand Down
Loading
Loading