From a469f2bc96c538eb8f39682ad186726a7fb51121 Mon Sep 17 00:00:00 2001 From: KonradStaniec Date: Mon, 5 Sep 2022 19:56:45 +0200 Subject: [PATCH] Add custom query --- .../babylon/btccheckpoint/btccheckpoint.proto | 2 +- proto/babylon/btccheckpoint/genesis.proto | 2 +- proto/babylon/btccheckpoint/params.proto | 2 +- proto/babylon/btccheckpoint/query.proto | 21 +- proto/babylon/btccheckpoint/tx.proto | 2 +- x/btccheckpoint/client/cli/query.go | 30 +- x/btccheckpoint/keeper/grpc_query.go | 86 ++++ x/btccheckpoint/keeper/keeper.go | 5 + x/btccheckpoint/keeper/msg_server_test.go | 1 - x/btccheckpoint/types/btccheckpoint.pb.go | 78 ++-- x/btccheckpoint/types/genesis.pb.go | 24 +- x/btccheckpoint/types/params.pb.go | 2 +- x/btccheckpoint/types/query.pb.go | 425 ++++++++++++++++-- x/btccheckpoint/types/query.pb.gw.go | 100 ++++- x/btccheckpoint/types/tx.pb.go | 60 +-- 15 files changed, 721 insertions(+), 119 deletions(-) diff --git a/proto/babylon/btccheckpoint/btccheckpoint.proto b/proto/babylon/btccheckpoint/btccheckpoint.proto index da6e97d17..b837d8b39 100644 --- a/proto/babylon/btccheckpoint/btccheckpoint.proto +++ b/proto/babylon/btccheckpoint/btccheckpoint.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package babylon.btccheckpoint; +package babylon.btccheckpoint.v1; import "gogoproto/gogo.proto"; diff --git a/proto/babylon/btccheckpoint/genesis.proto b/proto/babylon/btccheckpoint/genesis.proto index 9b267fb85..8e2c068c5 100644 --- a/proto/babylon/btccheckpoint/genesis.proto +++ b/proto/babylon/btccheckpoint/genesis.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package babylon.btccheckpoint; +package babylon.btccheckpoint.v1; import "gogoproto/gogo.proto"; import "babylon/btccheckpoint/params.proto"; diff --git a/proto/babylon/btccheckpoint/params.proto b/proto/babylon/btccheckpoint/params.proto index b0e748150..69c2d30c7 100644 --- a/proto/babylon/btccheckpoint/params.proto +++ b/proto/babylon/btccheckpoint/params.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package babylon.btccheckpoint; +package babylon.btccheckpoint.v1; import "gogoproto/gogo.proto"; diff --git a/proto/babylon/btccheckpoint/query.proto b/proto/babylon/btccheckpoint/query.proto index ee398b480..c093c2843 100644 --- a/proto/babylon/btccheckpoint/query.proto +++ b/proto/babylon/btccheckpoint/query.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package babylon.btccheckpoint; +package babylon.btccheckpoint.v1; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; @@ -13,9 +13,15 @@ option go_package = "github.com/babylonchain/babylon/x/btccheckpoint/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/babylonchain/babylon/btccheckpoint/params"; + option (google.api.http).get = "/babylon/btccheckpoint/v1/params"; } // this line is used by starport scaffolding # 2 + + + // BtcCheckpointHeight returns earliest block height for given rawcheckpoint + rpc BtcCheckpointHeight(QueryBtcCheckpointHeightRequest) returns (QueryBtcCheckpointHeightResponse) { + option (google.api.http).get = "/babylon/btccheckpoint/v1/{raw_checkpoint}"; + } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -28,3 +34,14 @@ message QueryParamsResponse { } // this line is used by starport scaffolding # 3 + +message QueryBtcCheckpointHeightRequest { + // Hex encoded raw checkpoint bytes + string raw_checkpoint = 1; +} + +// QueryCurrentEpochResponse is response type for the Query/CurrentEpoch RPC method +message QueryBtcCheckpointHeightResponse { + // Earliest btc block number containing given raw checkpoint + uint64 earliest_btc_block_number = 1; +} diff --git a/proto/babylon/btccheckpoint/tx.proto b/proto/babylon/btccheckpoint/tx.proto index 6a0f92539..b885d712d 100644 --- a/proto/babylon/btccheckpoint/tx.proto +++ b/proto/babylon/btccheckpoint/tx.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -package babylon.btccheckpoint; +package babylon.btccheckpoint.v1; // this line is used by starport scaffolding # proto/tx/import diff --git a/x/btccheckpoint/client/cli/query.go b/x/btccheckpoint/client/cli/query.go index d5c4c1b2f..73b93aaa9 100644 --- a/x/btccheckpoint/client/cli/query.go +++ b/x/btccheckpoint/client/cli/query.go @@ -1,14 +1,12 @@ package cli import ( + "context" "fmt" - // "strings" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" "github.com/babylonchain/babylon/x/btccheckpoint/types" ) @@ -27,5 +25,31 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryParams()) // this line is used by starport scaffolding # 1 + cmd.AddCommand(CmdBtcCheckpointHeight()) + return cmd +} + +func CmdBtcCheckpointHeight() *cobra.Command { + cmd := &cobra.Command{ + Use: "btc-height rawcheckpoint", + Short: "retrieve earliest btc height for given raw checkpoint", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := types.QueryBtcCheckpointHeightRequest{RawCheckpoint: args[0]} + + res, err := queryClient.BtcCheckpointHeight(context.Background(), ¶ms) + + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + return cmd } diff --git a/x/btccheckpoint/keeper/grpc_query.go b/x/btccheckpoint/keeper/grpc_query.go index 860c7784a..20207a6ef 100644 --- a/x/btccheckpoint/keeper/grpc_query.go +++ b/x/btccheckpoint/keeper/grpc_query.go @@ -1,7 +1,93 @@ package keeper import ( + "context" + "encoding/hex" + "errors" + "math" + "github.com/babylonchain/babylon/x/btccheckpoint/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" ) var _ types.QueryServer = Keeper{} + +func (k Keeper) lowestBtcHeight(ctx sdk.Context, subKey *types.SubmissionKey) (uint64, error) { + // initializing to max, as then every header number will be smaller + var lowestHeaderNumber uint64 = math.MaxUint64 + + for _, tk := range subKey.Key { + + if !k.CheckHeaderIsOnMainChain(ctx, tk.Hash) { + return 0, errors.New("one of submission headers not on main chain") + } + + headerNumber, err := k.GetBlockHeight(ctx, tk.Hash) + + if err != nil { + // CheckHeaderIsOnMainChain (which uses main chain depth) returned true which + // means header should be saved and we should know its heigh but GetBlockHeight + // returned error. Something is really bad, panic. + panic("Inconsistent data model in btc light client") + } + + if headerNumber < lowestHeaderNumber { + lowestHeaderNumber = headerNumber + } + } + + return lowestHeaderNumber, nil +} + +func (k Keeper) BtcCheckpointHeight(c context.Context, req *types.QueryBtcCheckpointHeightRequest) (*types.QueryBtcCheckpointHeightResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(c) + + rawCheckpointBytes, err := hex.DecodeString(req.GetRawCheckpoint()) + + if err != nil { + return nil, err + } + + checkpointEpoch, err := k.GetCheckpointEpoch(ctx, rawCheckpointBytes) + + if err != nil { + return nil, err + } + + epochData := k.GetEpochData(ctx, checkpointEpoch) + + // It is valid raw checkpoint (known to checkpointing module), but we do not have + // any submission fot it yet + if epochData == nil || len(epochData.Key) == 0 { + return nil, errors.New("checkpoint for given epoch not yet submitted") + } + + var lowestHeaderNumber uint64 = math.MaxUint64 + + // we need to go for each submission in given epoch + for _, submissionKey := range epochData.Key { + + headerNumber, err := k.lowestBtcHeight(ctx, submissionKey) + + if err != nil { + // submission is not valid for some reason, ignore it + continue + } + + if headerNumber < lowestHeaderNumber { + lowestHeaderNumber = headerNumber + } + } + + if lowestHeaderNumber == math.MaxUint64 { + return nil, errors.New("there is no valid submission for given raw checkpoint") + } + + return &types.QueryBtcCheckpointHeightResponse{EarliestBtcBlockNumber: lowestHeaderNumber}, nil +} diff --git a/x/btccheckpoint/keeper/keeper.go b/x/btccheckpoint/keeper/keeper.go index 6924b02eb..b5a57e9bd 100644 --- a/x/btccheckpoint/keeper/keeper.go +++ b/x/btccheckpoint/keeper/keeper.go @@ -76,6 +76,11 @@ func (k Keeper) CheckHeaderIsKnown(ctx sdk.Context, hash *bbn.BTCHeaderHashBytes return err == nil } +func (k Keeper) CheckHeaderIsOnMainChain(ctx sdk.Context, hash *bbn.BTCHeaderHashBytes) bool { + depth, err := k.btcLightClientKeeper.MainChainDepth(ctx, hash) + return err == nil && depth >= 0 +} + func (k Keeper) MainChainDepth(ctx sdk.Context, hash *bbn.BTCHeaderHashBytes) (uint64, bool, error) { depth, err := k.btcLightClientKeeper.MainChainDepth(ctx, hash) diff --git a/x/btccheckpoint/keeper/msg_server_test.go b/x/btccheckpoint/keeper/msg_server_test.go index e95e71580..687f0a9f9 100644 --- a/x/btccheckpoint/keeper/msg_server_test.go +++ b/x/btccheckpoint/keeper/msg_server_test.go @@ -243,7 +243,6 @@ func TestStateTransitionOfValidSubmission(t *testing.T) { // fire tip change callback k.OnTipChange(ctx) - // TODO customs Equality for submission keys to check this are really keys // we are looking for unc = k.GetAllUnconfirmedSubmissions(ctx) diff --git a/x/btccheckpoint/types/btccheckpoint.pb.go b/x/btccheckpoint/types/btccheckpoint.pb.go index 32a366b46..ce890f242 100644 --- a/x/btccheckpoint/types/btccheckpoint.pb.go +++ b/x/btccheckpoint/types/btccheckpoint.pb.go @@ -240,7 +240,7 @@ type EpochData struct { // submission. Key []*SubmissionKey `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"` // Current state of epoch. - Status EpochStatus `protobuf:"varint,2,opt,name=status,proto3,enum=babylon.btccheckpoint.EpochStatus" json:"status,omitempty"` + Status EpochStatus `protobuf:"varint,2,opt,name=status,proto3,enum=babylon.btccheckpoint.v1.EpochStatus" json:"status,omitempty"` // Required to comunicate with checkpoint module about checkpoint status RawCheckpoint []byte `protobuf:"bytes,3,opt,name=raw_checkpoint,json=rawCheckpoint,proto3" json:"raw_checkpoint,omitempty"` } @@ -300,11 +300,11 @@ func (m *EpochData) GetRawCheckpoint() []byte { } func init() { - proto.RegisterEnum("babylon.btccheckpoint.EpochStatus", EpochStatus_name, EpochStatus_value) - proto.RegisterType((*TransactionKey)(nil), "babylon.btccheckpoint.TransactionKey") - proto.RegisterType((*SubmissionKey)(nil), "babylon.btccheckpoint.SubmissionKey") - proto.RegisterType((*SubmissionData)(nil), "babylon.btccheckpoint.SubmissionData") - proto.RegisterType((*EpochData)(nil), "babylon.btccheckpoint.EpochData") + proto.RegisterEnum("babylon.btccheckpoint.v1.EpochStatus", EpochStatus_name, EpochStatus_value) + proto.RegisterType((*TransactionKey)(nil), "babylon.btccheckpoint.v1.TransactionKey") + proto.RegisterType((*SubmissionKey)(nil), "babylon.btccheckpoint.v1.SubmissionKey") + proto.RegisterType((*SubmissionData)(nil), "babylon.btccheckpoint.v1.SubmissionData") + proto.RegisterType((*EpochData)(nil), "babylon.btccheckpoint.v1.EpochData") } func init() { @@ -312,39 +312,39 @@ func init() { } var fileDescriptor_da8b9af3dbd18a36 = []byte{ - // 508 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xb3, 0x49, 0x88, 0x94, 0x6d, 0x12, 0x45, 0xa6, 0xa0, 0x28, 0x42, 0xc6, 0x0a, 0x14, - 0xa5, 0x1c, 0x1c, 0xa9, 0x88, 0x3f, 0x42, 0x5c, 0x9a, 0xd8, 0x21, 0x16, 0x34, 0xa9, 0x6c, 0xf7, - 0xd2, 0x4b, 0xb4, 0xb6, 0x97, 0x78, 0xd5, 0xc4, 0x1b, 0x79, 0x37, 0x6a, 0xcc, 0x13, 0xa0, 0x9e, - 0x78, 0x81, 0x9e, 0x90, 0x78, 0x07, 0xde, 0x80, 0x63, 0x8f, 0x88, 0x03, 0x42, 0xc9, 0x8b, 0x20, - 0xaf, 0x0d, 0xa9, 0x4b, 0xab, 0xde, 0x76, 0xc6, 0xbf, 0x99, 0xef, 0x9b, 0xd1, 0x18, 0xee, 0x3a, - 0xc8, 0x89, 0xa6, 0x34, 0xe8, 0x38, 0xdc, 0x75, 0x7d, 0xec, 0x9e, 0xcc, 0x29, 0x09, 0x78, 0x36, - 0x52, 0xe7, 0x21, 0xe5, 0x54, 0xba, 0x97, 0xa2, 0x6a, 0xe6, 0x63, 0x73, 0x7b, 0x42, 0x27, 0x54, - 0x10, 0x9d, 0xf8, 0x95, 0xc0, 0xad, 0x25, 0xac, 0xd9, 0x21, 0x0a, 0x18, 0x72, 0x39, 0xa1, 0xc1, - 0x3b, 0x1c, 0x49, 0xdb, 0xf0, 0x0e, 0x09, 0x3c, 0xbc, 0x6c, 0x00, 0x05, 0xb4, 0xab, 0x66, 0x12, - 0x48, 0x87, 0xb0, 0xe8, 0x23, 0xe6, 0x37, 0xf2, 0x0a, 0x68, 0x57, 0xba, 0x6f, 0x7e, 0xfe, 0x7a, - 0xf8, 0x6a, 0x42, 0xb8, 0xbf, 0x70, 0x54, 0x97, 0xce, 0x3a, 0xa9, 0xa2, 0xeb, 0x23, 0x12, 0xfc, - 0x0d, 0x3a, 0x3c, 0x9a, 0x63, 0xa6, 0x76, 0xed, 0xde, 0x00, 0x23, 0x0f, 0x87, 0x03, 0xc4, 0xfc, - 0x6e, 0xc4, 0x31, 0x33, 0x45, 0xa7, 0xd6, 0x00, 0x56, 0xad, 0x85, 0x33, 0x23, 0x8c, 0xa5, 0xc2, - 0x2f, 0x61, 0xe1, 0x04, 0x47, 0x0d, 0xa0, 0x14, 0xda, 0x5b, 0x7b, 0x3b, 0xea, 0xb5, 0x53, 0xa8, - 0x59, 0xb3, 0x66, 0x5c, 0xd1, 0x9a, 0xc2, 0xda, 0xa6, 0x93, 0x86, 0x38, 0x92, 0x1e, 0xc0, 0x32, - 0x8b, 0x33, 0x9c, 0xe3, 0x50, 0xcc, 0x51, 0x31, 0x37, 0x09, 0xe9, 0x09, 0xac, 0x39, 0xdc, 0xe5, - 0x9b, 0x4e, 0x8d, 0xbc, 0x52, 0x68, 0x57, 0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x5c, 0xac, 0x64, - 0xf0, 0x7b, 0x25, 0x83, 0xcf, 0x6b, 0x39, 0x77, 0xb1, 0x96, 0x73, 0x3f, 0xd6, 0x72, 0xee, 0xf8, - 0xf9, 0x6d, 0x67, 0xb7, 0xbc, 0xf2, 0x8b, 0x88, 0x33, 0x74, 0x4a, 0xe2, 0xdc, 0x9f, 0xfd, 0x09, - 0x00, 0x00, 0xff, 0xff, 0xb2, 0x7a, 0xe8, 0xcf, 0x48, 0x03, 0x00, 0x00, + // 510 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xb3, 0x4d, 0x88, 0x94, 0x6d, 0x12, 0x45, 0xa6, 0x42, 0x56, 0x84, 0x8c, 0x15, 0x54, + 0x70, 0x39, 0x38, 0xa2, 0x08, 0x09, 0x10, 0x1c, 0x9a, 0xc4, 0x21, 0x51, 0x69, 0x52, 0xd9, 0xee, + 0xa5, 0x97, 0x68, 0x6d, 0x2f, 0xf1, 0xaa, 0x89, 0x37, 0xf2, 0x6e, 0x68, 0xcc, 0x13, 0xa0, 0x9e, + 0x78, 0x81, 0x9e, 0xb8, 0xf2, 0x02, 0xbc, 0x01, 0xc7, 0x1e, 0x11, 0x07, 0x84, 0x92, 0x17, 0x41, + 0x5e, 0x1b, 0x52, 0x17, 0x22, 0x6e, 0x3b, 0xe3, 0x6f, 0xe6, 0xff, 0x67, 0x34, 0x86, 0x7b, 0x0e, + 0x72, 0xa2, 0x09, 0x0d, 0x9a, 0x0e, 0x77, 0x5d, 0x1f, 0xbb, 0x67, 0x33, 0x4a, 0x02, 0x9e, 0x8d, + 0xf4, 0x59, 0x48, 0x39, 0x95, 0xe4, 0x14, 0xd5, 0xb3, 0x1f, 0xdf, 0x3d, 0xae, 0xef, 0x8c, 0xe9, + 0x98, 0x0a, 0xa8, 0x19, 0xbf, 0x12,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02, 0x00, 0x00, 0xff, 0xff, 0x99, 0xdd, 0xef, 0x21, 0x54, 0x03, 0x00, 0x00, } func (m *TransactionKey) Marshal() (dAtA []byte, err error) { diff --git a/x/btccheckpoint/types/genesis.pb.go b/x/btccheckpoint/types/genesis.pb.go index cd8700c6c..86a1fb9c8 100644 --- a/x/btccheckpoint/types/genesis.pb.go +++ b/x/btccheckpoint/types/genesis.pb.go @@ -69,7 +69,7 @@ func (m *GenesisState) GetParams() Params { } func init() { - proto.RegisterType((*GenesisState)(nil), "babylon.btccheckpoint.GenesisState") + proto.RegisterType((*GenesisState)(nil), "babylon.btccheckpoint.v1.GenesisState") } func init() { @@ -77,20 +77,20 @@ func init() { } var fileDescriptor_bf9801ce688057b7 = []byte{ - // 199 bytes of a gzipped FileDescriptorProto + // 202 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0x4a, 0x4c, 0xaa, 0xcc, 0xc9, 0xcf, 0xd3, 0x4f, 0x2a, 0x49, 0x4e, 0xce, 0x48, 0x4d, 0xce, 0x2e, 0xc8, 0xcf, 0xcc, 0x2b, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x85, 0x2a, 0xd2, 0x43, 0x51, 0x24, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa1, 0x0f, - 0x62, 0x41, 0x14, 0x4b, 0x29, 0x61, 0x37, 0xb1, 0x20, 0xb1, 0x28, 0x31, 0x17, 0x6a, 0xa0, 0x92, - 0x37, 0x17, 0x8f, 0x3b, 0xc4, 0x86, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x6b, 0x2e, 0x36, 0x88, - 0xbc, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0xac, 0x1e, 0x56, 0x1b, 0xf5, 0x02, 0xc0, 0x8a, - 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x6a, 0x71, 0xf2, 0x3f, 0xf1, 0x48, 0x8e, 0xf1, - 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, - 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, - 0x5c, 0x7d, 0xa8, 0x81, 0xc9, 0x19, 0x89, 0x99, 0x79, 0x30, 0x8e, 0x7e, 0x05, 0x9a, 0x23, 0x4b, - 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x8e, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3f, - 0x7d, 0x26, 0x57, 0x1c, 0x01, 0x00, 0x00, + 0x92, 0x80, 0x2a, 0xd2, 0x43, 0x51, 0xa4, 0x57, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, + 0x56, 0xa4, 0x0f, 0x62, 0x41, 0xd4, 0x4b, 0x29, 0x61, 0x37, 0xb4, 0x20, 0xb1, 0x28, 0x31, 0x17, + 0x6a, 0xa6, 0x92, 0x1f, 0x17, 0x8f, 0x3b, 0xc4, 0x92, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x3b, + 0x2e, 0x36, 0x88, 0xbc, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x82, 0x1e, 0x2e, 0x4b, 0xf5, + 0x02, 0xc0, 0xea, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0xea, 0x72, 0xf2, 0x3f, 0xf1, + 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, + 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xd3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, + 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0xa8, 0x99, 0xc9, 0x19, 0x89, 0x99, 0x79, 0x30, 0x8e, 0x7e, 0x05, + 0x9a, 0x3b, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xee, 0x34, 0x06, 0x04, 0x00, 0x00, + 0xff, 0xff, 0x8b, 0xb4, 0x95, 0x7a, 0x22, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/x/btccheckpoint/types/params.pb.go b/x/btccheckpoint/types/params.pb.go index ad674f0ee..e7fc19a0c 100644 --- a/x/btccheckpoint/types/params.pb.go +++ b/x/btccheckpoint/types/params.pb.go @@ -85,7 +85,7 @@ func (m *Params) GetCheckpointFinalizationTimeout() uint64 { } func init() { - proto.RegisterType((*Params)(nil), "babylon.btccheckpoint.Params") + proto.RegisterType((*Params)(nil), "babylon.btccheckpoint.v1.Params") } func init() { diff --git a/x/btccheckpoint/types/query.pb.go b/x/btccheckpoint/types/query.pb.go index a3cc57857..1bad8e436 100644 --- a/x/btccheckpoint/types/query.pb.go +++ b/x/btccheckpoint/types/query.pb.go @@ -113,35 +113,136 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +type QueryBtcCheckpointHeightRequest struct { + // Hex encoded raw checkpoint bytes + RawCheckpoint string `protobuf:"bytes,1,opt,name=raw_checkpoint,json=rawCheckpoint,proto3" json:"raw_checkpoint,omitempty"` +} + +func (m *QueryBtcCheckpointHeightRequest) Reset() { *m = QueryBtcCheckpointHeightRequest{} } +func (m *QueryBtcCheckpointHeightRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBtcCheckpointHeightRequest) ProtoMessage() {} +func (*QueryBtcCheckpointHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_009c1165ec392ace, []int{2} +} +func (m *QueryBtcCheckpointHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBtcCheckpointHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBtcCheckpointHeightRequest.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 *QueryBtcCheckpointHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBtcCheckpointHeightRequest.Merge(m, src) +} +func (m *QueryBtcCheckpointHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBtcCheckpointHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBtcCheckpointHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBtcCheckpointHeightRequest proto.InternalMessageInfo + +func (m *QueryBtcCheckpointHeightRequest) GetRawCheckpoint() string { + if m != nil { + return m.RawCheckpoint + } + return "" +} + +// QueryCurrentEpochResponse is response type for the Query/CurrentEpoch RPC method +type QueryBtcCheckpointHeightResponse struct { + // Earliest btc block number containing given raw checkpoint + EarliestBtcBlockNumber uint64 `protobuf:"varint,1,opt,name=earliest_btc_block_number,json=earliestBtcBlockNumber,proto3" json:"earliest_btc_block_number,omitempty"` +} + +func (m *QueryBtcCheckpointHeightResponse) Reset() { *m = QueryBtcCheckpointHeightResponse{} } +func (m *QueryBtcCheckpointHeightResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBtcCheckpointHeightResponse) ProtoMessage() {} +func (*QueryBtcCheckpointHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_009c1165ec392ace, []int{3} +} +func (m *QueryBtcCheckpointHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBtcCheckpointHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBtcCheckpointHeightResponse.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 *QueryBtcCheckpointHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBtcCheckpointHeightResponse.Merge(m, src) +} +func (m *QueryBtcCheckpointHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBtcCheckpointHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBtcCheckpointHeightResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBtcCheckpointHeightResponse proto.InternalMessageInfo + +func (m *QueryBtcCheckpointHeightResponse) GetEarliestBtcBlockNumber() uint64 { + if m != nil { + return m.EarliestBtcBlockNumber + } + return 0 +} + func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "babylon.btccheckpoint.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "babylon.btccheckpoint.QueryParamsResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "babylon.btccheckpoint.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "babylon.btccheckpoint.v1.QueryParamsResponse") + proto.RegisterType((*QueryBtcCheckpointHeightRequest)(nil), "babylon.btccheckpoint.v1.QueryBtcCheckpointHeightRequest") + proto.RegisterType((*QueryBtcCheckpointHeightResponse)(nil), "babylon.btccheckpoint.v1.QueryBtcCheckpointHeightResponse") } func init() { proto.RegisterFile("babylon/btccheckpoint/query.proto", fileDescriptor_009c1165ec392ace) } var fileDescriptor_009c1165ec392ace = []byte{ - // 305 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4a, 0x73, 0x31, - 0x18, 0x86, 0x4f, 0x7e, 0x7e, 0x3b, 0xc4, 0x2d, 0x56, 0x90,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f, - 0x22, 0xdd, 0x67, 0x84, 0xb7, 0x2a, 0x29, 0x99, 0x23, 0xdc, 0x88, 0x08, 0x39, 0xfd, 0xc1, 0xf0, - 0xbd, 0x53, 0xab, 0xfd, 0x17, 0x34, 0x16, 0xcd, 0xbb, 0x8f, 0x2f, 0x1f, 0xf3, 0x7f, 0x67, 0xa4, - 0xcd, 0x52, 0x46, 0x0e, 0xb8, 0xb1, 0xec, 0xb7, 0x7d, 0xf4, 0xae, 0x16, 0x2b, 0x8a, 0x96, 0x2b, - 0x8a, 0xde, 0x57, 0x14, 0x3d, 0x95, 0x34, 0x5b, 0x96, 0x34, 0x7b, 0x2d, 0x69, 0x76, 0x7b, 0xa1, - 0x4d, 0x18, 0x4c, 0x45, 0x21, 0x61, 0x54, 0xef, 0x7b, 0xf8, 0x62, 0x0c, 0x33, 0xa7, 0xbc, 0x68, - 0x54, 0x1b, 0x3e, 0xff, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x04, 0xb7, 0x88, 0x21, 0x02, 0x00, - 0x00, + // 438 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x93, 0x52, 0x17, 0x1c, 0xd1, 0xc3, 0xb4, 0x48, 0x0d, 0x92, 0xc6, 0x80, 0x50, 0x4a, + 0xcd, 0x90, 0x15, 0x0f, 0xf5, 0xe0, 0x21, 0x5e, 0x7a, 0xf2, 0x4f, 0xc0, 0x8b, 0x20, 0x61, 0x66, + 0x18, 0x92, 0xa1, 0xc9, 0x4c, 0x9a, 0x99, 0x6c, 0x5d, 0xc4, 0x8b, 0x5f, 0x40, 0xc1, 0x2f, 0xe4, + 0x71, 0x8f, 0x0b, 0x5e, 0x3c, 0x88, 0xc8, 0xae, 0x1f, 0x44, 0x76, 0x32, 0xbb, 0xcb, 0xea, 0x06, + 0xa5, 0xb7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0x40, 0xd0, 0x4f, 0xb2, 0x69, 0x4f, 0xc1, 0x1d, + 0x86, 0x9b, 0x92, 0x33, 0xa5, 0x33, 0xa2, 0x69, 0x46, 0x4a, 0x49, 0xcf, 0x33, 0xd1, 0x56, 0x84, + 0x35, 0x86, 0xba, 0x9b, 0xde, 0x5e, 0x0a, 0x12, 0x4d, 0x93, 0x45, 0xf9, 0x99, 0xa9, 0x0e, 0xbf, + 0xef, 0x80, 0x6b, 0x86, 0x0f, 0x3f, 0xba, 0x60, 0xd0, 0xcd, 0x02, 0x4f, 0xfa, 0xa7, 0xfd, 0x7b, + 0x85, 0xde, 0x83, 0xff, 0x54, 0x77, 0x61, 0xc3, 0xa3, 0x0f, 0x5f, 0x7f, 0x7d, 0xde, 0x09, 0x61, + 0x80, 0xb6, 0x1f, 0x6d, 0x14, 0xdb, 0xbb, 0xc1, 0x2f, 0x2e, 0xd8, 0xdb, 0x32, 0x36, 0x3c, 0xfd, + 0x47, 0xc3, 0xfe, 0xa5, 0x7b, 0x8f, 0xaf, 0x62, 0xb5, 0xc1, 0x87, 0x26, 0xf8, 0x09, 0x3c, 0xee, + 0x0f, 0xfe, 0x6e, 0xf3, 0xa2, 0xef, 0x93, 0xe7, 0x93, 0x99, 0xef, 0x4e, 0x67, 0xbe, 0xfb, 0x73, + 0xe6, 0xbb, 0x9f, 0xe6, 0xbe, 0x33, 0x9d, 0xfb, 0xce, 0xb7, 0xb9, 0xef, 0xbc, 0x7e, 0x94, 0x73, + 0x5d, 0xb4, 0x24, 0xa2, 0xb2, 0x5a, 0xf2, 0x68, 0x81, 0xb9, 0x58, 0xc1, 0xdf, 0xfe, 0x81, 0xd7, + 0xe3, 0x9a, 0x29, 0x32, 0x30, 0x3f, 0xf3, 0xc3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1e, 0xcc, + 0x50, 0x74, 0x8f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -158,6 +259,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // BtcCheckpointHeight returns earliest block height for given rawcheckpoint + BtcCheckpointHeight(ctx context.Context, in *QueryBtcCheckpointHeightRequest, opts ...grpc.CallOption) (*QueryBtcCheckpointHeightResponse, error) } type queryClient struct { @@ -170,7 +273,16 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/babylon.btccheckpoint.Query/Params", in, out, opts...) + err := c.cc.Invoke(ctx, "/babylon.btccheckpoint.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) BtcCheckpointHeight(ctx context.Context, in *QueryBtcCheckpointHeightRequest, opts ...grpc.CallOption) (*QueryBtcCheckpointHeightResponse, error) { + out := new(QueryBtcCheckpointHeightResponse) + err := c.cc.Invoke(ctx, "/babylon.btccheckpoint.v1.Query/BtcCheckpointHeight", in, out, opts...) if err != nil { return nil, err } @@ -181,6 +293,8 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // BtcCheckpointHeight returns earliest block height for given rawcheckpoint + BtcCheckpointHeight(context.Context, *QueryBtcCheckpointHeightRequest) (*QueryBtcCheckpointHeightResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -190,6 +304,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } +func (*UnimplementedQueryServer) BtcCheckpointHeight(ctx context.Context, req *QueryBtcCheckpointHeightRequest) (*QueryBtcCheckpointHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BtcCheckpointHeight not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -205,7 +322,7 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/babylon.btccheckpoint.Query/Params", + FullMethod: "/babylon.btccheckpoint.v1.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) @@ -213,14 +330,36 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } +func _Query_BtcCheckpointHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBtcCheckpointHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BtcCheckpointHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/babylon.btccheckpoint.v1.Query/BtcCheckpointHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BtcCheckpointHeight(ctx, req.(*QueryBtcCheckpointHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "babylon.btccheckpoint.Query", + ServiceName: "babylon.btccheckpoint.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Params", Handler: _Query_Params_Handler, }, + { + MethodName: "BtcCheckpointHeight", + Handler: _Query_BtcCheckpointHeight_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "babylon/btccheckpoint/query.proto", @@ -282,6 +421,64 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryBtcCheckpointHeightRequest) 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 *QueryBtcCheckpointHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBtcCheckpointHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RawCheckpoint) > 0 { + i -= len(m.RawCheckpoint) + copy(dAtA[i:], m.RawCheckpoint) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RawCheckpoint))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBtcCheckpointHeightResponse) 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 *QueryBtcCheckpointHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBtcCheckpointHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.EarliestBtcBlockNumber != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EarliestBtcBlockNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -313,6 +510,31 @@ func (m *QueryParamsResponse) Size() (n int) { return n } +func (m *QueryBtcCheckpointHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RawCheckpoint) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryBtcCheckpointHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EarliestBtcBlockNumber != 0 { + n += 1 + sovQuery(uint64(m.EarliestBtcBlockNumber)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -452,6 +674,157 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryBtcCheckpointHeightRequest) 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: QueryBtcCheckpointHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBtcCheckpointHeightRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RawCheckpoint", 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.RawCheckpoint = string(dAtA[iNdEx:postIndex]) + 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 *QueryBtcCheckpointHeightResponse) 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: QueryBtcCheckpointHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBtcCheckpointHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestBtcBlockNumber", wireType) + } + m.EarliestBtcBlockNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EarliestBtcBlockNumber |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/btccheckpoint/types/query.pb.gw.go b/x/btccheckpoint/types/query.pb.gw.go index 508b2bd79..25ef975a0 100644 --- a/x/btccheckpoint/types/query.pb.gw.go +++ b/x/btccheckpoint/types/query.pb.gw.go @@ -49,6 +49,60 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } +func request_Query_BtcCheckpointHeight_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBtcCheckpointHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["raw_checkpoint"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "raw_checkpoint") + } + + protoReq.RawCheckpoint, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "raw_checkpoint", err) + } + + msg, err := client.BtcCheckpointHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BtcCheckpointHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBtcCheckpointHeightRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["raw_checkpoint"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "raw_checkpoint") + } + + protoReq.RawCheckpoint, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "raw_checkpoint", err) + } + + msg, err := server.BtcCheckpointHeight(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. @@ -75,6 +129,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_BtcCheckpointHeight_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_BtcCheckpointHeight_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BtcCheckpointHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -136,13 +210,37 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_BtcCheckpointHeight_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_BtcCheckpointHeight_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_BtcCheckpointHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylonchain", "babylon", "btccheckpoint", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"babylon", "btccheckpoint", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_BtcCheckpointHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"babylon", "btccheckpoint", "v1", "raw_checkpoint"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_BtcCheckpointHeight_0 = runtime.ForwardResponseMessage ) diff --git a/x/btccheckpoint/types/tx.pb.go b/x/btccheckpoint/types/tx.pb.go index b4c8cce77..ee10712ec 100644 --- a/x/btccheckpoint/types/tx.pb.go +++ b/x/btccheckpoint/types/tx.pb.go @@ -209,38 +209,38 @@ func (m *MsgInsertBTCSpvProofResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInsertBTCSpvProofResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*BTCSpvProof)(nil), "babylon.btccheckpoint.BTCSpvProof") - proto.RegisterType((*MsgInsertBTCSpvProof)(nil), "babylon.btccheckpoint.MsgInsertBTCSpvProof") - proto.RegisterType((*MsgInsertBTCSpvProofResponse)(nil), "babylon.btccheckpoint.MsgInsertBTCSpvProofResponse") + proto.RegisterType((*BTCSpvProof)(nil), "babylon.btccheckpoint.v1.BTCSpvProof") + proto.RegisterType((*MsgInsertBTCSpvProof)(nil), "babylon.btccheckpoint.v1.MsgInsertBTCSpvProof") + proto.RegisterType((*MsgInsertBTCSpvProofResponse)(nil), "babylon.btccheckpoint.v1.MsgInsertBTCSpvProofResponse") } func init() { proto.RegisterFile("babylon/btccheckpoint/tx.proto", fileDescriptor_aeec89810b39ea83) } var fileDescriptor_aeec89810b39ea83 = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x3f, 0x4f, 0x3a, 0x31, - 0x1c, 0xc6, 0x29, 0xfc, 0x42, 0x42, 0xe1, 0xa7, 0xf1, 0x90, 0xe4, 0x62, 0x48, 0x83, 0xb7, 0x48, - 0x62, 0x72, 0x97, 0x40, 0x5c, 0x1c, 0x71, 0x91, 0x01, 0x35, 0x27, 0x93, 0xcb, 0xe5, 0x5a, 0xca, - 0x5d, 0x03, 0xd7, 0x36, 0x6d, 0x31, 0x90, 0xf8, 0x22, 0x7c, 0x4b, 0x6e, 0x8e, 0x8c, 0x8e, 0x06, - 0xde, 0x88, 0xb9, 0x13, 0xc2, 0x1f, 0x71, 0x70, 0xec, 0xf3, 0x3c, 0xfd, 0x3c, 0xfd, 0x36, 0x5f, - 0x88, 0x70, 0x88, 0x67, 0x63, 0xc1, 0x3d, 0x6c, 0x08, 0x89, 0x29, 0x19, 0x49, 0xc1, 0xb8, 0xf1, - 0xcc, 0xd4, 0x95, 0x4a, 0x18, 0x61, 0xd5, 0x56, 0xbe, 0xbb, 0xe3, 0x3b, 0x6f, 0x00, 0x96, 0x3b, - 0xfd, 0x9b, 0x47, 0xf9, 0xfc, 0xa0, 0x84, 0x18, 0x5a, 0x17, 0xf0, 0x18, 0x1b, 0x12, 0x18, 0x15, - 0x72, 0x1d, 0x12, 0xc3, 0x04, 0xb7, 0x41, 0x03, 0x34, 0x2b, 0xfe, 0x11, 0x36, 0xa4, 0xbf, 0x51, - 0xad, 0x16, 0xac, 0xed, 0x05, 0x03, 0xc6, 0x07, 0x74, 0x6a, 0xe7, 0x1b, 0xa0, 0xf9, 0xdf, 0xaf, - 0xee, 0xc6, 0xbb, 0xa9, 0x65, 0x9d, 0xc3, 0x4a, 0x42, 0xd5, 0x68, 0x4c, 0x03, 0x2e, 0x06, 0x54, - 0xdb, 0x85, 0x8c, 0x5c, 0xfe, 0xd6, 0xee, 0x52, 0x29, 0xc5, 0x12, 0xc1, 0x87, 0x4c, 0x25, 0x8c, - 0x47, 0x41, 0xda, 0x10, 0xd3, 0x70, 0x40, 0x95, 0xfd, 0x2f, 0xcb, 0x56, 0x37, 0x66, 0xc7, 0x90, - 0xdb, 0xcc, 0x72, 0x24, 0x3c, 0xed, 0xe9, 0xa8, 0xcb, 0x35, 0x55, 0x66, 0x7b, 0x96, 0x3a, 0x2c, - 0xe9, 0x09, 0x4e, 0x98, 0x31, 0x54, 0x65, 0x53, 0x94, 0xfc, 0x8d, 0x60, 0x5d, 0xc3, 0xa2, 0x4c, - 0x63, 0xda, 0xce, 0x37, 0x0a, 0xcd, 0x72, 0xcb, 0x71, 0x0f, 0xfe, 0x90, 0xbb, 0x45, 0xf4, 0x57, - 0x37, 0x1c, 0x04, 0xeb, 0x87, 0x1a, 0x7d, 0xaa, 0xa5, 0xe0, 0x9a, 0xb6, 0x5e, 0x60, 0xa1, 0xa7, - 0x23, 0x6b, 0x02, 0x4f, 0x7e, 0xbe, 0xea, 0xf2, 0x97, 0x9e, 0x43, 0xc0, 0xb3, 0xf6, 0x1f, 0xc2, - 0xeb, 0xf6, 0xce, 0xfd, 0xfb, 0x02, 0x81, 0xf9, 0x02, 0x81, 0xcf, 0x05, 0x02, 0xaf, 0x4b, 0x94, - 0x9b, 0x2f, 0x51, 0xee, 0x63, 0x89, 0x72, 0x4f, 0x57, 0x11, 0x33, 0xf1, 0x04, 0xbb, 0x44, 0x24, - 0xde, 0x0a, 0x4c, 0xe2, 0x90, 0xf1, 0xf5, 0xc1, 0x9b, 0xee, 0xaf, 0xcf, 0x4c, 0x52, 0x8d, 0x8b, - 0xd9, 0x0a, 0xb5, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xfe, 0x6a, 0xfb, 0x64, 0x02, 0x00, - 0x00, + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbf, 0x4e, 0x2a, 0x41, + 0x18, 0xc5, 0x19, 0xb8, 0x21, 0x61, 0xe0, 0xde, 0x1b, 0x17, 0x4d, 0x36, 0x86, 0x4c, 0x90, 0xc4, + 0x48, 0x35, 0x1b, 0x31, 0xda, 0xd9, 0x60, 0x23, 0x05, 0x6a, 0x56, 0x2a, 0x9b, 0xcd,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x05, 0x3d, 0x24, 0x11, 0x37, 0x86, 0xa9, 0x74, 0x8b, 0x82, 0xbb, 0x12, + 0xac, 0x6b, 0x98, 0x8f, 0x93, 0x98, 0xb6, 0xb3, 0xd5, 0x5c, 0xbd, 0xd8, 0x38, 0xc5, 0xfb, 0x1e, + 0x09, 0xaf, 0x41, 0xdd, 0xc5, 0x4f, 0x35, 0x04, 0x2b, 0xbb, 0x4a, 0x5d, 0xa6, 0x63, 0x29, 0x34, + 0x6b, 0xbc, 0x00, 0x98, 0x6b, 0xeb, 0xc0, 0x7a, 0x86, 0x07, 0x3f, 0x27, 0xc3, 0xfb, 0xbb, 0x76, + 0x41, 0x8f, 0xaf, 0x7e, 0x97, 0x5f, 0x0e, 0xd1, 0xbc, 0x7f, 0x9f, 0x21, 0x30, 0x9d, 0x21, 0xf0, + 0x39, 0x43, 0xe0, 0x75, 0x8e, 0x32, 0xd3, 0x39, 0xca, 0x7c, 0xcc, 0x51, 0xe6, 0xe9, 0x32, 0xe0, + 0x26, 0x1c, 0x12, 0x4c, 0x65, 0xe4, 0x2c, 0xd8, 0x34, 0xf4, 0xb9, 0x58, 0x7e, 0x38, 0xe3, 0xed, + 0x5b, 0x9a, 0xc4, 0x4c, 0x93, 0x7c, 0x7a, 0x4f, 0x17, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x33, + 0x5d, 0x52, 0xc8, 0x71, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -268,7 +268,7 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { func (c *msgClient) InsertBTCSpvProof(ctx context.Context, in *MsgInsertBTCSpvProof, opts ...grpc.CallOption) (*MsgInsertBTCSpvProofResponse, error) { out := new(MsgInsertBTCSpvProofResponse) - err := c.cc.Invoke(ctx, "/babylon.btccheckpoint.Msg/InsertBTCSpvProof", in, out, opts...) + err := c.cc.Invoke(ctx, "/babylon.btccheckpoint.v1.Msg/InsertBTCSpvProof", in, out, opts...) if err != nil { return nil, err } @@ -302,7 +302,7 @@ func _Msg_InsertBTCSpvProof_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/babylon.btccheckpoint.Msg/InsertBTCSpvProof", + FullMethod: "/babylon.btccheckpoint.v1.Msg/InsertBTCSpvProof", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).InsertBTCSpvProof(ctx, req.(*MsgInsertBTCSpvProof)) @@ -311,7 +311,7 @@ func _Msg_InsertBTCSpvProof_Handler(srv interface{}, ctx context.Context, dec fu } var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "babylon.btccheckpoint.Msg", + ServiceName: "babylon.btccheckpoint.v1.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ {