diff --git a/app/app.go b/app/app.go index 87687cbc..d3e9822d 100644 --- a/app/app.go +++ b/app/app.go @@ -554,6 +554,7 @@ func New( keys[btcbridgetypes.MemStoreKey], govAuthor, app.BankKeeper, + app.StakingKeeper, ) btcbridgeModule := btcbridge.NewAppModule(appCodec, app.BtcBridgeKeeper) diff --git a/go.mod b/go.mod index 3cd828d3..c769c9b6 100644 --- a/go.mod +++ b/go.mod @@ -16,9 +16,11 @@ require ( github.com/cometbft/cometbft v0.37.4 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/btcutil v1.0.5 + github.com/cosmos/cosmos-proto v1.0.0-beta.4 github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.3.0 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -66,7 +68,6 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.1 // indirect @@ -78,7 +79,6 @@ require ( github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect diff --git a/proto/side/btcbridge/bitcoin.proto b/proto/side/btcbridge/bitcoin.proto index 6b071a6e..c3e53761 100644 --- a/proto/side/btcbridge/bitcoin.proto +++ b/proto/side/btcbridge/bitcoin.proto @@ -2,7 +2,11 @@ syntax = "proto3"; package side.btcbridge; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "side/btcbridge/params.proto"; option go_package = "github.com/sideprotocol/side/x/btcbridge/types"; @@ -56,3 +60,46 @@ message Edict { string amount = 2; uint32 output = 3; } + +// DKG Participant +message DKGParticipant { + // the moniker of the corresponding validator + string moniker = 1; + // the operator address of the corresponding validator + string address = 2; +} + +enum DKGRequestStatus { + // DKG_REQUEST_STATUS_UNSPECIFIED defines the unknown DKG request status + DKG_REQUEST_STATUS_UNSPECIFIED = 0; + // DKG_REQUEST_STATUS_PENDING defines the status of the DKG request which is pending + DKG_REQUEST_STATUS_PENDING = 1; + // DKG_REQUEST_STATUS_COMPLETED defines the status of the DKG request which is completed + DKG_REQUEST_STATUS_COMPLETED = 2; + // DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed + DKG_REQUEST_STATUS_FAILED = 3; +} + +// DKG Request +message DKGRequest { + // the unique request id + uint64 id = 1; + // participant set + repeated DKGParticipant participants = 2; + // threshold required to perform DKG + uint32 threshold = 3; + // expiration time + google.protobuf.Timestamp expiration = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = true]; + // status + DKGRequestStatus status = 5; +} + +// DKG Completion Request +message DKGCompletionRequest { + // request id + uint64 id = 1; + // sender + string sender = 2; + // new vaults generated by DKG + repeated Vault vaults = 3; +} diff --git a/proto/side/btcbridge/params.proto b/proto/side/btcbridge/params.proto index 0a85aaae..266e6bd7 100644 --- a/proto/side/btcbridge/params.proto +++ b/proto/side/btcbridge/params.proto @@ -25,8 +25,8 @@ message Params { int64 network_fee = 7; // Reward epoch for relayer and TSS participant incentivization google.protobuf.Duration reward_epoch = 8 [(gogoproto.stdduration) = true]; - // Transition period after which TSS participants update process is completed - google.protobuf.Duration tss_update_transition_period = 9 [(gogoproto.stdduration) = true]; + // TSS params + TSSParams tss_params = 9; } // AssetType defines the type of asset @@ -72,3 +72,11 @@ message ProtocolFees { // Protocol fee collector string collector = 3; } + +// TSSParams defines the params related to TSS +message TSSParams { + // timeout duration for DKG request + google.protobuf.Duration dkg_timeout_period = 1 [(gogoproto.stdduration) = true]; + // Transition period after which TSS participants update process is completed + google.protobuf.Duration participant_update_transition_period = 2 [(gogoproto.stdduration) = true]; +} diff --git a/proto/side/btcbridge/query.proto b/proto/side/btcbridge/query.proto index c274ddd5..5f6e2b60 100644 --- a/proto/side/btcbridge/query.proto +++ b/proto/side/btcbridge/query.proto @@ -39,6 +39,22 @@ service Query { rpc QueryWithdrawRequestByTxHash(QueryWithdrawRequestByTxHashRequest) returns (QueryWithdrawRequestByTxHashResponse) { option (google.api.http).get = "/side/btcbridge/withdrawal/request/tx/{txid}"; } + // QueryDKGRequest queries the DKG request by the given id. + rpc QueryDKGRequest(QueryDKGRequestRequest) returns (QueryDKGRequestResponse) { + option (google.api.http).get = "/side/btcbridge/dkg/request/{id}"; + } + // QueryDKGRequests queries the DKG requests by the given status + rpc QueryDKGRequests(QueryDKGRequestsRequest) returns (QueryDKGRequestsResponse) { + option (google.api.http).get = "/side/btcbridge/dkg/request"; + } + // QueryAllDKGRequests queries all DKG requests. + rpc QueryAllDKGRequests(QueryAllDKGRequestsRequest) returns (QueryAllDKGRequestsResponse) { + option (google.api.http).get = "/side/btcbridge/dkg/requests"; + } + // QueryDKGCompletionRequests queries DKG completion requests by the given id. + rpc QueryDKGCompletionRequests(QueryDKGCompletionRequestsRequest) returns (QueryDKGCompletionRequestsResponse) { + option (google.api.http).get = "/side/btcbridge/dkg/completion/request/{id}"; + } } // QueryWithdrawRequestsRequest is request type for the Query/WithdrawRequests RPC method. @@ -112,3 +128,42 @@ message QueryBlockHeaderByHashRequest { message QueryBlockHeaderByHashResponse { BlockHeader block_header = 1; } + +// QueryDKGRequestRequest is the request type for the Query/DKGRequest RPC method. +message QueryDKGRequestRequest { + uint64 id = 1; +} + +// QueryDKGRequestResponse is the response type for the Query/DKGRequest RPC method. +message QueryDKGRequestResponse { + DKGRequest request = 1; +} + +// QueryDKGRequestsRequest is the request type for the Query/DKGRequests RPC method. +message QueryDKGRequestsRequest { + DKGRequestStatus status = 1; +} + +// QueryDKGRequestsResponse is the response type for the Query/DKGRequests RPC method. +message QueryDKGRequestsResponse { + repeated DKGRequest requests = 1; +} + +// QueryAllDKGRequestsRequest is the request type for the Query/AllDKGRequests RPC method. +message QueryAllDKGRequestsRequest { +} + +// QueryAllDKGRequestsResponse is the response type for the Query/AllDKGRequests RPC method. +message QueryAllDKGRequestsResponse { + repeated DKGRequest requests = 1; +} + +// QueryDKGCompletionRequestsRequest is the request type for the Query/DKGCompletionRequests RPC method. +message QueryDKGCompletionRequestsRequest { + uint64 id = 1; +} + +// QueryDKGCompletionRequestsResponse is the response type for the Query/DKGCompletionRequests RPC method. +message QueryDKGCompletionRequestsResponse { + repeated DKGCompletionRequest requests = 1; +} diff --git a/proto/side/btcbridge/tx.proto b/proto/side/btcbridge/tx.proto index 4e166d33..8035c519 100644 --- a/proto/side/btcbridge/tx.proto +++ b/proto/side/btcbridge/tx.proto @@ -20,6 +20,10 @@ service Msg { rpc WithdrawToBitcoin (MsgWithdrawToBitcoin) returns (MsgWithdrawToBitcoinResponse); // SubmitWithdrawStatus submits the status of the withdraw transaction. rpc SubmitWithdrawStatus (MsgSubmitWithdrawStatus) returns (MsgSubmitWithdrawStatusResponse); + // InitiateDKG initiates the DKG request. + rpc InitiateDKG (MsgInitiateDKG) returns (MsgInitiateDKGResponse); + // CompleteDKG completes the given DKG request. + rpc CompleteDKG (MsgCompleteDKG) returns (MsgCompleteDKGResponse); // UpdateParams defines a governance operation for updating the x/btcbridge module // parameters. The authority defaults to the x/gov module account. // @@ -93,6 +97,32 @@ message MsgWithdrawToBitcoin { message MsgWithdrawToBitcoinResponse { } +// MsgInitiateDKG is the Msg/InitiateDKG request type. +message MsgInitiateDKG { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1; + // expected participant set + repeated DKGParticipant participants = 2; + // threshold required to perform DKG + uint32 threshold = 3; +} + +// MsgInitiateDKGResponse defines the Msg/InitiateDKG response type. +message MsgInitiateDKGResponse {} + +// MsgCompleteDKG is the Msg/CompleteDKG request type. +message MsgCompleteDKG { + // the sender is expected to be the validator which participates in DKG + string sender = 1; + // request id + uint64 id = 2; + // new vaults generated by DKG + repeated Vault vaults = 3; +} + +// MsgCompleteDKGResponse defines the Msg/CompleteDKG response type. +message MsgCompleteDKGResponse {} + // MsgUpdateParams is the Msg/UpdateParams request type. // // Since: cosmos-sdk 0.47 diff --git a/testutil/keeper/btc_bridge.go b/testutil/keeper/btc_bridge.go index de0e7a5f..a357d47c 100644 --- a/testutil/keeper/btc_bridge.go +++ b/testutil/keeper/btc_bridge.go @@ -42,6 +42,7 @@ func BtcBridgeKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { memStoreKey, authority, app.BankKeeper, + app.StakingKeeper, ) ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/btcbridge/abci.go b/x/btcbridge/abci.go new file mode 100644 index 00000000..df891334 --- /dev/null +++ b/x/btcbridge/abci.go @@ -0,0 +1,38 @@ +package btcbridge + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sideprotocol/side/x/btcbridge/keeper" + "github.com/sideprotocol/side/x/btcbridge/types" +) + +// EndBlocker called at every block to handle DKG requests +func EndBlocker(ctx sdk.Context, k keeper.Keeper) { + pendingDKGRequests := k.GetPendingDKGRequests(ctx) + + for _, req := range pendingDKGRequests { + // check if the DKG request expired + if !ctx.BlockTime().Before(*req.Expiration) { + req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_FAILED + continue + } + + // handle DKG completion requests + completionRequests := k.GetDKGCompletionRequests(ctx, req.Id) + if len(completionRequests) != len(req.Participants) { + continue + } + + // check if the DKG completion requests are valid + if !types.CheckCompletionRequests(completionRequests) { + req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_FAILED + continue + } + + req.Status = types.DKGRequestStatus_DKG_REQUEST_STATUS_COMPLETED + + // update vaults + k.UpdateVaults(ctx, completionRequests[0].Vaults) + } +} diff --git a/x/btcbridge/keeper/keeper.go b/x/btcbridge/keeper/keeper.go index 8f0c804a..d06a855b 100644 --- a/x/btcbridge/keeper/keeper.go +++ b/x/btcbridge/keeper/keeper.go @@ -24,7 +24,8 @@ type ( authority string - bankKeeper types.BankKeeper + bankKeeper types.BankKeeper + stakingKeeper types.StakingKeeper } ) @@ -34,13 +35,15 @@ func NewKeeper( memKey storetypes.StoreKey, authority string, bankKeeper types.BankKeeper, + stakingKeeper types.StakingKeeper, ) *Keeper { return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - authority: authority, - bankKeeper: bankKeeper, + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + authority: authority, + bankKeeper: bankKeeper, + stakingKeeper: stakingKeeper, } } diff --git a/x/btcbridge/keeper/keeper_tss.go b/x/btcbridge/keeper/keeper_tss.go new file mode 100644 index 00000000..b020ce14 --- /dev/null +++ b/x/btcbridge/keeper/keeper_tss.go @@ -0,0 +1,216 @@ +package keeper + +import ( + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sideprotocol/side/x/btcbridge/types" +) + +// GetNextDKGRequestID gets the next DKG request ID +func (keeper Keeper) GetNextDKGRequestID(ctx sdk.Context) uint64 { + store := ctx.KVStore(keeper.storeKey) + + bz := store.Get(types.DKGRequestIDKey) + if bz == nil { + return 1 + } + + return sdk.BigEndianToUint64(bz) + 1 +} + +// SetDKGRequestID sets the current DKG request ID +func (keeper Keeper) SetDKGRequestID(ctx sdk.Context, id uint64) { + store := ctx.KVStore(keeper.storeKey) + + store.Set(types.DKGRequestIDKey, sdk.Uint64ToBigEndian(id)) +} + +// SetDKGRequest sets the given DKG request +func (k Keeper) SetDKGRequest(ctx sdk.Context, req *types.DKGRequest) { + store := ctx.KVStore(k.storeKey) + + bz := k.cdc.MustMarshal(req) + store.Set(types.DKGRequestKey(req.Id), bz) +} + +// GetDKGRequest gets the DKG request by the given id +func (k Keeper) GetDKGRequest(ctx sdk.Context, id uint64) *types.DKGRequest { + store := ctx.KVStore(k.storeKey) + + var req types.DKGRequest + bz := store.Get(types.DKGRequestKey(id)) + k.cdc.MustUnmarshal(bz, &req) + + return &req +} + +// GetDKGRequests gets the DKG requests by the given status +func (k Keeper) GetDKGRequests(ctx sdk.Context, status types.DKGRequestStatus) []*types.DKGRequest { + requests := make([]*types.DKGRequest, 0) + + k.IterateDKGRequests(ctx, func(req *types.DKGRequest) (stop bool) { + if req.Status == status { + requests = append(requests, req) + } + + return false + }) + + return requests +} + +// GetPendingDKGRequests gets the pending DKG requests +func (k Keeper) GetPendingDKGRequests(ctx sdk.Context) []*types.DKGRequest { + requests := make([]*types.DKGRequest, 0) + + k.IterateDKGRequests(ctx, func(req *types.DKGRequest) (stop bool) { + if req.Status == types.DKGRequestStatus_DKG_REQUEST_STATUS_PENDING { + requests = append(requests, req) + } + + return false + }) + + return requests +} + +// GetAllDKGRequests gets all DKG requests +func (k Keeper) GetAllDKGRequests(ctx sdk.Context) []*types.DKGRequest { + requests := make([]*types.DKGRequest, 0) + + k.IterateDKGRequests(ctx, func(req *types.DKGRequest) (stop bool) { + requests = append(requests, req) + return false + }) + + return requests +} + +// IterateDKGRequests iterates through all DKG requests +func (k Keeper) IterateDKGRequests(ctx sdk.Context, cb func(req *types.DKGRequest) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, types.DKGRequestKeyPrefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var req types.DKGRequest + k.cdc.MustUnmarshal(iterator.Value(), &req) + + if cb(&req) { + break + } + } +} + +// GetDKGRequestExpirationTime gets the expiration time of the DKG request +func (k Keeper) GetDKGRequestExpirationTime(ctx sdk.Context) *time.Time { + creationTime := ctx.BlockTime() + timeout := k.GetParams(ctx).TssParams.DkgTimeoutPeriod + + expiration := creationTime.Add(*timeout) + + return &expiration +} + +// SetDKGCompletionRequest sets the given DKG completion request +func (k Keeper) SetDKGCompletionRequest(ctx sdk.Context, req *types.DKGCompletionRequest) { + store := ctx.KVStore(k.storeKey) + + bz := k.cdc.MustMarshal(req) + store.Set(types.DKGCompletionRequestKey(req.Id, req.Sender), bz) +} + +// HasDKGCompletionRequest returns true if the given completion request exists, false otherwise +func (k Keeper) HasDKGCompletionRequest(ctx sdk.Context, id uint64, sender string) bool { + store := ctx.KVStore(k.storeKey) + + return store.Has(types.DKGCompletionRequestKey(id, sender)) +} + +// GetDKGCompletionRequests gets DKG completion requests by the given id +func (k Keeper) GetDKGCompletionRequests(ctx sdk.Context, id uint64) []*types.DKGCompletionRequest { + requests := make([]*types.DKGCompletionRequest, 0) + + k.IterateDKGCompletionRequests(ctx, id, func(req *types.DKGCompletionRequest) (stop bool) { + requests = append(requests, req) + return false + }) + + return requests +} + +// IterateDKGCompletionRequests iterates through all DKG completion requests by the given id +func (k Keeper) IterateDKGCompletionRequests(ctx sdk.Context, id uint64, cb func(req *types.DKGCompletionRequest) (stop bool)) { + store := ctx.KVStore(k.storeKey) + + iterator := sdk.KVStorePrefixIterator(store, append(types.DKGCompletionRequestKeyPrefix, types.Int64ToBytes(id)...)) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var req types.DKGCompletionRequest + k.cdc.MustUnmarshal(iterator.Value(), &req) + + if cb(&req) { + break + } + } +} + +// CompleteDKG attempts to complete the DKG request +// The DKG request is completed when all participants submit the valid completion request before timeout +func (k Keeper) CompleteDKG(ctx sdk.Context, req *types.DKGCompletionRequest) error { + dkgReq := k.GetDKGRequest(ctx, req.Id) + if dkgReq == nil { + return types.ErrDKGRequestDoesNotExist + } + + if dkgReq.Status != types.DKGRequestStatus_DKG_REQUEST_STATUS_PENDING { + return types.ErrInvalidDKGCompletionRequest + } + + if !ctx.BlockTime().Before(*dkgReq.Expiration) { + return types.ErrInvalidDKGCompletionRequest + } + + if k.HasDKGCompletionRequest(ctx, req.Id, req.Sender) { + return types.ErrDKGCompletionRequestExists + } + + if !types.ParticipantExists(dkgReq.Participants, req.Sender) { + return types.ErrUnauthorizedDKGCompletionRequest + } + + for _, v := range req.Vaults { + if types.SelectVaultByPubKey(k.GetParams(ctx).Vaults, v.PubKey) != nil { + return types.ErrInvalidDKGCompletionRequest + } + } + + k.SetDKGCompletionRequest(ctx, req) + + return nil +} + +// UpdateVaults updates the asset vaults of the btc bridge +func (k Keeper) UpdateVaults(ctx sdk.Context, newVaults []*types.Vault) { + params := k.GetParams(ctx) + + for _, v := range newVaults { + address, err := types.GetVaultAddressFromPubKey(v.PubKey) + if err != nil { + panic(err) + } + + v.Address = address + + // TODO + v.Version = 1 + + params.Vaults = append(params.Vaults, v) + } + + k.SetParams(ctx, params) +} diff --git a/x/btcbridge/keeper/msg_server.go b/x/btcbridge/keeper/msg_server.go index 799a147d..0e2bb5c8 100644 --- a/x/btcbridge/keeper/msg_server.go +++ b/x/btcbridge/keeper/msg_server.go @@ -172,6 +172,64 @@ func (m msgServer) SubmitWithdrawStatus(goCtx context.Context, msg *types.MsgSub return &types.MsgSubmitWithdrawStatusResponse{}, nil } +// InitiateDKG initiates the DKG request. +func (m msgServer) InitiateDKG(goCtx context.Context, msg *types.MsgInitiateDKG) (*types.MsgInitiateDKGResponse, error) { + if m.authority != msg.Authority { + return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", m.authority, msg.Authority) + } + + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + req := &types.DKGRequest{ + Id: m.Keeper.GetNextDKGRequestID(ctx), + Participants: msg.Participants, + Threshold: msg.Threshold, + Expiration: m.Keeper.GetDKGRequestExpirationTime(ctx), + Status: types.DKGRequestStatus_DKG_REQUEST_STATUS_PENDING, + } + + m.Keeper.SetDKGRequest(ctx, req) + m.Keeper.SetDKGRequestID(ctx, req.Id) + + // Emit events + m.EmitEvent(ctx, msg.Authority, + sdk.NewAttribute("id", fmt.Sprintf("%d", req.Id)), + sdk.NewAttribute("expiration", req.Expiration.String()), + ) + + return &types.MsgInitiateDKGResponse{}, nil +} + +// CompleteDKG initiates the DKG request. +func (m msgServer) CompleteDKG(goCtx context.Context, msg *types.MsgCompleteDKG) (*types.MsgCompleteDKGResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + req := &types.DKGCompletionRequest{ + Id: msg.Id, + Sender: msg.Sender, + Vaults: msg.Vaults, + } + + if err := m.Keeper.CompleteDKG(ctx, req); err != nil { + return nil, err + } + + // Emit events + m.EmitEvent(ctx, msg.Sender, + sdk.NewAttribute("id", fmt.Sprintf("%d", msg.Id)), + ) + + return &types.MsgCompleteDKGResponse{}, nil +} + // UpdateParams updates the module params. func (m msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { if m.authority != msg.Authority { diff --git a/x/btcbridge/keeper/queries.go b/x/btcbridge/keeper/queries.go index 45ae833c..19b04f1b 100644 --- a/x/btcbridge/keeper/queries.go +++ b/x/btcbridge/keeper/queries.go @@ -105,3 +105,51 @@ func (k Keeper) QueryWithdrawRequestByTxHash(goCtx context.Context, req *types.Q return &types.QueryWithdrawRequestByTxHashResponse{Request: request}, nil } + +func (k Keeper) QueryDKGRequest(goCtx context.Context, req *types.QueryDKGRequestRequest) (*types.QueryDKGRequestResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + request := k.GetDKGRequest(ctx, req.Id) + + return &types.QueryDKGRequestResponse{Request: request}, nil +} + +func (k Keeper) QueryDKGRequests(goCtx context.Context, req *types.QueryDKGRequestsRequest) (*types.QueryDKGRequestsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + requests := k.GetDKGRequests(ctx, req.Status) + + return &types.QueryDKGRequestsResponse{Requests: requests}, nil +} + +func (k Keeper) QueryAllDKGRequests(goCtx context.Context, req *types.QueryAllDKGRequestsRequest) (*types.QueryAllDKGRequestsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + requests := k.GetAllDKGRequests(ctx) + + return &types.QueryAllDKGRequestsResponse{Requests: requests}, nil +} + +func (k Keeper) QueryDKGCompletionRequests(goCtx context.Context, req *types.QueryDKGCompletionRequestsRequest) (*types.QueryDKGCompletionRequestsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + requests := k.GetDKGCompletionRequests(ctx, req.Id) + + return &types.QueryDKGCompletionRequestsResponse{Requests: requests}, nil +} diff --git a/x/btcbridge/types/bitcoin.go b/x/btcbridge/types/bitcoin.go index ca96f7e3..5296b983 100644 --- a/x/btcbridge/types/bitcoin.go +++ b/x/btcbridge/types/bitcoin.go @@ -1,10 +1,13 @@ package types import ( + "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/mempool" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" + "github.com/decred/dcrd/dcrec/secp256k1/v4" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -20,6 +23,11 @@ const ( DefaultSigHashType = txscript.SigHashAll ) +// GetTaprootAddress gets the taproot address from the given public key +func GetTaprootAddress(pubKey *secp256k1.PublicKey, chainCfg *chaincfg.Params) (*btcutil.AddressTaproot, error) { + return btcutil.NewAddressTaproot(schnorr.SerializePubKey(txscript.ComputeTaprootKeyNoScript(pubKey)), chainCfg) +} + // IsDustOut returns true if the given output is dust, false otherwise func IsDustOut(out *wire.TxOut) bool { return !IsOpReturnOutput(out) && mempool.IsDust(out, MinRelayFee) diff --git a/x/btcbridge/types/bitcoin.pb.go b/x/btcbridge/types/bitcoin.pb.go index 4d8724f2..dd0691e2 100644 --- a/x/btcbridge/types/bitcoin.pb.go +++ b/x/btcbridge/types/bitcoin.pb.go @@ -5,18 +5,24 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/codec/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -60,6 +66,41 @@ func (WithdrawStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor_b004a69efe3c7d84, []int{0} } +type DKGRequestStatus int32 + +const ( + // DKG_REQUEST_STATUS_UNSPECIFIED defines the unknown DKG request status + DKGRequestStatus_DKG_REQUEST_STATUS_UNSPECIFIED DKGRequestStatus = 0 + // DKG_REQUEST_STATUS_PENDING defines the status of the DKG request which is pending + DKGRequestStatus_DKG_REQUEST_STATUS_PENDING DKGRequestStatus = 1 + // DKG_REQUEST_STATUS_COMPLETED defines the status of the DKG request which is completed + DKGRequestStatus_DKG_REQUEST_STATUS_COMPLETED DKGRequestStatus = 2 + // DKG_REQUEST_STATUS_FAILED defines the status of the DKG request which failed + DKGRequestStatus_DKG_REQUEST_STATUS_FAILED DKGRequestStatus = 3 +) + +var DKGRequestStatus_name = map[int32]string{ + 0: "DKG_REQUEST_STATUS_UNSPECIFIED", + 1: "DKG_REQUEST_STATUS_PENDING", + 2: "DKG_REQUEST_STATUS_COMPLETED", + 3: "DKG_REQUEST_STATUS_FAILED", +} + +var DKGRequestStatus_value = map[string]int32{ + "DKG_REQUEST_STATUS_UNSPECIFIED": 0, + "DKG_REQUEST_STATUS_PENDING": 1, + "DKG_REQUEST_STATUS_COMPLETED": 2, + "DKG_REQUEST_STATUS_FAILED": 3, +} + +func (x DKGRequestStatus) String() string { + return proto.EnumName(DKGRequestStatus_name, int32(x)) +} + +func (DKGRequestStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b004a69efe3c7d84, []int{1} +} + // Bitcoin Block Header type BlockHeader struct { Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` @@ -362,55 +403,277 @@ func (m *Edict) GetOutput() uint32 { return 0 } +// DKG Participant +type DKGParticipant struct { + // the moniker of the corresponding validator + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // the operator address of the corresponding validator + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *DKGParticipant) Reset() { *m = DKGParticipant{} } +func (m *DKGParticipant) String() string { return proto.CompactTextString(m) } +func (*DKGParticipant) ProtoMessage() {} +func (*DKGParticipant) Descriptor() ([]byte, []int) { + return fileDescriptor_b004a69efe3c7d84, []int{4} +} +func (m *DKGParticipant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DKGParticipant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DKGParticipant.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 *DKGParticipant) XXX_Merge(src proto.Message) { + xxx_messageInfo_DKGParticipant.Merge(m, src) +} +func (m *DKGParticipant) XXX_Size() int { + return m.Size() +} +func (m *DKGParticipant) XXX_DiscardUnknown() { + xxx_messageInfo_DKGParticipant.DiscardUnknown(m) +} + +var xxx_messageInfo_DKGParticipant proto.InternalMessageInfo + +func (m *DKGParticipant) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *DKGParticipant) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// DKG Request +type DKGRequest struct { + // the unique request id + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // participant set + Participants []*DKGParticipant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants,omitempty"` + // threshold required to perform DKG + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + // expiration time + Expiration *time.Time `protobuf:"bytes,4,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` + // status + Status DKGRequestStatus `protobuf:"varint,5,opt,name=status,proto3,enum=side.btcbridge.DKGRequestStatus" json:"status,omitempty"` +} + +func (m *DKGRequest) Reset() { *m = DKGRequest{} } +func (m *DKGRequest) String() string { return proto.CompactTextString(m) } +func (*DKGRequest) ProtoMessage() {} +func (*DKGRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b004a69efe3c7d84, []int{5} +} +func (m *DKGRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DKGRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DKGRequest.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 *DKGRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DKGRequest.Merge(m, src) +} +func (m *DKGRequest) XXX_Size() int { + return m.Size() +} +func (m *DKGRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DKGRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DKGRequest proto.InternalMessageInfo + +func (m *DKGRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *DKGRequest) GetParticipants() []*DKGParticipant { + if m != nil { + return m.Participants + } + return nil +} + +func (m *DKGRequest) GetThreshold() uint32 { + if m != nil { + return m.Threshold + } + return 0 +} + +func (m *DKGRequest) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + +func (m *DKGRequest) GetStatus() DKGRequestStatus { + if m != nil { + return m.Status + } + return DKGRequestStatus_DKG_REQUEST_STATUS_UNSPECIFIED +} + +// DKG Completion Request +type DKGCompletionRequest struct { + // request id + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // sender + Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` + // new vaults generated by DKG + Vaults []*Vault `protobuf:"bytes,3,rep,name=vaults,proto3" json:"vaults,omitempty"` +} + +func (m *DKGCompletionRequest) Reset() { *m = DKGCompletionRequest{} } +func (m *DKGCompletionRequest) String() string { return proto.CompactTextString(m) } +func (*DKGCompletionRequest) ProtoMessage() {} +func (*DKGCompletionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b004a69efe3c7d84, []int{6} +} +func (m *DKGCompletionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DKGCompletionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DKGCompletionRequest.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 *DKGCompletionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_DKGCompletionRequest.Merge(m, src) +} +func (m *DKGCompletionRequest) XXX_Size() int { + return m.Size() +} +func (m *DKGCompletionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_DKGCompletionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_DKGCompletionRequest proto.InternalMessageInfo + +func (m *DKGCompletionRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *DKGCompletionRequest) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *DKGCompletionRequest) GetVaults() []*Vault { + if m != nil { + return m.Vaults + } + return nil +} + func init() { proto.RegisterEnum("side.btcbridge.WithdrawStatus", WithdrawStatus_name, WithdrawStatus_value) + proto.RegisterEnum("side.btcbridge.DKGRequestStatus", DKGRequestStatus_name, DKGRequestStatus_value) proto.RegisterType((*BlockHeader)(nil), "side.btcbridge.BlockHeader") proto.RegisterType((*BitcoinWithdrawRequest)(nil), "side.btcbridge.BitcoinWithdrawRequest") proto.RegisterType((*RuneId)(nil), "side.btcbridge.RuneId") proto.RegisterType((*Edict)(nil), "side.btcbridge.Edict") + proto.RegisterType((*DKGParticipant)(nil), "side.btcbridge.DKGParticipant") + proto.RegisterType((*DKGRequest)(nil), "side.btcbridge.DKGRequest") + proto.RegisterType((*DKGCompletionRequest)(nil), "side.btcbridge.DKGCompletionRequest") } func init() { proto.RegisterFile("side/btcbridge/bitcoin.proto", fileDescriptor_b004a69efe3c7d84) } var fileDescriptor_b004a69efe3c7d84 = []byte{ - // 584 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0xcd, 0x6e, 0xda, 0x4c, - 0x14, 0x86, 0xb1, 0x01, 0x27, 0x0c, 0x0a, 0xe2, 0x9b, 0x2f, 0xa2, 0x0e, 0x69, 0x4d, 0xc4, 0xa2, - 0x8a, 0xba, 0x18, 0x2b, 0x54, 0x6a, 0xd7, 0xfc, 0x38, 0x82, 0x45, 0x93, 0x6a, 0x20, 0x42, 0xea, - 0xc6, 0xf2, 0xcf, 0x08, 0x8f, 0x02, 0x1e, 0xea, 0x19, 0x53, 0x7a, 0x13, 0x55, 0x2f, 0x2b, 0xcb, - 0x48, 0xdd, 0x74, 0x55, 0x55, 0x70, 0x0b, 0xbd, 0x80, 0x6a, 0xc6, 0x86, 0x26, 0x69, 0x77, 0xe7, - 0x9d, 0xf3, 0x9e, 0x33, 0xc7, 0xcf, 0xf1, 0x80, 0xe7, 0x9c, 0x86, 0xc4, 0xf6, 0x45, 0xe0, 0x27, - 0x34, 0x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xf4, 0x32, 0x9c, 0x53, 0x2a, 0xa2, 0x30, - 0xf1, 0x3e, 0x61, 0xf2, 0x31, 0x25, 0x5c, 0x48, 0x02, 0x5e, 0x18, 0x26, 0x84, 0x73, 0x45, 0xa0, - 0x82, 0x77, 0x12, 0xbe, 0x05, 0x86, 0xb7, 0x60, 0x69, 0x2c, 0x14, 0x83, 0x6a, 0xe7, 0x04, 0x65, - 0x70, 0x91, 0x84, 0x8b, 0x72, 0xb8, 0xa8, 0xcf, 0x68, 0xdc, 0x2b, 0xdd, 0xfd, 0x68, 0x15, 0x70, - 0x6e, 0x87, 0x4d, 0x70, 0xc8, 0x65, 0x77, 0xf9, 0x01, 0x19, 0xa8, 0xbd, 0x56, 0xf3, 0xae, 0x69, - 0x98, 0xb3, 0x51, 0x31, 0x7c, 0x03, 0x0c, 0x2e, 0x3c, 0x91, 0x72, 0x45, 0xa2, 0xd6, 0xb1, 0xd0, - 0xe3, 0x5d, 0xa3, 0xdd, 0xcc, 0x63, 0xe5, 0xc2, 0xb9, 0xbb, 0x8d, 0x80, 0x81, 0xd3, 0x98, 0x8c, - 0x42, 0xc9, 0x4b, 0x71, 0xcf, 0x97, 0x98, 0x09, 0x58, 0x03, 0xba, 0x58, 0xab, 0xe1, 0x8f, 0xb0, - 0x2e, 0xd6, 0x6d, 0x17, 0x94, 0x9d, 0x90, 0x06, 0x02, 0xbe, 0x04, 0x3a, 0x0d, 0x95, 0xb7, 0xda, - 0x69, 0x3c, 0xbd, 0x2c, 0x6b, 0x89, 0x75, 0x1a, 0xca, 0x7d, 0x3f, 0x20, 0x50, 0xd9, 0x7f, 0x60, - 0x03, 0x18, 0x2c, 0x15, 0xcb, 0x34, 0xfb, 0x0f, 0x8e, 0x70, 0xae, 0x5e, 0x7d, 0xd1, 0x40, 0xed, - 0xf1, 0xac, 0xb0, 0x05, 0x4e, 0xa7, 0xa3, 0xc9, 0x70, 0x80, 0xbb, 0x53, 0x77, 0x3c, 0xe9, 0x4e, - 0x6e, 0xc6, 0xee, 0xcd, 0xd5, 0xf8, 0xbd, 0xd3, 0x1f, 0x5d, 0x8e, 0x9c, 0x41, 0xbd, 0x00, 0x4f, - 0xc1, 0xb3, 0xa7, 0x86, 0x3e, 0x76, 0xba, 0x13, 0x67, 0x50, 0xd7, 0xfe, 0x55, 0xdd, 0xc3, 0xd7, - 0xdd, 0x41, 0xbf, 0x3b, 0x96, 0x06, 0x1d, 0xbe, 0x00, 0x27, 0x7f, 0x55, 0x5f, 0x5f, 0x5d, 0x8e, - 0xf0, 0x3b, 0x67, 0x50, 0x2f, 0xf6, 0x86, 0x77, 0x1b, 0x4b, 0xbb, 0xdf, 0x58, 0xda, 0xcf, 0x8d, - 0xa5, 0x7d, 0xdd, 0x5a, 0x85, 0xfb, 0xad, 0x55, 0xf8, 0xbe, 0xb5, 0x0a, 0x1f, 0xd0, 0x8c, 0x8a, - 0x28, 0xf5, 0x51, 0xc0, 0x16, 0xb6, 0x04, 0xa0, 0x9e, 0x47, 0xc0, 0xe6, 0x4a, 0xd8, 0xeb, 0x07, - 0xcf, 0x50, 0x7c, 0x5e, 0x12, 0xee, 0x1b, 0xca, 0xf0, 0xfa, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xa3, 0xf2, 0x72, 0xd3, 0xa5, 0x03, 0x00, 0x00, + // 856 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x41, 0x6f, 0xe2, 0x46, + 0x18, 0xc5, 0xc0, 0xb2, 0xe1, 0xa3, 0x8b, 0xe8, 0x34, 0xa5, 0x0e, 0x49, 0x4d, 0xc4, 0xa1, 0x8a, + 0x56, 0xaa, 0xad, 0x4d, 0xa5, 0xb6, 0x57, 0xc0, 0x0e, 0x41, 0xd9, 0x4d, 0xd2, 0x81, 0x34, 0x52, + 0x2f, 0xc8, 0xc6, 0x53, 0x18, 0x05, 0x7b, 0x5c, 0xcf, 0x38,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 0xc4, 0x19, 0x42, 0x26, 0x7c, 0x16, 0xc5, 0xe4, 0x96, 0xb2, 0x84, 0x4f, 0x3c, 0xb9, 0xfb, 0x44, + 0x95, 0x96, 0x55, 0xe9, 0xa7, 0x39, 0x95, 0xf6, 0x95, 0xfb, 0xb4, 0xa1, 0x16, 0x90, 0xf8, 0x66, + 0x41, 0x26, 0x31, 0x63, 0x42, 0x7f, 0xa6, 0x74, 0x90, 0x7e, 0xc2, 0x8c, 0x09, 0xb4, 0x0b, 0xcf, + 0x42, 0x16, 0x4e, 0x89, 0x5e, 0x51, 0x7d, 0x52, 0x20, 0x2d, 0x79, 0x54, 0x70, 0xfd, 0x79, 0x6a, + 0x49, 0xae, 0xe5, 0x37, 0x99, 0x9d, 0xbe, 0xa3, 0x84, 0x6a, 0x8d, 0x1a, 0x50, 0x0a, 0xc5, 0x52, + 0xaf, 0xaa, 0x4f, 0x72, 0xd9, 0xf9, 0x43, 0x83, 0x66, 0x2f, 0x1d, 0xe1, 0x35, 0x15, 0x73, 0x3f, + 0x76, 0x7f, 0xc5, 0xe4, 0x97, 0x84, 0x70, 0x21, 0x13, 0x70, 0x7d, 0x3f, 0x26, 0x9c, 0xab, 0x04, + 0xaa, 0x38, 0x87, 0xe8, 0x3b, 0xa8, 0xb8, 0x01, 0x4b, 0x42, 0xa1, 0x32, 0xa8, 0x1d, 0xef, 0x99, + 0x59, 0xce, 0x72, 0x28, 0x66, 0x36, 0x14, 0xb3, 0xcf, 0x68, 0xd8, 0x2b, 0xdf, 0x7d, 0x68, 0x17, + 0x70, 0x26, 0x47, 0x2d, 0xd8, 0xe1, 0x72, 0x77, 0x79, 0x80, 0x34, 0xa8, 0x15, 0x56, 0x7e, 0x97, + 0xd4, 0xcf, 0xb2, 0x51, 0x6b, 0xf4, 0x2d, 0x54, 0xb8, 0x70, 0x45, 0xc2, 0x55, 0x12, 0xf5, 0x63, + 0xc3, 0x5c, 0xbf, 0x5f, 0x66, 0xee, 0x79, 0xa4, 0x54,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 0xd3, 0xbb, 0x7b, 0x43, 0x7b, 0x7f, 0x6f, 0x68, 0x7f, 0xdf, 0x1b, 0xda, + 0xbb, 0x07, 0xa3, 0xf0, 0xfe, 0xc1, 0x28, 0xfc, 0xf9, 0x60, 0x14, 0x7e, 0x32, 0x67, 0x54, 0xcc, + 0x13, 0xcf, 0x9c, 0xb2, 0xc0, 0x92, 0x69, 0xab, 0x6b, 0x32, 0x65, 0x0b, 0x05, 0xac, 0xe5, 0x93, + 0xff, 0xb1, 0x78, 0x1b, 0x11, 0xee, 0x55, 0x94, 0xe0, 0x9b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xe1, 0x18, 0xd8, 0xec, 0x69, 0x06, 0x00, 0x00, } func (m *BlockHeader) Marshal() (dAtA []byte, err error) { @@ -626,6 +889,154 @@ func (m *Edict) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DKGParticipant) 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 *DKGParticipant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DKGParticipant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintBitcoin(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintBitcoin(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DKGRequest) 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 *DKGRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DKGRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintBitcoin(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x28 + } + if m.Expiration != nil { + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintBitcoin(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x22 + } + if m.Threshold != 0 { + i = encodeVarintBitcoin(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x18 + } + if len(m.Participants) > 0 { + for iNdEx := len(m.Participants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Participants[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBitcoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Id != 0 { + i = encodeVarintBitcoin(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *DKGCompletionRequest) 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 *DKGCompletionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DKGCompletionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Vaults) > 0 { + for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Vaults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBitcoin(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintBitcoin(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0x12 + } + if m.Id != 0 { + i = encodeVarintBitcoin(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintBitcoin(dAtA []byte, offset int, v uint64) int { offset -= sovBitcoin(v) base := offset @@ -737,22 +1148,89 @@ func (m *Edict) Size() (n int) { return n } -func sovBitcoin(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBitcoin(x uint64) (n int) { - return sovBitcoin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func (m *DKGParticipant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovBitcoin(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovBitcoin(uint64(l)) + } + return n } -func (m *BlockHeader) 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 ErrIntOverflowBitcoin - } + +func (m *DKGRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovBitcoin(uint64(m.Id)) + } + if len(m.Participants) > 0 { + for _, e := range m.Participants { + l = e.Size() + n += 1 + l + sovBitcoin(uint64(l)) + } + } + if m.Threshold != 0 { + n += 1 + sovBitcoin(uint64(m.Threshold)) + } + if m.Expiration != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovBitcoin(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovBitcoin(uint64(m.Status)) + } + return n +} + +func (m *DKGCompletionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovBitcoin(uint64(m.Id)) + } + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovBitcoin(uint64(l)) + } + if len(m.Vaults) > 0 { + for _, e := range m.Vaults { + l = e.Size() + n += 1 + l + sovBitcoin(uint64(l)) + } + } + return n +} + +func sovBitcoin(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBitcoin(x uint64) (n int) { + return sovBitcoin(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BlockHeader) 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 ErrIntOverflowBitcoin + } if iNdEx >= l { return io.ErrUnexpectedEOF } @@ -1426,6 +1904,432 @@ func (m *Edict) Unmarshal(dAtA []byte) error { } return nil } +func (m *DKGParticipant) 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 ErrIntOverflowBitcoin + } + 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: DKGParticipant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DKGParticipant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBitcoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBitcoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DKGRequest) 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 ErrIntOverflowBitcoin + } + 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: DKGRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DKGRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Participants = append(m.Participants, &DKGParticipant{}) + if err := m.Participants[len(m.Participants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DKGRequestStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipBitcoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBitcoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DKGCompletionRequest) 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 ErrIntOverflowBitcoin + } + 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: DKGCompletionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DKGCompletionRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vaults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBitcoin + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBitcoin + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBitcoin + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vaults = append(m.Vaults, &Vault{}) + if err := m.Vaults[len(m.Vaults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBitcoin(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBitcoin + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipBitcoin(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/btcbridge/types/errors.go b/x/btcbridge/types/errors.go index 2d9eba73..49c3a3d0 100644 --- a/x/btcbridge/types/errors.go +++ b/x/btcbridge/types/errors.go @@ -42,4 +42,10 @@ var ( ErrInvalidDepositAmount = errorsmod.Register(ModuleName, 8100, "invalid deposit amount") ErrInvalidWithdrawAmount = errorsmod.Register(ModuleName, 8101, "invalid withdrawal amount") ErrInvalidSequence = errorsmod.Register(ModuleName, 8102, "invalid sequence") + + ErrInvalidDKGParams = errorsmod.Register(ModuleName, 9100, "invalid dkg params") + ErrDKGRequestDoesNotExist = errorsmod.Register(ModuleName, 9101, "dkg request does not exist") + ErrDKGCompletionRequestExists = errorsmod.Register(ModuleName, 9102, "dkg completion request already exists") + ErrInvalidDKGCompletionRequest = errorsmod.Register(ModuleName, 9103, "invalid dkg completion request") + ErrUnauthorizedDKGCompletionRequest = errorsmod.Register(ModuleName, 9104, "unauthorized dkg completion request") ) diff --git a/x/btcbridge/types/expected_keepers.go b/x/btcbridge/types/expected_keepers.go index c3387102..4e97511b 100644 --- a/x/btcbridge/types/expected_keepers.go +++ b/x/btcbridge/types/expected_keepers.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" banktype "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) // AccountKeeper defines the expected account keeper used for simulations (noalias) @@ -30,3 +31,8 @@ type BankKeeper interface { HasSupply(ctx sdk.Context, denom string) bool GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin } + +// StakingKeeper defines the expected staking keeper used to retrieve validator (noalias) +type StakingKeeper interface { + GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (stakingtypes.Validator, bool) +} diff --git a/x/btcbridge/types/keys.go b/x/btcbridge/types/keys.go index b718d896..d629aec1 100644 --- a/x/btcbridge/types/keys.go +++ b/x/btcbridge/types/keys.go @@ -34,6 +34,10 @@ var ( BtcWithdrawRequestByTxHashPrefix = []byte{0x15} // prefix for each key to a withdrawal request from tx hash BtcMintedTxHashKeyPrefix = []byte{0x15} // prefix for each key to a minted tx hash + + DKGRequestIDKey = []byte{0x16} // key for the DKG request id + DKGRequestKeyPrefix = []byte{0x17} // prefix for each key to a DKG request + DKGCompletionRequestKeyPrefix = []byte{0x18} // prefix for each key to a DKG completion request ) func Int64ToBytes(number uint64) []byte { @@ -61,3 +65,11 @@ func BtcWithdrawRequestByTxHashKey(txid string) []byte { func BtcMintedTxHashKey(hash string) []byte { return append(BtcMintedTxHashKeyPrefix, []byte(hash)...) } + +func DKGRequestKey(id uint64) []byte { + return append(DKGRequestKeyPrefix, Int64ToBytes(id)...) +} + +func DKGCompletionRequestKey(id uint64, sender string) []byte { + return append(append(DKGCompletionRequestKeyPrefix, Int64ToBytes(id)...), []byte(sender)...) +} diff --git a/x/btcbridge/types/message_complete_dkg.go b/x/btcbridge/types/message_complete_dkg.go new file mode 100644 index 00000000..d38a0925 --- /dev/null +++ b/x/btcbridge/types/message_complete_dkg.go @@ -0,0 +1,42 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgCompleteDKG = "complete_dkg" + +// Route returns the route of MsgCompleteDKG. +func (msg *MsgCompleteDKG) Route() string { + return RouterKey +} + +// Type returns the type of MsgCompleteDKG. +func (msg *MsgCompleteDKG) Type() string { + return TypeMsgCompleteDKG +} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgCompleteDKG) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgCompleteDKG message. +func (m *MsgCompleteDKG) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Sender) + return []sdk.AccAddress{addr} +} + +// ValidateBasic performs basic MsgCompleteDKG message validation. +func (m *MsgCompleteDKG) ValidateBasic() error { + if _, err := sdk.ConsAddressFromBech32(m.Sender); err != nil { + return sdkerrors.Wrap(err, "invalid sender address") + } + + if len(m.Vaults) != 2 { + return ErrInvalidDKGParams + } + + return nil +} diff --git a/x/btcbridge/types/message_initiate_dkg.go b/x/btcbridge/types/message_initiate_dkg.go new file mode 100644 index 00000000..4080e14e --- /dev/null +++ b/x/btcbridge/types/message_initiate_dkg.go @@ -0,0 +1,53 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +const TypeMsgInitiateDKG = "initiate_dkg" + +// Route returns the route of MsgInitiateDKG. +func (msg *MsgInitiateDKG) Route() string { + return RouterKey +} + +// Type returns the type of MsgInitiateDKG. +func (msg *MsgInitiateDKG) Type() string { + return TypeMsgInitiateDKG +} + +// GetSignBytes implements the LegacyMsg interface. +func (m MsgInitiateDKG) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +// GetSigners returns the expected signers for a MsgInitiateDKG message. +func (m *MsgInitiateDKG) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(m.Authority) + return []sdk.AccAddress{addr} +} + +// ValidateBasic performs basic MsgInitiateDKG message validation. +func (m *MsgInitiateDKG) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { + return sdkerrors.Wrap(err, "invalid authority address") + } + + if len(m.Participants) == 0 || m.Threshold == 0 || m.Threshold >= uint32(len(m.Participants)) { + return ErrInvalidDKGParams + } + + for _, p := range m.Participants { + if _, err := sdk.AccAddressFromBech32(p.Address); err != nil { + return ErrInvalidDKGParams + } + + if len(p.Moniker) > stakingtypes.MaxMonikerLength { + return ErrInvalidDKGParams + } + } + + return nil +} diff --git a/x/btcbridge/types/params.go b/x/btcbridge/types/params.go index 75aeaf25..c6b9ccc0 100644 --- a/x/btcbridge/types/params.go +++ b/x/btcbridge/types/params.go @@ -16,8 +16,11 @@ var ( // default reward epoch DefaultRewardEpoch = time.Duration(1209600) * time.Second // 14 days - // default TSS update transition period - DefaultTssUpdateTransitionPeriod = time.Duration(1209600) * time.Second // 14 days + // default DKG timeout period + DefaultDKGTimeoutPeriod = time.Duration(86400) * time.Second // 1 day + + // default TSS participant update transition period + DefaultTSSParticipantUpdateTransitionPeriod = time.Duration(1209600) * time.Second // 14 days ) // NewParams creates a new Params instance @@ -45,9 +48,12 @@ func NewParams() Params { WithdrawFee: 12000, // 0.00012 BTC Collector: "", }, - NetworkFee: 8000, // 0.00008 BTC - RewardEpoch: &DefaultRewardEpoch, - TssUpdateTransitionPeriod: &DefaultTssUpdateTransitionPeriod, + NetworkFee: 8000, // 0.00008 BTC + RewardEpoch: &DefaultRewardEpoch, + TssParams: &TSSParams{ + DkgTimeoutPeriod: &DefaultDKGTimeoutPeriod, + ParticipantUpdateTransitionPeriod: &DefaultTSSParticipantUpdateTransitionPeriod, + }, } } diff --git a/x/btcbridge/types/params.pb.go b/x/btcbridge/types/params.pb.go index 596f6592..ebd74375 100644 --- a/x/btcbridge/types/params.pb.go +++ b/x/btcbridge/types/params.pb.go @@ -82,8 +82,8 @@ type Params struct { NetworkFee int64 `protobuf:"varint,7,opt,name=network_fee,json=networkFee,proto3" json:"network_fee,omitempty"` // Reward epoch for relayer and TSS participant incentivization RewardEpoch *time.Duration `protobuf:"bytes,8,opt,name=reward_epoch,json=rewardEpoch,proto3,stdduration" json:"reward_epoch,omitempty"` - // Transition period after which TSS participants update process is completed - TssUpdateTransitionPeriod *time.Duration `protobuf:"bytes,9,opt,name=tss_update_transition_period,json=tssUpdateTransitionPeriod,proto3,stdduration" json:"tss_update_transition_period,omitempty"` + // TSS params + TssParams *TSSParams `protobuf:"bytes,9,opt,name=tss_params,json=tssParams,proto3" json:"tss_params,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -175,9 +175,9 @@ func (m *Params) GetRewardEpoch() *time.Duration { return nil } -func (m *Params) GetTssUpdateTransitionPeriod() *time.Duration { +func (m *Params) GetTssParams() *TSSParams { if m != nil { - return m.TssUpdateTransitionPeriod + return m.TssParams } return nil } @@ -383,64 +383,124 @@ func (m *ProtocolFees) GetCollector() string { return "" } +// TSSParams defines the params related to TSS +type TSSParams struct { + // timeout duration for DKG request + DkgTimeoutPeriod *time.Duration `protobuf:"bytes,1,opt,name=dkg_timeout_period,json=dkgTimeoutPeriod,proto3,stdduration" json:"dkg_timeout_period,omitempty"` + // Transition period after which TSS participants update process is completed + ParticipantUpdateTransitionPeriod *time.Duration `protobuf:"bytes,2,opt,name=participant_update_transition_period,json=participantUpdateTransitionPeriod,proto3,stdduration" json:"participant_update_transition_period,omitempty"` +} + +func (m *TSSParams) Reset() { *m = TSSParams{} } +func (m *TSSParams) String() string { return proto.CompactTextString(m) } +func (*TSSParams) ProtoMessage() {} +func (*TSSParams) Descriptor() ([]byte, []int) { + return fileDescriptor_f1d33573cda8a6d2, []int{4} +} +func (m *TSSParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TSSParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TSSParams.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 *TSSParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_TSSParams.Merge(m, src) +} +func (m *TSSParams) XXX_Size() int { + return m.Size() +} +func (m *TSSParams) XXX_DiscardUnknown() { + xxx_messageInfo_TSSParams.DiscardUnknown(m) +} + +var xxx_messageInfo_TSSParams proto.InternalMessageInfo + +func (m *TSSParams) GetDkgTimeoutPeriod() *time.Duration { + if m != nil { + return m.DkgTimeoutPeriod + } + return nil +} + +func (m *TSSParams) GetParticipantUpdateTransitionPeriod() *time.Duration { + if m != nil { + return m.ParticipantUpdateTransitionPeriod + } + return nil +} + func init() { proto.RegisterEnum("side.btcbridge.AssetType", AssetType_name, AssetType_value) proto.RegisterType((*Params)(nil), "side.btcbridge.Params") proto.RegisterType((*Vault)(nil), "side.btcbridge.Vault") proto.RegisterType((*ProtocolLimits)(nil), "side.btcbridge.ProtocolLimits") proto.RegisterType((*ProtocolFees)(nil), "side.btcbridge.ProtocolFees") + proto.RegisterType((*TSSParams)(nil), "side.btcbridge.TSSParams") } func init() { proto.RegisterFile("side/btcbridge/params.proto", fileDescriptor_f1d33573cda8a6d2) } var fileDescriptor_f1d33573cda8a6d2 = []byte{ - // 728 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6f, 0xda, 0x48, - 0x18, 0xc5, 0x81, 0x90, 0x65, 0x20, 0x84, 0x9d, 0xcd, 0x6e, 0x1c, 0x36, 0x72, 0x58, 0xb4, 0x5a, - 0xa1, 0x48, 0x6b, 0x37, 0xf4, 0x52, 0xa9, 0x27, 0x08, 0xa4, 0x8d, 0xda, 0x46, 0xc8, 0x21, 0xa9, - 0xda, 0x8b, 0x3b, 0x1e, 0x0f, 0x60, 0xc5, 0xf6, 0x58, 0x9e, 0x31, 0x3f, 0xfe, 0x87, 0xaa, 0xea, - 0xb1, 0xfd, 0x8f, 0x7a, 0xcc, 0xb1, 0xb7, 0x56, 0xc9, 0x3f, 0x52, 0xcd, 0xd8, 0x26, 0x10, 0xa9, - 0x52, 0x6f, 0xf3, 0xbd, 0xf7, 0xe6, 0xcd, 0xc7, 0xf7, 0x3e, 0x0c, 0xfe, 0x66, 0xae, 0x43, 0x0c, - 0x9b, 0x63, 0x3b, 0x72, 0x9d, 0x31, 0x31, 0x42, 0x14, 0x21, 0x9f, 0xe9, 0x61, 0x44, 0x39, 0x85, - 0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x59, 0x41, 0xcd, 0xcb, 0xf3, 0x7e, 0x2d, 0xdf, 0x7d, 0xfe, 0xe5, 0x56, 0x53, 0x6e, 0x6e, 0x35, - 0xe5, 0xfb, 0xad, 0xa6, 0x7c, 0xbc, 0xd3, 0x72, 0x37, 0x77, 0x5a, 0xee, 0xeb, 0x9d, 0x96, 0x7b, - 0xab, 0x8f, 0x5d, 0x3e, 0x89, 0x6d, 0x1d, 0x53, 0xdf, 0x10, 0x61, 0x66, 0x7b, 0x2f, 0x0b, 0x63, - 0xbe, 0xf2, 0x31, 0x13, 0xb9, 0x33, 0xbb, 0x28, 0x05, 0x8f, 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, - 0xef, 0x81, 0xca, 0xaf, 0xeb, 0x04, 0x00, 0x00, + // 789 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x41, 0x6f, 0x23, 0x35, + 0x14, 0xee, 0x34, 0x6d, 0xca, 0x38, 0x6d, 0x1a, 0xcc, 0xc2, 0x0e, 0x65, 0x95, 0xcd, 0x46, 0x2b, + 0x14, 0xad, 0xc4, 0x0c, 0x5b, 0x2e, 0x48, 0x9c, 0x9a, 0x26, 0x85, 0x15, 0xec, 0x2a, 0x72, 0xd2, + 0x45, 0x70, 0xb1, 0x3c, 0x1e, 0x37, 0xb1, 0x92, 0x19, 0x5b, 0xb6, 0xa7, 0x4d, 0xff, 0x03, 0x42, + 0x1c, 0xf9, 0x49, 0x1c, 0x38, 0xec, 0x91, 0x1b, 0xa8, 0xfd, 0x05, 0xfc, 0x03, 0x64, 0xcf, 0x4c, + 0x9a, 0x14, 0xad, 0xd4, 0x9b, 0xdf, 0xf7, 0xbe, 0xf7, 0xbd, 0xd7, 0xf9, 0xbe, 0x06, 0x7c, 0xa6, + 0x79, 0xc2, 0xa2, 0xd8, 0xd0, 0x58, 0xf1, 0x64, 0xca, 0x22, 0x49, 0x14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, 0x15, 0x1b, 0x5f, 0x5c, 0x00, 0x7f, 0x95, 0x00, 0x78, 0x04, 0x3e, 0x39, 0x19, 0x8f, 0x87, + 0x13, 0x3c, 0xf9, 0x69, 0x34, 0xc4, 0xe7, 0x6f, 0xc6, 0xa3, 0xe1, 0xe9, 0xab, 0xb3, 0x57, 0xc3, + 0x41, 0x6b, 0x0b, 0x42, 0xd0, 0x5c, 0xeb, 0xf5, 0x27, 0xa7, 0x2d, 0x0f, 0x3e, 0x02, 0xad, 0x75, + 0x0c, 0x9d, 0x1e, 0x7f, 0xd9, 0xda, 0x86, 0x1f, 0x81, 0xc3, 0x35, 0x14, 0x9d, 0xbf, 0x19, 0xb6, + 0x6a, 0xfd, 0xef, 0xfe, 0xb8, 0x69, 0x7b, 0xef, 0x6e, 0xda, 0xde, 0x3f, 0x37, 0x6d, 0xef, 0xb7, + 0xdb, 0xf6, 0xd6, 0xbb, 0xdb, 0xf6, 0xd6, 0x5f, 0xb7, 0xed, 0xad, 0x9f, 0xc3, 0x29, 0x37, 0xb3, + 0x3c, 0x0e, 0xa9, 0x48, 0x23, 0x9b, 0xcd, 0xea, 0xdf, 0xd3, 0x15, 0xd1, 0x72, 0xed, 0x37, 0xd7, + 0xc6, 0x58, 0xc7, 0x75, 0x47, 0xf8, 0xea, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x9e, 0x07, + 0x6d, 0x92, 0x05, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -463,13 +523,15 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TssUpdateTransitionPeriod != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.TssUpdateTransitionPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TssUpdateTransitionPeriod):]) - if err1 != nil { - return 0, err1 + if m.TssParams != nil { + { + size, err := m.TssParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) } - i -= n1 - i = encodeVarintParams(dAtA, i, uint64(n1)) i-- dAtA[i] = 0x4a } @@ -671,6 +733,49 @@ func (m *ProtocolFees) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TSSParams) 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 *TSSParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TSSParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParticipantUpdateTransitionPeriod != nil { + n5, err5 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.ParticipantUpdateTransitionPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.ParticipantUpdateTransitionPeriod):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintParams(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x12 + } + if m.DkgTimeoutPeriod != nil { + n6, err6 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(*m.DkgTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.DkgTimeoutPeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintParams(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintParams(dAtA []byte, offset int, v uint64) int { offset -= sovParams(v) base := offset @@ -719,8 +824,8 @@ func (m *Params) Size() (n int) { l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.RewardEpoch) n += 1 + l + sovParams(uint64(l)) } - if m.TssUpdateTransitionPeriod != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.TssUpdateTransitionPeriod) + if m.TssParams != nil { + l = m.TssParams.Size() n += 1 + l + sovParams(uint64(l)) } return n @@ -786,6 +891,23 @@ func (m *ProtocolFees) Size() (n int) { return n } +func (m *TSSParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DkgTimeoutPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.DkgTimeoutPeriod) + n += 1 + l + sovParams(uint64(l)) + } + if m.ParticipantUpdateTransitionPeriod != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(*m.ParticipantUpdateTransitionPeriod) + n += 1 + l + sovParams(uint64(l)) + } + return n +} + func sovParams(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1054,7 +1176,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TssUpdateTransitionPeriod", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TssParams", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1081,10 +1203,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.TssUpdateTransitionPeriod == nil { - m.TssUpdateTransitionPeriod = new(time.Duration) + if m.TssParams == nil { + m.TssParams = &TSSParams{} } - if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.TssUpdateTransitionPeriod, dAtA[iNdEx:postIndex]); err != nil { + if err := m.TssParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1488,6 +1610,128 @@ func (m *ProtocolFees) Unmarshal(dAtA []byte) error { } return nil } +func (m *TSSParams) 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 ErrIntOverflowParams + } + 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: TSSParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TSSParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DkgTimeoutPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DkgTimeoutPeriod == nil { + m.DkgTimeoutPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.DkgTimeoutPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParticipantUpdateTransitionPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParticipantUpdateTransitionPeriod == nil { + m.ParticipantUpdateTransitionPeriod = new(time.Duration) + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(m.ParticipantUpdateTransitionPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipParams(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/btcbridge/types/query.pb.go b/x/btcbridge/types/query.pb.go index d67195fa..51dfdead 100644 --- a/x/btcbridge/types/query.pb.go +++ b/x/btcbridge/types/query.pb.go @@ -687,6 +687,358 @@ func (m *QueryBlockHeaderByHashResponse) GetBlockHeader() *BlockHeader { return nil } +// QueryDKGRequestRequest is the request type for the Query/DKGRequest RPC method. +type QueryDKGRequestRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryDKGRequestRequest) Reset() { *m = QueryDKGRequestRequest{} } +func (m *QueryDKGRequestRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDKGRequestRequest) ProtoMessage() {} +func (*QueryDKGRequestRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{14} +} +func (m *QueryDKGRequestRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGRequestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGRequestRequest.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 *QueryDKGRequestRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGRequestRequest.Merge(m, src) +} +func (m *QueryDKGRequestRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGRequestRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGRequestRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGRequestRequest proto.InternalMessageInfo + +func (m *QueryDKGRequestRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +// QueryDKGRequestResponse is the response type for the Query/DKGRequest RPC method. +type QueryDKGRequestResponse struct { + Request *DKGRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` +} + +func (m *QueryDKGRequestResponse) Reset() { *m = QueryDKGRequestResponse{} } +func (m *QueryDKGRequestResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDKGRequestResponse) ProtoMessage() {} +func (*QueryDKGRequestResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{15} +} +func (m *QueryDKGRequestResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGRequestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGRequestResponse.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 *QueryDKGRequestResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGRequestResponse.Merge(m, src) +} +func (m *QueryDKGRequestResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGRequestResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGRequestResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGRequestResponse proto.InternalMessageInfo + +func (m *QueryDKGRequestResponse) GetRequest() *DKGRequest { + if m != nil { + return m.Request + } + return nil +} + +// QueryDKGRequestsRequest is the request type for the Query/DKGRequests RPC method. +type QueryDKGRequestsRequest struct { + Status DKGRequestStatus `protobuf:"varint,1,opt,name=status,proto3,enum=side.btcbridge.DKGRequestStatus" json:"status,omitempty"` +} + +func (m *QueryDKGRequestsRequest) Reset() { *m = QueryDKGRequestsRequest{} } +func (m *QueryDKGRequestsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDKGRequestsRequest) ProtoMessage() {} +func (*QueryDKGRequestsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{16} +} +func (m *QueryDKGRequestsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGRequestsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGRequestsRequest.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 *QueryDKGRequestsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGRequestsRequest.Merge(m, src) +} +func (m *QueryDKGRequestsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGRequestsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGRequestsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGRequestsRequest proto.InternalMessageInfo + +func (m *QueryDKGRequestsRequest) GetStatus() DKGRequestStatus { + if m != nil { + return m.Status + } + return DKGRequestStatus_DKG_REQUEST_STATUS_UNSPECIFIED +} + +// QueryDKGRequestsResponse is the response type for the Query/DKGRequests RPC method. +type QueryDKGRequestsResponse struct { + Requests []*DKGRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (m *QueryDKGRequestsResponse) Reset() { *m = QueryDKGRequestsResponse{} } +func (m *QueryDKGRequestsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDKGRequestsResponse) ProtoMessage() {} +func (*QueryDKGRequestsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{17} +} +func (m *QueryDKGRequestsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGRequestsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGRequestsResponse.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 *QueryDKGRequestsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGRequestsResponse.Merge(m, src) +} +func (m *QueryDKGRequestsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGRequestsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGRequestsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGRequestsResponse proto.InternalMessageInfo + +func (m *QueryDKGRequestsResponse) GetRequests() []*DKGRequest { + if m != nil { + return m.Requests + } + return nil +} + +// QueryAllDKGRequestsRequest is the request type for the Query/AllDKGRequests RPC method. +type QueryAllDKGRequestsRequest struct { +} + +func (m *QueryAllDKGRequestsRequest) Reset() { *m = QueryAllDKGRequestsRequest{} } +func (m *QueryAllDKGRequestsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllDKGRequestsRequest) ProtoMessage() {} +func (*QueryAllDKGRequestsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{18} +} +func (m *QueryAllDKGRequestsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllDKGRequestsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllDKGRequestsRequest.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 *QueryAllDKGRequestsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllDKGRequestsRequest.Merge(m, src) +} +func (m *QueryAllDKGRequestsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllDKGRequestsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllDKGRequestsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllDKGRequestsRequest proto.InternalMessageInfo + +// QueryAllDKGRequestsResponse is the response type for the Query/AllDKGRequests RPC method. +type QueryAllDKGRequestsResponse struct { + Requests []*DKGRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (m *QueryAllDKGRequestsResponse) Reset() { *m = QueryAllDKGRequestsResponse{} } +func (m *QueryAllDKGRequestsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllDKGRequestsResponse) ProtoMessage() {} +func (*QueryAllDKGRequestsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{19} +} +func (m *QueryAllDKGRequestsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllDKGRequestsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllDKGRequestsResponse.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 *QueryAllDKGRequestsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllDKGRequestsResponse.Merge(m, src) +} +func (m *QueryAllDKGRequestsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllDKGRequestsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllDKGRequestsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllDKGRequestsResponse proto.InternalMessageInfo + +func (m *QueryAllDKGRequestsResponse) GetRequests() []*DKGRequest { + if m != nil { + return m.Requests + } + return nil +} + +// QueryDKGCompletionRequestsRequest is the request type for the Query/DKGCompletionRequests RPC method. +type QueryDKGCompletionRequestsRequest struct { + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryDKGCompletionRequestsRequest) Reset() { *m = QueryDKGCompletionRequestsRequest{} } +func (m *QueryDKGCompletionRequestsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDKGCompletionRequestsRequest) ProtoMessage() {} +func (*QueryDKGCompletionRequestsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{20} +} +func (m *QueryDKGCompletionRequestsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGCompletionRequestsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGCompletionRequestsRequest.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 *QueryDKGCompletionRequestsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGCompletionRequestsRequest.Merge(m, src) +} +func (m *QueryDKGCompletionRequestsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGCompletionRequestsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGCompletionRequestsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGCompletionRequestsRequest proto.InternalMessageInfo + +func (m *QueryDKGCompletionRequestsRequest) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +// QueryDKGCompletionRequestsResponse is the response type for the Query/DKGCompletionRequests RPC method. +type QueryDKGCompletionRequestsResponse struct { + Requests []*DKGCompletionRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` +} + +func (m *QueryDKGCompletionRequestsResponse) Reset() { *m = QueryDKGCompletionRequestsResponse{} } +func (m *QueryDKGCompletionRequestsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDKGCompletionRequestsResponse) ProtoMessage() {} +func (*QueryDKGCompletionRequestsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fb547edb49d5502d, []int{21} +} +func (m *QueryDKGCompletionRequestsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDKGCompletionRequestsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDKGCompletionRequestsResponse.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 *QueryDKGCompletionRequestsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDKGCompletionRequestsResponse.Merge(m, src) +} +func (m *QueryDKGCompletionRequestsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDKGCompletionRequestsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDKGCompletionRequestsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDKGCompletionRequestsResponse proto.InternalMessageInfo + +func (m *QueryDKGCompletionRequestsResponse) GetRequests() []*DKGCompletionRequest { + if m != nil { + return m.Requests + } + return nil +} + func init() { proto.RegisterType((*QueryWithdrawRequestsRequest)(nil), "side.btcbridge.QueryWithdrawRequestsRequest") proto.RegisterType((*QueryWithdrawRequestsResponse)(nil), "side.btcbridge.QueryWithdrawRequestsResponse") @@ -702,65 +1054,87 @@ func init() { proto.RegisterType((*QueryBlockHeaderByHeightResponse)(nil), "side.btcbridge.QueryBlockHeaderByHeightResponse") proto.RegisterType((*QueryBlockHeaderByHashRequest)(nil), "side.btcbridge.QueryBlockHeaderByHashRequest") proto.RegisterType((*QueryBlockHeaderByHashResponse)(nil), "side.btcbridge.QueryBlockHeaderByHashResponse") + proto.RegisterType((*QueryDKGRequestRequest)(nil), "side.btcbridge.QueryDKGRequestRequest") + proto.RegisterType((*QueryDKGRequestResponse)(nil), "side.btcbridge.QueryDKGRequestResponse") + proto.RegisterType((*QueryDKGRequestsRequest)(nil), "side.btcbridge.QueryDKGRequestsRequest") + proto.RegisterType((*QueryDKGRequestsResponse)(nil), "side.btcbridge.QueryDKGRequestsResponse") + proto.RegisterType((*QueryAllDKGRequestsRequest)(nil), "side.btcbridge.QueryAllDKGRequestsRequest") + proto.RegisterType((*QueryAllDKGRequestsResponse)(nil), "side.btcbridge.QueryAllDKGRequestsResponse") + proto.RegisterType((*QueryDKGCompletionRequestsRequest)(nil), "side.btcbridge.QueryDKGCompletionRequestsRequest") + proto.RegisterType((*QueryDKGCompletionRequestsResponse)(nil), "side.btcbridge.QueryDKGCompletionRequestsResponse") } func init() { proto.RegisterFile("side/btcbridge/query.proto", fileDescriptor_fb547edb49d5502d) } var fileDescriptor_fb547edb49d5502d = []byte{ - // 833 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x4f, 0xe3, 0x46, - 0x14, 0xce, 0xd0, 0x34, 0xd0, 0x49, 0xcb, 0x61, 0x80, 0x28, 0x72, 0xc0, 0xa4, 0xe6, 0xa7, 0x10, - 0x78, 0x4a, 0x48, 0x91, 0x90, 0xaa, 0xaa, 0x35, 0x87, 0x46, 0xea, 0x85, 0xba, 0x48, 0x95, 0x7a, - 0x69, 0xc7, 0x89, 0x65, 0x5b, 0x0d, 0xb1, 0xf1, 0x38, 0x90, 0x28, 0xca, 0xa5, 0xc7, 0x9e, 0x2a, - 0xf5, 0x5a, 0xa9, 0x3d, 0xf5, 0xd4, 0xeb, 0x9e, 0xf7, 0xca, 0x65, 0x25, 0xa4, 0xbd, 0xec, 0x69, - 0xb5, 0x82, 0xfd, 0x1f, 0xf6, 0xba, 0xf2, 0xf8, 0x99, 0x10, 0x13, 0x83, 0x91, 0x38, 0xec, 0x25, - 0x19, 0xcf, 0xfb, 0xbe, 0xf7, 0x7d, 0xef, 0xcd, 0x8c, 0xc7, 0x58, 0xe2, 0x4e, 0xcb, 0xa4, 0x46, - 0xd0, 0x34, 0x7c, 0xa7, 0x65, 0x99, 0xf4, 0xb4, 0x6b, 0xfa, 0x7d, 0xd5, 0xf3, 0xdd, 0xc0, 0x25, - 0xb3, 0x61, 0x4c, 0xbd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0x13, 0xe5, 0x52, 0x2e, 0x67, 0x69, 0x27, 0x23, 0x1a, 0xbc, 0x6d, 0x09, 0x6f, - 0xab, 0x44, 0x49, 0x7a, 0x3b, 0x07, 0x06, 0x6b, 0x53, 0x78, 0xbb, 0x91, 0x17, 0x08, 0x8e, 0x52, - 0xea, 0xd5, 0x41, 0xbe, 0xcc, 0xa4, 0x9e, 0xbc, 0xf7, 0xa4, 0xfd, 0xc7, 0xd2, 0xc0, 0xfd, 0x57, - 0xc2, 0xfd, 0x3e, 0xa9, 0x3f, 0xec, 0x9e, 0xc2, 0x4d, 0x4a, 0x07, 0x30, 0x18, 0x92, 0xe7, 0x29, - 0x1f, 0x3a, 0xf1, 0xc5, 0x40, 0xf6, 0xb2, 0xd8, 0x4a, 0xdc, 0x40, 0x52, 0xfd, 0x71, 0x24, 0xa8, - 0xa4, 0x2e, 0x2a, 0x51, 0xc9, 0x76, 0x86, 0x4a, 0x82, 0x1e, 0x1d, 0x84, 0x17, 0xdb, 0x50, 0x6b, - 0x5c, 0x5c, 0xc9, 0xe8, 0xf2, 0x4a, 0x46, 0x6f, 0xae, 0x64, 0xf4, 0xe7, 0xb5, 0x9c, 0xbb, 0xbc, - 0x96, 0x73, 0xaf, 0xae, 0xe5, 0xdc, 0xcf, 0xaa, 0xe5, 0x04, 0x76, 0xd7, 0x50, 0x9b, 0xee, 0x89, - 0xc8, 0x28, 0x3e, 0xed, 0x9a, 0x6e, 0x3b, 0x4a, 0xdf, 0xbb, 0x7d, 0x88, 0xfb, 0x9e, 0xc9, 0x8d, - 0x82, 0x00, 0xec, 0xbd, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x8d, 0x45, 0x5c, 0xc4, 0x0a, 0x00, - 0x00, + // 1071 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x97, 0xc1, 0x6f, 0xdb, 0x74, + 0x14, 0xc7, 0xfb, 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, 0x6f, 0x70, 0x9a, 0x4e, 0xb2, 0x09, 0xaa, 0xd3, 0x0d, 0xa7, 0x7d, 0x50, 0x23, 0x44, + 0xf8, 0x2d, 0xa3, 0x61, 0x6d, 0xfc, 0x28, 0xc2, 0xad, 0x4c, 0x99, 0xcc, 0xd3, 0x4c, 0xba, 0x39, + 0x93, 0x2d, 0x51, 0x55, 0x38, 0x95, 0x8c, 0xa5, 0x09, 0x54, 0x3e, 0xfe, 0xc2, 0xe8, 0xfc, 0xcc, + 0x3c, 0x95, 0x70, 0x27, 0xaf, 0x08, 0xb9, 0xc7, 0x9e, 0x54, 0x3b, 0x8f, 0x0b, 0xb1, 0xd6, 0x39, + 0xeb, 0x36, 0xde, 0xcc, 0x62, 0x6d, 0x26, 0x7e, 0x63, 0xaf, 0xb7, 0x71, 0xf0, 0xfc, 0x54, 0x66, + 0x2f, 0x4e, 0x65, 0xf6, 0xd7, 0xa9, 0xcc, 0xbe, 0x3e, 0x93, 0xe7, 0x5e, 0x9c, 0xc9, 0x73, 0x7f, + 0x9c, 0xc9, 0x73, 0x9f, 0xaa, 0xb6, 0x1b, 0x38, 0x47, 0xa6, 0xda, 0xf4, 0x0e, 0x79, 0x40, 0xfe, + 0xef, 0x67, 0xd3, 0x6b, 0x47, 0xd1, 0x8f, 0x47, 0x8f, 0x8c, 0x7e, 0xd7, 0xf2, 0xcd, 0x45, 0x6e, + 0x50, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0xa7, 0xa7, 0x10, 0x2c, 0x68, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -789,6 +1163,14 @@ type QueryClient interface { QueryWithdrawRequestsByAddress(ctx context.Context, in *QueryWithdrawRequestsByAddressRequest, opts ...grpc.CallOption) (*QueryWithdrawRequestsByAddressResponse, error) // QueryWithdrawRequestByTxHash queries the withdrawal request by the given tx hash. QueryWithdrawRequestByTxHash(ctx context.Context, in *QueryWithdrawRequestByTxHashRequest, opts ...grpc.CallOption) (*QueryWithdrawRequestByTxHashResponse, error) + // QueryDKGRequest queries the DKG request by the given id. + QueryDKGRequest(ctx context.Context, in *QueryDKGRequestRequest, opts ...grpc.CallOption) (*QueryDKGRequestResponse, error) + // QueryDKGRequests queries the DKG requests by the given status + QueryDKGRequests(ctx context.Context, in *QueryDKGRequestsRequest, opts ...grpc.CallOption) (*QueryDKGRequestsResponse, error) + // QueryAllDKGRequests queries all DKG requests. + QueryAllDKGRequests(ctx context.Context, in *QueryAllDKGRequestsRequest, opts ...grpc.CallOption) (*QueryAllDKGRequestsResponse, error) + // QueryDKGCompletionRequests queries DKG completion requests by the given id. + QueryDKGCompletionRequests(ctx context.Context, in *QueryDKGCompletionRequestsRequest, opts ...grpc.CallOption) (*QueryDKGCompletionRequestsResponse, error) } type queryClient struct { @@ -862,6 +1244,42 @@ func (c *queryClient) QueryWithdrawRequestByTxHash(ctx context.Context, in *Quer return out, nil } +func (c *queryClient) QueryDKGRequest(ctx context.Context, in *QueryDKGRequestRequest, opts ...grpc.CallOption) (*QueryDKGRequestResponse, error) { + out := new(QueryDKGRequestResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryDKGRequest", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDKGRequests(ctx context.Context, in *QueryDKGRequestsRequest, opts ...grpc.CallOption) (*QueryDKGRequestsResponse, error) { + out := new(QueryDKGRequestsResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryDKGRequests", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryAllDKGRequests(ctx context.Context, in *QueryAllDKGRequestsRequest, opts ...grpc.CallOption) (*QueryAllDKGRequestsResponse, error) { + out := new(QueryAllDKGRequestsResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryAllDKGRequests", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) QueryDKGCompletionRequests(ctx context.Context, in *QueryDKGCompletionRequestsRequest, opts ...grpc.CallOption) (*QueryDKGCompletionRequestsResponse, error) { + out := new(QueryDKGCompletionRequestsResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Query/QueryDKGCompletionRequests", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -878,6 +1296,14 @@ type QueryServer interface { QueryWithdrawRequestsByAddress(context.Context, *QueryWithdrawRequestsByAddressRequest) (*QueryWithdrawRequestsByAddressResponse, error) // QueryWithdrawRequestByTxHash queries the withdrawal request by the given tx hash. QueryWithdrawRequestByTxHash(context.Context, *QueryWithdrawRequestByTxHashRequest) (*QueryWithdrawRequestByTxHashResponse, error) + // QueryDKGRequest queries the DKG request by the given id. + QueryDKGRequest(context.Context, *QueryDKGRequestRequest) (*QueryDKGRequestResponse, error) + // QueryDKGRequests queries the DKG requests by the given status + QueryDKGRequests(context.Context, *QueryDKGRequestsRequest) (*QueryDKGRequestsResponse, error) + // QueryAllDKGRequests queries all DKG requests. + QueryAllDKGRequests(context.Context, *QueryAllDKGRequestsRequest) (*QueryAllDKGRequestsResponse, error) + // QueryDKGCompletionRequests queries DKG completion requests by the given id. + QueryDKGCompletionRequests(context.Context, *QueryDKGCompletionRequestsRequest) (*QueryDKGCompletionRequestsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -905,6 +1331,18 @@ func (*UnimplementedQueryServer) QueryWithdrawRequestsByAddress(ctx context.Cont func (*UnimplementedQueryServer) QueryWithdrawRequestByTxHash(ctx context.Context, req *QueryWithdrawRequestByTxHashRequest) (*QueryWithdrawRequestByTxHashResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryWithdrawRequestByTxHash not implemented") } +func (*UnimplementedQueryServer) QueryDKGRequest(ctx context.Context, req *QueryDKGRequestRequest) (*QueryDKGRequestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDKGRequest not implemented") +} +func (*UnimplementedQueryServer) QueryDKGRequests(ctx context.Context, req *QueryDKGRequestsRequest) (*QueryDKGRequestsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDKGRequests not implemented") +} +func (*UnimplementedQueryServer) QueryAllDKGRequests(ctx context.Context, req *QueryAllDKGRequestsRequest) (*QueryAllDKGRequestsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAllDKGRequests not implemented") +} +func (*UnimplementedQueryServer) QueryDKGCompletionRequests(ctx context.Context, req *QueryDKGCompletionRequestsRequest) (*QueryDKGCompletionRequestsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryDKGCompletionRequests not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1036,27 +1474,99 @@ func _Query_QueryWithdrawRequestByTxHash_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "side.btcbridge.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueryParams", - Handler: _Query_QueryParams_Handler, - }, - { - MethodName: "QueryChainTip", - Handler: _Query_QueryChainTip_Handler, - }, - { - MethodName: "QueryBlockHeaderByHeight", - Handler: _Query_QueryBlockHeaderByHeight_Handler, - }, - { - MethodName: "QueryBlockHeaderByHash", - Handler: _Query_QueryBlockHeaderByHash_Handler, - }, - { +func _Query_QueryDKGRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDKGRequestRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDKGRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Query/QueryDKGRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDKGRequest(ctx, req.(*QueryDKGRequestRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDKGRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDKGRequestsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDKGRequests(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Query/QueryDKGRequests", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDKGRequests(ctx, req.(*QueryDKGRequestsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryAllDKGRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllDKGRequestsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryAllDKGRequests(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Query/QueryAllDKGRequests", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryAllDKGRequests(ctx, req.(*QueryAllDKGRequestsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_QueryDKGCompletionRequests_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDKGCompletionRequestsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryDKGCompletionRequests(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Query/QueryDKGCompletionRequests", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryDKGCompletionRequests(ctx, req.(*QueryDKGCompletionRequestsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "side.btcbridge.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QueryParams", + Handler: _Query_QueryParams_Handler, + }, + { + MethodName: "QueryChainTip", + Handler: _Query_QueryChainTip_Handler, + }, + { + MethodName: "QueryBlockHeaderByHeight", + Handler: _Query_QueryBlockHeaderByHeight_Handler, + }, + { + MethodName: "QueryBlockHeaderByHash", + Handler: _Query_QueryBlockHeaderByHash_Handler, + }, + { MethodName: "QueryWithdrawRequests", Handler: _Query_QueryWithdrawRequests_Handler, }, @@ -1068,6 +1578,22 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryWithdrawRequestByTxHash", Handler: _Query_QueryWithdrawRequestByTxHash_Handler, }, + { + MethodName: "QueryDKGRequest", + Handler: _Query_QueryDKGRequest_Handler, + }, + { + MethodName: "QueryDKGRequests", + Handler: _Query_QueryDKGRequests_Handler, + }, + { + MethodName: "QueryAllDKGRequests", + Handler: _Query_QueryAllDKGRequests_Handler, + }, + { + MethodName: "QueryDKGCompletionRequests", + Handler: _Query_QueryDKGCompletionRequests_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "side/btcbridge/query.proto", @@ -1560,118 +2086,371 @@ func (m *QueryBlockHeaderByHashResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *QueryDKGRequestRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryWithdrawRequestsRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *QueryDKGRequestRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGRequestRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Status != 0 { - n += 1 + sovQuery(uint64(m.Status)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryWithdrawRequestsResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryDKGRequestResponse) 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 *QueryDKGRequestResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGRequestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryWithdrawRequestsByAddressRequest) Size() (n int) { - if m == nil { - return 0 +func (m *QueryDKGRequestsRequest) 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 *QueryDKGRequestsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGRequestsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *QueryWithdrawRequestsByAddressResponse) Size() (n int) { - if m == nil { - return 0 +func (m *QueryDKGRequestsResponse) 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 *QueryDKGRequestsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGRequestsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n + return len(dAtA) - i, nil } -func (m *QueryWithdrawRequestByTxHashRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Txid) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) +func (m *QueryAllDKGRequestsRequest) 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 n + return dAtA[:n], nil } -func (m *QueryWithdrawRequestByTxHashResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Request != nil { - l = m.Request.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n +func (m *QueryAllDKGRequestsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryAllDKGRequestsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllDKGRequestsResponse) 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 *QueryAllDKGRequestsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllDKGRequestsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[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 *QueryDKGCompletionRequestsRequest) 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 *QueryDKGCompletionRequestsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGCompletionRequestsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Id != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryDKGCompletionRequestsResponse) 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 *QueryDKGCompletionRequestsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDKGCompletionRequestsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Requests) > 0 { + for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Requests[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 encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryWithdrawRequestsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWithdrawRequestsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWithdrawRequestsByAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWithdrawRequestsByAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWithdrawRequestByTxHashRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Txid) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWithdrawRequestByTxHashResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l return n @@ -1764,13 +2543,579 @@ func (m *QueryBlockHeaderByHashResponse) Size() (n int) { return n } -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *QueryDKGRequestRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n } -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *QueryDKGRequestResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDKGRequestsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + return n +} + +func (m *QueryDKGRequestsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryAllDKGRequestsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllDKGRequestsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryDKGCompletionRequestsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryDKGCompletionRequestsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Requests) > 0 { + for _, e := range m.Requests { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryWithdrawRequestsRequest) 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: QueryWithdrawRequestsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWithdrawRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= WithdrawStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryWithdrawRequestsResponse) 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: QueryWithdrawRequestsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWithdrawRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Requests", 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.Requests = append(m.Requests, &BitcoinWithdrawRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryWithdrawRequestsByAddressRequest) 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: QueryWithdrawRequestsByAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWithdrawRequestsByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryWithdrawRequestsByAddressResponse) 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: QueryWithdrawRequestsByAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWithdrawRequestsByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Requests", 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.Requests = append(m.Requests, &BitcoinWithdrawRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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 m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryWithdrawRequestsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryWithdrawRequestByTxHashRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1793,36 +3138,17 @@ func (m *QueryWithdrawRequestsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryWithdrawRequestByTxHashRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryWithdrawRequestByTxHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= WithdrawStatus(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Txid", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1832,27 +3158,23 @@ func (m *QueryWithdrawRequestsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Txid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1875,7 +3197,7 @@ func (m *QueryWithdrawRequestsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWithdrawRequestsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryWithdrawRequestByTxHashResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1898,15 +3220,15 @@ func (m *QueryWithdrawRequestsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryWithdrawRequestByTxHashResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryWithdrawRequestByTxHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1933,14 +3255,116 @@ func (m *QueryWithdrawRequestsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, &BitcoinWithdrawRequest{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Request == nil { + m.Request = &BitcoinWithdrawRequest{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + 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 *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1967,10 +3391,7 @@ func (m *QueryWithdrawRequestsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1995,7 +3416,7 @@ func (m *QueryWithdrawRequestsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWithdrawRequestsByAddressRequest) Unmarshal(dAtA []byte) error { +func (m *QueryChainTipRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2018,15 +3439,65 @@ func (m *QueryWithdrawRequestsByAddressRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestsByAddressRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryChainTipRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestsByAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryChainTipRequest: 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 *QueryChainTipResponse) 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: QueryChainTipResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChainTipResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2054,13 +3525,13 @@ func (m *QueryWithdrawRequestsByAddressRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.Hash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var msglen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2069,29 +3540,12 @@ func (m *QueryWithdrawRequestsByAddressRequest) Unmarshal(dAtA []byte) error { 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 m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2113,7 +3567,7 @@ func (m *QueryWithdrawRequestsByAddressRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWithdrawRequestsByAddressResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBlockHeaderByHeightRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2136,17 +3590,17 @@ func (m *QueryWithdrawRequestsByAddressResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestsByAddressResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBlockHeaderByHeightRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestsByAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBlockHeaderByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var msglen int + m.Height = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2156,29 +3610,64 @@ func (m *QueryWithdrawRequestsByAddressResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.Height |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthQuery + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthQuery } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - m.Requests = append(m.Requests, &BitcoinWithdrawRequest{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBlockHeaderByHeightResponse) 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 } - iNdEx = postIndex - case 2: + 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: QueryBlockHeaderByHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlockHeaderByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2205,10 +3694,10 @@ func (m *QueryWithdrawRequestsByAddressResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} + if m.BlockHeader == nil { + m.BlockHeader = &BlockHeader{} } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2233,7 +3722,7 @@ func (m *QueryWithdrawRequestsByAddressResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWithdrawRequestByTxHashRequest) Unmarshal(dAtA []byte) error { +func (m *QueryBlockHeaderByHashRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2256,15 +3745,15 @@ func (m *QueryWithdrawRequestByTxHashRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestByTxHashRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBlockHeaderByHashRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestByTxHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBlockHeaderByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txid", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2292,7 +3781,7 @@ func (m *QueryWithdrawRequestByTxHashRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Txid = string(dAtA[iNdEx:postIndex]) + m.Hash = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2315,7 +3804,7 @@ func (m *QueryWithdrawRequestByTxHashRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryWithdrawRequestByTxHashResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBlockHeaderByHashResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2338,15 +3827,15 @@ func (m *QueryWithdrawRequestByTxHashResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryWithdrawRequestByTxHashResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBlockHeaderByHashResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryWithdrawRequestByTxHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBlockHeaderByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeader", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2373,10 +3862,10 @@ func (m *QueryWithdrawRequestByTxHashResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Request == nil { - m.Request = &BitcoinWithdrawRequest{} + if m.BlockHeader == nil { + m.BlockHeader = &BlockHeader{} } - if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2401,7 +3890,7 @@ func (m *QueryWithdrawRequestByTxHashResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDKGRequestRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2424,12 +3913,31 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGRequestRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGRequestRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2451,7 +3959,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDKGRequestResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2474,15 +3982,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGRequestResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGRequestResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2509,7 +4017,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Request == nil { + m.Request = &DKGRequest{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2534,7 +4045,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryChainTipRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDKGRequestsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2557,12 +4068,31 @@ func (m *QueryChainTipRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryChainTipRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGRequestsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainTipRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= DKGRequestStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2584,7 +4114,7 @@ func (m *QueryChainTipRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryChainTipResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDKGRequestsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2607,17 +4137,17 @@ func (m *QueryChainTipResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryChainTipResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGRequestsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChainTipResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2627,43 +4157,26 @@ func (m *QueryChainTipResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + m.Requests = append(m.Requests, &DKGRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2685,7 +4198,7 @@ func (m *QueryChainTipResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBlockHeaderByHeightRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAllDKGRequestsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2708,31 +4221,12 @@ func (m *QueryBlockHeaderByHeightRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBlockHeaderByHeightRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllDKGRequestsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBlockHeaderByHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllDKGRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2754,7 +4248,7 @@ func (m *QueryBlockHeaderByHeightRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBlockHeaderByHeightResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAllDKGRequestsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2777,15 +4271,15 @@ func (m *QueryBlockHeaderByHeightResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBlockHeaderByHeightResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAllDKGRequestsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBlockHeaderByHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAllDKGRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeader", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2812,10 +4306,8 @@ func (m *QueryBlockHeaderByHeightResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.BlockHeader == nil { - m.BlockHeader = &BlockHeader{} - } - if err := m.BlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Requests = append(m.Requests, &DKGRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2840,7 +4332,7 @@ func (m *QueryBlockHeaderByHeightResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBlockHeaderByHashRequest) Unmarshal(dAtA []byte) error { +func (m *QueryDKGCompletionRequestsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2863,17 +4355,17 @@ func (m *QueryBlockHeaderByHashRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBlockHeaderByHashRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGCompletionRequestsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBlockHeaderByHashRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGCompletionRequestsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var stringLen uint64 + m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -2883,24 +4375,11 @@ func (m *QueryBlockHeaderByHashRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Id |= uint64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -2922,7 +4401,7 @@ func (m *QueryBlockHeaderByHashRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBlockHeaderByHashResponse) Unmarshal(dAtA []byte) error { +func (m *QueryDKGCompletionRequestsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2945,15 +4424,15 @@ func (m *QueryBlockHeaderByHashResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBlockHeaderByHashResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDKGCompletionRequestsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBlockHeaderByHashResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDKGCompletionRequestsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockHeader", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Requests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2980,10 +4459,8 @@ func (m *QueryBlockHeaderByHashResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.BlockHeader == nil { - m.BlockHeader = &BlockHeader{} - } - if err := m.BlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Requests = append(m.Requests, &DKGCompletionRequest{}) + if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/btcbridge/types/query.pb.gw.go b/x/btcbridge/types/query.pb.gw.go index 511b5b99..4de08513 100644 --- a/x/btcbridge/types/query.pb.gw.go +++ b/x/btcbridge/types/query.pb.gw.go @@ -339,6 +339,168 @@ func local_request_Query_QueryWithdrawRequestByTxHash_0(ctx context.Context, mar } +func request_Query_QueryDKGRequest_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGRequestRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryDKGRequest(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDKGRequest_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGRequestRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryDKGRequest(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_QueryDKGRequests_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryDKGRequests_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGRequestsRequest + 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_QueryDKGRequests_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryDKGRequests(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDKGRequests_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGRequestsRequest + 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_QueryDKGRequests_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryDKGRequests(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryAllDKGRequests_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllDKGRequestsRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryAllDKGRequests(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryAllDKGRequests_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllDKGRequestsRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryAllDKGRequests(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_QueryDKGCompletionRequests_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGCompletionRequestsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.QueryDKGCompletionRequests(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryDKGCompletionRequests_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDKGCompletionRequestsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.QueryDKGCompletionRequests(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. @@ -506,6 +668,98 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryDKGRequest_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_QueryDKGRequest_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_QueryDKGRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDKGRequests_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_QueryDKGRequests_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_QueryDKGRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllDKGRequests_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_QueryAllDKGRequests_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_QueryAllDKGRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDKGCompletionRequests_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_QueryDKGCompletionRequests_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_QueryDKGCompletionRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -687,6 +941,86 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryDKGRequest_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_QueryDKGRequest_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_QueryDKGRequest_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDKGRequests_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_QueryDKGRequests_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_QueryDKGRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryAllDKGRequests_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_QueryAllDKGRequests_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_QueryAllDKGRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_QueryDKGCompletionRequests_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_QueryDKGCompletionRequests_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_QueryDKGCompletionRequests_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -704,6 +1038,14 @@ var ( pattern_Query_QueryWithdrawRequestsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 4}, []string{"side", "btcbridge", "withdrawal", "request", "address"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_QueryWithdrawRequestByTxHash_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"side", "btcbridge", "withdrawal", "request", "tx", "txid"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDKGRequest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"side", "btcbridge", "dkg", "request", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDKGRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"side", "btcbridge", "dkg", "request"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryAllDKGRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"side", "btcbridge", "dkg", "requests"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_QueryDKGCompletionRequests_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"side", "btcbridge", "dkg", "completion", "request", "id"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -720,4 +1062,12 @@ var ( forward_Query_QueryWithdrawRequestsByAddress_0 = runtime.ForwardResponseMessage forward_Query_QueryWithdrawRequestByTxHash_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDKGRequest_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDKGRequests_0 = runtime.ForwardResponseMessage + + forward_Query_QueryAllDKGRequests_0 = runtime.ForwardResponseMessage + + forward_Query_QueryDKGCompletionRequests_0 = runtime.ForwardResponseMessage ) diff --git a/x/btcbridge/types/tss.go b/x/btcbridge/types/tss.go new file mode 100644 index 00000000..d75d31f0 --- /dev/null +++ b/x/btcbridge/types/tss.go @@ -0,0 +1,59 @@ +package types + +import ( + "encoding/hex" + "reflect" + + "github.com/btcsuite/btcd/btcec/v2/schnorr" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// ParticipantExists returns true if the given address is a participant, false otherwise +func ParticipantExists(participants []*DKGParticipant, addr string) bool { + for _, p := range participants { + if p.Address == addr { + return true + } + } + + return false +} + +// CheckCompletionRequests checks if the vaults of all the completion requests are same +func CheckCompletionRequests(requests []*DKGCompletionRequest) bool { + if len(requests) == 0 { + return false + } + + vaults := requests[0].Vaults + + for _, req := range requests[1:] { + if !reflect.DeepEqual(req.Vaults, vaults) { + return false + } + } + + return true +} + +// GetVaultAddressFromPubKey gets the vault address from the given public key +// Note: the method generates taproot address +func GetVaultAddressFromPubKey(pubKey string) (string, error) { + pubKeyBytes, err := hex.DecodeString(pubKey) + if err != nil { + return "", err + } + + parsedPubKey, err := schnorr.ParsePubKey(pubKeyBytes) + if err != nil { + return "", err + } + + address, err := GetTaprootAddress(parsedPubKey, sdk.GetConfig().GetBtcChainCfg()) + if err != nil { + return "", err + } + + return address.String(), nil +} diff --git a/x/btcbridge/types/tx.pb.go b/x/btcbridge/types/tx.pb.go index a11dac9f..2f96cea7 100644 --- a/x/btcbridge/types/tx.pb.go +++ b/x/btcbridge/types/tx.pb.go @@ -550,6 +550,208 @@ func (m *MsgWithdrawToBitcoinResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawToBitcoinResponse proto.InternalMessageInfo +// MsgInitiateDKG is the Msg/InitiateDKG request type. +type MsgInitiateDKG struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // expected participant set + Participants []*DKGParticipant `protobuf:"bytes,2,rep,name=participants,proto3" json:"participants,omitempty"` + // threshold required to perform DKG + Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"` +} + +func (m *MsgInitiateDKG) Reset() { *m = MsgInitiateDKG{} } +func (m *MsgInitiateDKG) String() string { return proto.CompactTextString(m) } +func (*MsgInitiateDKG) ProtoMessage() {} +func (*MsgInitiateDKG) Descriptor() ([]byte, []int) { + return fileDescriptor_785ca8e1e4227068, []int{10} +} +func (m *MsgInitiateDKG) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitiateDKG) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitiateDKG.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 *MsgInitiateDKG) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitiateDKG.Merge(m, src) +} +func (m *MsgInitiateDKG) XXX_Size() int { + return m.Size() +} +func (m *MsgInitiateDKG) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitiateDKG.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitiateDKG proto.InternalMessageInfo + +func (m *MsgInitiateDKG) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgInitiateDKG) GetParticipants() []*DKGParticipant { + if m != nil { + return m.Participants + } + return nil +} + +func (m *MsgInitiateDKG) GetThreshold() uint32 { + if m != nil { + return m.Threshold + } + return 0 +} + +// MsgInitiateDKGResponse defines the Msg/InitiateDKG response type. +type MsgInitiateDKGResponse struct { +} + +func (m *MsgInitiateDKGResponse) Reset() { *m = MsgInitiateDKGResponse{} } +func (m *MsgInitiateDKGResponse) String() string { return proto.CompactTextString(m) } +func (*MsgInitiateDKGResponse) ProtoMessage() {} +func (*MsgInitiateDKGResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_785ca8e1e4227068, []int{11} +} +func (m *MsgInitiateDKGResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgInitiateDKGResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgInitiateDKGResponse.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 *MsgInitiateDKGResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgInitiateDKGResponse.Merge(m, src) +} +func (m *MsgInitiateDKGResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgInitiateDKGResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgInitiateDKGResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgInitiateDKGResponse proto.InternalMessageInfo + +// MsgCompleteDKG is the Msg/CompleteDKG request type. +type MsgCompleteDKG struct { + // the sender is expected to be the validator which participates in DKG + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // request id + Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + // new vaults generated by DKG + Vaults []*Vault `protobuf:"bytes,3,rep,name=vaults,proto3" json:"vaults,omitempty"` +} + +func (m *MsgCompleteDKG) Reset() { *m = MsgCompleteDKG{} } +func (m *MsgCompleteDKG) String() string { return proto.CompactTextString(m) } +func (*MsgCompleteDKG) ProtoMessage() {} +func (*MsgCompleteDKG) Descriptor() ([]byte, []int) { + return fileDescriptor_785ca8e1e4227068, []int{12} +} +func (m *MsgCompleteDKG) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCompleteDKG) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCompleteDKG.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 *MsgCompleteDKG) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCompleteDKG.Merge(m, src) +} +func (m *MsgCompleteDKG) XXX_Size() int { + return m.Size() +} +func (m *MsgCompleteDKG) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCompleteDKG.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCompleteDKG proto.InternalMessageInfo + +func (m *MsgCompleteDKG) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgCompleteDKG) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MsgCompleteDKG) GetVaults() []*Vault { + if m != nil { + return m.Vaults + } + return nil +} + +// MsgCompleteDKGResponse defines the Msg/CompleteDKG response type. +type MsgCompleteDKGResponse struct { +} + +func (m *MsgCompleteDKGResponse) Reset() { *m = MsgCompleteDKGResponse{} } +func (m *MsgCompleteDKGResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCompleteDKGResponse) ProtoMessage() {} +func (*MsgCompleteDKGResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_785ca8e1e4227068, []int{13} +} +func (m *MsgCompleteDKGResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCompleteDKGResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCompleteDKGResponse.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 *MsgCompleteDKGResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCompleteDKGResponse.Merge(m, src) +} +func (m *MsgCompleteDKGResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCompleteDKGResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCompleteDKGResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCompleteDKGResponse proto.InternalMessageInfo + // MsgUpdateParams is the Msg/UpdateParams request type. // // Since: cosmos-sdk 0.47 @@ -566,7 +768,7 @@ func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParams) ProtoMessage() {} func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_785ca8e1e4227068, []int{10} + return fileDescriptor_785ca8e1e4227068, []int{14} } func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -619,7 +821,7 @@ func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateParamsResponse) ProtoMessage() {} func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_785ca8e1e4227068, []int{11} + return fileDescriptor_785ca8e1e4227068, []int{15} } func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -659,6 +861,10 @@ func init() { proto.RegisterType((*MsgSubmitWithdrawTransactionResponse)(nil), "side.btcbridge.MsgSubmitWithdrawTransactionResponse") proto.RegisterType((*MsgWithdrawToBitcoin)(nil), "side.btcbridge.MsgWithdrawToBitcoin") proto.RegisterType((*MsgWithdrawToBitcoinResponse)(nil), "side.btcbridge.MsgWithdrawToBitcoinResponse") + proto.RegisterType((*MsgInitiateDKG)(nil), "side.btcbridge.MsgInitiateDKG") + proto.RegisterType((*MsgInitiateDKGResponse)(nil), "side.btcbridge.MsgInitiateDKGResponse") + proto.RegisterType((*MsgCompleteDKG)(nil), "side.btcbridge.MsgCompleteDKG") + proto.RegisterType((*MsgCompleteDKGResponse)(nil), "side.btcbridge.MsgCompleteDKGResponse") proto.RegisterType((*MsgUpdateParams)(nil), "side.btcbridge.MsgUpdateParams") proto.RegisterType((*MsgUpdateParamsResponse)(nil), "side.btcbridge.MsgUpdateParamsResponse") } @@ -666,48 +872,56 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/tx.proto", fileDescriptor_785ca8e1e4227068) } var fileDescriptor_785ca8e1e4227068 = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x86, 0xe3, 0x26, 0x0d, 0xcd, 0xe9, 0x05, 0x31, 0x0a, 0xad, 0xeb, 0x16, 0x27, 0x98, 0x96, - 0x46, 0xa2, 0xd8, 0x52, 0x5a, 0xb1, 0x46, 0x11, 0x42, 0xdd, 0x44, 0x42, 0x6e, 0x11, 0x88, 0x4d, - 0xe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x56, 0x7e, 0x9f, 0xa9, 0x95, 0x77, 0xba, 0x17, 0x30, 0x3f, 0xb1, 0x75, 0x87, 0x0c, - 0x8c, 0x54, 0x8c, 0x7f, 0xba, 0x1c, 0x72, 0xc0, 0x17, 0xc6, 0x70, 0xf4, 0xc3, 0x79, 0x14, 0x61, - 0x6a, 0xd7, 0x39, 0xb0, 0xf5, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x92, 0x4f, 0xf5, 0xa7, 0x57, 0x07, - 0x00, 0x00, + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcb, 0x4e, 0xf3, 0x46, + 0x18, 0x8d, 0x93, 0x90, 0x92, 0x2f, 0x90, 0xaa, 0x56, 0x08, 0xc6, 0x50, 0x27, 0x75, 0xb9, 0x44, + 0x2a, 0x24, 0x52, 0x40, 0x5d, 0x57, 0x29, 0x2a, 0x54, 0x28, 0x12, 0x32, 0xd0, 0x56, 0xdd, 0x20, + 0x5f, 0xa6, 0xf6, 0xb4, 0x89, 0xc7, 0x78, 0x26, 0x34, 0x48, 0x95, 0xfa, 0x0a, 0x6c, 0xfb, 0x06, + 0xed, 0x9b, 0xb0, 0x44, 0xea, 0xa6, 0xab, 0xaa, 0x82, 0x17, 0xa9, 0x7c, 0xc9, 0xc4, 0x49, 0x6c, + 0x2e, 0xbb, 0x7f, 0xe7, 0x99, 0x73, 0xe6, 0x9c, 0x33, 0x9f, 0xf3, 0x7d, 0x31, 0xac, 0x53, 0x6c, + 0xa1, 0x8e, 0xc1, 0x4c, 0xc3, 0xc7, 0x96, 0x8d, 0x3a, 0x6c, 0xdc, 0xf6, 0x7c, 0xc2, 0x88, 0x58, + 0x0d, 0x80, 0x36, 0x07, 0xe4, 0x9a, 0x4d, 0x6c, 0x12, 0x42, 0x9d, 0xe0, 0x29, 0x62, 0xc9, 0x9b, + 0x73, 0xc7, 0x3d, 0xdd, 0xd7, 0x87, 0x34, 0x06, 0xb7, 0xe6, 0x40, 0x03, 0x33, 0x93, 0x60, 0x37, + 0x42, 0xd5, 0x3f, 0x04, 0x58, 0xef, 0x53, 0xfb, 0x62, 0x64, 0x0c, 0x31, 0xfb, 0x1e, 0x33, 0xc7, + 0xf2, 0xf5, 0x5f, 0x2f, 0x98, 0xce, 0x46, 0x54, 0xac, 0x43, 0x89, 0x22, 0xd7, 0x42, 0xbe, 0x24, + 0x34, 0x85, 0x56, 0x59, 0x8b, 0x57, 0xa2, 0x0c, 0xcb, 0x14, 0xdd, 0x8c, 0x90, 0x6b, 0x22, 0x29, + 0xdf, 0x14, 0x5a, 0x45, 0x8d, 0xaf, 0x45, 0x11, 0x8a, 0x6c, 0x8c, 0x2d, 0xa9, 0x10, 0x9e, 0x08, + 0x9f, 0xc5, 0x2f, 0xa1, 0x44, 0x43, 0x45, 0xa9, 0xd8, 0x14, 0x5a, 0xd5, 0xae, 0xd2, 0x9e, 0xbd, + 0x55, 0x7b, 0xd6, 0x57, 0x8b, 0xd9, 0xea, 0x67, 0xd0, 0xc8, 0x88, 0xa6, 0x21, 0xea, 0x11, 0x97, + 0x22, 0xf5, 0x06, 0xd6, 0x38, 0xa5, 0x37, 0x20, 0xe6, 0x2f, 0xa7, 0x48, 0xb7, 0x90, 0x9f, 0x9d, + 0xfd, 0x2b, 0x58, 0x35, 0x02, 0xde, 0xb5, 0x13, 0x11, 0xa5, 0x7c, 0xb3, 0xd0, 0xaa, 0x74, 0x37, + 0xe7, 0x23, 0x25, 0xc4, 0xb4, 0x15, 0x23, 0xa1, 0xac, 0x36, 0xe0, 0xd3, 0x54, 0x4b, 0x9e, 0xe9, + 0x4f, 0x01, 0x36, 0x39, 0xe3, 0x18, 0x79, 0x84, 0x62, 0x76, 0xe9, 0xeb, 0x2e, 0xd5, 0x4d, 0x86, + 0x89, 0x9b, 0x19, 0x6d, 0x0b, 0xca, 0xa1, 0x91, 0xa3, 0x53, 0x27, 0xac, 0x6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x9f, 0xc0, 0xe5, 0xdd, 0x97, 0xf1, 0xa4, 0x6c, 0xb2, 0x4d, 0xd3, + 0x64, 0x13, 0x78, 0xaa, 0x6c, 0x4a, 0xf7, 0x89, 0x3f, 0xc0, 0xca, 0x4c, 0xeb, 0x35, 0x52, 0xce, + 0x25, 0x09, 0xf2, 0xde, 0x2b, 0x84, 0x89, 0x72, 0xef, 0xf4, 0xe1, 0x49, 0x11, 0x1e, 0x9f, 0x14, + 0xe1, 0xbf, 0x27, 0x45, 0xb8, 0x7f, 0x56, 0x72, 0x8f, 0xcf, 0x4a, 0xee, 0x9f, 0x67, 0x25, 0xf7, + 0x63, 0xdb, 0xc6, 0xcc, 0x19, 0x19, 0x6d, 0x93, 0x0c, 0x3b, 0x81, 0x58, 0xf8, 0x61, 0x62, 0x92, + 0x41, 0xb8, 0xe8, 0x8c, 0x93, 0x9f, 0x45, 0x77, 0x1e, 0xa2, 0x46, 0x29, 0x24, 0x1c, 0xfe, 0x1f, + 0x00, 0x00, 0xff, 0xff, 0x5c, 0xdd, 0x13, 0xd9, 0x35, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -732,6 +946,10 @@ type MsgClient interface { WithdrawToBitcoin(ctx context.Context, in *MsgWithdrawToBitcoin, opts ...grpc.CallOption) (*MsgWithdrawToBitcoinResponse, error) // SubmitWithdrawStatus submits the status of the withdraw transaction. SubmitWithdrawStatus(ctx context.Context, in *MsgSubmitWithdrawStatus, opts ...grpc.CallOption) (*MsgSubmitWithdrawStatusResponse, error) + // InitiateDKG initiates the DKG request. + InitiateDKG(ctx context.Context, in *MsgInitiateDKG, opts ...grpc.CallOption) (*MsgInitiateDKGResponse, error) + // CompleteDKG completes the given DKG request. + CompleteDKG(ctx context.Context, in *MsgCompleteDKG, opts ...grpc.CallOption) (*MsgCompleteDKGResponse, error) // UpdateParams defines a governance operation for updating the x/btcbridge module // parameters. The authority defaults to the x/gov module account. // @@ -792,6 +1010,24 @@ func (c *msgClient) SubmitWithdrawStatus(ctx context.Context, in *MsgSubmitWithd return out, nil } +func (c *msgClient) InitiateDKG(ctx context.Context, in *MsgInitiateDKG, opts ...grpc.CallOption) (*MsgInitiateDKGResponse, error) { + out := new(MsgInitiateDKGResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Msg/InitiateDKG", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) CompleteDKG(ctx context.Context, in *MsgCompleteDKG, opts ...grpc.CallOption) (*MsgCompleteDKGResponse, error) { + out := new(MsgCompleteDKGResponse) + err := c.cc.Invoke(ctx, "/side.btcbridge.Msg/CompleteDKG", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { out := new(MsgUpdateParamsResponse) err := c.cc.Invoke(ctx, "/side.btcbridge.Msg/UpdateParams", in, out, opts...) @@ -813,6 +1049,10 @@ type MsgServer interface { WithdrawToBitcoin(context.Context, *MsgWithdrawToBitcoin) (*MsgWithdrawToBitcoinResponse, error) // SubmitWithdrawStatus submits the status of the withdraw transaction. SubmitWithdrawStatus(context.Context, *MsgSubmitWithdrawStatus) (*MsgSubmitWithdrawStatusResponse, error) + // InitiateDKG initiates the DKG request. + InitiateDKG(context.Context, *MsgInitiateDKG) (*MsgInitiateDKGResponse, error) + // CompleteDKG completes the given DKG request. + CompleteDKG(context.Context, *MsgCompleteDKG) (*MsgCompleteDKGResponse, error) // UpdateParams defines a governance operation for updating the x/btcbridge module // parameters. The authority defaults to the x/gov module account. // @@ -839,6 +1079,12 @@ func (*UnimplementedMsgServer) WithdrawToBitcoin(ctx context.Context, req *MsgWi func (*UnimplementedMsgServer) SubmitWithdrawStatus(ctx context.Context, req *MsgSubmitWithdrawStatus) (*MsgSubmitWithdrawStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitWithdrawStatus not implemented") } +func (*UnimplementedMsgServer) InitiateDKG(ctx context.Context, req *MsgInitiateDKG) (*MsgInitiateDKGResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InitiateDKG not implemented") +} +func (*UnimplementedMsgServer) CompleteDKG(ctx context.Context, req *MsgCompleteDKG) (*MsgCompleteDKGResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CompleteDKG not implemented") +} func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") } @@ -937,6 +1183,42 @@ func _Msg_SubmitWithdrawStatus_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_InitiateDKG_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInitiateDKG) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InitiateDKG(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Msg/InitiateDKG", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InitiateDKG(ctx, req.(*MsgInitiateDKG)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_CompleteDKG_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCompleteDKG) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CompleteDKG(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/side.btcbridge.Msg/CompleteDKG", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CompleteDKG(ctx, req.(*MsgCompleteDKG)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateParams) if err := dec(in); err != nil { @@ -979,6 +1261,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "SubmitWithdrawStatus", Handler: _Msg_SubmitWithdrawStatus_Handler, }, + { + MethodName: "InitiateDKG", + Handler: _Msg_InitiateDKG_Handler, + }, + { + MethodName: "CompleteDKG", + Handler: _Msg_CompleteDKG_Handler, + }, { MethodName: "UpdateParams", Handler: _Msg_UpdateParams_Handler, @@ -1351,7 +1641,7 @@ func (m *MsgWithdrawToBitcoinResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } -func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { +func (m *MsgInitiateDKG) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1361,26 +1651,35 @@ func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgInitiateDKG) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgInitiateDKG) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Threshold != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Threshold)) + i-- + dAtA[i] = 0x18 + } + if len(m.Participants) > 0 { + for iNdEx := len(m.Participants) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Participants[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 if len(m.Authority) > 0 { i -= len(m.Authority) copy(dAtA[i:], m.Authority) @@ -1391,7 +1690,7 @@ func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgInitiateDKGResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1401,12 +1700,12 @@ func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgInitiateDKGResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgInitiateDKGResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1414,43 +1713,178 @@ func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgCompleteDKG) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *MsgSubmitWithdrawStatus) Size() (n int) { - if m == nil { - return 0 - } + +func (m *MsgCompleteDKG) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCompleteDKG) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Sequence != 0 { - n += 1 + sovTx(uint64(m.Sequence)) + if len(m.Vaults) > 0 { + for iNdEx := len(m.Vaults) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Vaults[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } } - l = len(m.Txid) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.Id != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x10 } - if m.Status != 0 { - n += 1 + sovTx(uint64(m.Status)) + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *MsgSubmitWithdrawStatusResponse) Size() (n int) { - if m == nil { - return 0 +func (m *MsgCompleteDKGResponse) 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 *MsgCompleteDKGResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCompleteDKGResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSubmitWithdrawStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } + l = len(m.Txid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + return n +} + +func (m *MsgSubmitWithdrawStatusResponse) Size() (n int) { + if m == nil { + return 0 } var l int _ = l @@ -1591,6 +2025,68 @@ func (m *MsgWithdrawToBitcoinResponse) Size() (n int) { return n } +func (m *MsgInitiateDKG) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Participants) > 0 { + for _, e := range m.Participants { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if m.Threshold != 0 { + n += 1 + sovTx(uint64(m.Threshold)) + } + return n +} + +func (m *MsgInitiateDKGResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgCompleteDKG) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Id != 0 { + n += 1 + sovTx(uint64(m.Id)) + } + if len(m.Vaults) > 0 { + for _, e := range m.Vaults { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgCompleteDKGResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgUpdateParams) Size() (n int) { if m == nil { return 0 @@ -2673,6 +3169,376 @@ func (m *MsgWithdrawToBitcoinResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgInitiateDKG) 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 ErrIntOverflowTx + } + 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: MsgInitiateDKG: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitiateDKG: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Participants", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Participants = append(m.Participants, &DKGParticipant{}) + if err := m.Participants[len(m.Participants)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + m.Threshold = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Threshold |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgInitiateDKGResponse) 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 ErrIntOverflowTx + } + 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: MsgInitiateDKGResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInitiateDKGResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCompleteDKG) 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 ErrIntOverflowTx + } + 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: MsgCompleteDKG: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCompleteDKG: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vaults", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Vaults = append(m.Vaults, &Vault{}) + if err := m.Vaults[len(m.Vaults)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCompleteDKGResponse) 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 ErrIntOverflowTx + } + 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: MsgCompleteDKGResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCompleteDKGResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0