diff --git a/changelog.md b/changelog.md index 09b9f9e887..083aa3d8fe 100644 --- a/changelog.md +++ b/changelog.md @@ -29,6 +29,7 @@ * [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 * [2366](https://github.com/zeta-chain/node/pull/2366) - add migration script for adding authorizations table +* [2372](https://github.com/zeta-chain/node/pull/2372) - add queries for tss fund migration info ### Refactor @@ -98,6 +99,10 @@ * [2335](https://github.com/zeta-chain/node/pull/2335) - ci: updated the artillery report to publish to artillery cloud * [2377](https://github.com/zeta-chain/node/pull/2377) - ci: adjusted sast-linters.yml to not scan itself, nor alert on removal of nosec. +### Documentation + +* [2321](https://github.com/zeta-chain/node/pull/2321) - improve documentation for ZetaClient functions and packages + ## v17.0.0 ### Fixes diff --git a/docs/cli/zetacored/zetacored_query_observer.md b/docs/cli/zetacored/zetacored_query_observer.md index 42d0ffe777..e19f4cbecb 100644 --- a/docs/cli/zetacored/zetacored_query_observer.md +++ b/docs/cli/zetacored/zetacored_query_observer.md @@ -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 * [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 @@ -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 diff --git a/docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md b/docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md new file mode 100644 index 0000000000..0eca411dae --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-tss-funds-migrator.md @@ -0,0 +1,40 @@ +# query observer list-tss-funds-migrator + +list all tss funds migrators + +``` +zetacored query observer list-tss-funds-migrator [flags] +``` + +### Options + +``` + --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 + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md b/docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md new file mode 100644 index 0000000000..c307953301 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-tss-funds-migrator.md @@ -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 + +``` + --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 + diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index dc72d0bf6b..987feb13d4 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -30252,6 +30252,42 @@ paths: format: int64 tags: - Query + /zeta-chain/observer/getAllTssFundsMigrators: + 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/getTssFundsMigrator: + 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 @@ -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: @@ -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: diff --git a/proto/zetachain/zetacore/observer/query.proto b/proto/zetachain/zetacore/observer/query.proto index ef06616b2e..799bc1efb9 100644 --- a/proto/zetachain/zetacore/observer/query.proto +++ b/proto/zetachain/zetacore/observer/query.proto @@ -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"; @@ -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/getTssFundsMigrator"; + } + + // Queries all TssFundMigratorInfo + rpc TssFundsMigratorInfoAll(QueryTssFundsMigratorInfoAllRequest) + returns (QueryTssFundsMigratorInfoAllResponse) { + option (google.api.http).get = + "/zeta-chain/observer/getAllTssFundsMigrators"; + } +} + +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 ]; } message QueryGetChainNoncesRequest { string index = 1; } diff --git a/typescript/zetachain/zetacore/observer/query_pb.d.ts b/typescript/zetachain/zetacore/observer/query_pb.d.ts index 5c4f8c71d0..41873827e5 100644 --- a/typescript/zetachain/zetacore/observer/query_pb.d.ts +++ b/typescript/zetachain/zetacore/observer/query_pb.d.ts @@ -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"; 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"; @@ -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 { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssFundsMigratorInfoAllRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssFundsMigratorInfoAllRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssFundsMigratorInfoAllRequest; + + static equals(a: QueryTssFundsMigratorInfoAllRequest | PlainMessage | undefined, b: QueryTssFundsMigratorInfoAllRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllResponse + */ +export declare class QueryTssFundsMigratorInfoAllResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.TssFundMigratorInfo tss_funds_migrators = 1; + */ + tssFundsMigrators: TssFundMigratorInfo[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssFundsMigratorInfoAllResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssFundsMigratorInfoAllResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssFundsMigratorInfoAllResponse; + + static equals(a: QueryTssFundsMigratorInfoAllResponse | PlainMessage | undefined, b: QueryTssFundsMigratorInfoAllResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoRequest + */ +export declare class QueryTssFundsMigratorInfoRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssFundsMigratorInfoRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssFundsMigratorInfoRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssFundsMigratorInfoRequest; + + static equals(a: QueryTssFundsMigratorInfoRequest | PlainMessage | undefined, b: QueryTssFundsMigratorInfoRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryTssFundsMigratorInfoResponse + */ +export declare class QueryTssFundsMigratorInfoResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.TssFundMigratorInfo tss_funds_migrator = 1; + */ + tssFundsMigrator?: TssFundMigratorInfo; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryTssFundsMigratorInfoResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssFundsMigratorInfoResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssFundsMigratorInfoResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssFundsMigratorInfoResponse; + + static equals(a: QueryTssFundsMigratorInfoResponse | PlainMessage | undefined, b: QueryTssFundsMigratorInfoResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message zetachain.zetacore.observer.QueryGetChainNoncesRequest */ diff --git a/x/observer/client/cli/query.go b/x/observer/client/cli/query.go index 84b9c6c6e6..39f43847a7 100644 --- a/x/observer/client/cli/query.go +++ b/x/observer/client/cli/query.go @@ -41,6 +41,8 @@ func GetQueryCmd(_ string) *cobra.Command { CmdListChainNonces(), CmdShowChainNonces(), CmdListPendingNonces(), + CmdGetAllTssFundsMigrator(), + CmdGetTssFundsMigrator(), ) return cmd diff --git a/x/observer/client/cli/query_tss_fund_migrator.go b/x/observer/client/cli/query_tss_fund_migrator.go new file mode 100644 index 0000000000..a5483fde51 --- /dev/null +++ b/x/observer/client/cli/query_tss_fund_migrator.go @@ -0,0 +1,70 @@ +package cli + +import ( + "context" + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func CmdGetTssFundsMigrator() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-tss-funds-migrator [chain-id]", + Short: "show the tss funds migrator for a chain", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + chainID, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + return err + } + params := &types.QueryTssFundsMigratorInfoRequest{ + ChainId: chainID, + } + + res, err := queryClient.TssFundsMigratorInfo(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdGetAllTssFundsMigrator() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-tss-funds-migrator", + Short: "list all tss funds migrators", + RunE: func(cmd *cobra.Command, _ []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryTssFundsMigratorInfoAllRequest{} + + res, err := queryClient.TssFundsMigratorInfoAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/observer/keeper/grpc_query_tss_funds_migrator_info.go b/x/observer/keeper/grpc_query_tss_funds_migrator_info.go new file mode 100644 index 0000000000..7a2ab7e357 --- /dev/null +++ b/x/observer/keeper/grpc_query_tss_funds_migrator_info.go @@ -0,0 +1,51 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +// TssFundsMigratorInfo queries a tss fund migrator info +func (k Keeper) TssFundsMigratorInfo( + goCtx context.Context, + req *types.QueryTssFundsMigratorInfoRequest, +) (*types.QueryTssFundsMigratorInfoResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + if chains.GetChainFromChainID(req.ChainId) == nil { + return nil, status.Error(codes.InvalidArgument, "invalid chain id") + } + + fm, found := k.GetFundMigrator(ctx, req.ChainId) + if !found { + return nil, status.Error(codes.NotFound, "tss fund migrator not found") + } + return &types.QueryTssFundsMigratorInfoResponse{ + TssFundsMigrator: fm, + }, nil +} + +// TssFundsMigratorInfoAll queries all tss fund migrator info for all chains +func (k Keeper) TssFundsMigratorInfoAll( + goCtx context.Context, + request *types.QueryTssFundsMigratorInfoAllRequest, +) (*types.QueryTssFundsMigratorInfoAllResponse, error) { + if request == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + migrators := k.GetAllTssFundMigrators(ctx) + + return &types.QueryTssFundsMigratorInfoAllResponse{TssFundsMigrators: migrators}, nil +} diff --git a/x/observer/keeper/grpc_query_tss_funds_migrator_test.go b/x/observer/keeper/grpc_query_tss_funds_migrator_test.go new file mode 100644 index 0000000000..3882079f5d --- /dev/null +++ b/x/observer/keeper/grpc_query_tss_funds_migrator_test.go @@ -0,0 +1,104 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/zeta-chain/zetacore/pkg/chains" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func TestKeeper_TssFundsMigratorInfo(t *testing.T) { + t.Run("should error if req is nil", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + res, err := k.TssFundsMigratorInfo(wctx, nil) + require.ErrorContains(t, err, "invalid request") + require.Nil(t, res) + }) + + t.Run("should error if chain id is invalid", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + res, err := k.TssFundsMigratorInfo(wctx, &types.QueryTssFundsMigratorInfoRequest{ + ChainId: 0, + }) + require.ErrorContains(t, err, "invalid chain id") + require.Nil(t, res) + }) + + t.Run("should error if not found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + res, err := k.TssFundsMigratorInfo(wctx, &types.QueryTssFundsMigratorInfoRequest{ + ChainId: chains.Ethereum.ChainId, + }) + require.ErrorContains(t, err, "tss fund migrator not found") + require.Nil(t, res) + }) + + t.Run("should return if found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + chainId := chains.Ethereum.ChainId + + fm := types.TssFundMigratorInfo{ + ChainId: chainId, + MigrationCctxIndex: sample.ZetaIndex(t), + } + k.SetFundMigrator(ctx, fm) + + res, err := k.TssFundsMigratorInfo(wctx, &types.QueryTssFundsMigratorInfoRequest{ + ChainId: chainId, + }) + require.NoError(t, err) + require.Equal(t, fm, res.TssFundsMigrator) + }) +} + +func TestKeeper_TssFundsMigratorInfoAll(t *testing.T) { + t.Run("should error if req is nil", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + res, err := k.TssFundsMigratorInfoAll(wctx, nil) + require.ErrorContains(t, err, "invalid request") + require.Nil(t, res) + }) + + t.Run("should return empty list if not found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + res, err := k.TssFundsMigratorInfoAll(wctx, &types.QueryTssFundsMigratorInfoAllRequest{}) + require.NoError(t, err) + require.Equal(t, 0, len(res.TssFundsMigrators)) + }) + + t.Run("should return list of infos if found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + + migrators := make([]types.TssFundMigratorInfo, 3) + for i := 0; i < 3; i++ { + fm := types.TssFundMigratorInfo{ + ChainId: int64(i), + MigrationCctxIndex: sample.ZetaIndex(t), + } + k.SetFundMigrator(ctx, fm) + migrators[i] = fm + } + + res, err := k.TssFundsMigratorInfoAll(wctx, &types.QueryTssFundsMigratorInfoAllRequest{}) + require.NoError(t, err) + require.Equal(t, 3, len(res.TssFundsMigrators)) + require.ElementsMatch(t, migrators, res.TssFundsMigrators) + }) +} diff --git a/x/observer/types/query.pb.go b/x/observer/types/query.pb.go index 1c7b0178cc..38d676df2b 100644 --- a/x/observer/types/query.pb.go +++ b/x/observer/types/query.pb.go @@ -32,6 +32,174 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type QueryTssFundsMigratorInfoAllRequest struct { +} + +func (m *QueryTssFundsMigratorInfoAllRequest) Reset() { *m = QueryTssFundsMigratorInfoAllRequest{} } +func (m *QueryTssFundsMigratorInfoAllRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTssFundsMigratorInfoAllRequest) ProtoMessage() {} +func (*QueryTssFundsMigratorInfoAllRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_25b2aa420449a0c0, []int{0} +} +func (m *QueryTssFundsMigratorInfoAllRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTssFundsMigratorInfoAllRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTssFundsMigratorInfoAllRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTssFundsMigratorInfoAllRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTssFundsMigratorInfoAllRequest.Merge(m, src) +} +func (m *QueryTssFundsMigratorInfoAllRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTssFundsMigratorInfoAllRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTssFundsMigratorInfoAllRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTssFundsMigratorInfoAllRequest proto.InternalMessageInfo + +type QueryTssFundsMigratorInfoAllResponse struct { + TssFundsMigrators []TssFundMigratorInfo `protobuf:"bytes,1,rep,name=tss_funds_migrators,json=tssFundsMigrators,proto3" json:"tss_funds_migrators"` +} + +func (m *QueryTssFundsMigratorInfoAllResponse) Reset() { *m = QueryTssFundsMigratorInfoAllResponse{} } +func (m *QueryTssFundsMigratorInfoAllResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTssFundsMigratorInfoAllResponse) ProtoMessage() {} +func (*QueryTssFundsMigratorInfoAllResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25b2aa420449a0c0, []int{1} +} +func (m *QueryTssFundsMigratorInfoAllResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTssFundsMigratorInfoAllResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTssFundsMigratorInfoAllResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTssFundsMigratorInfoAllResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTssFundsMigratorInfoAllResponse.Merge(m, src) +} +func (m *QueryTssFundsMigratorInfoAllResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTssFundsMigratorInfoAllResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTssFundsMigratorInfoAllResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTssFundsMigratorInfoAllResponse proto.InternalMessageInfo + +func (m *QueryTssFundsMigratorInfoAllResponse) GetTssFundsMigrators() []TssFundMigratorInfo { + if m != nil { + return m.TssFundsMigrators + } + return nil +} + +type QueryTssFundsMigratorInfoRequest struct { + ChainId int64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` +} + +func (m *QueryTssFundsMigratorInfoRequest) Reset() { *m = QueryTssFundsMigratorInfoRequest{} } +func (m *QueryTssFundsMigratorInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTssFundsMigratorInfoRequest) ProtoMessage() {} +func (*QueryTssFundsMigratorInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_25b2aa420449a0c0, []int{2} +} +func (m *QueryTssFundsMigratorInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTssFundsMigratorInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTssFundsMigratorInfoRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTssFundsMigratorInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTssFundsMigratorInfoRequest.Merge(m, src) +} +func (m *QueryTssFundsMigratorInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTssFundsMigratorInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTssFundsMigratorInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTssFundsMigratorInfoRequest proto.InternalMessageInfo + +func (m *QueryTssFundsMigratorInfoRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +type QueryTssFundsMigratorInfoResponse struct { + TssFundsMigrator TssFundMigratorInfo `protobuf:"bytes,1,opt,name=tss_funds_migrator,json=tssFundsMigrator,proto3" json:"tss_funds_migrator"` +} + +func (m *QueryTssFundsMigratorInfoResponse) Reset() { *m = QueryTssFundsMigratorInfoResponse{} } +func (m *QueryTssFundsMigratorInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTssFundsMigratorInfoResponse) ProtoMessage() {} +func (*QueryTssFundsMigratorInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25b2aa420449a0c0, []int{3} +} +func (m *QueryTssFundsMigratorInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTssFundsMigratorInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTssFundsMigratorInfoResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTssFundsMigratorInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTssFundsMigratorInfoResponse.Merge(m, src) +} +func (m *QueryTssFundsMigratorInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTssFundsMigratorInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTssFundsMigratorInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTssFundsMigratorInfoResponse proto.InternalMessageInfo + +func (m *QueryTssFundsMigratorInfoResponse) GetTssFundsMigrator() TssFundMigratorInfo { + if m != nil { + return m.TssFundsMigrator + } + return TssFundMigratorInfo{} +} + type QueryGetChainNoncesRequest struct { Index string `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -40,7 +208,7 @@ func (m *QueryGetChainNoncesRequest) Reset() { *m = QueryGetChainNoncesR func (m *QueryGetChainNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetChainNoncesRequest) ProtoMessage() {} func (*QueryGetChainNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{0} + return fileDescriptor_25b2aa420449a0c0, []int{4} } func (m *QueryGetChainNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -84,7 +252,7 @@ func (m *QueryGetChainNoncesResponse) Reset() { *m = QueryGetChainNonces func (m *QueryGetChainNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetChainNoncesResponse) ProtoMessage() {} func (*QueryGetChainNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{1} + return fileDescriptor_25b2aa420449a0c0, []int{5} } func (m *QueryGetChainNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -128,7 +296,7 @@ func (m *QueryAllChainNoncesRequest) Reset() { *m = QueryAllChainNoncesR func (m *QueryAllChainNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllChainNoncesRequest) ProtoMessage() {} func (*QueryAllChainNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{2} + return fileDescriptor_25b2aa420449a0c0, []int{6} } func (m *QueryAllChainNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -173,7 +341,7 @@ func (m *QueryAllChainNoncesResponse) Reset() { *m = QueryAllChainNonces func (m *QueryAllChainNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllChainNoncesResponse) ProtoMessage() {} func (*QueryAllChainNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{3} + return fileDescriptor_25b2aa420449a0c0, []int{7} } func (m *QueryAllChainNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -224,7 +392,7 @@ func (m *QueryAllPendingNoncesRequest) Reset() { *m = QueryAllPendingNon func (m *QueryAllPendingNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllPendingNoncesRequest) ProtoMessage() {} func (*QueryAllPendingNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{4} + return fileDescriptor_25b2aa420449a0c0, []int{8} } func (m *QueryAllPendingNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -269,7 +437,7 @@ func (m *QueryAllPendingNoncesResponse) Reset() { *m = QueryAllPendingNo func (m *QueryAllPendingNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllPendingNoncesResponse) ProtoMessage() {} func (*QueryAllPendingNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{5} + return fileDescriptor_25b2aa420449a0c0, []int{9} } func (m *QueryAllPendingNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -320,7 +488,7 @@ func (m *QueryPendingNoncesByChainRequest) Reset() { *m = QueryPendingNo func (m *QueryPendingNoncesByChainRequest) String() string { return proto.CompactTextString(m) } func (*QueryPendingNoncesByChainRequest) ProtoMessage() {} func (*QueryPendingNoncesByChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{6} + return fileDescriptor_25b2aa420449a0c0, []int{10} } func (m *QueryPendingNoncesByChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -364,7 +532,7 @@ func (m *QueryPendingNoncesByChainResponse) Reset() { *m = QueryPendingN func (m *QueryPendingNoncesByChainResponse) String() string { return proto.CompactTextString(m) } func (*QueryPendingNoncesByChainResponse) ProtoMessage() {} func (*QueryPendingNoncesByChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{7} + return fileDescriptor_25b2aa420449a0c0, []int{11} } func (m *QueryPendingNoncesByChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -407,7 +575,7 @@ func (m *QueryGetTSSRequest) Reset() { *m = QueryGetTSSRequest{} } func (m *QueryGetTSSRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTSSRequest) ProtoMessage() {} func (*QueryGetTSSRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{8} + return fileDescriptor_25b2aa420449a0c0, []int{12} } func (m *QueryGetTSSRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -444,7 +612,7 @@ func (m *QueryGetTSSResponse) Reset() { *m = QueryGetTSSResponse{} } func (m *QueryGetTSSResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTSSResponse) ProtoMessage() {} func (*QueryGetTSSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{9} + return fileDescriptor_25b2aa420449a0c0, []int{13} } func (m *QueryGetTSSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -488,7 +656,7 @@ func (m *QueryGetTssAddressRequest) Reset() { *m = QueryGetTssAddressReq func (m *QueryGetTssAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTssAddressRequest) ProtoMessage() {} func (*QueryGetTssAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{10} + return fileDescriptor_25b2aa420449a0c0, []int{14} } func (m *QueryGetTssAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -533,7 +701,7 @@ func (m *QueryGetTssAddressResponse) Reset() { *m = QueryGetTssAddressRe func (m *QueryGetTssAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTssAddressResponse) ProtoMessage() {} func (*QueryGetTssAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{11} + return fileDescriptor_25b2aa420449a0c0, []int{15} } func (m *QueryGetTssAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -589,7 +757,7 @@ func (m *QueryGetTssAddressByFinalizedHeightRequest) String() string { } func (*QueryGetTssAddressByFinalizedHeightRequest) ProtoMessage() {} func (*QueryGetTssAddressByFinalizedHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{12} + return fileDescriptor_25b2aa420449a0c0, []int{16} } func (m *QueryGetTssAddressByFinalizedHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -645,7 +813,7 @@ func (m *QueryGetTssAddressByFinalizedHeightResponse) String() string { } func (*QueryGetTssAddressByFinalizedHeightResponse) ProtoMessage() {} func (*QueryGetTssAddressByFinalizedHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{13} + return fileDescriptor_25b2aa420449a0c0, []int{17} } func (m *QueryGetTssAddressByFinalizedHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -696,7 +864,7 @@ func (m *QueryTssHistoryRequest) Reset() { *m = QueryTssHistoryRequest{} func (m *QueryTssHistoryRequest) String() string { return proto.CompactTextString(m) } func (*QueryTssHistoryRequest) ProtoMessage() {} func (*QueryTssHistoryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{14} + return fileDescriptor_25b2aa420449a0c0, []int{18} } func (m *QueryTssHistoryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -741,7 +909,7 @@ func (m *QueryTssHistoryResponse) Reset() { *m = QueryTssHistoryResponse func (m *QueryTssHistoryResponse) String() string { return proto.CompactTextString(m) } func (*QueryTssHistoryResponse) ProtoMessage() {} func (*QueryTssHistoryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{15} + return fileDescriptor_25b2aa420449a0c0, []int{19} } func (m *QueryTssHistoryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +961,7 @@ func (m *QueryHasVotedRequest) Reset() { *m = QueryHasVotedRequest{} } func (m *QueryHasVotedRequest) String() string { return proto.CompactTextString(m) } func (*QueryHasVotedRequest) ProtoMessage() {} func (*QueryHasVotedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{16} + return fileDescriptor_25b2aa420449a0c0, []int{20} } func (m *QueryHasVotedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -844,7 +1012,7 @@ func (m *QueryHasVotedResponse) Reset() { *m = QueryHasVotedResponse{} } func (m *QueryHasVotedResponse) String() string { return proto.CompactTextString(m) } func (*QueryHasVotedResponse) ProtoMessage() {} func (*QueryHasVotedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{17} + return fileDescriptor_25b2aa420449a0c0, []int{21} } func (m *QueryHasVotedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +1056,7 @@ func (m *QueryBallotByIdentifierRequest) Reset() { *m = QueryBallotByIde func (m *QueryBallotByIdentifierRequest) String() string { return proto.CompactTextString(m) } func (*QueryBallotByIdentifierRequest) ProtoMessage() {} func (*QueryBallotByIdentifierRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{18} + return fileDescriptor_25b2aa420449a0c0, []int{22} } func (m *QueryBallotByIdentifierRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -933,7 +1101,7 @@ func (m *VoterList) Reset() { *m = VoterList{} } func (m *VoterList) String() string { return proto.CompactTextString(m) } func (*VoterList) ProtoMessage() {} func (*VoterList) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{19} + return fileDescriptor_25b2aa420449a0c0, []int{23} } func (m *VoterList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +1155,7 @@ func (m *QueryBallotByIdentifierResponse) Reset() { *m = QueryBallotById func (m *QueryBallotByIdentifierResponse) String() string { return proto.CompactTextString(m) } func (*QueryBallotByIdentifierResponse) ProtoMessage() {} func (*QueryBallotByIdentifierResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{20} + return fileDescriptor_25b2aa420449a0c0, []int{24} } func (m *QueryBallotByIdentifierResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1051,7 +1219,7 @@ func (m *QueryObserverSet) Reset() { *m = QueryObserverSet{} } func (m *QueryObserverSet) String() string { return proto.CompactTextString(m) } func (*QueryObserverSet) ProtoMessage() {} func (*QueryObserverSet) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{21} + return fileDescriptor_25b2aa420449a0c0, []int{25} } func (m *QueryObserverSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1088,7 +1256,7 @@ func (m *QueryObserverSetResponse) Reset() { *m = QueryObserverSetRespon func (m *QueryObserverSetResponse) String() string { return proto.CompactTextString(m) } func (*QueryObserverSetResponse) ProtoMessage() {} func (*QueryObserverSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{22} + return fileDescriptor_25b2aa420449a0c0, []int{26} } func (m *QueryObserverSetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1131,7 +1299,7 @@ func (m *QuerySupportedChains) Reset() { *m = QuerySupportedChains{} } func (m *QuerySupportedChains) String() string { return proto.CompactTextString(m) } func (*QuerySupportedChains) ProtoMessage() {} func (*QuerySupportedChains) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{23} + return fileDescriptor_25b2aa420449a0c0, []int{27} } func (m *QuerySupportedChains) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1168,7 +1336,7 @@ func (m *QuerySupportedChainsResponse) Reset() { *m = QuerySupportedChai func (m *QuerySupportedChainsResponse) String() string { return proto.CompactTextString(m) } func (*QuerySupportedChainsResponse) ProtoMessage() {} func (*QuerySupportedChainsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{24} + return fileDescriptor_25b2aa420449a0c0, []int{28} } func (m *QuerySupportedChainsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1212,7 +1380,7 @@ func (m *QueryGetChainParamsForChainRequest) Reset() { *m = QueryGetChai func (m *QueryGetChainParamsForChainRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetChainParamsForChainRequest) ProtoMessage() {} func (*QueryGetChainParamsForChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{25} + return fileDescriptor_25b2aa420449a0c0, []int{29} } func (m *QueryGetChainParamsForChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1256,7 +1424,7 @@ func (m *QueryGetChainParamsForChainResponse) Reset() { *m = QueryGetCha func (m *QueryGetChainParamsForChainResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetChainParamsForChainResponse) ProtoMessage() {} func (*QueryGetChainParamsForChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{26} + return fileDescriptor_25b2aa420449a0c0, []int{30} } func (m *QueryGetChainParamsForChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1299,7 +1467,7 @@ func (m *QueryGetChainParamsRequest) Reset() { *m = QueryGetChainParamsR func (m *QueryGetChainParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetChainParamsRequest) ProtoMessage() {} func (*QueryGetChainParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{27} + return fileDescriptor_25b2aa420449a0c0, []int{31} } func (m *QueryGetChainParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1336,7 +1504,7 @@ func (m *QueryGetChainParamsResponse) Reset() { *m = QueryGetChainParams func (m *QueryGetChainParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetChainParamsResponse) ProtoMessage() {} func (*QueryGetChainParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{28} + return fileDescriptor_25b2aa420449a0c0, []int{32} } func (m *QueryGetChainParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1380,7 +1548,7 @@ func (m *QueryGetNodeAccountRequest) Reset() { *m = QueryGetNodeAccountR func (m *QueryGetNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountRequest) ProtoMessage() {} func (*QueryGetNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{29} + return fileDescriptor_25b2aa420449a0c0, []int{33} } func (m *QueryGetNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1424,7 +1592,7 @@ func (m *QueryGetNodeAccountResponse) Reset() { *m = QueryGetNodeAccount func (m *QueryGetNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNodeAccountResponse) ProtoMessage() {} func (*QueryGetNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{30} + return fileDescriptor_25b2aa420449a0c0, []int{34} } func (m *QueryGetNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1468,7 +1636,7 @@ func (m *QueryAllNodeAccountRequest) Reset() { *m = QueryAllNodeAccountR func (m *QueryAllNodeAccountRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountRequest) ProtoMessage() {} func (*QueryAllNodeAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{31} + return fileDescriptor_25b2aa420449a0c0, []int{35} } func (m *QueryAllNodeAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1513,7 +1681,7 @@ func (m *QueryAllNodeAccountResponse) Reset() { *m = QueryAllNodeAccount func (m *QueryAllNodeAccountResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNodeAccountResponse) ProtoMessage() {} func (*QueryAllNodeAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{32} + return fileDescriptor_25b2aa420449a0c0, []int{36} } func (m *QueryAllNodeAccountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1563,7 +1731,7 @@ func (m *QueryGetCrosschainFlagsRequest) Reset() { *m = QueryGetCrosscha func (m *QueryGetCrosschainFlagsRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetCrosschainFlagsRequest) ProtoMessage() {} func (*QueryGetCrosschainFlagsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{33} + return fileDescriptor_25b2aa420449a0c0, []int{37} } func (m *QueryGetCrosschainFlagsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1600,7 +1768,7 @@ func (m *QueryGetCrosschainFlagsResponse) Reset() { *m = QueryGetCrossch func (m *QueryGetCrosschainFlagsResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetCrosschainFlagsResponse) ProtoMessage() {} func (*QueryGetCrosschainFlagsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{34} + return fileDescriptor_25b2aa420449a0c0, []int{38} } func (m *QueryGetCrosschainFlagsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1643,7 +1811,7 @@ func (m *QueryGetKeygenRequest) Reset() { *m = QueryGetKeygenRequest{} } func (m *QueryGetKeygenRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetKeygenRequest) ProtoMessage() {} func (*QueryGetKeygenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{35} + return fileDescriptor_25b2aa420449a0c0, []int{39} } func (m *QueryGetKeygenRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1680,7 +1848,7 @@ func (m *QueryGetKeygenResponse) Reset() { *m = QueryGetKeygenResponse{} func (m *QueryGetKeygenResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetKeygenResponse) ProtoMessage() {} func (*QueryGetKeygenResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{36} + return fileDescriptor_25b2aa420449a0c0, []int{40} } func (m *QueryGetKeygenResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1723,7 +1891,7 @@ func (m *QueryShowObserverCountRequest) Reset() { *m = QueryShowObserver func (m *QueryShowObserverCountRequest) String() string { return proto.CompactTextString(m) } func (*QueryShowObserverCountRequest) ProtoMessage() {} func (*QueryShowObserverCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{37} + return fileDescriptor_25b2aa420449a0c0, []int{41} } func (m *QueryShowObserverCountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1760,7 +1928,7 @@ func (m *QueryShowObserverCountResponse) Reset() { *m = QueryShowObserve func (m *QueryShowObserverCountResponse) String() string { return proto.CompactTextString(m) } func (*QueryShowObserverCountResponse) ProtoMessage() {} func (*QueryShowObserverCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{38} + return fileDescriptor_25b2aa420449a0c0, []int{42} } func (m *QueryShowObserverCountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1804,7 +1972,7 @@ func (m *QueryBlameByIdentifierRequest) Reset() { *m = QueryBlameByIdent func (m *QueryBlameByIdentifierRequest) String() string { return proto.CompactTextString(m) } func (*QueryBlameByIdentifierRequest) ProtoMessage() {} func (*QueryBlameByIdentifierRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{39} + return fileDescriptor_25b2aa420449a0c0, []int{43} } func (m *QueryBlameByIdentifierRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1848,7 +2016,7 @@ func (m *QueryBlameByIdentifierResponse) Reset() { *m = QueryBlameByIden func (m *QueryBlameByIdentifierResponse) String() string { return proto.CompactTextString(m) } func (*QueryBlameByIdentifierResponse) ProtoMessage() {} func (*QueryBlameByIdentifierResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{40} + return fileDescriptor_25b2aa420449a0c0, []int{44} } func (m *QueryBlameByIdentifierResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1892,7 +2060,7 @@ func (m *QueryAllBlameRecordsRequest) Reset() { *m = QueryAllBlameRecord func (m *QueryAllBlameRecordsRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllBlameRecordsRequest) ProtoMessage() {} func (*QueryAllBlameRecordsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{41} + return fileDescriptor_25b2aa420449a0c0, []int{45} } func (m *QueryAllBlameRecordsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1937,7 +2105,7 @@ func (m *QueryAllBlameRecordsResponse) Reset() { *m = QueryAllBlameRecor func (m *QueryAllBlameRecordsResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllBlameRecordsResponse) ProtoMessage() {} func (*QueryAllBlameRecordsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{42} + return fileDescriptor_25b2aa420449a0c0, []int{46} } func (m *QueryAllBlameRecordsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1989,7 +2157,7 @@ func (m *QueryBlameByChainAndNonceRequest) Reset() { *m = QueryBlameByCh func (m *QueryBlameByChainAndNonceRequest) String() string { return proto.CompactTextString(m) } func (*QueryBlameByChainAndNonceRequest) ProtoMessage() {} func (*QueryBlameByChainAndNonceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{43} + return fileDescriptor_25b2aa420449a0c0, []int{47} } func (m *QueryBlameByChainAndNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2040,7 +2208,7 @@ func (m *QueryBlameByChainAndNonceResponse) Reset() { *m = QueryBlameByC func (m *QueryBlameByChainAndNonceResponse) String() string { return proto.CompactTextString(m) } func (*QueryBlameByChainAndNonceResponse) ProtoMessage() {} func (*QueryBlameByChainAndNonceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25b2aa420449a0c0, []int{44} + return fileDescriptor_25b2aa420449a0c0, []int{48} } func (m *QueryBlameByChainAndNonceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2077,6 +2245,10 @@ func (m *QueryBlameByChainAndNonceResponse) GetBlameInfo() []*Blame { } func init() { + proto.RegisterType((*QueryTssFundsMigratorInfoAllRequest)(nil), "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllRequest") + proto.RegisterType((*QueryTssFundsMigratorInfoAllResponse)(nil), "zetachain.zetacore.observer.QueryTssFundsMigratorInfoAllResponse") + proto.RegisterType((*QueryTssFundsMigratorInfoRequest)(nil), "zetachain.zetacore.observer.QueryTssFundsMigratorInfoRequest") + proto.RegisterType((*QueryTssFundsMigratorInfoResponse)(nil), "zetachain.zetacore.observer.QueryTssFundsMigratorInfoResponse") proto.RegisterType((*QueryGetChainNoncesRequest)(nil), "zetachain.zetacore.observer.QueryGetChainNoncesRequest") proto.RegisterType((*QueryGetChainNoncesResponse)(nil), "zetachain.zetacore.observer.QueryGetChainNoncesResponse") proto.RegisterType((*QueryAllChainNoncesRequest)(nil), "zetachain.zetacore.observer.QueryAllChainNoncesRequest") @@ -2129,140 +2301,150 @@ func init() { } var fileDescriptor_25b2aa420449a0c0 = []byte{ - // 2128 bytes of a gzipped FileDescriptorProto + // 2284 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x5a, 0xcf, 0x6f, 0x1b, 0xc7, - 0x15, 0xf6, 0x4a, 0x89, 0x22, 0x3d, 0xd9, 0x92, 0x3c, 0x96, 0x1d, 0x87, 0x76, 0x64, 0x79, 0x65, - 0xc7, 0xb2, 0x62, 0x73, 0x6d, 0x3a, 0xa9, 0x7f, 0xc7, 0x16, 0xdd, 0x58, 0xb2, 0x93, 0xda, 0x0e, - 0xa9, 0x36, 0x80, 0x91, 0x96, 0x5d, 0x92, 0x43, 0x72, 0xeb, 0xd5, 0x0e, 0xb3, 0x33, 0x72, 0xc2, - 0xa8, 0x02, 0x8a, 0x1e, 0x73, 0x2a, 0x50, 0xa0, 0xbd, 0x15, 0xbd, 0xf4, 0x58, 0xa0, 0x08, 0x50, - 0xb4, 0x40, 0xd1, 0x43, 0x4e, 0xcd, 0xa1, 0x87, 0x14, 0x05, 0x8a, 0x9e, 0xda, 0xc0, 0xee, 0xff, - 0xd1, 0x62, 0x67, 0xde, 0x92, 0xbb, 0xcb, 0xe5, 0x72, 0x28, 0xab, 0x27, 0xee, 0xce, 0xbe, 0xf7, - 0xe6, 0xfb, 0xde, 0xce, 0xcc, 0xfb, 0x66, 0x87, 0x70, 0xe6, 0x33, 0x2a, 0xec, 0x5a, 0xcb, 0x76, - 0x3c, 0x4b, 0x5e, 0x31, 0x9f, 0x5a, 0xac, 0xca, 0xa9, 0xff, 0x94, 0xfa, 0xd6, 0xc7, 0x5b, 0xd4, - 0xef, 0xe4, 0xdb, 0x3e, 0x13, 0x8c, 0x1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0xcc, 0xa9, - 0xa7, 0x72, 0x10, 0x28, 0x6e, 0xe3, 0x92, 0xdb, 0xb9, 0xcc, 0x48, 0x0f, 0x7b, 0x4e, 0x92, 0xe2, - 0x2c, 0x8b, 0x37, 0x90, 0x07, 0x70, 0x00, 0x59, 0x70, 0x61, 0x8b, 0x2d, 0x7e, 0xf4, 0x25, 0x19, - 0xf5, 0x6c, 0x66, 0x54, 0x95, 0x95, 0xb2, 0x74, 0x28, 0xed, 0xaf, 0x46, 0xee, 0x4c, 0x02, 0x73, - 0x32, 0x71, 0x0f, 0xd1, 0xb6, 0x4c, 0x85, 0x79, 0x05, 0x8e, 0x26, 0xdb, 0xba, 0x59, 0x3c, 0x0e, - 0x53, 0x61, 0x58, 0x55, 0x02, 0xa7, 0x4a, 0xbd, 0x06, 0xf3, 0x08, 0x0e, 0xf6, 0xf2, 0x56, 0xbb, - 0xcd, 0x7c, 0x41, 0xeb, 0x72, 0x89, 0xe1, 0xe6, 0x47, 0x58, 0xc7, 0x13, 0xed, 0xdd, 0xa8, 0x37, - 0x60, 0x42, 0x29, 0x3d, 0x9c, 0xae, 0xa7, 0xd2, 0xe8, 0xb4, 0x9f, 0x34, 0xf3, 0xa8, 0x07, 0x55, - 0x55, 0x42, 0x1f, 0xf3, 0x16, 0x98, 0x31, 0xdd, 0xf6, 0x48, 0x2a, 0xd7, 0xbb, 0xcc, 0xd7, 0xad, - 0x7d, 0x3e, 0x2c, 0x65, 0x06, 0x40, 0x94, 0xef, 0xc1, 0x7e, 0x15, 0x41, 0x49, 0x63, 0x7d, 0x05, - 0xa8, 0xe2, 0x95, 0xa6, 0x6b, 0xbd, 0x1b, 0xf3, 0x78, 0x42, 0xa0, 0xa2, 0x0d, 0x56, 0x3e, 0x2f, - 0x21, 0x45, 0xc3, 0xa7, 0x88, 0xe4, 0x61, 0x2a, 0x92, 0x73, 0xba, 0x48, 0xe4, 0x50, 0x8d, 0xa1, - 0x89, 0xc8, 0xe5, 0x07, 0xac, 0x4e, 0x57, 0xd5, 0x96, 0x22, 0x5b, 0x2e, 0xff, 0xa8, 0x87, 0x31, - 0xe6, 0xd3, 0xcb, 0x56, 0x74, 0x7b, 0xa2, 0x95, 0xad, 0x68, 0x9c, 0x69, 0xaf, 0x77, 0x13, 0x55, - 0xca, 0x29, 0xf8, 0xf6, 0xaa, 0xa6, 0x7c, 0x11, 0x51, 0xca, 0x69, 0x94, 0xee, 0xc3, 0x74, 0xa4, - 0x59, 0x4b, 0x29, 0xc7, 0x18, 0x45, 0x6e, 0xf6, 0xae, 0xc0, 0x2c, 0xe2, 0x02, 0x1e, 0x0c, 0x95, - 0xee, 0x66, 0xf3, 0x6e, 0xb0, 0xd7, 0x0c, 0x07, 0xd3, 0x4f, 0x0c, 0x5c, 0x1d, 0xd3, 0x4c, 0x90, - 0xda, 0xf7, 0x61, 0x2e, 0xb9, 0x55, 0xd5, 0x1b, 0x55, 0xf1, 0x78, 0x58, 0x46, 0x67, 0x6b, 0xf1, - 0x66, 0xf3, 0x55, 0xac, 0x4d, 0x6b, 0x54, 0xbc, 0x27, 0x77, 0xb7, 0x21, 0xb6, 0xef, 0xa2, 0x50, - 0x88, 0x3c, 0x40, 0x44, 0xd7, 0x61, 0x42, 0x6d, 0x84, 0x11, 0xc7, 0x52, 0x26, 0x0e, 0x74, 0x46, - 0x17, 0xf3, 0x04, 0xea, 0xf9, 0x72, 0x8b, 0x7d, 0x12, 0x2e, 0x63, 0x77, 0x22, 0x43, 0x26, 0xc8, - 0xc9, 0xc2, 0x20, 0x0b, 0x04, 0xf0, 0x03, 0x38, 0xe4, 0xda, 0x5c, 0x54, 0xc2, 0x3e, 0x2a, 0xd1, - 0x71, 0x9c, 0xcf, 0x44, 0xf3, 0xbe, 0xcd, 0x45, 0x3c, 0xe8, 0x41, 0x37, 0xd9, 0x64, 0xde, 0x47, - 0x8c, 0x45, 0xd7, 0xde, 0xa4, 0x69, 0x85, 0xf7, 0x2c, 0xcc, 0xc9, 0xef, 0x12, 0xfd, 0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a, 0xeb, 0xea, 0xe0, 0x4e, 0x55, 0xb2, 0x3a, 0xb8, 0xd3, - 0xb5, 0xa9, 0xb9, 0x2c, 0x71, 0x9b, 0x64, 0x71, 0x18, 0x6e, 0xf2, 0x27, 0x03, 0x66, 0x13, 0xb2, - 0x4d, 0x67, 0x89, 0x1c, 0xa8, 0x2f, 0x75, 0x96, 0xc8, 0xc1, 0xca, 0x73, 0xc8, 0x10, 0x49, 0x8a, - 0x52, 0xf2, 0x0b, 0x03, 0x26, 0x94, 0xd8, 0x23, 0x05, 0xad, 0x7e, 0x63, 0x7a, 0x33, 0x77, 0x69, - 0x24, 0x1f, 0x84, 0xb8, 0x24, 0x21, 0xbe, 0x4e, 0x8e, 0xa5, 0x42, 0x54, 0x92, 0x93, 0xfc, 0xc5, - 0x80, 0x83, 0x7d, 0x62, 0x92, 0x5c, 0xd3, 0x58, 0xd1, 0x06, 0x68, 0xd4, 0xdc, 0xf5, 0x5d, 0xf9, - 0x22, 0xe6, 0xab, 0x12, 0xf3, 0x25, 0x72, 0x31, 0x8a, 0xb9, 0xff, 0x24, 0x86, 0xb7, 0xd8, 0x27, - 0x09, 0x85, 0x4b, 0xfe, 0x66, 0xc0, 0xc1, 0x3e, 0x21, 0xa9, 0xc3, 0x64, 0x90, 0x92, 0xd5, 0x61, - 0x32, 0x50, 0xb9, 0x9a, 0x77, 0x24, 0x93, 0x9b, 0xe4, 0x7a, 0x7a, 0x0d, 0x95, 0xea, 0x27, 0x59, - 0x42, 0x13, 0xb2, 0x79, 0x27, 0x90, 0x36, 0x64, 0x8d, 0x8a, 0x84, 0xa4, 0x24, 0x7a, 0xf3, 0x2d, - 0x45, 0xed, 0xea, 0x94, 0xaa, 0x01, 0xfa, 0xd5, 0x2c, 0x48, 0x42, 0xe7, 0xc8, 0xca, 0xc0, 0x45, - 0xd1, 0x76, 0xdd, 0x8a, 0xe2, 0xe0, 0x23, 0xd0, 0x6f, 0x0c, 0x38, 0x2c, 0x83, 0xf1, 0x84, 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x03, 0xc5, 0x69, 0x11, 0x1b, 0x95, 0x93, 0x9b, 0x68, 0x3e, 0x15, 0x0f, 0x80, + 0xc6, 0xaf, 0xa2, 0x51, 0x35, 0x0f, 0xed, 0xda, 0xac, 0x31, 0x6f, 0x2c, 0x0d, 0x17, 0x5f, 0x91, + 0xd7, 0x77, 0x6b, 0xe4, 0xa7, 0x06, 0x3a, 0x95, 0x61, 0x0f, 0x64, 0x6a, 0x08, 0xf7, 0x92, 0x91, + 0xae, 0xf6, 0xce, 0x65, 0x2a, 0xce, 0x85, 0xac, 0xa2, 0x9c, 0x84, 0xb2, 0x41, 0xc5, 0x1d, 0xdf, + 0xdd, 0x7d, 0x39, 0xa9, 0x02, 0x12, 0x33, 0xe8, 0x65, 0xdb, 0xad, 0xd1, 0x4f, 0xe4, 0xb0, 0x63, + 0x45, 0x75, 0x41, 0x18, 0x3a, 0x9e, 0x68, 0x03, 0xc0, 0x1f, 0xa2, 0xf1, 0x50, 0x33, 0x20, 0x5e, + 0xca, 0x44, 0x1c, 0xea, 0x0f, 0x48, 0xc3, 0x2e, 0x48, 0x0d, 0x40, 0xae, 0x39, 0x4e, 0x02, 0xc8, + 0x75, 0x84, 0xba, 0xb9, 0x0d, 0x86, 0x7b, 0x3d, 0xaf, 0x12, 0x61, 0xde, 0x4f, 0x84, 0x79, 0x95, + 0x3e, 0x21, 0x11, 0xe6, 0x1f, 0x5a, 0x0d, 0x0a, 0xb6, 0xc5, 0x90, 0x25, 0xf9, 0xa3, 0x01, 0xbc, + 0xe2, 0xc3, 0xa4, 0xf1, 0x1a, 0x7e, 0x41, 0x5e, 0x78, 0x23, 0x82, 0x7c, 0x48, 0x22, 0x3f, 0xd3, + 0x17, 0xb9, 0x82, 0x13, 0x81, 0x5e, 0x47, 0x27, 0x02, 0xe4, 0x0f, 0x55, 0x76, 0xf8, 0xff, 0x84, + 0xe8, 0x4b, 0x03, 0xbd, 0x96, 0x32, 0x10, 0x04, 0xe9, 0x03, 0x34, 0x11, 0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 0x76, 0xcd, 0x9d, + 0x88, 0xba, 0xdc, 0xc5, 0xff, 0x34, 0x10, 0xee, 0x55, 0x80, 0xf8, 0x7a, 0x7f, 0x58, 0xa9, 0xea, + 0x37, 0x77, 0x63, 0x6f, 0xc6, 0xc0, 0xee, 0x6d, 0xc9, 0xee, 0x16, 0xbe, 0x99, 0xc8, 0x0e, 0x28, + 0x55, 0xda, 0x21, 0x56, 0x49, 0x44, 0xf1, 0xaf, 0x0d, 0x34, 0x1e, 0x52, 0x63, 0xf8, 0x5c, 0x7f, + 0x50, 0xa1, 0xee, 0xb9, 0x37, 0x07, 0xea, 0xde, 0x01, 0x7f, 0x56, 0x82, 0x5f, 0xc0, 0xa7, 0x12, + 0xc1, 0x77, 0xd2, 0x22, 0xa7, 0x02, 0xff, 0xd6, 0x40, 0x93, 0x31, 0x71, 0xa7, 0x33, 0x81, 0x62, + 0x26, 0xb9, 0xab, 0x03, 0x9b, 0x74, 0xc0, 0xae, 0x48, 0xb0, 0xaf, 0xe3, 0xc5, 0x44, 0xb0, 0x3c, + 0x86, 0xed, 0x3f, 0x06, 0x3a, 0x9a, 0xac, 0xf6, 0xf0, 0xad, 0xfe, 0x18, 0x32, 0x85, 0x66, 0xee, + 0xf6, 0xde, 0x1d, 0x00, 0x97, 0x82, 0xe4, 0x72, 0x03, 0x5f, 0x4b, 0xe4, 0xd2, 0xa0, 0xa2, 0x1c, + 0x56, 0x7f, 0xe5, 0x3a, 0xf3, 0x54, 0x83, 0xb9, 0x13, 0x64, 0x98, 0x5d, 0xfc, 0x85, 0x81, 0x26, + 0xa2, 0xc3, 0xe0, 0xcb, 0x83, 0x02, 0x0b, 0x18, 0x5d, 0x19, 0xdc, 0x10, 0x98, 0x9c, 0x93, 0x4c, + 0xce, 0xe0, 0xd3, 0x5a, 0x4c, 0x7c, 0xd0, 0x11, 0x91, 0xa4, 0x87, 0xb8, 0x57, 0x11, 0x6a, 0x22, + 0x4e, 0xd0, 0x78, 0xe4, 0xbc, 0x44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, 0xd7, 0xcf, 0xe7, 0x0e, 0xfc, + 0xeb, 0xf9, 0xdc, 0x81, 0xc7, 0x66, 0xc3, 0x16, 0xcd, 0xed, 0x4a, 0xbe, 0xca, 0xb6, 0x12, 0x85, + 0xe6, 0x27, 0xa1, 0xe4, 0xd6, 0x6e, 0x51, 0x5e, 0x19, 0x91, 0x9f, 0x48, 0x5d, 0xfc, 0x5f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xc1, 0xd9, 0x00, 0xc6, 0x18, 0x28, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2315,6 +2497,10 @@ type QueryClient interface { ChainNonces(ctx context.Context, in *QueryGetChainNoncesRequest, opts ...grpc.CallOption) (*QueryGetChainNoncesResponse, error) // Queries a list of chainNonces items. ChainNoncesAll(ctx context.Context, in *QueryAllChainNoncesRequest, opts ...grpc.CallOption) (*QueryAllChainNoncesResponse, error) + // Queries the TssFundMigratorInfo for a specific chain + TssFundsMigratorInfo(ctx context.Context, in *QueryTssFundsMigratorInfoRequest, opts ...grpc.CallOption) (*QueryTssFundsMigratorInfoResponse, error) + // Queries all TssFundMigratorInfo + TssFundsMigratorInfoAll(ctx context.Context, in *QueryTssFundsMigratorInfoAllRequest, opts ...grpc.CallOption) (*QueryTssFundsMigratorInfoAllResponse, error) } type queryClient struct { @@ -2523,6 +2709,24 @@ func (c *queryClient) ChainNoncesAll(ctx context.Context, in *QueryAllChainNonce return out, nil } +func (c *queryClient) TssFundsMigratorInfo(ctx context.Context, in *QueryTssFundsMigratorInfoRequest, opts ...grpc.CallOption) (*QueryTssFundsMigratorInfoResponse, error) { + out := new(QueryTssFundsMigratorInfoResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.observer.Query/TssFundsMigratorInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TssFundsMigratorInfoAll(ctx context.Context, in *QueryTssFundsMigratorInfoAllRequest, opts ...grpc.CallOption) (*QueryTssFundsMigratorInfoAllResponse, error) { + out := new(QueryTssFundsMigratorInfoAllResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.observer.Query/TssFundsMigratorInfoAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Query if a voter has voted for a ballot @@ -2563,6 +2767,10 @@ type QueryServer interface { ChainNonces(context.Context, *QueryGetChainNoncesRequest) (*QueryGetChainNoncesResponse, error) // Queries a list of chainNonces items. ChainNoncesAll(context.Context, *QueryAllChainNoncesRequest) (*QueryAllChainNoncesResponse, error) + // Queries the TssFundMigratorInfo for a specific chain + TssFundsMigratorInfo(context.Context, *QueryTssFundsMigratorInfoRequest) (*QueryTssFundsMigratorInfoResponse, error) + // Queries all TssFundMigratorInfo + TssFundsMigratorInfoAll(context.Context, *QueryTssFundsMigratorInfoAllRequest) (*QueryTssFundsMigratorInfoAllResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -2635,6 +2843,12 @@ func (*UnimplementedQueryServer) ChainNonces(ctx context.Context, req *QueryGetC func (*UnimplementedQueryServer) ChainNoncesAll(ctx context.Context, req *QueryAllChainNoncesRequest) (*QueryAllChainNoncesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChainNoncesAll not implemented") } +func (*UnimplementedQueryServer) TssFundsMigratorInfo(ctx context.Context, req *QueryTssFundsMigratorInfoRequest) (*QueryTssFundsMigratorInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TssFundsMigratorInfo not implemented") +} +func (*UnimplementedQueryServer) TssFundsMigratorInfoAll(ctx context.Context, req *QueryTssFundsMigratorInfoAllRequest) (*QueryTssFundsMigratorInfoAllResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TssFundsMigratorInfoAll not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -3036,6 +3250,42 @@ func _Query_ChainNoncesAll_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Query_TssFundsMigratorInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTssFundsMigratorInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TssFundsMigratorInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.observer.Query/TssFundsMigratorInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TssFundsMigratorInfo(ctx, req.(*QueryTssFundsMigratorInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TssFundsMigratorInfoAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTssFundsMigratorInfoAllRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TssFundsMigratorInfoAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.observer.Query/TssFundsMigratorInfoAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TssFundsMigratorInfoAll(ctx, req.(*QueryTssFundsMigratorInfoAllRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "zetachain.zetacore.observer.Query", HandlerType: (*QueryServer)(nil), @@ -3128,12 +3378,20 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ChainNoncesAll", Handler: _Query_ChainNoncesAll_Handler, }, + { + MethodName: "TssFundsMigratorInfo", + Handler: _Query_TssFundsMigratorInfo_Handler, + }, + { + MethodName: "TssFundsMigratorInfoAll", + Handler: _Query_TssFundsMigratorInfoAll_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "zetachain/zetacore/observer/query.proto", } -func (m *QueryGetChainNoncesRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryTssFundsMigratorInfoAllRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3143,27 +3401,20 @@ func (m *QueryGetChainNoncesRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetChainNoncesRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryTssFundsMigratorInfoAllRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetChainNoncesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryTssFundsMigratorInfoAllRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Index) > 0 { - i -= len(m.Index) - copy(dAtA[i:], m.Index) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *QueryGetChainNoncesResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryTssFundsMigratorInfoAllResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3173,25 +3424,153 @@ func (m *QueryGetChainNoncesResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetChainNoncesResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryTssFundsMigratorInfoAllResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetChainNoncesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryTssFundsMigratorInfoAllResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.ChainNonces.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- + if len(m.TssFundsMigrators) > 0 { + for iNdEx := len(m.TssFundsMigrators) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TssFundsMigrators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTssFundsMigratorInfoRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTssFundsMigratorInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTssFundsMigratorInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryTssFundsMigratorInfoResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTssFundsMigratorInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTssFundsMigratorInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.TssFundsMigrator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetChainNoncesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetChainNoncesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetChainNoncesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Index) > 0 { + i -= len(m.Index) + copy(dAtA[i:], m.Index) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Index))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetChainNoncesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetChainNoncesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetChainNoncesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.ChainNonces.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -4676,6 +5055,53 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryTssFundsMigratorInfoAllRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTssFundsMigratorInfoAllResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TssFundsMigrators) > 0 { + for _, e := range m.TssFundsMigrators { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryTssFundsMigratorInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + return n +} + +func (m *QueryTssFundsMigratorInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.TssFundsMigrator.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryGetChainNoncesRequest) Size() (n int) { if m == nil { return 0 @@ -5294,6 +5720,292 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryTssFundsMigratorInfoAllRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoAllRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoAllRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTssFundsMigratorInfoAllResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoAllResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoAllResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TssFundsMigrators", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TssFundsMigrators = append(m.TssFundsMigrators, TssFundMigratorInfo{}) + if err := m.TssFundsMigrators[len(m.TssFundsMigrators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTssFundsMigratorInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTssFundsMigratorInfoResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTssFundsMigratorInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TssFundsMigrator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TssFundsMigrator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetChainNoncesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/observer/types/query.pb.gw.go b/x/observer/types/query.pb.gw.go index fc62c63354..0c1295a13f 100644 --- a/x/observer/types/query.pb.gw.go +++ b/x/observer/types/query.pb.gw.go @@ -945,6 +945,60 @@ func local_request_Query_ChainNoncesAll_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_TssFundsMigratorInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TssFundsMigratorInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTssFundsMigratorInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TssFundsMigratorInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TssFundsMigratorInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TssFundsMigratorInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTssFundsMigratorInfoRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TssFundsMigratorInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TssFundsMigratorInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TssFundsMigratorInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTssFundsMigratorInfoAllRequest + var metadata runtime.ServerMetadata + + msg, err := client.TssFundsMigratorInfoAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TssFundsMigratorInfoAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTssFundsMigratorInfoAllRequest + var metadata runtime.ServerMetadata + + msg, err := server.TssFundsMigratorInfoAll(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1457,6 +1511,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TssFundsMigratorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TssFundsMigratorInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TssFundsMigratorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TssFundsMigratorInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TssFundsMigratorInfoAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TssFundsMigratorInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1938,6 +2038,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TssFundsMigratorInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TssFundsMigratorInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TssFundsMigratorInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TssFundsMigratorInfoAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TssFundsMigratorInfoAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TssFundsMigratorInfoAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1985,6 +2125,10 @@ var ( pattern_Query_ChainNonces_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "observer", "chainNonces", "index"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ChainNoncesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "chainNonces"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TssFundsMigratorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "getTssFundsMigrator"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TssFundsMigratorInfoAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "observer", "getAllTssFundsMigrators"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -2031,4 +2175,8 @@ var ( forward_Query_ChainNonces_0 = runtime.ForwardResponseMessage forward_Query_ChainNoncesAll_0 = runtime.ForwardResponseMessage + + forward_Query_TssFundsMigratorInfo_0 = runtime.ForwardResponseMessage + + forward_Query_TssFundsMigratorInfoAll_0 = runtime.ForwardResponseMessage ) diff --git a/zetaclient/authz/authz_signer.go b/zetaclient/authz/authz_signer.go index 5f1221f9a9..7f9dc4d471 100644 --- a/zetaclient/authz/authz_signer.go +++ b/zetaclient/authz/authz_signer.go @@ -1,3 +1,5 @@ +// Package authz provides a signer object for transactions using grants +// grants are used to allow a hotkey to sign transactions on behalf of the observers package authz import ( @@ -7,18 +9,22 @@ import ( crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" ) +// Signer represents a signer for a grantee key type Signer struct { KeyType authz.KeyType GranterAddress string GranteeAddress sdk.AccAddress } +// String returns a string representation of a Signer func (a Signer) String() string { return a.KeyType.String() + " " + a.GranterAddress + " " + a.GranteeAddress.String() } +// signers is a map of all the signers for the different tx types var signers map[string]Signer +// init initializes the signers map with all the crosschain tx types using the ZetaClientGranteeKey func init() { signersList := make(map[string]Signer) for _, tx := range crosschaintypes.GetAllAuthzZetaclientTxTypes() { @@ -27,6 +33,7 @@ func init() { signers = signersList } +// SetupAuthZSignerList sets the granter and grantee for all the signers func SetupAuthZSignerList(granter string, grantee sdk.AccAddress) { for k, v := range signers { v.GranterAddress = granter @@ -35,6 +42,7 @@ func SetupAuthZSignerList(granter string, grantee sdk.AccAddress) { } } +// GetSigner returns the signer for a given msgURL func GetSigner(msgURL string) Signer { return signers[msgURL] } diff --git a/zetaclient/authz/authz_signer_test.go b/zetaclient/authz/authz_signer_test.go index 00a25722c4..1cc70b3116 100644 --- a/zetaclient/authz/authz_signer_test.go +++ b/zetaclient/authz/authz_signer_test.go @@ -1 +1,3 @@ package authz_test + +// NOTE: test file currently created empty to add the package in the test coverage scope diff --git a/zetaclient/chains/bitcoin/observer/inbound.go b/zetaclient/chains/bitcoin/observer/inbound.go index 2438411b5b..037fd11cd1 100644 --- a/zetaclient/chains/bitcoin/observer/inbound.go +++ b/zetaclient/chains/bitcoin/observer/inbound.go @@ -26,6 +26,8 @@ import ( ) // WatchInbound watches Bitcoin chain for inbounds on a ticker +// It starts a ticker and run ObserveInbound +// TODO(revamp): move all ticker related methods in the same file func (ob *Observer) WatchInbound() { ticker, err := types.NewDynamicTicker("Bitcoin_WatchInbound", ob.GetChainParams().InboundTicker) if err != nil { @@ -37,6 +39,7 @@ func (ob *Observer) WatchInbound() { ob.logger.Inbound.Info().Msgf("WatchInbound started for chain %d", ob.Chain().ChainId) sampledLogger := ob.logger.Inbound.Sample(&zerolog.BasicSampler{N: 10}) + // ticker loop for { select { case <-ticker.C(): @@ -58,6 +61,7 @@ func (ob *Observer) WatchInbound() { } // ObserveInbound observes the Bitcoin chain for inbounds and post votes to zetacore +// TODO(revamp): simplify this function into smaller functions func (ob *Observer) ObserveInbound() error { // get and update latest block height cnt, err := ob.btcClient.GetBlockCount() @@ -171,6 +175,7 @@ func (ob *Observer) ObserveInbound() error { } // WatchInboundTracker watches zetacore for bitcoin inbound trackers +// TODO(revamp): move all ticker related methods in the same file func (ob *Observer) WatchInboundTracker() { ticker, err := types.NewDynamicTicker("Bitcoin_WatchInboundTracker", ob.GetChainParams().InboundTicker) if err != nil { @@ -200,6 +205,7 @@ func (ob *Observer) WatchInboundTracker() { } // ProcessInboundTrackers processes inbound trackers +// TODO(revamp): move inbound tracker logic in a specific file func (ob *Observer) ProcessInboundTrackers() error { trackers, err := ob.ZetacoreClient().GetInboundTrackersForChain(ob.Chain().ChainId) if err != nil { @@ -328,6 +334,7 @@ func FilterAndParseIncomingTx( return inbounds, nil } +// GetInboundVoteMessageFromBtcEvent converts a BTCInboundEvent to a MsgVoteInbound to enable voting on the inbound on zetacore func (ob *Observer) GetInboundVoteMessageFromBtcEvent(inbound *BTCInboundEvent) *crosschaintypes.MsgVoteInbound { ob.logger.Inbound.Debug().Msgf("Processing inbound: %s", inbound.TxHash) amount := big.NewFloat(inbound.Value) @@ -360,6 +367,7 @@ func (ob *Observer) GetInboundVoteMessageFromBtcEvent(inbound *BTCInboundEvent) } // DoesInboundContainsRestrictedAddress returns true if the inbound contains restricted addresses +// TODO(revamp): move all compliance related functions in a specific file func (ob *Observer) DoesInboundContainsRestrictedAddress(inTx *BTCInboundEvent) bool { receiver := "" parsedAddress, _, err := chains.ParseAddressAndData(hex.EncodeToString(inTx.MemoBytes)) @@ -376,6 +384,7 @@ func (ob *Observer) DoesInboundContainsRestrictedAddress(inTx *BTCInboundEvent) // GetBtcEvent either returns a valid BTCInboundEvent or nil // Note: the caller should retry the tx on error (e.g., GetSenderAddressByVin failed) +// TODO(revamp): simplify this function func GetBtcEvent( rpcClient interfaces.BTCRPCClient, tx btcjson.TxRawResult, diff --git a/zetaclient/chains/bitcoin/observer/observer.go b/zetaclient/chains/bitcoin/observer/observer.go index 5d6e308dfe..11ccc5460a 100644 --- a/zetaclient/chains/bitcoin/observer/observer.go +++ b/zetaclient/chains/bitcoin/observer/observer.go @@ -1,3 +1,4 @@ +// Package observer implements the Bitcoin chain observer package observer import ( @@ -54,6 +55,7 @@ type Logger struct { } // BTCInboundEvent represents an incoming transaction event +// TODO(revamp): Move to inbound type BTCInboundEvent struct { // FromAddress is the first input address FromAddress string @@ -69,7 +71,7 @@ type BTCInboundEvent struct { TxHash string } -// BTCOutboundEvent contains bitcoin block and the header +// BTCBlockNHeader contains bitcoin block and the header type BTCBlockNHeader struct { Header *wire.BlockHeader Block *btcjson.GetBlockVerboseTxResult @@ -190,7 +192,7 @@ func (ob *Observer) GetChainParams() observertypes.ChainParams { return ob.ChainParams() } -// Start starts the Go routine to observe the Bitcoin chain +// Start starts the Go routine processes to observe the Bitcoin chain func (ob *Observer) Start() { ob.Logger().Chain.Info().Msgf("observer is starting for chain %d", ob.Chain().ChainId) @@ -214,6 +216,8 @@ func (ob *Observer) Start() { } // WatchRPCStatus watches the RPC status of the Bitcoin chain +// TODO(revamp): move ticker related functions to a specific file +// TODO(revamp): move inner logic in a separate function func (ob *Observer) WatchRPCStatus() { ob.logger.Chain.Info().Msgf("RPCStatus is starting") ticker := time.NewTicker(60 * time.Second) @@ -297,6 +301,8 @@ func (ob *Observer) ConfirmationsThreshold(amount *big.Int) int64 { } // WatchGasPrice watches Bitcoin chain for gas rate and post to zetacore +// TODO(revamp): move ticker related functions to a specific file +// TODO(revamp): move inner logic in a separate function func (ob *Observer) WatchGasPrice() { // report gas price right away as the ticker takes time to kick in err := ob.PostGasPrice() @@ -333,6 +339,7 @@ func (ob *Observer) WatchGasPrice() { } // PostGasPrice posts gas price to zetacore +// TODO(revamp): move to gas price file func (ob *Observer) PostGasPrice() error { // hardcode gas price here since this RPC is not available on regtest if chains.IsBitcoinRegnet(ob.Chain().ChainId) { @@ -379,6 +386,7 @@ func (ob *Observer) PostGasPrice() error { } // GetSenderAddressByVin get the sender address from the previous transaction +// TODO(revamp): move in upper package to separate file (e.g., rpc.go) func GetSenderAddressByVin(rpcClient interfaces.BTCRPCClient, vin btcjson.Vin, net *chaincfg.Params) (string, error) { // query previous raw transaction by txid // GetTransaction requires reconfiguring the bitcoin node (txindex=1), so we use GetRawTransaction instead @@ -421,6 +429,7 @@ func GetSenderAddressByVin(rpcClient interfaces.BTCRPCClient, vin btcjson.Vin, n } // WatchUTXOs watches bitcoin chain for UTXOs owned by the TSS address +// TODO(revamp): move ticker related functions to a specific file func (ob *Observer) WatchUTXOs() { ticker, err := clienttypes.NewDynamicTicker("Bitcoin_WatchUTXOs", ob.GetChainParams().WatchUtxoTicker) if err != nil { @@ -448,6 +457,7 @@ func (ob *Observer) WatchUTXOs() { } // FetchUTXOs fetches TSS-owned UTXOs from the Bitcoin node +// TODO(revamp): move to UTXO file func (ob *Observer) FetchUTXOs() error { defer func() { if err := recover(); err != nil { @@ -511,6 +521,7 @@ func (ob *Observer) FetchUTXOs() error { } // SaveBroadcastedTx saves successfully broadcasted transaction +// TODO(revamp): move to db file func (ob *Observer) SaveBroadcastedTx(txHash string, nonce uint64) { outboundID := ob.GetTxID(nonce) ob.Mu().Lock() @@ -641,6 +652,7 @@ func (ob *Observer) isTssTransaction(txid string) bool { } // postBlockHeader posts block header to zetacore +// TODO(revamp): move to block header file func (ob *Observer) postBlockHeader(tip int64) error { ob.logger.Inbound.Info().Msgf("postBlockHeader: tip %d", tip) bn := tip diff --git a/zetaclient/chains/bitcoin/observer/outbound.go b/zetaclient/chains/bitcoin/observer/outbound.go index 5bf20c8e7d..5f4684f50f 100644 --- a/zetaclient/chains/bitcoin/observer/outbound.go +++ b/zetaclient/chains/bitcoin/observer/outbound.go @@ -27,6 +27,8 @@ func (ob *Observer) GetTxID(nonce uint64) string { } // WatchOutbound watches Bitcoin chain for outgoing txs status +// TODO(revamp): move ticker functions to a specific file +// TODO(revamp): move into a separate package func (ob *Observer) WatchOutbound() { ticker, err := types.NewDynamicTicker("Bitcoin_WatchOutbound", ob.GetChainParams().OutboundTicker) if err != nil { @@ -111,6 +113,7 @@ func (ob *Observer) WatchOutbound() { } // IsOutboundProcessed returns isIncluded(or inMempool), isConfirmed, Error +// TODO(revamp): rename as it vote the outbound and doesn't only check if outbound is processed func (ob *Observer) IsOutboundProcessed(cctx *crosschaintypes.CrossChainTx, logger zerolog.Logger) (bool, bool, error) { params := *cctx.GetCurrentOutboundParam() sendHash := cctx.Index @@ -213,6 +216,8 @@ func (ob *Observer) IsOutboundProcessed(cctx *crosschaintypes.CrossChainTx, logg // - the total value of the selected UTXOs. // - the number of consolidated UTXOs. // - the total value of the consolidated UTXOs. +// +// TODO(revamp): move to utxo file func (ob *Observer) SelectUTXOs( amount float64, utxosToSpend uint16, @@ -329,6 +334,8 @@ func (ob *Observer) refreshPendingNonce() { } } +// getOutboundIDByNonce gets the outbound ID from the nonce of the outbound transaction +// test is true for unit test only func (ob *Observer) getOutboundIDByNonce(nonce uint64, test bool) (string, error) { // There are 2 types of txids an observer can trust // 1. The ones had been verified and saved by observer self. @@ -363,6 +370,7 @@ func (ob *Observer) getOutboundIDByNonce(nonce uint64, test bool) (string, error return "", fmt.Errorf("getOutboundIDByNonce: cannot find outbound txid for nonce %d", nonce) } +// findNonceMarkUTXO finds the nonce-mark UTXO in the list of UTXOs. func (ob *Observer) findNonceMarkUTXO(nonce uint64, txid string) (int, error) { tssAddress := ob.TSS().BTCAddressWitnessPubkeyHash().EncodeAddress() amount := chains.NonceMarkAmount(nonce) diff --git a/zetaclient/chains/bitcoin/signer/signer.go b/zetaclient/chains/bitcoin/signer/signer.go index 6ad9bfc2a6..eae11a68ce 100644 --- a/zetaclient/chains/bitcoin/signer/signer.go +++ b/zetaclient/chains/bitcoin/signer/signer.go @@ -1,3 +1,4 @@ +// Package signer implements the ChainSigner interface for BTC package signer import ( @@ -168,6 +169,7 @@ func (signer *Signer) AddWithdrawTxOutputs( } // SignWithdrawTx receives utxos sorted by value, amount in BTC, feeRate in BTC per Kb +// TODO(revamp): simplify the function func (signer *Signer) SignWithdrawTx( to btcutil.Address, amount float64, @@ -291,6 +293,7 @@ func (signer *Signer) SignWithdrawTx( return tx, nil } +// Broadcast sends the signed transaction to the network func (signer *Signer) Broadcast(signedTx *wire.MsgTx) error { fmt.Printf("BTCSigner: Broadcasting: %s\n", signedTx.TxHash().String()) @@ -311,6 +314,8 @@ func (signer *Signer) Broadcast(signedTx *wire.MsgTx) error { return nil } +// TryProcessOutbound signs and broadcasts a BTC transaction from a new outbound +// TODO(revamp): simplify the function func (signer *Signer) TryProcessOutbound( cctx *types.CrossChainTx, outboundProcessor *outboundprocessor.Processor, diff --git a/zetaclient/chains/bitcoin/utils.go b/zetaclient/chains/bitcoin/utils.go index fe2bb2481b..8c37e01fad 100644 --- a/zetaclient/chains/bitcoin/utils.go +++ b/zetaclient/chains/bitcoin/utils.go @@ -8,6 +8,9 @@ import ( "github.com/pkg/errors" ) +// TODO(revamp): Remove utils.go and move the functions to the appropriate files + +// PrettyPrintStruct returns a pretty-printed string representation of a struct func PrettyPrintStruct(val interface{}) (string, error) { prettyStruct, err := json.MarshalIndent( val, @@ -20,6 +23,7 @@ func PrettyPrintStruct(val interface{}) (string, error) { return string(prettyStruct), nil } +// GetSatoshis converts a bitcoin amount to satoshis func GetSatoshis(btc float64) (int64, error) { // The amount is only considered invalid if it cannot be represented // as an integer type. This may happen if f is NaN or +-Infinity. @@ -39,6 +43,7 @@ func GetSatoshis(btc float64) (int64, error) { return round(btc * btcutil.SatoshiPerBitcoin), nil } +// round rounds a float64 to the nearest integer func round(f float64) int64 { if f < 0 { // #nosec G701 always in range diff --git a/zetaclient/chains/evm/observer/inbound.go b/zetaclient/chains/evm/observer/inbound.go index 5b40464e27..b6081b190e 100644 --- a/zetaclient/chains/evm/observer/inbound.go +++ b/zetaclient/chains/evm/observer/inbound.go @@ -34,6 +34,7 @@ import ( ) // WatchInbound watches evm chain for incoming txs and post votes to zetacore +// TODO(revamp): move ticker function to a separate file func (ob *Observer) WatchInbound() { ticker, err := clienttypes.NewDynamicTicker( fmt.Sprintf("EVM_WatchInbound_%d", ob.Chain().ChainId), @@ -70,6 +71,7 @@ func (ob *Observer) WatchInbound() { // WatchInboundTracker gets a list of Inbound tracker suggestions from zeta-core at each tick and tries to check if the in-tx was confirmed. // If it was, it tries to broadcast the confirmation vote. If this zeta client has previously broadcast the vote, the tx would be rejected +// TODO(revamp): move inbound tracker function to a separate file func (ob *Observer) WatchInboundTracker() { ticker, err := clienttypes.NewDynamicTicker( fmt.Sprintf("EVM_WatchInboundTracker_%d", ob.Chain().ChainId), @@ -101,6 +103,7 @@ func (ob *Observer) WatchInboundTracker() { } // ProcessInboundTrackers processes inbound trackers from zetacore +// TODO(revamp): move inbound tracker function to a separate file func (ob *Observer) ProcessInboundTrackers() error { trackers, err := ob.ZetacoreClient().GetInboundTrackersForChain(ob.Chain().ChainId) if err != nil { @@ -152,6 +155,7 @@ func (ob *Observer) ProcessInboundTrackers() error { return nil } +// ObserveInbound observes the evm chain for inbounds and posts votes to zetacore func (ob *Observer) ObserveInbound(sampledLogger zerolog.Logger) error { // get and update latest block height blockNumber, err := ob.evmClient.BlockNumber(context.Background()) diff --git a/zetaclient/chains/evm/observer/observer.go b/zetaclient/chains/evm/observer/observer.go index 3db0538870..0a33603196 100644 --- a/zetaclient/chains/evm/observer/observer.go +++ b/zetaclient/chains/evm/observer/observer.go @@ -1,3 +1,4 @@ +// Package observer implements the EVM chain observer package observer import ( @@ -147,6 +148,7 @@ func (ob *Observer) GetERC20CustodyContract() (ethcommon.Address, *erc20custody. } // FetchConnectorContractEth returns the Eth connector address and binder +// TODO(revamp): move this to a contract package func FetchConnectorContractEth( addr ethcommon.Address, client interfaces.EVMRPCClient, @@ -155,6 +157,7 @@ func FetchConnectorContractEth( } // FetchZetaTokenContract returns the non-Eth ZETA token binder +// TODO(revamp): move this to a contract package func FetchZetaTokenContract( addr ethcommon.Address, client interfaces.EVMRPCClient, @@ -183,6 +186,8 @@ func (ob *Observer) Start() { } // WatchRPCStatus watches the RPC status of the evm chain +// TODO(revamp): move ticker to ticker file +// TODO(revamp): move inner logic to a separate function func (ob *Observer) WatchRPCStatus() { ob.Logger().Chain.Info().Msgf("Starting RPC status check for chain %d", ob.Chain().ChainId) ticker := time.NewTicker(60 * time.Second) @@ -288,6 +293,8 @@ func (ob *Observer) CheckTxInclusion(tx *ethtypes.Transaction, receipt *ethtypes } // WatchGasPrice watches evm chain for gas prices and post to zetacore +// TODO(revamp): move ticker to ticker file +// TODO(revamp): move inner logic to a separate function func (ob *Observer) WatchGasPrice() { // report gas price right away as the ticker takes time to kick in err := ob.PostGasPrice() @@ -326,6 +333,8 @@ func (ob *Observer) WatchGasPrice() { } } +// PostGasPrice posts gas price to zetacore +// TODO(revamp): move to gas price file func (ob *Observer) PostGasPrice() error { // GAS PRICE gasPrice, err := ob.evmClient.SuggestGasPrice(context.TODO()) @@ -353,6 +362,7 @@ func (ob *Observer) PostGasPrice() error { } // TransactionByHash query transaction by hash via JSON-RPC +// TODO(revamp): update this method as a pure RPC method that takes two parameters (jsonRPC, and txHash) and move to upper package to file rpc.go func (ob *Observer) TransactionByHash(txHash string) (*ethrpc.Transaction, bool, error) { tx, err := ob.evmJSONRPC.EthGetTransactionByHash(txHash) if err != nil { @@ -365,6 +375,7 @@ func (ob *Observer) TransactionByHash(txHash string) (*ethrpc.Transaction, bool, return tx, tx.BlockNumber == nil, nil } +// GetBlockHeaderCached get block header by number from cache func (ob *Observer) GetBlockHeaderCached(blockNumber uint64) (*ethtypes.Header, error) { if result, ok := ob.HeaderCache().Get(blockNumber); ok { if header, ok := result.(*ethtypes.Header); ok { @@ -422,6 +433,7 @@ func (ob *Observer) BlockByNumber(blockNumber int) (*ethrpc.Block, error) { } // LoadDB open sql database and load data into EVM observer +// TODO(revamp): move to a db file func (ob *Observer) LoadDB(dbPath string) error { if dbPath == "" { return errors.New("empty db path") @@ -450,6 +462,7 @@ func (ob *Observer) LoadDB(dbPath string) error { } // LoadLastBlockScanned loads the last scanned block from the database +// TODO(revamp): move to a db file func (ob *Observer) LoadLastBlockScanned() error { err := ob.Observer.LoadLastBlockScanned(ob.Logger().Chain) if err != nil { @@ -471,6 +484,8 @@ func (ob *Observer) LoadLastBlockScanned() error { return nil } +// postBlockHeader posts the block header to zetacore +// TODO(revamp): move to a block header file func (ob *Observer) postBlockHeader(tip uint64) error { bn := tip diff --git a/zetaclient/chains/evm/observer/outbound.go b/zetaclient/chains/evm/observer/outbound.go index 9c3bd1c66b..2f3d3c136f 100644 --- a/zetaclient/chains/evm/observer/outbound.go +++ b/zetaclient/chains/evm/observer/outbound.go @@ -34,6 +34,8 @@ func (ob *Observer) GetTxID(nonce uint64) string { } // WatchOutbound watches evm chain for outgoing txs status +// TODO(revamp): move ticker function to ticker file +// TODO(revamp): move inner logic to a separate function func (ob *Observer) WatchOutbound() { ticker, err := clienttypes.NewDynamicTicker( fmt.Sprintf("EVM_WatchOutbound_%d", ob.Chain().ChainId), @@ -130,6 +132,7 @@ func (ob *Observer) PostVoteOutbound( // IsOutboundProcessed checks outbound status and returns (isIncluded, isConfirmed, error) // It also posts vote to zetacore if the tx is confirmed +// TODO(revamp): rename as it also vote the outbound func (ob *Observer) IsOutboundProcessed(cctx *crosschaintypes.CrossChainTx, logger zerolog.Logger) (bool, bool, error) { // skip if outbound is not confirmed nonce := cctx.GetCurrentOutboundParam().TssNonce diff --git a/zetaclient/chains/evm/signer/signer.go b/zetaclient/chains/evm/signer/signer.go index 37506144ff..9924fcb347 100644 --- a/zetaclient/chains/evm/signer/signer.go +++ b/zetaclient/chains/evm/signer/signer.go @@ -1,3 +1,4 @@ +// Package signer implements the ChainSigner interface for EVM chains package signer import ( @@ -329,6 +330,7 @@ func (signer *Signer) SignCommandTx(txData *OutboundData, cmd string, params str // TryProcessOutbound - signer interface implementation // This function will attempt to build and sign an evm transaction using the TSS signer. // It will then broadcast the signed transaction to the outbound chain. +// TODO(revamp): simplify function func (signer *Signer) TryProcessOutbound( cctx *types.CrossChainTx, outboundProc *outboundprocessor.Processor, @@ -617,14 +619,19 @@ func (signer *Signer) GetReportedTxList() *map[string]bool { return &signer.outboundHashBeingReported } +// EvmClient returns the EVM RPC client func (signer *Signer) EvmClient() interfaces.EVMRPCClient { return signer.client } +// EvmSigner returns the EVM signer object for the signer func (signer *Signer) EvmSigner() ethtypes.Signer { + // TODO(revamp): rename field into evmSigner return signer.ethSigner } +// IsSenderZetaChain checks if the sender chain is ZetaChain +// TODO(revamp): move to another package more general for cctx functions func IsSenderZetaChain( cctx *types.CrossChainTx, zetacoreClient interfaces.ZetacoreClient, @@ -634,6 +641,7 @@ func IsSenderZetaChain( cctx.CctxStatus.Status == types.CctxStatus_PendingOutbound && flags.IsOutboundEnabled } +// ErrorMsg returns a error message for SignOutbound failure with cctx data func ErrorMsg(cctx *types.CrossChainTx) string { return fmt.Sprintf( "signer SignOutbound error: nonce %d chain %d", @@ -642,6 +650,8 @@ func ErrorMsg(cctx *types.CrossChainTx) string { ) } +// SignWhitelistERC20Cmd signs a whitelist command for ERC20 token +// TODO(revamp): move the cmd in a specific file func (signer *Signer) SignWhitelistERC20Cmd(txData *OutboundData, params string) (*ethtypes.Transaction, error) { outboundParams := txData.outboundParams erc20 := ethcommon.HexToAddress(params) @@ -671,6 +681,8 @@ func (signer *Signer) SignWhitelistERC20Cmd(txData *OutboundData, params string) return tx, nil } +// SignMigrateTssFundsCmd signs a migrate TSS funds command +// TODO(revamp): move the cmd in a specific file func (signer *Signer) SignMigrateTssFundsCmd(txData *OutboundData) (*ethtypes.Transaction, error) { tx, _, _, err := signer.Sign( nil, @@ -688,6 +700,7 @@ func (signer *Signer) SignMigrateTssFundsCmd(txData *OutboundData) (*ethtypes.Tr } // reportToOutboundTracker reports outboundHash to tracker only when tx receipt is available +// TODO(revamp): move outbound tracker function to a outbound tracker file func (signer *Signer) reportToOutboundTracker( zetacoreClient interfaces.ZetacoreClient, chainID int64, @@ -820,6 +833,7 @@ func getEVMRPC(endpoint string) (interfaces.EVMRPCClient, ethtypes.Signer, error return client, ethSigner, nil } +// roundUpToNearestGwei rounds up the gas price to the nearest Gwei func roundUpToNearestGwei(gasPrice *big.Int) *big.Int { oneGwei := big.NewInt(1_000_000_000) // 1 Gwei mod := new(big.Int) diff --git a/zetaclient/chains/interfaces/interfaces.go b/zetaclient/chains/interfaces/interfaces.go index 1ef94ec8de..2272ef1dfe 100644 --- a/zetaclient/chains/interfaces/interfaces.go +++ b/zetaclient/chains/interfaces/interfaces.go @@ -1,3 +1,4 @@ +// Package interfaces provides interfaces for clients and signers for the chain to interact with package interfaces import ( @@ -96,7 +97,6 @@ type ZetacoreClient interface { GetKeys() keyinterfaces.ObserverKeys GetKeyGen() (*observertypes.Keygen, error) GetBlockHeight() (int64, error) - GetLastBlockHeightByChain(chain chains.Chain) (*crosschaintypes.LastBlockHeight, error) ListPendingCctx(chainID int64) ([]*crosschaintypes.CrossChainTx, uint64, error) ListPendingCctxWithinRatelimit() ([]*crosschaintypes.CrossChainTx, uint64, int64, string, bool, error) GetRateLimiterInput(window int64) (crosschaintypes.QueryRateLimiterInputResponse, error) diff --git a/zetaclient/compliance/compliance.go b/zetaclient/compliance/compliance.go index e085b6954b..849d56742b 100644 --- a/zetaclient/compliance/compliance.go +++ b/zetaclient/compliance/compliance.go @@ -1,3 +1,4 @@ +// Package compliance provides functions to check for compliance of cross-chain transactions package compliance import ( diff --git a/zetaclient/config/config.go b/zetaclient/config/config.go index 7dcf1b00f3..6efd149628 100644 --- a/zetaclient/config/config.go +++ b/zetaclient/config/config.go @@ -1,3 +1,4 @@ +// Package config provides functions to load and save ZetaClient config package config import ( @@ -11,7 +12,10 @@ import ( // restrictedAddressBook is a map of restricted addresses var restrictedAddressBook = map[string]bool{} +// filename is config file name for ZetaClient const filename string = "zetaclient_config.json" + +// folder is the folder name for ZetaClient config const folder string = "config" // Save saves ZetaClient config @@ -78,10 +82,12 @@ func Load(path string) (Config, error) { return cfg, nil } +// LoadComplianceConfig loads compliance data (restricted addresses) from config func LoadComplianceConfig(cfg Config) { restrictedAddressBook = cfg.GetRestrictedAddressBook() } +// GetPath returns the absolute path of the input path func GetPath(inputPath string) string { path := strings.Split(inputPath, "/") if len(path) > 0 { @@ -94,6 +100,7 @@ func GetPath(inputPath string) string { return filepath.Join(path...) } } + return inputPath } diff --git a/zetaclient/config/config_chain.go b/zetaclient/config/config_chain.go index 12c889f6af..5c2ed1d077 100644 --- a/zetaclient/config/config_chain.go +++ b/zetaclient/config/config_chain.go @@ -7,20 +7,29 @@ const ( ) const ( + // ConnectorAbiString is the ABI of the connector contract + // TODO(revamp): we should be able to use info from Go binding ConnectorAbiString = ` [{"inputs":[{"internalType":"address","name":"_zetaTokenAddress","type":"address"},{"internalType":"address","name":"_tssAddress","type":"address"},{"internalType":"address","name":"_tssAddressUpdater","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"originSenderAddress","type":"bytes"},{"indexed":true,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"destinationAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":true,"internalType":"bytes32","name":"internalSendHash","type":"bytes32"}],"name":"ZetaReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"originSenderAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"originChainId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"indexed":true,"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":true,"internalType":"bytes32","name":"internalSendHash","type":"bytes32"}],"name":"ZetaReverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"originSenderAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"gasLimit","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"zetaParams","type":"bytes"}],"name":"ZetaSent","type":"event"},{"inputs":[],"name":"getLockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"originSenderAddress","type":"bytes"},{"internalType":"uint256","name":"originChainId","type":"uint256"},{"internalType":"address","name":"destinationAddress","type":"address"},{"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes32","name":"internalSendHash","type":"bytes32"}],"name":"onReceive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"originSenderAddress","type":"address"},{"internalType":"uint256","name":"originChainId","type":"uint256"},{"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes32","name":"internalSendHash","type":"bytes32"}],"name":"onRevert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceTssAddressUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"destinationChainId","type":"uint256"},{"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"internalType":"uint256","name":"gasLimit","type":"uint256"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"uint256","name":"zetaAmount","type":"uint256"},{"internalType":"bytes","name":"zetaParams","type":"bytes"}],"internalType":"struct ZetaInterfaces.SendInput","name":"input","type":"tuple"}],"name":"send","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tssAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tssAddressUpdater","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tssAddress","type":"address"}],"name":"updateTssAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"zetaToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]` + + // ERC20CustodyAbiString is the ABI of the erc20 custodu contract + // TODO(revamp): we should be able to use info from Go binding ERC20CustodyAbiString = ` [{"inputs":[{"internalType":"address","name":"_TSSAddress","type":"address"},{"internalType":"address","name":"_TSSAddressUpdater","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"InvalidTSSUpdater","type":"error"},{"inputs":[],"name":"IsPaused","type":"error"},{"inputs":[],"name":"NotPaused","type":"error"},{"inputs":[],"name":"NotWhitelisted","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"recipient","type":"bytes"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"Unwhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"}],"name":"Whitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"TSSAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TSSAddressUpdater","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"recipient","type":"bytes"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"message","type":"bytes"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceTSSAddressUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"unwhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"updateTSSAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"whitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]` ) +// GetConnectorABI returns the ABI of the connector contract func GetConnectorABI() string { return ConnectorAbiString } +// GetERC20CustodyABI returns the ABI of the erc20 custody contract func GetERC20CustodyABI() string { return ERC20CustodyAbiString } +// New returns a new config +// It is initialize with default chain configs func New() Config { return Config{ EVMChainConfigs: evmChainsConfigs, @@ -28,6 +37,7 @@ func New() Config { } } +// bitcoinConfigRegnet contains Bitcoin config for regnet var bitcoinConfigRegnet = BTCConfig{ RPCUsername: "smoketest", // smoketest is the previous name for E2E test, we keep this name for compatibility between client versions in upgrade test RPCPassword: "123", @@ -35,6 +45,8 @@ var bitcoinConfigRegnet = BTCConfig{ RPCParams: "regtest", } +// evmChainsConfigs contains EVM chain configs +// it contains list of EVM chains with empty endpoint except for localnet var evmChainsConfigs = map[int64]EVMConfig{ chains.Ethereum.ChainId: { Chain: chains.Ethereum, diff --git a/zetaclient/config/types.go b/zetaclient/config/types.go index b14cc8191b..96cdf24a4c 100644 --- a/zetaclient/config/types.go +++ b/zetaclient/config/types.go @@ -12,9 +12,14 @@ import ( type KeyringBackend string const ( + // KeyringBackendUndefined is undefined keyring backend KeyringBackendUndefined KeyringBackend = "" - KeyringBackendTest KeyringBackend = "test" - KeyringBackendFile KeyringBackend = "file" + + // KeyringBackendTest is the test Cosmos keyring backend + KeyringBackendTest KeyringBackend = "test" + + // KeyringBackendFile is the file Cosmos keyring backend + KeyringBackendFile KeyringBackend = "file" ) // ClientConfiguration is a subset of zetaclient config that is used by zetacore client @@ -27,11 +32,13 @@ type ClientConfiguration struct { HsmMode bool `json:"hsm_mode"` } +// EVMConfig is the config for EVM chain type EVMConfig struct { Chain chains.Chain Endpoint string } +// BTCConfig is the config for Bitcoin chain type BTCConfig struct { // the following are rpcclient ConnConfig fields RPCUsername string @@ -40,6 +47,7 @@ type BTCConfig struct { RPCParams string // "regtest", "mainnet", "testnet3" } +// ComplianceConfig is the config for compliance type ComplianceConfig struct { LogPath string `json:"LogPath"` RestrictedAddresses []string `json:"RestrictedAddresses"` @@ -78,6 +86,8 @@ type Config struct { ComplianceConfig ComplianceConfig `json:"ComplianceConfig"` } +// NewConfig returns a new Config with initialize EVM chain mapping and a new mutex +// TODO(revamp): consolidate with New function func NewConfig() Config { return Config{ cfgLock: &sync.RWMutex{}, @@ -85,6 +95,7 @@ func NewConfig() Config { } } +// GetEVMConfig returns the EVM config for the given chain ID func (c Config) GetEVMConfig(chainID int64) (EVMConfig, bool) { c.cfgLock.RLock() defer c.cfgLock.RUnlock() @@ -92,6 +103,7 @@ func (c Config) GetEVMConfig(chainID int64) (EVMConfig, bool) { return evmCfg, found } +// GetAllEVMConfigs returns a map of all EVM configs func (c Config) GetAllEVMConfigs() map[int64]EVMConfig { c.cfgLock.RLock() defer c.cfgLock.RUnlock() @@ -104,6 +116,7 @@ func (c Config) GetAllEVMConfigs() map[int64]EVMConfig { return copied } +// GetBTCConfig returns the BTC config func (c Config) GetBTCConfig() (BTCConfig, bool) { c.cfgLock.RLock() defer c.cfgLock.RUnlock() @@ -111,6 +124,7 @@ func (c Config) GetBTCConfig() (BTCConfig, bool) { return c.BitcoinConfig, c.BitcoinConfig != (BTCConfig{}) } +// String returns the string representation of the config func (c Config) String() string { s, err := json.MarshalIndent(c, "", "\t") if err != nil { @@ -131,6 +145,7 @@ func (c Config) GetRestrictedAddressBook() map[string]bool { return restrictedAddresses } +// GetKeyringBackend returns the keyring backend func (c *Config) GetKeyringBackend() KeyringBackend { c.cfgLock.RLock() defer c.cfgLock.RUnlock() diff --git a/zetaclient/context/app_context.go b/zetaclient/context/app_context.go index d47cd925e8..ffdfa05604 100644 --- a/zetaclient/context/app_context.go +++ b/zetaclient/context/app_context.go @@ -1,3 +1,4 @@ +// Package context provides global app context for ZetaClient package context import ( @@ -22,10 +23,12 @@ func NewAppContext( } } +// Config returns the config of the app func (a AppContext) Config() config.Config { return a.config } +// ZetacoreContext returns the context for ZetaChain func (a AppContext) ZetacoreContext() *ZetacoreContext { return a.coreContext } diff --git a/zetaclient/context/zetacore_context.go b/zetaclient/context/zetacore_context.go index c9e00fe54b..7121a4871c 100644 --- a/zetaclient/context/zetacore_context.go +++ b/zetaclient/context/zetacore_context.go @@ -56,6 +56,7 @@ func NewZetacoreContext(cfg config.Config) *ZetacoreContext { } } +// GetKeygen returns the current keygen func (c *ZetacoreContext) GetKeygen() observertypes.Keygen { c.coreContextLock.RLock() defer c.coreContextLock.RUnlock() @@ -73,6 +74,7 @@ func (c *ZetacoreContext) GetKeygen() observertypes.Keygen { } } +// GetCurrentTssPubkey returns the current tss pubkey func (c *ZetacoreContext) GetCurrentTssPubkey() string { c.coreContextLock.RLock() defer c.coreContextLock.RUnlock() @@ -103,6 +105,7 @@ func (c *ZetacoreContext) GetEnabledExternalChains() []chains.Chain { return externalChains } +// GetEVMChainParams returns chain params for a specific EVM chain func (c *ZetacoreContext) GetEVMChainParams(chainID int64) (*observertypes.ChainParams, bool) { c.coreContextLock.RLock() defer c.coreContextLock.RUnlock() @@ -111,6 +114,7 @@ func (c *ZetacoreContext) GetEVMChainParams(chainID int64) (*observertypes.Chain return evmChainParams, found } +// GetAllEVMChainParams returns all chain params for EVM chains func (c *ZetacoreContext) GetAllEVMChainParams() map[int64]*observertypes.ChainParams { c.coreContextLock.RLock() defer c.coreContextLock.RUnlock() @@ -141,7 +145,7 @@ func (c *ZetacoreContext) GetBTCChainParams() (chains.Chain, *observertypes.Chai return *chain, c.bitcoinChainParams, true } -// GetCrossChainFlags returns cross chain flags +// GetCrossChainFlags returns crosschain flags func (c *ZetacoreContext) GetCrossChainFlags() observertypes.CrosschainFlags { c.coreContextLock.RLock() defer c.coreContextLock.RUnlock() diff --git a/zetaclient/hsm/hsm_signer.go b/zetaclient/hsm/hsm_signer.go index a6d513a353..7d11952716 100644 --- a/zetaclient/hsm/hsm_signer.go +++ b/zetaclient/hsm/hsm_signer.go @@ -1,3 +1,5 @@ +// Package hsm is used to interact with chains with a HSM +// it is currently not used package hsm import ( @@ -158,6 +160,7 @@ func SignWithHSM( return txBuilder.SetSignatures(prevSignatures...) } +// GetPKCS11Config returns the PKCS11 configuration from the environment variables func GetPKCS11Config() (config *crypto11.Config, err error) { config = &crypto11.Config{} config.Path = os.Getenv(hsmPath) diff --git a/zetaclient/keys/keys.go b/zetaclient/keys/keys.go index 3532c12233..0fdef6c204 100644 --- a/zetaclient/keys/keys.go +++ b/zetaclient/keys/keys.go @@ -23,8 +23,11 @@ import ( ) var ( + // ErrBech32ifyPubKey is an error when Bech32ifyPubKey fails ErrBech32ifyPubKey = errors.New("Bech32ifyPubKey fail in main") - ErrNewPubKey = errors.New("NewPubKey error from string") + + // ErrNewPubKey is an error when NewPubKey fails + ErrNewPubKey = errors.New("NewPubKey error from string") ) var _ interfaces.ObserverKeys = &Keys{} @@ -52,6 +55,7 @@ func NewKeysWithKeybase( } } +// GetGranteeKeyName return the grantee name func GetGranteeKeyName(signerName string) string { return signerName } @@ -110,6 +114,7 @@ func (k *Keys) GetSignerInfo() *ckeys.Record { return info } +// GetOperatorAddress return the operator address func (k *Keys) GetOperatorAddress() sdk.AccAddress { return k.OperatorAddress } diff --git a/zetaclient/metrics/metrics.go b/zetaclient/metrics/metrics.go index 1170d16f68..1da10d10e8 100644 --- a/zetaclient/metrics/metrics.go +++ b/zetaclient/metrics/metrics.go @@ -1,3 +1,4 @@ +// Package metrics provides metrics functionalities for the zetaclient package metrics import ( @@ -11,79 +12,93 @@ import ( "github.com/rs/zerolog/log" ) +// Metrics is a struct that contains the http server for metrics type Metrics struct { s *http.Server } +// ZetaClientNamespace is the namespace for the metrics const ZetaClientNamespace = "zetaclient" var ( + // PendingTxsPerChain is a gauge that contains the number of pending transactions per chain PendingTxsPerChain = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "pending_txs_total", Help: "Number of pending transactions per chain", }, []string{"chain"}) + // GetFilterLogsPerChain is a counter that contains the number of getLogs per chain GetFilterLogsPerChain = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: ZetaClientNamespace, Name: "rpc_getFilterLogs_count", Help: "Count of getLogs per chain", }, []string{"chain"}) + // GetBlockByNumberPerChain is a counter that contains the number of getBlockByNumber per chain GetBlockByNumberPerChain = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: ZetaClientNamespace, Name: "rpc_getBlockByNumber_count", Help: "Count of getLogs per chain", }, []string{"chain"}) + // TssNodeBlamePerPubKey is a counter that contains the number of tss node blame per pubkey TssNodeBlamePerPubKey = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: ZetaClientNamespace, Name: "tss_node_blame_count", Help: "Tss node blame counter per pubkey", }, []string{"pubkey"}) + // HotKeyBurnRate is a gauge that contains the fee burn rate of the hotkey HotKeyBurnRate = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "hotkey_burn_rate", Help: "Fee burn rate of the hotkey", }) + // NumberOfUTXO is a gauge that contains the number of UTXOs NumberOfUTXO = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "utxo_number", Help: "Number of UTXOs", }) + // LastScannedBlockNumber is a gauge that contains the last scanned block number per chain LastScannedBlockNumber = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "last_scanned_block_number", Help: "Last scanned block number per chain", }, []string{"chain"}) + // LastCoreBlockNumber is a gauge that contains the last core block number LastCoreBlockNumber = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "last_core_block_number", Help: "Last core block number", }) + // Info is a gauge that contains information about the zetaclient environment Info = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "info", Help: "Information about Zetaclient environment", }, []string{"version"}) + // LastStartTime is a gauge that contains the start time in Unix time LastStartTime = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "last_start_timestamp_seconds", Help: "Start time in Unix time", }) + // NumActiveMsgSigns is a gauge that contains the number of concurrent key signs NumActiveMsgSigns = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "num_active_message_signs", Help: "Number of concurrent key signs", }) + // PercentageOfRateReached is a gauge that contains the percentage of the rate limiter rate reached PercentageOfRateReached = promauto.NewGauge(prometheus.GaugeOpts{ Namespace: ZetaClientNamespace, Name: "percentage_of_rate_reached", @@ -91,6 +106,7 @@ var ( }) ) +// NewMetrics creates a new Metrics instance func NewMetrics() (*Metrics, error) { handler := promhttp.InstrumentMetricHandler( prometheus.DefaultRegisterer, @@ -111,6 +127,7 @@ func NewMetrics() (*Metrics, error) { }, nil } +// Start starts the metrics server func (m *Metrics) Start() { log.Info().Msg("metrics server starting") go func() { @@ -120,6 +137,7 @@ func (m *Metrics) Start() { }() } +// Stop stops the metrics server func (m *Metrics) Stop() error { ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) defer cancel() diff --git a/zetaclient/metrics/telemetry.go b/zetaclient/metrics/telemetry.go index f49c1bf7b1..ebf62d887c 100644 --- a/zetaclient/metrics/telemetry.go +++ b/zetaclient/metrics/telemetry.go @@ -176,10 +176,12 @@ func (t *TelemetryServer) Stop() error { return err } +// pingHandler returns a 200 OK response func (t *TelemetryServer) pingHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) } +// p2pHandler returns the p2p id func (t *TelemetryServer) p2pHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) t.mu.Lock() @@ -187,6 +189,7 @@ func (t *TelemetryServer) p2pHandler(w http.ResponseWriter, _ *http.Request) { fmt.Fprintf(w, "%s", t.p2pid) } +// ipHandler returns the ip address func (t *TelemetryServer) ipHandler(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) t.mu.Lock() @@ -248,6 +251,7 @@ func (t *TelemetryServer) hotKeyFeeBurnRate(w http.ResponseWriter, _ *http.Reque fmt.Fprintf(w, "%v", t.HotKeyBurnRate.GetBurnRate()) } +// logMiddleware logs the incoming HTTP request func logMiddleware() mux.MiddlewareFunc { return func(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/zetaclient/orchestrator/orchestrator.go b/zetaclient/orchestrator/orchestrator.go index 9cda5fb0ca..874131daf2 100644 --- a/zetaclient/orchestrator/orchestrator.go +++ b/zetaclient/orchestrator/orchestrator.go @@ -1,3 +1,4 @@ +// Package orchestrator provides the orchestrator for orchestrating cross-chain transactions package orchestrator import ( @@ -32,6 +33,8 @@ const ( loggerSamplingRate = 10 ) +// Log is a struct that contains the logger +// TODO(revamp): rename to logger type Log struct { Std zerolog.Logger Sampled zerolog.Logger @@ -42,8 +45,10 @@ type Orchestrator struct { // zetacore client zetacoreClient interfaces.ZetacoreClient - // chain signers and observers - signerMap map[int64]interfaces.ChainSigner + // signerMap contains the chain signers indexed by chainID + signerMap map[int64]interfaces.ChainSigner + + // observerMap contains the chain observers indexed by chainID observerMap map[int64]interfaces.ChainObserver // outbound processor @@ -94,6 +99,7 @@ func NewOrchestrator( return &oc } +// MonitorCore starts the orchestrator for CCTXs func (oc *Orchestrator) MonitorCore(appContext *context.AppContext) error { signerAddress, err := oc.zetacoreClient.GetKeys().GetAddress() if err != nil { @@ -231,6 +237,7 @@ func (oc *Orchestrator) GetPendingCctxsWithinRatelimit( } // StartCctxScheduler schedules keysigns for cctxs on each ZetaChain block (the ticker) +// TODO(revamp): make this function simpler func (oc *Orchestrator) StartCctxScheduler(appContext *context.AppContext) { observeTicker := time.NewTicker(3 * time.Second) var lastBlockNum int64 diff --git a/zetaclient/outboundprocessor/outbound_processor.go b/zetaclient/outboundprocessor/outbound_processor.go index feb4caafa7..75a9a6a19f 100644 --- a/zetaclient/outboundprocessor/outbound_processor.go +++ b/zetaclient/outboundprocessor/outbound_processor.go @@ -1,3 +1,4 @@ +// Package outboundprocessor provides functionalities to track outbound processing package outboundprocessor import ( @@ -8,6 +9,9 @@ import ( "github.com/rs/zerolog" ) +// Processor is a struct that contains data about outbound being processed +// TODO(revamp): rename this struct as it is not used to process outbound but track their processing +// We can also consider removing it once we refactor chain client to contains common logic to sign outbounds type Processor struct { outboundStartTime map[string]time.Time outboundEndTime map[string]time.Time @@ -17,6 +21,7 @@ type Processor struct { numActiveProcessor int64 } +// NewProcessor creates a new Processor func NewProcessor(logger zerolog.Logger) *Processor { return &Processor{ outboundStartTime: make(map[string]time.Time), @@ -28,6 +33,7 @@ func NewProcessor(logger zerolog.Logger) *Processor { } } +// StartTryProcess register a new outbound ID to track func (p *Processor) StartTryProcess(outboundID string) { p.mu.Lock() defer p.mu.Unlock() @@ -37,6 +43,7 @@ func (p *Processor) StartTryProcess(outboundID string) { p.Logger.Info().Msgf("StartTryProcess %s, numActiveProcessor %d", outboundID, p.numActiveProcessor) } +// EndTryProcess remove the outbound ID from tracking func (p *Processor) EndTryProcess(outboundID string) { p.mu.Lock() defer p.mu.Unlock() @@ -47,6 +54,7 @@ func (p *Processor) EndTryProcess(outboundID string) { Msgf("EndTryProcess %s, numActiveProcessor %d, time elapsed %s", outboundID, p.numActiveProcessor, time.Since(p.outboundStartTime[outboundID])) } +// IsOutboundActive checks if the outbound ID is being processed func (p *Processor) IsOutboundActive(outboundID string) bool { p.mu.Lock() defer p.mu.Unlock() @@ -54,6 +62,7 @@ func (p *Processor) IsOutboundActive(outboundID string) bool { return found } +// TimeInTryProcess returns the time elapsed since the outbound ID is being processed func (p *Processor) TimeInTryProcess(outboundID string) time.Duration { p.mu.Lock() defer p.mu.Unlock() diff --git a/zetaclient/ratelimiter/rate_limiter.go b/zetaclient/ratelimiter/rate_limiter.go index 0ddb3b378b..e3c69898fa 100644 --- a/zetaclient/ratelimiter/rate_limiter.go +++ b/zetaclient/ratelimiter/rate_limiter.go @@ -1,3 +1,4 @@ +// Package ratelimiter provides functionalities for rate limiting the cross-chain transactions package ratelimiter import ( diff --git a/zetaclient/supplychecker/logger.go b/zetaclient/supplychecker/logger.go index 223e43eab8..89da0300d6 100644 --- a/zetaclient/supplychecker/logger.go +++ b/zetaclient/supplychecker/logger.go @@ -21,6 +21,7 @@ type ZetaSupplyCheckLogs struct { SupplyCheckSuccess bool `json:"supply_check_success"` } +// LogOutput logs the output of the ZetaSupplyChecker func (z ZetaSupplyCheckLogs) LogOutput() { output, err := bitcoin.PrettyPrintStruct(z) if err != nil { diff --git a/zetaclient/supplychecker/validate.go b/zetaclient/supplychecker/validate.go index d70bda8c34..f9e4dbaf79 100644 --- a/zetaclient/supplychecker/validate.go +++ b/zetaclient/supplychecker/validate.go @@ -5,6 +5,7 @@ import ( "github.com/rs/zerolog" ) +// ValidateZetaSupply validates the zeta supply from the checked values func ValidateZetaSupply( logger zerolog.Logger, abortedTxAmounts, zetaInTransit, genesisAmounts, externalChainTotalSupply, zetaTokenSupplyOnNode, ethLockedAmount sdkmath.Int, diff --git a/zetaclient/supplychecker/zeta_supply_checker.go b/zetaclient/supplychecker/zeta_supply_checker.go index 2bf9cf9499..1d588e9317 100644 --- a/zetaclient/supplychecker/zeta_supply_checker.go +++ b/zetaclient/supplychecker/zeta_supply_checker.go @@ -1,3 +1,5 @@ +// Package supplychecker provides functionalities to check the total supply of Zeta tokens +// Currently not used in the codebase package supplychecker import ( @@ -97,6 +99,7 @@ func NewZetaSupplyChecker( return zetaSupplyChecker, nil } +// Start starts the ZetaSupplyChecker func (zs *ZetaSupplyChecker) Start() { defer zs.ticker.Stop() for { @@ -112,11 +115,13 @@ func (zs *ZetaSupplyChecker) Start() { } } +// Stop stops the ZetaSupplyChecker func (zs *ZetaSupplyChecker) Stop() { zs.logger.Info().Msgf("ZetaSupplyChecker is stopping") close(zs.stop) } +// CheckZetaTokenSupply checks the total supply of Zeta tokens func (zs *ZetaSupplyChecker) CheckZetaTokenSupply() error { externalChainTotalSupply := sdkmath.ZeroInt() for _, chain := range zs.externalEvmChain { @@ -198,6 +203,7 @@ func (zs *ZetaSupplyChecker) CheckZetaTokenSupply() error { return nil } +// AbortedTxAmount returns the amount of Zeta tokens in aborted transactions func (zs *ZetaSupplyChecker) AbortedTxAmount() (sdkmath.Int, error) { amount, err := zs.zetaClient.GetAbortedZetaAmount() if err != nil { @@ -210,6 +216,7 @@ func (zs *ZetaSupplyChecker) AbortedTxAmount() (sdkmath.Int, error) { return amountInt, nil } +// GetAmountOfZetaInTransit returns the amount of Zeta tokens in transit func (zs *ZetaSupplyChecker) GetAmountOfZetaInTransit() (sdkmath.Int, error) { chainsToCheck := make([]chains.Chain, len(zs.externalEvmChain)+1) chainsToCheck = append(append(chainsToCheck, zs.externalEvmChain...), zs.ethereumChain) @@ -227,6 +234,7 @@ func (zs *ZetaSupplyChecker) GetAmountOfZetaInTransit() (sdkmath.Int, error) { return amountInt, nil } +// GetPendingCCTXInTransit returns the pending CCTX in transit func (zs *ZetaSupplyChecker) GetPendingCCTXInTransit(receivingChains []chains.Chain) []*types.CrossChainTx { cctxInTransit := make([]*types.CrossChainTx, 0) for _, chain := range receivingChains { diff --git a/zetaclient/testutils/mempool_client.go b/zetaclient/testutils/mempool_client.go index 03c79120dc..a49ff45e78 100644 --- a/zetaclient/testutils/mempool_client.go +++ b/zetaclient/testutils/mempool_client.go @@ -15,6 +15,7 @@ const ( APIURLBlockTxsTestnet = "https://mempool.space/testnet/api/block/%s/txs" ) +// MempoolBlock represents a block in the mempool type MempoolBlock struct { ID string `json:"id"` Height int `json:"height"` @@ -32,6 +33,7 @@ type MempoolBlock struct { Extras BlockExtra `json:"extras"` } +// Vin represents a Bitcoin transaction input type Vin struct { TxID string `json:"txid"` Vout uint32 `json:"vout"` @@ -47,6 +49,7 @@ type Vin struct { Sequence uint32 `json:"sequence"` } +// Vout represents a Bitcoin transaction output type Vout struct { Scriptpubkey string `json:"scriptpubkey"` ScriptpubkeyAsm string `json:"scriptpubkey_asm"` @@ -54,6 +57,7 @@ type Vout struct { Value int64 `json:"value"` } +// MempoolTx represents a transaction in the mempool type MempoolTx struct { TxID string `json:"txid"` Version int `json:"version"` @@ -65,6 +69,7 @@ type MempoolTx struct { Fee int `json:"fee"` } +// BlockExtra represents extra information about a block type BlockExtra struct { TotalFees int `json:"totalFees"` MedianFee float64 `json:"medianFee"` @@ -105,6 +110,7 @@ type BlockExtra struct { ExpectedWeight int `json:"expectedWeight"` } +// Get makes a GET request to the given path and decodes the response func Get(ctx context.Context, path string, v interface{}) error { req, err := http.NewRequest("GET", path, nil) if err != nil { diff --git a/zetaclient/testutils/mocks/zetacore_client.go b/zetaclient/testutils/mocks/zetacore_client.go index 953d8ce287..2f413a8764 100644 --- a/zetaclient/testutils/mocks/zetacore_client.go +++ b/zetaclient/testutils/mocks/zetacore_client.go @@ -145,13 +145,6 @@ func (m *MockZetacoreClient) GetBlockHeight() (int64, error) { return 0, nil } -func (m *MockZetacoreClient) GetLastBlockHeightByChain(_ chains.Chain) (*crosschaintypes.LastBlockHeight, error) { - if m.paused { - return nil, errors.New(ErrMsgPaused) - } - return &crosschaintypes.LastBlockHeight{}, nil -} - func (m *MockZetacoreClient) GetRateLimiterInput(_ int64) (crosschaintypes.QueryRateLimiterInputResponse, error) { if m.paused { return crosschaintypes.QueryRateLimiterInputResponse{}, errors.New(ErrMsgPaused) diff --git a/zetaclient/testutils/testdata.go b/zetaclient/testutils/testdata.go index fc028bf0ec..620eb16b17 100644 --- a/zetaclient/testutils/testdata.go +++ b/zetaclient/testutils/testdata.go @@ -48,6 +48,8 @@ func LoadObjectFromJSONFile(t *testing.T, obj interface{}, filename string) { require.NoError(t, err) } +// ComplianceConfigTest returns a test compliance config +// TODO(revamp): move to sample package func ComplianceConfigTest() config.ComplianceConfig { return config.ComplianceConfig{ RestrictedAddresses: []string{RestrictedEVMAddressTest, RestrictedBtcAddressTest}, diff --git a/zetaclient/tss/tss_signer.go b/zetaclient/tss/tss_signer.go index 8fdd0384ee..08d48833db 100644 --- a/zetaclient/tss/tss_signer.go +++ b/zetaclient/tss/tss_signer.go @@ -1,3 +1,4 @@ +// Package tss provides the TSS signer functionalities for the zetaclient to sign transactions on external chains package tss import ( @@ -37,15 +38,18 @@ import ( ) const ( + // envFlagPostBlame is the environment flag to enable posting blame data to core envFlagPostBlame = "POST_BLAME" ) +// Key is a struct that holds the public key, bech32 pubkey, and address for the TSS type Key struct { PubkeyInBytes []byte PubkeyInBech32 string AddressInHex string } +// NewTSSKey creates a new TSS key func NewTSSKey(pk string) (*Key, error) { TSSKey := &Key{ PubkeyInBech32: pk, @@ -141,6 +145,8 @@ func NewTSS( return &newTss, nil } +// SetupTSSServer creates a new TSS server +// TODO(revamp): move to TSS server file func SetupTSSServer( peer p2p.AddrList, privkey tmcrypto.PrivKey, @@ -207,6 +213,7 @@ func SetupTSSServer( return tssServer, nil } +// Pubkey returns the current pubkey func (tss *TSS) Pubkey() []byte { return tss.Keys[tss.CurrentPubkey].PubkeyInBytes } @@ -404,6 +411,7 @@ func (tss *TSS) SignBatch(digests [][]byte, height uint64, nonce uint64, chainID return sigBytes, nil } +// Validate validates the TSS func (tss *TSS) Validate() error { evmAddress := tss.EVMAddress() blankAddress := ethcommon.Address{} @@ -419,6 +427,7 @@ func (tss *TSS) Validate() error { return nil } +// EVMAddress generates an EVM address from pubkey func (tss *TSS) EVMAddress() ethcommon.Address { addr, err := GetTssAddrEVM(tss.CurrentPubkey) if err != nil { @@ -438,6 +447,7 @@ func (tss *TSS) BTCAddress() string { return addr } +// BTCAddressWitnessPubkeyHash generates a bech32 p2wpkh address from pubkey func (tss *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash { addrWPKH, err := getKeyAddrBTCWitnessPubkeyHash(tss.CurrentPubkey, tss.BitcoinChainID) if err != nil { @@ -447,6 +457,7 @@ func (tss *TSS) BTCAddressWitnessPubkeyHash() *btcutil.AddressWitnessPubKeyHash return addrWPKH } +// PubKeyCompressedBytes returns the compressed bytes of the current pubkey func (tss *TSS) PubKeyCompressedBytes() []byte { pubk, err := cosmos.GetPubKeyFromBech32(cosmos.Bech32PubKeyTypeAccPub, tss.CurrentPubkey) if err != nil { @@ -466,6 +477,7 @@ func (tss *TSS) InsertPubKey(pk string) error { return nil } +// VerifyKeysharesForPubkeys verifies the keyshares present on the node. It checks whether the node has TSS key shares for the TSS ceremonies it was part of. func (tss *TSS) VerifyKeysharesForPubkeys(tssList []observertypes.TSS, granteePubKey32 string) error { for _, t := range tssList { if wasNodePartOfTss(granteePubKey32, t.TssParticipantList) { @@ -477,6 +489,7 @@ func (tss *TSS) VerifyKeysharesForPubkeys(tssList []observertypes.TSS, granteePu return nil } +// LoadTssFilesFromDirectory loads the TSS files at the directory specified by the `tssPath` func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error { files, err := os.ReadDir(tssPath) if err != nil { @@ -528,6 +541,7 @@ func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error { return nil } +// GetTssAddrBTC generates a bech32 p2wpkh address from pubkey func GetTssAddrBTC(tssPubkey string, bitcoinChainID int64) (string, error) { addrWPKH, err := getKeyAddrBTCWitnessPubkeyHash(tssPubkey, bitcoinChainID) if err != nil { @@ -538,6 +552,7 @@ func GetTssAddrBTC(tssPubkey string, bitcoinChainID int64) (string, error) { return addrWPKH.EncodeAddress(), nil } +// GetTssAddrEVM generates an EVM address from pubkey func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error) { var keyAddr ethcommon.Address pubk, err := cosmos.GetPubKeyFromBech32(cosmos.Bech32PubKeyTypeAccPub, tssPubkey) @@ -558,6 +573,9 @@ func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error) { return keyAddr, nil } +// TestKeysign tests the keysign +// it is called when a new TSS is generated to ensure the network works as expected +// TODO(revamp): move to a test package func TestKeysign(tssPubkey string, tssServer *tss.TssServer) error { log.Info().Msg("trying keysign...") data := []byte("hello meta") @@ -594,11 +612,14 @@ func TestKeysign(tssPubkey string, tssServer *tss.TssServer) error { return fmt.Errorf("verify signature fail") } +// IsEnvFlagEnabled checks if the environment flag is enabled func IsEnvFlagEnabled(flag string) bool { value := os.Getenv(flag) return value == "true" || value == "1" } +// verifySignature verifies the signature +// TODO(revamp): move to a test package func verifySignature(tssPubkey string, signature []keysign.Signature, H []byte) bool { if len(signature) == 0 { log.Warn().Msg("verify_signature: empty signature array") @@ -640,12 +661,15 @@ func verifySignature(tssPubkey string, signature []keysign.Signature, H []byte) return bytes.Equal(pubkey.Bytes(), compressedPubkey) } +// combineDigests combines the digests func combineDigests(digestList []string) []byte { digestConcat := strings.Join(digestList[:], "") digestBytes := chainhash.DoubleHashH([]byte(digestConcat)) return digestBytes.CloneBytes() } +// wasNodePartOfTss checks if the node was part of the TSS +// it checks whether a pubkey is part of the list used to generate the TSS , Every TSS generated on the network has its own list of associated public keys func wasNodePartOfTss(granteePubKey32 string, granteeList []string) bool { for _, grantee := range granteeList { if granteePubKey32 == grantee { @@ -655,6 +679,7 @@ func wasNodePartOfTss(granteePubKey32 string, granteeList []string) bool { return false } +// getKeyAddrBTCWitnessPubkeyHash generates a bech32 p2wpkh address from pubkey func getKeyAddrBTCWitnessPubkeyHash(tssPubkey string, chainID int64) (*btcutil.AddressWitnessPubKeyHash, error) { pubk, err := cosmos.GetPubKeyFromBech32(cosmos.Bech32PubKeyTypeAccPub, tssPubkey) if err != nil { diff --git a/zetaclient/types/dynamic_ticker.go b/zetaclient/types/dynamic_ticker.go index 49434e03ea..103bfffb94 100644 --- a/zetaclient/types/dynamic_ticker.go +++ b/zetaclient/types/dynamic_ticker.go @@ -7,12 +7,14 @@ import ( "github.com/rs/zerolog" ) +// DynamicTicker is a ticker that can have its interval updated type DynamicTicker struct { name string interval uint64 impl *time.Ticker } +// NewDynamicTicker creates a new DynamicTicker func NewDynamicTicker(name string, interval uint64) (*DynamicTicker, error) { if interval <= 0 { return nil, fmt.Errorf("non-positive ticker interval %d for %s", interval, name) @@ -25,10 +27,12 @@ func NewDynamicTicker(name string, interval uint64) (*DynamicTicker, error) { }, nil } +// C returns the channel of the ticker func (t *DynamicTicker) C() <-chan time.Time { return t.impl.C } +// UpdateInterval updates the interval of the ticker func (t *DynamicTicker) UpdateInterval(newInterval uint64, logger zerolog.Logger) { if newInterval > 0 && t.interval != newInterval { t.impl.Stop() @@ -39,6 +43,7 @@ func (t *DynamicTicker) UpdateInterval(newInterval uint64, logger zerolog.Logger } } +// Stop stops the ticker func (t *DynamicTicker) Stop() { t.impl.Stop() } diff --git a/zetaclient/types/ethish.go b/zetaclient/types/ethish.go index fd3a40af6d..6935a22141 100644 --- a/zetaclient/types/ethish.go +++ b/zetaclient/types/ethish.go @@ -4,6 +4,7 @@ import ( "encoding/hex" ) +// EthHexToBytes converts an Ethereum hex string to bytes func BytesToEthHex(b []byte) string { return "0x" + hex.EncodeToString(b) } diff --git a/zetaclient/types/sql_evm.go b/zetaclient/types/sql_evm.go index c551fda503..398a968a60 100644 --- a/zetaclient/types/sql_evm.go +++ b/zetaclient/types/sql_evm.go @@ -71,6 +71,7 @@ type LastBlockSQLType struct { // Type translation functions: +// ToReceiptDBType : Converts an Ethereum receipt to a ReceiptDB type func ToReceiptDBType(receipt *ethtypes.Receipt) (ReceiptDB, error) { logs, err := json.Marshal(receipt.Logs) if err != nil { @@ -92,6 +93,7 @@ func ToReceiptDBType(receipt *ethtypes.Receipt) (ReceiptDB, error) { }, nil } +// FromReceiptDBType : Converts a ReceiptDB type to an Ethereum receipt func FromReceiptDBType(receipt ReceiptDB) (*ethtypes.Receipt, error) { res := ðtypes.Receipt{ Type: receipt.Type, @@ -111,6 +113,7 @@ func FromReceiptDBType(receipt ReceiptDB) (*ethtypes.Receipt, error) { return res, err } +// ToReceiptSQLType : Converts an Ethereum receipt to a ReceiptSQLType func ToReceiptSQLType(receipt *ethtypes.Receipt, index string) (*ReceiptSQLType, error) { r, err := ToReceiptDBType(receipt) if err != nil { @@ -122,6 +125,7 @@ func ToReceiptSQLType(receipt *ethtypes.Receipt, index string) (*ReceiptSQLType, }, nil } +// ToTransactionDBType : Converts an Ethereum transaction to a TransactionDB type func ToTransactionDBType(transaction *ethtypes.Transaction) (TransactionDB, error) { data, err := transaction.MarshalBinary() if err != nil { @@ -137,12 +141,14 @@ func ToTransactionDBType(transaction *ethtypes.Transaction) (TransactionDB, erro }, nil } +// FromTransactionDBType : Converts a TransactionDB type to an Ethereum transaction func FromTransactionDBType(transaction TransactionDB) (*ethtypes.Transaction, error) { res := ðtypes.Transaction{} err := res.UnmarshalBinary(transaction.TransactionData) return res, err } +// ToTransactionSQLType : Converts an Ethereum transaction to a TransactionSQLType func ToTransactionSQLType(transaction *ethtypes.Transaction, index string) (*TransactionSQLType, error) { trans, err := ToTransactionDBType(transaction) if err != nil { @@ -154,6 +160,7 @@ func ToTransactionSQLType(transaction *ethtypes.Transaction, index string) (*Tra }, nil } +// ToLastBlockSQLType : Converts a last block number to a LastBlockSQLType func ToLastBlockSQLType(lastBlock uint64) *LastBlockSQLType { return &LastBlockSQLType{ Model: gorm.Model{ID: LastBlockNumID}, diff --git a/zetaclient/zetacore/broadcast.go b/zetaclient/zetacore/broadcast.go index 82a011c6ba..6c1b475476 100644 --- a/zetaclient/zetacore/broadcast.go +++ b/zetaclient/zetacore/broadcast.go @@ -50,7 +50,7 @@ func BroadcastToZetaCore( return client.Broadcast(gasLimit, authzWrappedMsg, authzSigner) } -// Broadcast Broadcasts tx to metachain. Returns txHash and error +// Broadcast Broadcasts tx to ZetaChain. Returns txHash and error func (c *Client) Broadcast(gaslimit uint64, authzWrappedMsg sdktypes.Msg, authzSigner authz.Signer) (string, error) { c.broadcastLock.Lock() defer c.broadcastLock.Unlock() @@ -204,6 +204,7 @@ func (c *Client) GetContext() (client.Context, error) { return ctx, nil } +// SignTx signs a tx with the given name func (c *Client) SignTx( txf clienttx.Factory, name string, diff --git a/zetaclient/zetacore/client.go b/zetaclient/zetacore/client.go index 290f824a0c..a8c36778b7 100644 --- a/zetaclient/zetacore/client.go +++ b/zetaclient/zetacore/client.go @@ -1,3 +1,4 @@ +// Package zetacore provides functionalities for interacting with ZetaChain package zetacore import ( @@ -289,14 +290,18 @@ func (c *Client) UpdateZetacoreContext( return nil } +// Pause pauses the client func (c *Client) Pause() { <-c.pause } +// Unpause unpauses the client func (c *Client) Unpause() { c.pause <- struct{}{} } +// EnableMockSDKClient enables the mock cosmos sdk client +// TODO(revamp): move this to a test package func (c *Client) EnableMockSDKClient(client rpcclient.Client) { c.mockSDKClient = client c.enableMockSDKClient = true diff --git a/zetaclient/zetacore/query.go b/zetaclient/zetacore/query.go index 56782ba6f0..9b54ece0b3 100644 --- a/zetaclient/zetacore/query.go +++ b/zetaclient/zetacore/query.go @@ -26,6 +26,7 @@ import ( "github.com/zeta-chain/zetacore/zetaclient/chains/interfaces" ) +// GetCrosschainFlags returns the crosschain flags func (c *Client) GetCrosschainFlags() (observertypes.CrosschainFlags, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.CrosschainFlags(context.Background(), &observertypes.QueryGetCrosschainFlagsRequest{}) @@ -35,6 +36,7 @@ func (c *Client) GetCrosschainFlags() (observertypes.CrosschainFlags, error) { return resp.CrosschainFlags, nil } +// GetBlockHeaderEnabledChains returns the enabled chains for block headers func (c *Client) GetBlockHeaderEnabledChains() ([]lightclienttypes.HeaderSupportedChain, error) { client := lightclienttypes.NewQueryClient(c.grpcConn) resp, err := client.HeaderEnabledChains(context.Background(), &lightclienttypes.QueryHeaderEnabledChainsRequest{}) @@ -44,6 +46,7 @@ func (c *Client) GetBlockHeaderEnabledChains() ([]lightclienttypes.HeaderSupport return resp.HeaderEnabledChains, nil } +// GetRateLimiterFlags returns the rate limiter flags func (c *Client) GetRateLimiterFlags() (crosschaintypes.RateLimiterFlags, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.RateLimiterFlags(context.Background(), &crosschaintypes.QueryRateLimiterFlagsRequest{}) @@ -53,6 +56,7 @@ func (c *Client) GetRateLimiterFlags() (crosschaintypes.RateLimiterFlags, error) return resp.RateLimiterFlags, nil } +// GetChainParamsForChainID returns the chain params for a given chain ID func (c *Client) GetChainParamsForChainID(externalChainID int64) (*observertypes.ChainParams, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.GetChainParamsForChain( @@ -65,6 +69,7 @@ func (c *Client) GetChainParamsForChainID(externalChainID int64) (*observertypes return resp.ChainParams, nil } +// GetChainParams returns all the chain params func (c *Client) GetChainParams() ([]*observertypes.ChainParams, error) { client := observertypes.NewQueryClient(c.grpcConn) var err error @@ -80,6 +85,7 @@ func (c *Client) GetChainParams() ([]*observertypes.ChainParams, error) { return nil, fmt.Errorf("failed to get chain params | err %s", err.Error()) } +// GetUpgradePlan returns the current upgrade plan func (c *Client) GetUpgradePlan() (*upgradetypes.Plan, error) { client := upgradetypes.NewQueryClient(c.grpcConn) @@ -90,6 +96,7 @@ func (c *Client) GetUpgradePlan() (*upgradetypes.Plan, error) { return resp.Plan, nil } +// GetAllCctx returns all cross chain transactions func (c *Client) GetAllCctx() ([]*crosschaintypes.CrossChainTx, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.CctxAll(context.Background(), &crosschaintypes.QueryAllCctxRequest{}) @@ -99,6 +106,7 @@ func (c *Client) GetAllCctx() ([]*crosschaintypes.CrossChainTx, error) { return resp.CrossChainTx, nil } +// GetCctxByHash returns a cross chain transaction by hash func (c *Client) GetCctxByHash(sendHash string) (*crosschaintypes.CrossChainTx, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.Cctx(context.Background(), &crosschaintypes.QueryGetCctxRequest{Index: sendHash}) @@ -108,6 +116,7 @@ func (c *Client) GetCctxByHash(sendHash string) (*crosschaintypes.CrossChainTx, return resp.CrossChainTx, nil } +// GetCctxByNonce returns a cross chain transaction by nonce func (c *Client) GetCctxByNonce(chainID int64, nonce uint64) (*crosschaintypes.CrossChainTx, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.CctxByNonce(context.Background(), &crosschaintypes.QueryGetCctxByNonceRequest{ @@ -120,6 +129,7 @@ func (c *Client) GetCctxByNonce(chainID int64, nonce uint64) (*crosschaintypes.C return resp.CrossChainTx, nil } +// GetObserverList returns the list of observers func (c *Client) GetObserverList() ([]string, error) { var err error client := observertypes.NewQueryClient(c.grpcConn) @@ -186,6 +196,7 @@ func (c *Client) ListPendingCctxWithinRatelimit() ([]*crosschaintypes.CrossChain return resp.CrossChainTx, resp.TotalPending, resp.CurrentWithdrawWindow, resp.CurrentWithdrawRate, resp.RateLimitExceeded, nil } +// GetAbortedZetaAmount returns the amount of zeta that has been aborted func (c *Client) GetAbortedZetaAmount() (string, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.ZetaAccounting(context.Background(), &crosschaintypes.QueryZetaAccountingRequest{}) @@ -195,6 +206,7 @@ func (c *Client) GetAbortedZetaAmount() (string, error) { return resp.AbortedZetaAmount, nil } +// GetGenesisSupply returns the genesis supply func (c *Client) GetGenesisSupply() (sdkmath.Int, error) { tmURL := fmt.Sprintf("http://%s", c.cfg.ChainRPC) s, err := tmhttp.New(tmURL, "/websocket") @@ -213,6 +225,7 @@ func (c *Client) GetGenesisSupply() (sdkmath.Int, error) { return bankstate.Supply.AmountOf(config.BaseDenom), nil } +// GetZetaTokenSupplyOnNode returns the zeta token supply on the node func (c *Client) GetZetaTokenSupplyOnNode() (sdkmath.Int, error) { client := banktypes.NewQueryClient(c.grpcConn) resp, err := client.SupplyOf(context.Background(), &banktypes.QuerySupplyOfRequest{Denom: config.BaseDenom}) @@ -222,6 +235,7 @@ func (c *Client) GetZetaTokenSupplyOnNode() (sdkmath.Int, error) { return resp.GetAmount().Amount, nil } +// GetLastBlockHeight returns the last block height func (c *Client) GetLastBlockHeight() ([]*crosschaintypes.LastBlockHeight, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.LastBlockHeightAll(context.Background(), &crosschaintypes.QueryAllLastBlockHeightRequest{}) @@ -232,6 +246,7 @@ func (c *Client) GetLastBlockHeight() ([]*crosschaintypes.LastBlockHeight, error return resp.LastBlockHeight, nil } +// GetLatestZetaBlock returns the latest zeta block func (c *Client) GetLatestZetaBlock() (*tmservice.Block, error) { client := tmservice.NewServiceClient(c.grpcConn) res, err := client.GetLatestBlock(context.Background(), &tmservice.GetLatestBlockRequest{}) @@ -241,6 +256,7 @@ func (c *Client) GetLatestZetaBlock() (*tmservice.Block, error) { return res.SdkBlock, nil } +// GetNodeInfo returns the node info func (c *Client) GetNodeInfo() (*tmservice.GetNodeInfoResponse, error) { var err error @@ -255,18 +271,7 @@ func (c *Client) GetNodeInfo() (*tmservice.GetNodeInfoResponse, error) { return nil, err } -func (c *Client) GetLastBlockHeightByChain(chain chains.Chain) (*crosschaintypes.LastBlockHeight, error) { - client := crosschaintypes.NewQueryClient(c.grpcConn) - resp, err := client.LastBlockHeight( - context.Background(), - &crosschaintypes.QueryGetLastBlockHeightRequest{Index: chain.ChainName.String()}, - ) - if err != nil { - return nil, err - } - return resp.LastBlockHeight, nil -} - +// GetBlockHeight returns the zetachain block height func (c *Client) GetBlockHeight() (int64, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.LastZetaHeight(context.Background(), &crosschaintypes.QueryLastZetaHeightRequest{}) @@ -276,6 +281,7 @@ func (c *Client) GetBlockHeight() (int64, error) { return resp.Height, nil } +// GetBaseGasPrice returns the base gas price func (c *Client) GetBaseGasPrice() (int64, error) { client := feemarkettypes.NewQueryClient(c.grpcConn) resp, err := client.Params(context.Background(), &feemarkettypes.QueryParamsRequest{}) @@ -288,6 +294,7 @@ func (c *Client) GetBaseGasPrice() (int64, error) { return resp.Params.BaseFee.Int64(), nil } +// GetBallotByID returns a ballot by ID func (c *Client) GetBallotByID(id string) (*observertypes.QueryBallotByIdentifierResponse, error) { client := observertypes.NewQueryClient(c.grpcConn) return client.BallotByIdentifier(context.Background(), &observertypes.QueryBallotByIdentifierRequest{ @@ -295,6 +302,7 @@ func (c *Client) GetBallotByID(id string) (*observertypes.QueryBallotByIdentifie }) } +// GetNonceByChain returns the nonce by chain func (c *Client) GetNonceByChain(chain chains.Chain) (observertypes.ChainNonces, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.ChainNonces( @@ -307,6 +315,7 @@ func (c *Client) GetNonceByChain(chain chains.Chain) (observertypes.ChainNonces, return resp.ChainNonces, nil } +// GetAllNodeAccounts returns all node accounts func (c *Client) GetAllNodeAccounts() ([]*observertypes.NodeAccount, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.NodeAccountAll(context.Background(), &observertypes.QueryAllNodeAccountRequest{}) @@ -317,6 +326,7 @@ func (c *Client) GetAllNodeAccounts() ([]*observertypes.NodeAccount, error) { return resp.NodeAccount, nil } +// GetKeyGen returns the keygen func (c *Client) GetKeyGen() (*observertypes.Keygen, error) { var err error client := observertypes.NewQueryClient(c.grpcConn) @@ -331,6 +341,7 @@ func (c *Client) GetKeyGen() (*observertypes.Keygen, error) { return nil, fmt.Errorf("failed to get keygen | err %s", err.Error()) } +// GetBallot returns a ballot by ID func (c *Client) GetBallot(ballotIdentifier string) (*observertypes.QueryBallotByIdentifierResponse, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.BallotByIdentifier(context.Background(), &observertypes.QueryBallotByIdentifierRequest{ @@ -342,6 +353,7 @@ func (c *Client) GetBallot(ballotIdentifier string) (*observertypes.QueryBallotB return resp, nil } +// GetInboundTrackersForChain returns the inbound trackers for a chain func (c *Client) GetInboundTrackersForChain(chainID int64) ([]crosschaintypes.InboundTracker, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.InboundTrackerAllByChain( @@ -354,6 +366,7 @@ func (c *Client) GetInboundTrackersForChain(chainID int64) ([]crosschaintypes.In return resp.InboundTracker, nil } +// GetCurrentTss returns the current TSS func (c *Client) GetCurrentTss() (observertypes.TSS, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.TSS(context.Background(), &observertypes.QueryGetTSSRequest{}) @@ -363,6 +376,8 @@ func (c *Client) GetCurrentTss() (observertypes.TSS, error) { return resp.TSS, nil } +// GetEthTssAddress returns the ETH TSS address +// TODO(revamp): rename to EVM func (c *Client) GetEthTssAddress() (string, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{}) @@ -372,6 +387,7 @@ func (c *Client) GetEthTssAddress() (string, error) { return resp.Eth, nil } +// GetBtcTssAddress returns the BTC TSS address func (c *Client) GetBtcTssAddress(chainID int64) (string, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.GetTssAddress(context.Background(), &observertypes.QueryGetTssAddressRequest{ @@ -383,6 +399,7 @@ func (c *Client) GetBtcTssAddress(chainID int64) (string, error) { return resp.Btc, nil } +// GetTssHistory returns the TSS history func (c *Client) GetTssHistory() ([]observertypes.TSS, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.TssHistory(context.Background(), &observertypes.QueryTssHistoryRequest{}) @@ -392,6 +409,7 @@ func (c *Client) GetTssHistory() ([]observertypes.TSS, error) { return resp.TssList, nil } +// GetOutboundTracker returns the outbound tracker for a chain and nonce func (c *Client) GetOutboundTracker(chain chains.Chain, nonce uint64) (*crosschaintypes.OutboundTracker, error) { client := crosschaintypes.NewQueryClient(c.grpcConn) resp, err := client.OutboundTracker(context.Background(), &crosschaintypes.QueryGetOutboundTrackerRequest{ @@ -404,6 +422,7 @@ func (c *Client) GetOutboundTracker(chain chains.Chain, nonce uint64) (*crosscha return &resp.OutboundTracker, nil } +// GetAllOutboundTrackerByChain returns all outbound trackers for a chain func (c *Client) GetAllOutboundTrackerByChain( chainID int64, order interfaces.Order, @@ -438,6 +457,7 @@ func (c *Client) GetAllOutboundTrackerByChain( return resp.OutboundTracker, nil } +// GetPendingNoncesByChain returns the pending nonces for a chain and current tss address func (c *Client) GetPendingNoncesByChain(chainID int64) (observertypes.PendingNonces, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.PendingNoncesByChain( @@ -450,6 +470,7 @@ func (c *Client) GetPendingNoncesByChain(chainID int64) (observertypes.PendingNo return resp.PendingNonces, nil } +// GetBlockHeaderChainState returns the block header chain state func (c *Client) GetBlockHeaderChainState(chainID int64) (lightclienttypes.QueryGetChainStateResponse, error) { client := lightclienttypes.NewQueryClient(c.grpcConn) resp, err := client.ChainState(context.Background(), &lightclienttypes.QueryGetChainStateRequest{ChainId: chainID}) @@ -459,6 +480,7 @@ func (c *Client) GetBlockHeaderChainState(chainID int64) (lightclienttypes.Query return *resp, nil } +// GetSupportedChains returns the supported chains func (c *Client) GetSupportedChains() ([]*chains.Chain, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.SupportedChains(context.Background(), &observertypes.QuerySupportedChains{}) @@ -468,6 +490,7 @@ func (c *Client) GetSupportedChains() ([]*chains.Chain, error) { return resp.GetChains(), nil } +// GetAdditionalChains returns the additional chains func (c *Client) GetAdditionalChains() ([]chains.Chain, error) { client := authoritytypes.NewQueryClient(c.grpcConn) resp, err := client.ChainInfo(context.Background(), &authoritytypes.QueryGetChainInfoRequest{}) @@ -477,6 +500,7 @@ func (c *Client) GetAdditionalChains() ([]chains.Chain, error) { return resp.GetChainInfo().Chains, nil } +// GetPendingNonces returns the pending nonces func (c *Client) GetPendingNonces() (*observertypes.QueryAllPendingNoncesResponse, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.PendingNoncesAll(context.Background(), &observertypes.QueryAllPendingNoncesRequest{}) @@ -486,6 +510,7 @@ func (c *Client) GetPendingNonces() (*observertypes.QueryAllPendingNoncesRespons return resp, nil } +// Prove returns whether a proof is valid func (c *Client) Prove( blockHash string, txHash string, @@ -507,6 +532,7 @@ func (c *Client) Prove( return resp.Valid, nil } +// HasVoted returns whether an observer has voted func (c *Client) HasVoted(ballotIndex string, voterAddress string) (bool, error) { client := observertypes.NewQueryClient(c.grpcConn) resp, err := client.HasVoted(context.Background(), &observertypes.QueryHasVotedRequest{ @@ -519,6 +545,7 @@ func (c *Client) HasVoted(ballotIndex string, voterAddress string) (bool, error) return resp.HasVoted, nil } +// GetZetaHotKeyBalance returns the zeta hot key balance func (c *Client) GetZetaHotKeyBalance() (sdkmath.Int, error) { client := banktypes.NewQueryClient(c.grpcConn) address, err := c.keys.GetAddress() diff --git a/zetaclient/zetacore/query_test.go b/zetaclient/zetacore/query_test.go index 6be9d0a5e3..e9b3518ea8 100644 --- a/zetaclient/zetacore/query_test.go +++ b/zetaclient/zetacore/query_test.go @@ -462,30 +462,6 @@ func TestZetacore_GetNodeInfo(t *testing.T) { require.Equal(t, expectedOutput, *resp) } -func TestZetacore_GetLastBlockHeightByChain(t *testing.T) { - index := chains.BscMainnet - expectedOutput := crosschainTypes.QueryGetLastBlockHeightResponse{ - LastBlockHeight: &crosschainTypes.LastBlockHeight{ - Index: index.ChainName.String(), - Chain: "7000", - LastOutboundHeight: 2134123, - LastInboundHeight: 1234333, - }, - } - input := crosschainTypes.QueryGetLastBlockHeightRequest{Index: index.ChainName.String()} - method := "/zetachain.zetacore.crosschain.Query/LastBlockHeight" - server := setupMockServer(t, crosschainTypes.RegisterQueryServer, method, input, expectedOutput) - server.Serve() - defer closeMockServer(t, server) - - client, err := setupZetacoreClient() - require.NoError(t, err) - - resp, err := client.GetLastBlockHeightByChain(index) - require.NoError(t, err) - require.Equal(t, expectedOutput.LastBlockHeight, resp) -} - func TestZetacore_GetZetaBlockHeight(t *testing.T) { expectedOutput := crosschainTypes.QueryLastZetaHeightResponse{Height: 12345} input := crosschainTypes.QueryLastZetaHeightRequest{} diff --git a/zetaclient/zetacore/tx.go b/zetaclient/zetacore/tx.go index d858d2525e..0b1c2fb1d3 100644 --- a/zetaclient/zetacore/tx.go +++ b/zetaclient/zetacore/tx.go @@ -24,6 +24,7 @@ import ( ) // GetInboundVoteMessage returns a new MsgVoteInbound +// TODO(revamp): move to a different file func GetInboundVoteMessage( sender string, senderChain int64, @@ -69,6 +70,8 @@ func GasPriceMultiplier(chain chains.Chain) (float64, error) { return 0, fmt.Errorf("cannot get gas price multiplier for unknown chain %d", chain.ChainId) } +// WrapMessageWithAuthz wraps a message with an authz message +// used since a hotkey is used to broadcast the transactions, instead of the operator func (c *Client) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, clientauthz.Signer, error) { msgURL := sdk.MsgTypeURL(msg) @@ -82,6 +85,8 @@ func (c *Client) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, clientauthz.Signer, return &authzMessage, authzSigner, nil } +// PostGasPrice posts a gas price vote +// TODO(revamp): rename to PostVoteGasPrice func (c *Client) PostGasPrice(chain chains.Chain, gasPrice uint64, supply string, blockNum uint64) (string, error) { // apply gas price multiplier for the chain multiplier, err := GasPriceMultiplier(chain) @@ -110,6 +115,8 @@ func (c *Client) PostGasPrice(chain chains.Chain, gasPrice uint64, supply string return "", fmt.Errorf("post gasprice failed after %d retries", DefaultRetryInterval) } +// AddOutboundTracker adds an outbound tracker +// TODO(revamp): rename to PostAddOutboundTracker func (c *Client) AddOutboundTracker( chainID int64, nonce uint64, @@ -143,6 +150,8 @@ func (c *Client) AddOutboundTracker( return zetaTxHash, nil } +// SetTSS sends message to vote tss +// TODO(revamp): rename to PostVoteTSS func (c *Client) SetTSS(tssPubkey string, keyGenZetaHeight int64, status chains.ReceiveStatus) (string, error) { signerAddress := c.keys.GetOperatorAddress().String() msg := observertypes.NewMsgVoteTSS(signerAddress, tssPubkey, keyGenZetaHeight, status) @@ -166,6 +175,8 @@ func (c *Client) SetTSS(tssPubkey string, keyGenZetaHeight int64, status chains. } // ZetacoreContextUpdater is a polling goroutine that checks and updates zetacore context at every height +// TODO(revamp): move to a different file +// TODO(revamp): rename to UpdateZetacoreContext func (c *Client) ZetacoreContextUpdater(appContext *appcontext.AppContext) { c.logger.Info().Msg("ZetacoreContextUpdater started") ticker := time.NewTicker(time.Duration(appContext.Config().ConfigUpdateTicker) * time.Second) @@ -185,6 +196,8 @@ func (c *Client) ZetacoreContextUpdater(appContext *appcontext.AppContext) { } } +// PostBlameData posts blame data message to zetacore +// TODO(revamp): rename to PostVoteBlame func (c *Client) PostBlameData(blame *blame.Blame, chainID int64, index string) (string, error) { signerAddress := c.keys.GetOperatorAddress().String() zetaBlame := observertypes.Blame{ @@ -212,6 +225,7 @@ func (c *Client) PostBlameData(blame *blame.Blame, chainID int64, index string) return "", fmt.Errorf("post blame data failed after %d retries", DefaultRetryCount) } +// PostVoteBlockHeader posts a vote on an observed block header func (c *Client) PostVoteBlockHeader( chainID int64, blockHash []byte, @@ -280,6 +294,7 @@ func (c *Client) PostVoteInbound(gasLimit, retryGasLimit uint64, msg *types.MsgV // MonitorVoteInboundResult monitors the result of a vote inbound tx // retryGasLimit is the gas limit used to resend the tx if it fails because of insufficient gas // if retryGasLimit is 0, the tx is not resent +// TODO(revamp): move to a monitor file func (c *Client) MonitorVoteInboundResult(zetaTxHash string, retryGasLimit uint64, msg *types.MsgVoteInbound) { var lastErr error @@ -330,6 +345,7 @@ func (c *Client) MonitorVoteInboundResult(zetaTxHash string, retryGasLimit uint6 } // PostVoteOutbound posts a vote on an observed outbound tx +// TODO(revamp): rename and move to a different file func (c *Client) PostVoteOutbound( cctxIndex string, outboundHash string, @@ -372,6 +388,7 @@ func (c *Client) PostVoteOutbound( } // PostVoteOutboundFromMsg posts a vote on an observed outbound tx from a MsgVoteOutbound +// TODO(revamp): rename to PostVoteOutbound func (c *Client) PostVoteOutboundFromMsg( gasLimit, retryGasLimit uint64, msg *types.MsgVoteOutbound, @@ -412,6 +429,7 @@ func (c *Client) PostVoteOutboundFromMsg( // MonitorVoteOutboundResult monitors the result of a vote outbound tx // retryGasLimit is the gas limit used to resend the tx if it fails because of insufficient gas // if retryGasLimit is 0, the tx is not resent +// TODO(revamp): move to a monitor file func (c *Client) MonitorVoteOutboundResult(zetaTxHash string, retryGasLimit uint64, msg *types.MsgVoteOutbound) { var lastErr error