diff --git a/abci/abci.go b/abci/abci.go index 129a1da..3feb707 100644 --- a/abci/abci.go +++ b/abci/abci.go @@ -68,18 +68,12 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { "height", req.Height, ) - registry, err := h.mempool.Registry(ctx) - if err != nil { - h.logger.Error("failed to get lane registry", "err", err) - return &abci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err - } - // Get the max gas limit and max block size for the proposal. _, maxGasLimit := proposals.GetBlockLimits(ctx) proposal := proposals.NewProposal(h.logger, req.MaxTxBytes, maxGasLimit) // Fill the proposal with transactions from each lane. - prepareLanesHandler := ChainPrepareLanes(registry) + prepareLanesHandler := ChainPrepareLanes(h.mempool.Registry()) finalProposal, err := prepareLanesHandler(ctx, proposal) if err != nil { h.logger.Error("failed to prepare proposal", "err", err) @@ -138,14 +132,9 @@ func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { } // Build handler that will verify the partial proposals according to each lane's verification logic. - registry, err := h.mempool.Registry(ctx) - if err != nil { - h.logger.Error("failed to get lane registry", "err", err) - return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, err - } + processLanesHandler := ChainProcessLanes(h.mempool.Registry()) // Verify the proposal. - processLanesHandler := ChainProcessLanes(registry) finalProposal, err := processLanesHandler( ctx, proposals.NewProposalWithContext(ctx, h.logger), diff --git a/abci/abci_test.go b/abci/abci_test.go index a85cbee..4e0fdc1 100644 --- a/abci/abci_test.go +++ b/abci/abci_test.go @@ -15,40 +15,10 @@ import ( "github.com/skip-mev/block-sdk/v2/abci" "github.com/skip-mev/block-sdk/v2/block" - "github.com/skip-mev/block-sdk/v2/block/mocks" "github.com/skip-mev/block-sdk/v2/lanes/free" testutils "github.com/skip-mev/block-sdk/v2/testutils" - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) -type MockLaneFetcher struct { - getLaneHandler func() (blocksdkmoduletypes.Lane, error) - getLanesHandler func() []blocksdkmoduletypes.Lane -} - -func NewMockLaneFetcher(getLane func() (blocksdkmoduletypes.Lane, error), getLanes func() []blocksdkmoduletypes.Lane) MockLaneFetcher { - return MockLaneFetcher{ - getLaneHandler: getLane, - getLanesHandler: getLanes, - } -} - -func (m *MockLaneFetcher) SetGetLaneHandler(h func() (blocksdkmoduletypes.Lane, error)) { - m.getLaneHandler = h -} - -func (m MockLaneFetcher) GetLane(_ sdk.Context, _ string) (blocksdkmoduletypes.Lane, error) { - return m.getLaneHandler() -} - -func (m *MockLaneFetcher) SetGetLanesHandler(h func() []blocksdkmoduletypes.Lane) { - m.getLanesHandler = h -} - -func (m MockLaneFetcher) GetLanes(_ sdk.Context) []blocksdkmoduletypes.Lane { - return m.getLanesHandler() -} - type ProposalsTestSuite struct { suite.Suite ctx sdk.Context @@ -522,27 +492,9 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() { defaultLane, } - chainLanes := []blocksdkmoduletypes.Lane{ - { - Id: panicLane.Name(), - MaxBlockSpace: panicLane.GetMaxBlockSpace(), - Order: 0, - }, - { - Id: defaultLane.Name(), - MaxBlockSpace: defaultLane.GetMaxBlockSpace(), - Order: 1, - }, - } - mempool, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return chainLanes - }), ) s.Require().NoError(err) @@ -587,27 +539,9 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() { panicLane, } - chainLanes := []blocksdkmoduletypes.Lane{ - { - Id: panicLane.Name(), - MaxBlockSpace: panicLane.GetMaxBlockSpace(), - Order: 1, - }, - { - Id: defaultLane.Name(), - MaxBlockSpace: defaultLane.GetMaxBlockSpace(), - Order: 0, - }, - } - mempool, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return chainLanes - }), ) s.Require().NoError(err) @@ -654,32 +588,9 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() { defaultLane, } - chainLanes := []blocksdkmoduletypes.Lane{ - { - Id: panicLane.Name(), - MaxBlockSpace: panicLane.GetMaxBlockSpace(), - Order: 0, - }, - { - Id: panicLane2.Name(), - MaxBlockSpace: panicLane2.GetMaxBlockSpace(), - Order: 1, - }, - { - Id: defaultLane.Name(), - MaxBlockSpace: defaultLane.GetMaxBlockSpace(), - Order: 2, - }, - } - mempool, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return chainLanes - }), ) s.Require().NoError(err) @@ -726,32 +637,9 @@ func (s *ProposalsTestSuite) TestPrepareProposalEdgeCases() { panicLane2, } - chainLanes := []blocksdkmoduletypes.Lane{ - { - Id: panicLane.Name(), - MaxBlockSpace: panicLane.GetMaxBlockSpace(), - Order: 1, - }, - { - Id: panicLane2.Name(), - MaxBlockSpace: panicLane2.GetMaxBlockSpace(), - Order: 2, - }, - { - Id: defaultLane.Name(), - MaxBlockSpace: defaultLane.GetMaxBlockSpace(), - Order: 0, - }, - } - mempool, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return chainLanes - }), ) s.Require().NoError(err) diff --git a/abci/checktx/check_tx_test.go b/abci/checktx/check_tx_test.go index 6d1ede6..044133f 100644 --- a/abci/checktx/check_tx_test.go +++ b/abci/checktx/check_tx_test.go @@ -18,11 +18,9 @@ import ( "github.com/skip-mev/block-sdk/v2/abci/checktx" "github.com/skip-mev/block-sdk/v2/block" "github.com/skip-mev/block-sdk/v2/block/utils" - "github.com/skip-mev/block-sdk/v2/lanes/mev" mevlanetestutils "github.com/skip-mev/block-sdk/v2/lanes/mev/testutils" "github.com/skip-mev/block-sdk/v2/testutils" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) type CheckTxTestSuite struct { @@ -62,9 +60,7 @@ func (s *CheckTxTestSuite) TestCheckTxMempoolParity() { } mevLane := s.InitLane(math.LegacyOneDec(), txs) - mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}, moduleLaneFetcher{ - mevLane, - }) + mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}) s.Require().NoError(err) cacheDecoder, err := utils.NewDefaultCacheTxDecoder(s.EncCfg.TxConfig.TxDecoder()) @@ -133,9 +129,7 @@ func (s *CheckTxTestSuite) TestRemovalOnRecheckTx() { s.Require().NoError(err) mevLane := s.InitLane(math.LegacyOneDec(), nil) - mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}, moduleLaneFetcher{ - mevLane, - }) + mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}) s.Require().NoError(err) cacheDecoder, err := utils.NewDefaultCacheTxDecoder(s.EncCfg.TxConfig.TxDecoder()) @@ -193,9 +187,7 @@ func (s *CheckTxTestSuite) TestMEVCheckTxHandler() { txs := map[sdk.Tx]bool{} mevLane := s.InitLane(math.LegacyOneDec(), txs) - mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}, moduleLaneFetcher{ - mevLane, - }) + mempool, err := block.NewLanedMempool(s.Ctx.Logger(), []block.Lane{mevLane}) s.Require().NoError(err) ba := &baseApp{ @@ -378,15 +370,3 @@ func (baseApp) GetConsensusParams(ctx sdk.Context) cmtproto.ConsensusParams { func (ba *baseApp) ChainID() string { return ba.ctx.ChainID() } - -type moduleLaneFetcher struct { - lane *mev.MEVLane -} - -func (mlf moduleLaneFetcher) GetLane(sdk.Context, string) (lane blocksdktypes.Lane, err error) { - return blocksdktypes.Lane{}, nil -} - -func (mlf moduleLaneFetcher) GetLanes(sdk.Context) []blocksdktypes.Lane { - return nil -} diff --git a/abci/utils_test.go b/abci/utils_test.go index 378b36f..53fdd2d 100644 --- a/abci/utils_test.go +++ b/abci/utils_test.go @@ -5,8 +5,6 @@ import ( "encoding/hex" "fmt" - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" - "cosmossdk.io/log" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -147,27 +145,9 @@ func (s *ProposalsTestSuite) setUpPanicLane(name string, maxBlockSpace math.Lega } func (s *ProposalsTestSuite) setUpProposalHandlers(lanes []block.Lane) *abci.ProposalHandler { - blocksdkLanes := make([]blocksdkmoduletypes.Lane, len(lanes)) - for i, lane := range lanes { - blocksdkLanes[i] = blocksdkmoduletypes.Lane{ - Id: lane.Name(), - MaxBlockSpace: lane.GetMaxBlockSpace(), - Order: uint64(i), - } - } - - laneFetcher := NewMockLaneFetcher( - func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, - func() []blocksdkmoduletypes.Lane { - return blocksdkLanes - }) - mempool, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - laneFetcher, ) s.Require().NoError(err) diff --git a/api/sdk/blocksdk/module/v1/module.pulsar.go b/api/sdk/blocksdk/module/v1/module.pulsar.go deleted file mode 100644 index b1a6a7f..0000000 --- a/api/sdk/blocksdk/module/v1/module.pulsar.go +++ /dev/null @@ -1,579 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package modulev1 - -import ( - _ "cosmossdk.io/api/cosmos/app/v1alpha1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Module protoreflect.MessageDescriptor - fd_Module_authority protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_module_v1_module_proto_init() - md_Module = File_sdk_blocksdk_module_v1_module_proto.Messages().ByName("Module") - fd_Module_authority = md_Module.Fields().ByName("authority") -} - -var _ protoreflect.Message = (*fastReflection_Module)(nil) - -type fastReflection_Module Module - -func (x *Module) ProtoReflect() protoreflect.Message { - return (*fastReflection_Module)(x) -} - -func (x *Module) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_module_v1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Module_messageType fastReflection_Module_messageType -var _ protoreflect.MessageType = fastReflection_Module_messageType{} - -type fastReflection_Module_messageType struct{} - -func (x fastReflection_Module_messageType) Zero() protoreflect.Message { - return (*fastReflection_Module)(nil) -} -func (x fastReflection_Module_messageType) New() protoreflect.Message { - return new(fastReflection_Module) -} -func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor { - return md_Module -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Module) Type() protoreflect.MessageType { - return _fastReflection_Module_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Module) New() protoreflect.Message { - return new(fastReflection_Module) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage { - return (*Module)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_Module_authority, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - return x.Authority != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - x.Authority = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - x.Authority = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - panic(fmt.Errorf("field authority of message sdk.blocksdk.module.v1.Module is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.module.v1.Module.authority": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.module.v1.Module")) - } - panic(fmt.Errorf("message sdk.blocksdk.module.v1.Module does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.module.v1.Module", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Module) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Module) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sdk/blocksdk/module/v1/module.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Module is the config object of the x/blocksdk module. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Authority defines the custom module authority. If not set, defaults to the - // governance module. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_module_v1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_module_v1_module_proto_rawDescGZIP(), []int{0} -} - -func (x *Module) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -var File_sdk_blocksdk_module_v1_module_proto protoreflect.FileDescriptor - -var file_sdk_blocksdk_module_v1_module_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x64, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x58, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x30, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2a, 0x0a, - 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6b, 0x69, 0x70, - 0x2d, 0x6d, 0x65, 0x76, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x42, 0xd6, 0x01, 0x0a, 0x1a, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, - 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x4d, 0xaa, - 0x02, 0x16, 0x53, 0x64, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x16, 0x53, 0x64, 0x6b, 0x5c, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x22, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, - 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_sdk_blocksdk_module_v1_module_proto_rawDescOnce sync.Once - file_sdk_blocksdk_module_v1_module_proto_rawDescData = file_sdk_blocksdk_module_v1_module_proto_rawDesc -) - -func file_sdk_blocksdk_module_v1_module_proto_rawDescGZIP() []byte { - file_sdk_blocksdk_module_v1_module_proto_rawDescOnce.Do(func() { - file_sdk_blocksdk_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_blocksdk_module_v1_module_proto_rawDescData) - }) - return file_sdk_blocksdk_module_v1_module_proto_rawDescData -} - -var file_sdk_blocksdk_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_sdk_blocksdk_module_v1_module_proto_goTypes = []interface{}{ - (*Module)(nil), // 0: sdk.blocksdk.module.v1.Module -} -var file_sdk_blocksdk_module_v1_module_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_sdk_blocksdk_module_v1_module_proto_init() } -func file_sdk_blocksdk_module_v1_module_proto_init() { - if File_sdk_blocksdk_module_v1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_sdk_blocksdk_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sdk_blocksdk_module_v1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_sdk_blocksdk_module_v1_module_proto_goTypes, - DependencyIndexes: file_sdk_blocksdk_module_v1_module_proto_depIdxs, - MessageInfos: file_sdk_blocksdk_module_v1_module_proto_msgTypes, - }.Build() - File_sdk_blocksdk_module_v1_module_proto = out.File - file_sdk_blocksdk_module_v1_module_proto_rawDesc = nil - file_sdk_blocksdk_module_v1_module_proto_goTypes = nil - file_sdk_blocksdk_module_v1_module_proto_depIdxs = nil -} diff --git a/api/sdk/blocksdk/v1/blocksdk.pulsar.go b/api/sdk/blocksdk/v1/blocksdk.pulsar.go deleted file mode 100644 index fe749ca..0000000 --- a/api/sdk/blocksdk/v1/blocksdk.pulsar.go +++ /dev/null @@ -1,724 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package blocksdkv1 - -import ( - _ "cosmossdk.io/api/amino" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_Lane protoreflect.MessageDescriptor - fd_Lane_id protoreflect.FieldDescriptor - fd_Lane_max_block_space protoreflect.FieldDescriptor - fd_Lane_order protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_blocksdk_proto_init() - md_Lane = File_sdk_blocksdk_v1_blocksdk_proto.Messages().ByName("Lane") - fd_Lane_id = md_Lane.Fields().ByName("id") - fd_Lane_max_block_space = md_Lane.Fields().ByName("max_block_space") - fd_Lane_order = md_Lane.Fields().ByName("order") -} - -var _ protoreflect.Message = (*fastReflection_Lane)(nil) - -type fastReflection_Lane Lane - -func (x *Lane) ProtoReflect() protoreflect.Message { - return (*fastReflection_Lane)(x) -} - -func (x *Lane) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_blocksdk_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_Lane_messageType fastReflection_Lane_messageType -var _ protoreflect.MessageType = fastReflection_Lane_messageType{} - -type fastReflection_Lane_messageType struct{} - -func (x fastReflection_Lane_messageType) Zero() protoreflect.Message { - return (*fastReflection_Lane)(nil) -} -func (x fastReflection_Lane_messageType) New() protoreflect.Message { - return new(fastReflection_Lane) -} -func (x fastReflection_Lane_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_Lane -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_Lane) Descriptor() protoreflect.MessageDescriptor { - return md_Lane -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_Lane) Type() protoreflect.MessageType { - return _fastReflection_Lane_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_Lane) New() protoreflect.Message { - return new(fastReflection_Lane) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_Lane) Interface() protoreflect.ProtoMessage { - return (*Lane)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_Lane) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_Lane_id, value) { - return - } - } - if x.MaxBlockSpace != "" { - value := protoreflect.ValueOfString(x.MaxBlockSpace) - if !f(fd_Lane_max_block_space, value) { - return - } - } - if x.Order != uint64(0) { - value := protoreflect.ValueOfUint64(x.Order) - if !f(fd_Lane_order, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_Lane) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.Lane.id": - return x.Id != "" - case "sdk.blocksdk.v1.Lane.max_block_space": - return x.MaxBlockSpace != "" - case "sdk.blocksdk.v1.Lane.order": - return x.Order != uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Lane) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.Lane.id": - x.Id = "" - case "sdk.blocksdk.v1.Lane.max_block_space": - x.MaxBlockSpace = "" - case "sdk.blocksdk.v1.Lane.order": - x.Order = uint64(0) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_Lane) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.Lane.id": - value := x.Id - return protoreflect.ValueOfString(value) - case "sdk.blocksdk.v1.Lane.max_block_space": - value := x.MaxBlockSpace - return protoreflect.ValueOfString(value) - case "sdk.blocksdk.v1.Lane.order": - value := x.Order - return protoreflect.ValueOfUint64(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Lane) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.Lane.id": - x.Id = value.Interface().(string) - case "sdk.blocksdk.v1.Lane.max_block_space": - x.MaxBlockSpace = value.Interface().(string) - case "sdk.blocksdk.v1.Lane.order": - x.Order = value.Uint() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Lane) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.Lane.id": - panic(fmt.Errorf("field id of message sdk.blocksdk.v1.Lane is not mutable")) - case "sdk.blocksdk.v1.Lane.max_block_space": - panic(fmt.Errorf("field max_block_space of message sdk.blocksdk.v1.Lane is not mutable")) - case "sdk.blocksdk.v1.Lane.order": - panic(fmt.Errorf("field order of message sdk.blocksdk.v1.Lane is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_Lane) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.Lane.id": - return protoreflect.ValueOfString("") - case "sdk.blocksdk.v1.Lane.max_block_space": - return protoreflect.ValueOfString("") - case "sdk.blocksdk.v1.Lane.order": - return protoreflect.ValueOfUint64(uint64(0)) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.Lane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.Lane does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_Lane) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.Lane", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_Lane) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_Lane) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_Lane) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_Lane) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*Lane) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.MaxBlockSpace) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Order != 0 { - n += 1 + runtime.Sov(uint64(x.Order)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*Lane) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Order != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Order)) - i-- - dAtA[i] = 0x18 - } - if len(x.MaxBlockSpace) > 0 { - i -= len(x.MaxBlockSpace) - copy(dAtA[i:], x.MaxBlockSpace) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MaxBlockSpace))) - i-- - dAtA[i] = 0x12 - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*Lane) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Lane: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Lane: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxBlockSpace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.MaxBlockSpace = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - x.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Order |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sdk/blocksdk/v1/blocksdk.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Lane defines a block-sdk lane and its associated parameters. Only the -// parameters that are critical to consensus are stored on-chain in this object. -// The other associated configuration for a lane can be set and stored locally, -// per-validator. -type Lane struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the unique identifier of a Lane. Maps to a block-sdk laneName. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // max_block_space defines the relative percentage of block space that can be - // used by this lane. NOTE: If this is set to zero, then there is no limit - // on the number of transactions that can be included in the block for this - // lane (up to maxTxBytes as provided by the request). This is useful for the - // default lane. - MaxBlockSpace string `protobuf:"bytes,2,opt,name=max_block_space,json=maxBlockSpace,proto3" json:"max_block_space,omitempty"` - // order is the priority ordering of the Lane when processed in - // PrepareProposal and ProcessProposal. Lane orders should be set in order of - // priority starting from 0, monotonically increasing and non-overlapping. A - // lane with a lower order value will have a higher priority over a lane with - // a higher order value. For example, if LaneA has priority of 0 and LaneB - // has a priority of 1, LaneA has priority over LaneB. - Order uint64 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"` -} - -func (x *Lane) Reset() { - *x = Lane{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_blocksdk_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Lane) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Lane) ProtoMessage() {} - -// Deprecated: Use Lane.ProtoReflect.Descriptor instead. -func (*Lane) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_blocksdk_proto_rawDescGZIP(), []int{0} -} - -func (x *Lane) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Lane) GetMaxBlockSpace() string { - if x != nil { - return x.MaxBlockSpace - } - return "" -} - -func (x *Lane) GetOrder() uint64 { - if x != nil { - return x.Order - } - return 0 -} - -var File_sdk_blocksdk_v1_blocksdk_proto protoreflect.FileDescriptor - -var file_sdk_blocksdk_v1_blocksdk_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, - 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0f, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, - 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, - 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x5e, - 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, - 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x0d, 0x6d, 0x61, 0x78, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x6f, - 0x72, 0x64, 0x65, 0x72, 0x42, 0xaf, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x64, 0x6b, - 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x3b, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, - 0xaa, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, - 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x64, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x11, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x64, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_sdk_blocksdk_v1_blocksdk_proto_rawDescOnce sync.Once - file_sdk_blocksdk_v1_blocksdk_proto_rawDescData = file_sdk_blocksdk_v1_blocksdk_proto_rawDesc -) - -func file_sdk_blocksdk_v1_blocksdk_proto_rawDescGZIP() []byte { - file_sdk_blocksdk_v1_blocksdk_proto_rawDescOnce.Do(func() { - file_sdk_blocksdk_v1_blocksdk_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_blocksdk_v1_blocksdk_proto_rawDescData) - }) - return file_sdk_blocksdk_v1_blocksdk_proto_rawDescData -} - -var file_sdk_blocksdk_v1_blocksdk_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_sdk_blocksdk_v1_blocksdk_proto_goTypes = []interface{}{ - (*Lane)(nil), // 0: sdk.blocksdk.v1.Lane -} -var file_sdk_blocksdk_v1_blocksdk_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_sdk_blocksdk_v1_blocksdk_proto_init() } -func file_sdk_blocksdk_v1_blocksdk_proto_init() { - if File_sdk_blocksdk_v1_blocksdk_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_sdk_blocksdk_v1_blocksdk_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Lane); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sdk_blocksdk_v1_blocksdk_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_sdk_blocksdk_v1_blocksdk_proto_goTypes, - DependencyIndexes: file_sdk_blocksdk_v1_blocksdk_proto_depIdxs, - MessageInfos: file_sdk_blocksdk_v1_blocksdk_proto_msgTypes, - }.Build() - File_sdk_blocksdk_v1_blocksdk_proto = out.File - file_sdk_blocksdk_v1_blocksdk_proto_rawDesc = nil - file_sdk_blocksdk_v1_blocksdk_proto_goTypes = nil - file_sdk_blocksdk_v1_blocksdk_proto_depIdxs = nil -} diff --git a/api/sdk/blocksdk/v1/genesis.pulsar.go b/api/sdk/blocksdk/v1/genesis.pulsar.go deleted file mode 100644 index 820782e..0000000 --- a/api/sdk/blocksdk/v1/genesis.pulsar.go +++ /dev/null @@ -1,652 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package blocksdkv1 - -import ( - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var _ protoreflect.List = (*_GenesisState_1_list)(nil) - -type _GenesisState_1_list struct { - list *[]*Lane -} - -func (x *_GenesisState_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_GenesisState_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_GenesisState_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Lane) - (*x.list)[i] = concreteValue -} - -func (x *_GenesisState_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Lane) - *x.list = append(*x.list, concreteValue) -} - -func (x *_GenesisState_1_list) AppendMutable() protoreflect.Value { - v := new(Lane) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GenesisState_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_GenesisState_1_list) NewElement() protoreflect.Value { - v := new(Lane) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_GenesisState_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_GenesisState protoreflect.MessageDescriptor - fd_GenesisState_lanes protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_genesis_proto_init() - md_GenesisState = File_sdk_blocksdk_v1_genesis_proto.Messages().ByName("GenesisState") - fd_GenesisState_lanes = md_GenesisState.Fields().ByName("lanes") -} - -var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) - -type fastReflection_GenesisState GenesisState - -func (x *GenesisState) ProtoReflect() protoreflect.Message { - return (*fastReflection_GenesisState)(x) -} - -func (x *GenesisState) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_genesis_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_GenesisState_messageType fastReflection_GenesisState_messageType -var _ protoreflect.MessageType = fastReflection_GenesisState_messageType{} - -type fastReflection_GenesisState_messageType struct{} - -func (x fastReflection_GenesisState_messageType) Zero() protoreflect.Message { - return (*fastReflection_GenesisState)(nil) -} -func (x fastReflection_GenesisState_messageType) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} -func (x fastReflection_GenesisState_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_GenesisState) Descriptor() protoreflect.MessageDescriptor { - return md_GenesisState -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_GenesisState) Type() protoreflect.MessageType { - return _fastReflection_GenesisState_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_GenesisState) New() protoreflect.Message { - return new(fastReflection_GenesisState) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_GenesisState) Interface() protoreflect.ProtoMessage { - return (*GenesisState)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Lanes) != 0 { - value := protoreflect.ValueOfList(&_GenesisState_1_list{list: &x.Lanes}) - if !f(fd_GenesisState_lanes, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - return len(x.Lanes) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - x.Lanes = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - if len(x.Lanes) == 0 { - return protoreflect.ValueOfList(&_GenesisState_1_list{}) - } - listValue := &_GenesisState_1_list{list: &x.Lanes} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - lv := value.List() - clv := lv.(*_GenesisState_1_list) - x.Lanes = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - if x.Lanes == nil { - x.Lanes = []*Lane{} - } - value := &_GenesisState_1_list{list: &x.Lanes} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.GenesisState.lanes": - list := []*Lane{} - return protoreflect.ValueOfList(&_GenesisState_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.GenesisState")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.GenesisState does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_GenesisState) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.GenesisState", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_GenesisState) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_GenesisState) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_GenesisState) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*GenesisState) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Lanes) > 0 { - for _, e := range x.Lanes { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*GenesisState) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Lanes) > 0 { - for iNdEx := len(x.Lanes) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Lanes[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*GenesisState) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lanes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Lanes = append(x.Lanes, &Lane{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Lanes[len(x.Lanes)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sdk/blocksdk/v1/genesis.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GenesisState defines the genesis state of the x/blocksdk module. -type GenesisState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // lanes is the list of all configured lanes at genesis time. - Lanes []*Lane `protobuf:"bytes,1,rep,name=lanes,proto3" json:"lanes,omitempty"` -} - -func (x *GenesisState) Reset() { - *x = GenesisState{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_genesis_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenesisState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenesisState) ProtoMessage() {} - -// Deprecated: Use GenesisState.ProtoReflect.Descriptor instead. -func (*GenesisState) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_genesis_proto_rawDescGZIP(), []int{0} -} - -func (x *GenesisState) GetLanes() []*Lane { - if x != nil { - return x.Lanes - } - return nil -} - -var File_sdk_blocksdk_v1_genesis_proto protoreflect.FileDescriptor - -var file_sdk_blocksdk_v1_genesis_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, - 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0f, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, - 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, - 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x65, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x42, 0xae, 0x01, 0x0a, 0x13, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, - 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, - 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x64, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x53, 0x64, 0x6b, 0x5c, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_sdk_blocksdk_v1_genesis_proto_rawDescOnce sync.Once - file_sdk_blocksdk_v1_genesis_proto_rawDescData = file_sdk_blocksdk_v1_genesis_proto_rawDesc -) - -func file_sdk_blocksdk_v1_genesis_proto_rawDescGZIP() []byte { - file_sdk_blocksdk_v1_genesis_proto_rawDescOnce.Do(func() { - file_sdk_blocksdk_v1_genesis_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_blocksdk_v1_genesis_proto_rawDescData) - }) - return file_sdk_blocksdk_v1_genesis_proto_rawDescData -} - -var file_sdk_blocksdk_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_sdk_blocksdk_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: sdk.blocksdk.v1.GenesisState - (*Lane)(nil), // 1: sdk.blocksdk.v1.Lane -} -var file_sdk_blocksdk_v1_genesis_proto_depIdxs = []int32{ - 1, // 0: sdk.blocksdk.v1.GenesisState.lanes:type_name -> sdk.blocksdk.v1.Lane - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_sdk_blocksdk_v1_genesis_proto_init() } -func file_sdk_blocksdk_v1_genesis_proto_init() { - if File_sdk_blocksdk_v1_genesis_proto != nil { - return - } - file_sdk_blocksdk_v1_blocksdk_proto_init() - if !protoimpl.UnsafeEnabled { - file_sdk_blocksdk_v1_genesis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenesisState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sdk_blocksdk_v1_genesis_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_sdk_blocksdk_v1_genesis_proto_goTypes, - DependencyIndexes: file_sdk_blocksdk_v1_genesis_proto_depIdxs, - MessageInfos: file_sdk_blocksdk_v1_genesis_proto_msgTypes, - }.Build() - File_sdk_blocksdk_v1_genesis_proto = out.File - file_sdk_blocksdk_v1_genesis_proto_rawDesc = nil - file_sdk_blocksdk_v1_genesis_proto_goTypes = nil - file_sdk_blocksdk_v1_genesis_proto_depIdxs = nil -} diff --git a/api/sdk/blocksdk/v1/query.pulsar.go b/api/sdk/blocksdk/v1/query.pulsar.go deleted file mode 100644 index 96ec8e5..0000000 --- a/api/sdk/blocksdk/v1/query.pulsar.go +++ /dev/null @@ -1,2035 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package blocksdkv1 - -import ( - _ "cosmossdk.io/api/cosmos/query/v1" - fmt "fmt" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_QueryLaneRequest protoreflect.MessageDescriptor - fd_QueryLaneRequest_id protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_query_proto_init() - md_QueryLaneRequest = File_sdk_blocksdk_v1_query_proto.Messages().ByName("QueryLaneRequest") - fd_QueryLaneRequest_id = md_QueryLaneRequest.Fields().ByName("id") -} - -var _ protoreflect.Message = (*fastReflection_QueryLaneRequest)(nil) - -type fastReflection_QueryLaneRequest QueryLaneRequest - -func (x *QueryLaneRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLaneRequest)(x) -} - -func (x *QueryLaneRequest) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLaneRequest_messageType fastReflection_QueryLaneRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryLaneRequest_messageType{} - -type fastReflection_QueryLaneRequest_messageType struct{} - -func (x fastReflection_QueryLaneRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLaneRequest)(nil) -} -func (x fastReflection_QueryLaneRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLaneRequest) -} -func (x fastReflection_QueryLaneRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLaneRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLaneRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLaneRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryLaneRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryLaneRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLaneRequest) New() protoreflect.Message { - return new(fastReflection_QueryLaneRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLaneRequest) Interface() protoreflect.ProtoMessage { - return (*QueryLaneRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryLaneRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Id != "" { - value := protoreflect.ValueOfString(x.Id) - if !f(fd_QueryLaneRequest_id, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryLaneRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - return x.Id != "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - x.Id = "" - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryLaneRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - value := x.Id - return protoreflect.ValueOfString(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - x.Id = value.Interface().(string) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - panic(fmt.Errorf("field id of message sdk.blocksdk.v1.QueryLaneRequest is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryLaneRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneRequest.id": - return protoreflect.ValueOfString("") - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryLaneRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.QueryLaneRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryLaneRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryLaneRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryLaneRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLaneRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Id) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryLaneRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Id) > 0 { - i -= len(x.Id) - copy(dAtA[i:], x.Id) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Id))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryLaneRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLaneRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLaneRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryLaneResponse protoreflect.MessageDescriptor - fd_QueryLaneResponse_lane protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_query_proto_init() - md_QueryLaneResponse = File_sdk_blocksdk_v1_query_proto.Messages().ByName("QueryLaneResponse") - fd_QueryLaneResponse_lane = md_QueryLaneResponse.Fields().ByName("lane") -} - -var _ protoreflect.Message = (*fastReflection_QueryLaneResponse)(nil) - -type fastReflection_QueryLaneResponse QueryLaneResponse - -func (x *QueryLaneResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLaneResponse)(x) -} - -func (x *QueryLaneResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLaneResponse_messageType fastReflection_QueryLaneResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryLaneResponse_messageType{} - -type fastReflection_QueryLaneResponse_messageType struct{} - -func (x fastReflection_QueryLaneResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLaneResponse)(nil) -} -func (x fastReflection_QueryLaneResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLaneResponse) -} -func (x fastReflection_QueryLaneResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLaneResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLaneResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLaneResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryLaneResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryLaneResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLaneResponse) New() protoreflect.Message { - return new(fastReflection_QueryLaneResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLaneResponse) Interface() protoreflect.ProtoMessage { - return (*QueryLaneResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryLaneResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Lane != nil { - value := protoreflect.ValueOfMessage(x.Lane.ProtoReflect()) - if !f(fd_QueryLaneResponse_lane, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryLaneResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - return x.Lane != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - x.Lane = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryLaneResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - value := x.Lane - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - x.Lane = value.Message().Interface().(*Lane) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - if x.Lane == nil { - x.Lane = new(Lane) - } - return protoreflect.ValueOfMessage(x.Lane.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryLaneResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLaneResponse.lane": - m := new(Lane) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLaneResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryLaneResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.QueryLaneResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryLaneResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLaneResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryLaneResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryLaneResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLaneResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Lane != nil { - l = options.Size(x.Lane) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryLaneResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Lane != nil { - encoded, err := options.Marshal(x.Lane) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryLaneResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLaneResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLaneResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lane", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Lane == nil { - x.Lane = &Lane{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Lane); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_QueryLanesRequest protoreflect.MessageDescriptor -) - -func init() { - file_sdk_blocksdk_v1_query_proto_init() - md_QueryLanesRequest = File_sdk_blocksdk_v1_query_proto.Messages().ByName("QueryLanesRequest") -} - -var _ protoreflect.Message = (*fastReflection_QueryLanesRequest)(nil) - -type fastReflection_QueryLanesRequest QueryLanesRequest - -func (x *QueryLanesRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLanesRequest)(x) -} - -func (x *QueryLanesRequest) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLanesRequest_messageType fastReflection_QueryLanesRequest_messageType -var _ protoreflect.MessageType = fastReflection_QueryLanesRequest_messageType{} - -type fastReflection_QueryLanesRequest_messageType struct{} - -func (x fastReflection_QueryLanesRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLanesRequest)(nil) -} -func (x fastReflection_QueryLanesRequest_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLanesRequest) -} -func (x fastReflection_QueryLanesRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLanesRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLanesRequest) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLanesRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryLanesRequest) Type() protoreflect.MessageType { - return _fastReflection_QueryLanesRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLanesRequest) New() protoreflect.Message { - return new(fastReflection_QueryLanesRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLanesRequest) Interface() protoreflect.ProtoMessage { - return (*QueryLanesRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryLanesRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryLanesRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryLanesRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryLanesRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesRequest")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryLanesRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.QueryLanesRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryLanesRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryLanesRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryLanesRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLanesRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryLanesRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryLanesRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLanesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLanesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var _ protoreflect.List = (*_QueryLanesResponse_1_list)(nil) - -type _QueryLanesResponse_1_list struct { - list *[]*Lane -} - -func (x *_QueryLanesResponse_1_list) Len() int { - if x.list == nil { - return 0 - } - return len(*x.list) -} - -func (x *_QueryLanesResponse_1_list) Get(i int) protoreflect.Value { - return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) -} - -func (x *_QueryLanesResponse_1_list) Set(i int, value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Lane) - (*x.list)[i] = concreteValue -} - -func (x *_QueryLanesResponse_1_list) Append(value protoreflect.Value) { - valueUnwrapped := value.Message() - concreteValue := valueUnwrapped.Interface().(*Lane) - *x.list = append(*x.list, concreteValue) -} - -func (x *_QueryLanesResponse_1_list) AppendMutable() protoreflect.Value { - v := new(Lane) - *x.list = append(*x.list, v) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLanesResponse_1_list) Truncate(n int) { - for i := n; i < len(*x.list); i++ { - (*x.list)[i] = nil - } - *x.list = (*x.list)[:n] -} - -func (x *_QueryLanesResponse_1_list) NewElement() protoreflect.Value { - v := new(Lane) - return protoreflect.ValueOfMessage(v.ProtoReflect()) -} - -func (x *_QueryLanesResponse_1_list) IsValid() bool { - return x.list != nil -} - -var ( - md_QueryLanesResponse protoreflect.MessageDescriptor - fd_QueryLanesResponse_lanes protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_query_proto_init() - md_QueryLanesResponse = File_sdk_blocksdk_v1_query_proto.Messages().ByName("QueryLanesResponse") - fd_QueryLanesResponse_lanes = md_QueryLanesResponse.Fields().ByName("lanes") -} - -var _ protoreflect.Message = (*fastReflection_QueryLanesResponse)(nil) - -type fastReflection_QueryLanesResponse QueryLanesResponse - -func (x *QueryLanesResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_QueryLanesResponse)(x) -} - -func (x *QueryLanesResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_QueryLanesResponse_messageType fastReflection_QueryLanesResponse_messageType -var _ protoreflect.MessageType = fastReflection_QueryLanesResponse_messageType{} - -type fastReflection_QueryLanesResponse_messageType struct{} - -func (x fastReflection_QueryLanesResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_QueryLanesResponse)(nil) -} -func (x fastReflection_QueryLanesResponse_messageType) New() protoreflect.Message { - return new(fastReflection_QueryLanesResponse) -} -func (x fastReflection_QueryLanesResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLanesResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_QueryLanesResponse) Descriptor() protoreflect.MessageDescriptor { - return md_QueryLanesResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_QueryLanesResponse) Type() protoreflect.MessageType { - return _fastReflection_QueryLanesResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_QueryLanesResponse) New() protoreflect.Message { - return new(fastReflection_QueryLanesResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_QueryLanesResponse) Interface() protoreflect.ProtoMessage { - return (*QueryLanesResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_QueryLanesResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Lanes) != 0 { - value := protoreflect.ValueOfList(&_QueryLanesResponse_1_list{list: &x.Lanes}) - if !f(fd_QueryLanesResponse_lanes, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_QueryLanesResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - return len(x.Lanes) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - x.Lanes = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_QueryLanesResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - if len(x.Lanes) == 0 { - return protoreflect.ValueOfList(&_QueryLanesResponse_1_list{}) - } - listValue := &_QueryLanesResponse_1_list{list: &x.Lanes} - return protoreflect.ValueOfList(listValue) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - lv := value.List() - clv := lv.(*_QueryLanesResponse_1_list) - x.Lanes = *clv.list - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - if x.Lanes == nil { - x.Lanes = []*Lane{} - } - value := &_QueryLanesResponse_1_list{list: &x.Lanes} - return protoreflect.ValueOfList(value) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_QueryLanesResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.QueryLanesResponse.lanes": - list := []*Lane{} - return protoreflect.ValueOfList(&_QueryLanesResponse_1_list{list: &list}) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.QueryLanesResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.QueryLanesResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_QueryLanesResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.QueryLanesResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_QueryLanesResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_QueryLanesResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_QueryLanesResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_QueryLanesResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*QueryLanesResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if len(x.Lanes) > 0 { - for _, e := range x.Lanes { - l = options.Size(e) - n += 1 + l + runtime.Sov(uint64(l)) - } - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*QueryLanesResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.Lanes) > 0 { - for iNdEx := len(x.Lanes) - 1; iNdEx >= 0; iNdEx-- { - encoded, err := options.Marshal(x.Lanes[iNdEx]) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0xa - } - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*QueryLanesResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLanesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryLanesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lanes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Lanes = append(x.Lanes, &Lane{}) - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Lanes[len(x.Lanes)-1]); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sdk/blocksdk/v1/query.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// QueryLaneRequest is the request type for the Query/Lane RPC method. -type QueryLaneRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *QueryLaneRequest) Reset() { - *x = QueryLaneRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLaneRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLaneRequest) ProtoMessage() {} - -// Deprecated: Use QueryLaneRequest.ProtoReflect.Descriptor instead. -func (*QueryLaneRequest) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_query_proto_rawDescGZIP(), []int{0} -} - -func (x *QueryLaneRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// QueryLaneResponse is the response type for the Query/Lane RPC method. -type QueryLaneResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Lane *Lane `protobuf:"bytes,1,opt,name=lane,proto3" json:"lane,omitempty"` -} - -func (x *QueryLaneResponse) Reset() { - *x = QueryLaneResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLaneResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLaneResponse) ProtoMessage() {} - -// Deprecated: Use QueryLaneResponse.ProtoReflect.Descriptor instead. -func (*QueryLaneResponse) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_query_proto_rawDescGZIP(), []int{1} -} - -func (x *QueryLaneResponse) GetLane() *Lane { - if x != nil { - return x.Lane - } - return nil -} - -// QueryLaneRequest is the request type for the Query/Lanes RPC method. -type QueryLanesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *QueryLanesRequest) Reset() { - *x = QueryLanesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLanesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLanesRequest) ProtoMessage() {} - -// Deprecated: Use QueryLanesRequest.ProtoReflect.Descriptor instead. -func (*QueryLanesRequest) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_query_proto_rawDescGZIP(), []int{2} -} - -// QueryLaneResponse is the response type for the Query/Lanes RPC method. -type QueryLanesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Lanes []*Lane `protobuf:"bytes,1,rep,name=lanes,proto3" json:"lanes,omitempty"` -} - -func (x *QueryLanesResponse) Reset() { - *x = QueryLanesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryLanesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryLanesResponse) ProtoMessage() {} - -// Deprecated: Use QueryLanesResponse.ProtoReflect.Descriptor instead. -func (*QueryLanesResponse) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_query_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryLanesResponse) GetLanes() []*Lane { - if x != nil { - return x.Lanes - } - return nil -} - -var File_sdk_blocksdk_v1_query_proto protoreflect.FileDescriptor - -var file_sdk_blocksdk_v1_query_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, - 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x73, - 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2f, 0x76, 0x31, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1e, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x22, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x44, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x65, 0x42, 0x04, 0xc8, - 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, - 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x05, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x61, 0x6e, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, - 0x52, 0x05, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x32, 0x82, 0x02, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x7c, 0x0a, 0x04, 0x4c, 0x61, 0x6e, 0x65, 0x12, 0x21, 0x2e, 0x73, 0x64, 0x6b, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, - 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2d, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, - 0x7b, 0x0a, 0x05, 0x4c, 0x61, 0x6e, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x4c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, - 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x4c, 0x61, 0x6e, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x29, 0x88, 0xe7, 0xb0, 0x2a, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, 0x1c, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x42, 0xac, 0x01, 0x0a, - 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, - 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, - 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x53, 0x64, 0x6b, 0x5c, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_sdk_blocksdk_v1_query_proto_rawDescOnce sync.Once - file_sdk_blocksdk_v1_query_proto_rawDescData = file_sdk_blocksdk_v1_query_proto_rawDesc -) - -func file_sdk_blocksdk_v1_query_proto_rawDescGZIP() []byte { - file_sdk_blocksdk_v1_query_proto_rawDescOnce.Do(func() { - file_sdk_blocksdk_v1_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_blocksdk_v1_query_proto_rawDescData) - }) - return file_sdk_blocksdk_v1_query_proto_rawDescData -} - -var file_sdk_blocksdk_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_sdk_blocksdk_v1_query_proto_goTypes = []interface{}{ - (*QueryLaneRequest)(nil), // 0: sdk.blocksdk.v1.QueryLaneRequest - (*QueryLaneResponse)(nil), // 1: sdk.blocksdk.v1.QueryLaneResponse - (*QueryLanesRequest)(nil), // 2: sdk.blocksdk.v1.QueryLanesRequest - (*QueryLanesResponse)(nil), // 3: sdk.blocksdk.v1.QueryLanesResponse - (*Lane)(nil), // 4: sdk.blocksdk.v1.Lane -} -var file_sdk_blocksdk_v1_query_proto_depIdxs = []int32{ - 4, // 0: sdk.blocksdk.v1.QueryLaneResponse.lane:type_name -> sdk.blocksdk.v1.Lane - 4, // 1: sdk.blocksdk.v1.QueryLanesResponse.lanes:type_name -> sdk.blocksdk.v1.Lane - 0, // 2: sdk.blocksdk.v1.Query.Lane:input_type -> sdk.blocksdk.v1.QueryLaneRequest - 2, // 3: sdk.blocksdk.v1.Query.Lanes:input_type -> sdk.blocksdk.v1.QueryLanesRequest - 1, // 4: sdk.blocksdk.v1.Query.Lane:output_type -> sdk.blocksdk.v1.QueryLaneResponse - 3, // 5: sdk.blocksdk.v1.Query.Lanes:output_type -> sdk.blocksdk.v1.QueryLanesResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_sdk_blocksdk_v1_query_proto_init() } -func file_sdk_blocksdk_v1_query_proto_init() { - if File_sdk_blocksdk_v1_query_proto != nil { - return - } - file_sdk_blocksdk_v1_blocksdk_proto_init() - if !protoimpl.UnsafeEnabled { - file_sdk_blocksdk_v1_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLaneRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sdk_blocksdk_v1_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLaneResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sdk_blocksdk_v1_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLanesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sdk_blocksdk_v1_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryLanesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sdk_blocksdk_v1_query_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_sdk_blocksdk_v1_query_proto_goTypes, - DependencyIndexes: file_sdk_blocksdk_v1_query_proto_depIdxs, - MessageInfos: file_sdk_blocksdk_v1_query_proto_msgTypes, - }.Build() - File_sdk_blocksdk_v1_query_proto = out.File - file_sdk_blocksdk_v1_query_proto_rawDesc = nil - file_sdk_blocksdk_v1_query_proto_goTypes = nil - file_sdk_blocksdk_v1_query_proto_depIdxs = nil -} diff --git a/api/sdk/blocksdk/v1/query_grpc.pb.go b/api/sdk/blocksdk/v1/query_grpc.pb.go deleted file mode 100644 index e50c381..0000000 --- a/api/sdk/blocksdk/v1/query_grpc.pb.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: sdk/blocksdk/v1/query.proto - -package blocksdkv1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Query_Lane_FullMethodName = "/sdk.blocksdk.v1.Query/Lane" - Query_Lanes_FullMethodName = "/sdk.blocksdk.v1.Query/Lanes" -) - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type QueryClient interface { - // Lane queries the a lane by its id. - Lane(ctx context.Context, in *QueryLaneRequest, opts ...grpc.CallOption) (*QueryLaneResponse, error) - // Lane queries all lanes in the x/blocksdk module - Lanes(ctx context.Context, in *QueryLanesRequest, opts ...grpc.CallOption) (*QueryLanesResponse, error) -} - -type queryClient struct { - cc grpc.ClientConnInterface -} - -func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Lane(ctx context.Context, in *QueryLaneRequest, opts ...grpc.CallOption) (*QueryLaneResponse, error) { - out := new(QueryLaneResponse) - err := c.cc.Invoke(ctx, Query_Lane_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Lanes(ctx context.Context, in *QueryLanesRequest, opts ...grpc.CallOption) (*QueryLanesResponse, error) { - out := new(QueryLanesResponse) - err := c.cc.Invoke(ctx, Query_Lanes_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -// All implementations must embed UnimplementedQueryServer -// for forward compatibility -type QueryServer interface { - // Lane queries the a lane by its id. - Lane(context.Context, *QueryLaneRequest) (*QueryLaneResponse, error) - // Lane queries all lanes in the x/blocksdk module - Lanes(context.Context, *QueryLanesRequest) (*QueryLanesResponse, error) - mustEmbedUnimplementedQueryServer() -} - -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (UnimplementedQueryServer) Lane(context.Context, *QueryLaneRequest) (*QueryLaneResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Lane not implemented") -} -func (UnimplementedQueryServer) Lanes(context.Context, *QueryLanesRequest) (*QueryLanesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Lanes not implemented") -} -func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} - -// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to QueryServer will -// result in compilation errors. -type UnsafeQueryServer interface { - mustEmbedUnimplementedQueryServer() -} - -func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { - s.RegisterService(&Query_ServiceDesc, srv) -} - -func _Query_Lane_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLaneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Lane(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Lane_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Lane(ctx, req.(*QueryLaneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Lanes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLanesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Lanes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Query_Lanes_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Lanes(ctx, req.(*QueryLanesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Query_ServiceDesc is the grpc.ServiceDesc for Query service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Query_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.blocksdk.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Lane", - Handler: _Query_Lane_Handler, - }, - { - MethodName: "Lanes", - Handler: _Query_Lanes_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "sdk/blocksdk/v1/query.proto", -} diff --git a/api/sdk/blocksdk/v1/tx.pulsar.go b/api/sdk/blocksdk/v1/tx.pulsar.go deleted file mode 100644 index 84fcd84..0000000 --- a/api/sdk/blocksdk/v1/tx.pulsar.go +++ /dev/null @@ -1,1090 +0,0 @@ -// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package blocksdkv1 - -import ( - _ "cosmossdk.io/api/amino" - _ "cosmossdk.io/api/cosmos/msg/v1" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoiface "google.golang.org/protobuf/runtime/protoiface" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - io "io" - reflect "reflect" - sync "sync" -) - -var ( - md_MsgUpdateLane protoreflect.MessageDescriptor - fd_MsgUpdateLane_authority protoreflect.FieldDescriptor - fd_MsgUpdateLane_lane protoreflect.FieldDescriptor -) - -func init() { - file_sdk_blocksdk_v1_tx_proto_init() - md_MsgUpdateLane = File_sdk_blocksdk_v1_tx_proto.Messages().ByName("MsgUpdateLane") - fd_MsgUpdateLane_authority = md_MsgUpdateLane.Fields().ByName("authority") - fd_MsgUpdateLane_lane = md_MsgUpdateLane.Fields().ByName("lane") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateLane)(nil) - -type fastReflection_MsgUpdateLane MsgUpdateLane - -func (x *MsgUpdateLane) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateLane)(x) -} - -func (x *MsgUpdateLane) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_tx_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdateLane_messageType fastReflection_MsgUpdateLane_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateLane_messageType{} - -type fastReflection_MsgUpdateLane_messageType struct{} - -func (x fastReflection_MsgUpdateLane_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateLane)(nil) -} -func (x fastReflection_MsgUpdateLane_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateLane) -} -func (x fastReflection_MsgUpdateLane_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateLane -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateLane) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateLane -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateLane) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateLane_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateLane) New() protoreflect.Message { - return new(fastReflection_MsgUpdateLane) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateLane) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateLane)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdateLane) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Authority != "" { - value := protoreflect.ValueOfString(x.Authority) - if !f(fd_MsgUpdateLane_authority, value) { - return - } - } - if x.Lane != nil { - value := protoreflect.ValueOfMessage(x.Lane.ProtoReflect()) - if !f(fd_MsgUpdateLane_lane, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateLane) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - return x.Authority != "" - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - return x.Lane != nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLane) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - x.Authority = "" - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - x.Lane = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateLane) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - value := x.Authority - return protoreflect.ValueOfString(value) - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - value := x.Lane - return protoreflect.ValueOfMessage(value.ProtoReflect()) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLane) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - x.Authority = value.Interface().(string) - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - x.Lane = value.Message().Interface().(*Lane) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLane) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - if x.Lane == nil { - x.Lane = new(Lane) - } - return protoreflect.ValueOfMessage(x.Lane.ProtoReflect()) - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - panic(fmt.Errorf("field authority of message sdk.blocksdk.v1.MsgUpdateLane is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateLane) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "sdk.blocksdk.v1.MsgUpdateLane.authority": - return protoreflect.ValueOfString("") - case "sdk.blocksdk.v1.MsgUpdateLane.lane": - m := new(Lane) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLane")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLane does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateLane) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.MsgUpdateLane", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateLane) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLane) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateLane) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateLane) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateLane) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - l = len(x.Authority) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.Lane != nil { - l = options.Size(x.Lane) - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateLane) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if x.Lane != nil { - encoded, err := options.Marshal(x.Lane) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if len(x.Authority) > 0 { - i -= len(x.Authority) - copy(dAtA[i:], x.Authority) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority))) - i-- - dAtA[i] = 0xa - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateLane) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateLane: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateLane: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Authority = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Lane", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Lane == nil { - x.Lane = &Lane{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Lane); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_MsgUpdateLaneResponse protoreflect.MessageDescriptor -) - -func init() { - file_sdk_blocksdk_v1_tx_proto_init() - md_MsgUpdateLaneResponse = File_sdk_blocksdk_v1_tx_proto.Messages().ByName("MsgUpdateLaneResponse") -} - -var _ protoreflect.Message = (*fastReflection_MsgUpdateLaneResponse)(nil) - -type fastReflection_MsgUpdateLaneResponse MsgUpdateLaneResponse - -func (x *MsgUpdateLaneResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_MsgUpdateLaneResponse)(x) -} - -func (x *MsgUpdateLaneResponse) slowProtoReflect() protoreflect.Message { - mi := &file_sdk_blocksdk_v1_tx_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_MsgUpdateLaneResponse_messageType fastReflection_MsgUpdateLaneResponse_messageType -var _ protoreflect.MessageType = fastReflection_MsgUpdateLaneResponse_messageType{} - -type fastReflection_MsgUpdateLaneResponse_messageType struct{} - -func (x fastReflection_MsgUpdateLaneResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_MsgUpdateLaneResponse)(nil) -} -func (x fastReflection_MsgUpdateLaneResponse_messageType) New() protoreflect.Message { - return new(fastReflection_MsgUpdateLaneResponse) -} -func (x fastReflection_MsgUpdateLaneResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateLaneResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_MsgUpdateLaneResponse) Descriptor() protoreflect.MessageDescriptor { - return md_MsgUpdateLaneResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_MsgUpdateLaneResponse) Type() protoreflect.MessageType { - return _fastReflection_MsgUpdateLaneResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_MsgUpdateLaneResponse) New() protoreflect.Message { - return new(fastReflection_MsgUpdateLaneResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_MsgUpdateLaneResponse) Interface() protoreflect.ProtoMessage { - return (*MsgUpdateLaneResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_MsgUpdateLaneResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_MsgUpdateLaneResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLaneResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_MsgUpdateLaneResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLaneResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLaneResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_MsgUpdateLaneResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: sdk.blocksdk.v1.MsgUpdateLaneResponse")) - } - panic(fmt.Errorf("message sdk.blocksdk.v1.MsgUpdateLaneResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_MsgUpdateLaneResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in sdk.blocksdk.v1.MsgUpdateLaneResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_MsgUpdateLaneResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_MsgUpdateLaneResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_MsgUpdateLaneResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_MsgUpdateLaneResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*MsgUpdateLaneResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateLaneResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*MsgUpdateLaneResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateLaneResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgUpdateLaneResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.0 -// protoc (unknown) -// source: sdk/blocksdk/v1/tx.proto - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// MsgUpdateLane defines a request to update an existing lane in the store. -type MsgUpdateLane struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Lane *Lane `protobuf:"bytes,2,opt,name=lane,proto3" json:"lane,omitempty"` -} - -func (x *MsgUpdateLane) Reset() { - *x = MsgUpdateLane{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_tx_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateLane) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateLane) ProtoMessage() {} - -// Deprecated: Use MsgUpdateLane.ProtoReflect.Descriptor instead. -func (*MsgUpdateLane) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_tx_proto_rawDescGZIP(), []int{0} -} - -func (x *MsgUpdateLane) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *MsgUpdateLane) GetLane() *Lane { - if x != nil { - return x.Lane - } - return nil -} - -// MsgUpdateLaneResponse defines a response to update an existing lane in the -// store. -type MsgUpdateLaneResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MsgUpdateLaneResponse) Reset() { - *x = MsgUpdateLaneResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_sdk_blocksdk_v1_tx_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MsgUpdateLaneResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MsgUpdateLaneResponse) ProtoMessage() {} - -// Deprecated: Use MsgUpdateLaneResponse.ProtoReflect.Descriptor instead. -func (*MsgUpdateLaneResponse) Descriptor() ([]byte, []int) { - return file_sdk_blocksdk_v1_tx_proto_rawDescGZIP(), []int{1} -} - -var File_sdk_blocksdk_v1_tx_proto protoreflect.FileDescriptor - -var file_sdk_blocksdk_v1_tx_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, - 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x73, 0x64, 0x6b, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x73, 0x67, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, 0x01, 0x0a, 0x0d, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x12, 0x2f, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x61, 0x6e, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x6c, 0x61, 0x6e, - 0x65, 0x3a, 0x39, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x22, 0x17, 0x0a, 0x15, - 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x8f, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x80, 0x01, - 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x12, 0x1e, 0x2e, 0x73, - 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x1a, 0x26, 0x2e, 0x73, - 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x22, 0x22, 0x2f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, - 0x6b, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x61, 0x6e, 0x65, - 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa9, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, - 0x73, 0x64, 0x6b, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x76, 0x31, 0x42, - 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x64, 0x6b, - 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0f, - 0x53, 0x64, 0x6b, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0f, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x1b, 0x53, 0x64, 0x6b, 0x5c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x11, 0x53, 0x64, 0x6b, 0x3a, 0x3a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x64, 0x6b, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_sdk_blocksdk_v1_tx_proto_rawDescOnce sync.Once - file_sdk_blocksdk_v1_tx_proto_rawDescData = file_sdk_blocksdk_v1_tx_proto_rawDesc -) - -func file_sdk_blocksdk_v1_tx_proto_rawDescGZIP() []byte { - file_sdk_blocksdk_v1_tx_proto_rawDescOnce.Do(func() { - file_sdk_blocksdk_v1_tx_proto_rawDescData = protoimpl.X.CompressGZIP(file_sdk_blocksdk_v1_tx_proto_rawDescData) - }) - return file_sdk_blocksdk_v1_tx_proto_rawDescData -} - -var file_sdk_blocksdk_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_sdk_blocksdk_v1_tx_proto_goTypes = []interface{}{ - (*MsgUpdateLane)(nil), // 0: sdk.blocksdk.v1.MsgUpdateLane - (*MsgUpdateLaneResponse)(nil), // 1: sdk.blocksdk.v1.MsgUpdateLaneResponse - (*Lane)(nil), // 2: sdk.blocksdk.v1.Lane -} -var file_sdk_blocksdk_v1_tx_proto_depIdxs = []int32{ - 2, // 0: sdk.blocksdk.v1.MsgUpdateLane.lane:type_name -> sdk.blocksdk.v1.Lane - 0, // 1: sdk.blocksdk.v1.Msg.UpdateLane:input_type -> sdk.blocksdk.v1.MsgUpdateLane - 1, // 2: sdk.blocksdk.v1.Msg.UpdateLane:output_type -> sdk.blocksdk.v1.MsgUpdateLaneResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_sdk_blocksdk_v1_tx_proto_init() } -func file_sdk_blocksdk_v1_tx_proto_init() { - if File_sdk_blocksdk_v1_tx_proto != nil { - return - } - file_sdk_blocksdk_v1_blocksdk_proto_init() - if !protoimpl.UnsafeEnabled { - file_sdk_blocksdk_v1_tx_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateLane); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_sdk_blocksdk_v1_tx_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MsgUpdateLaneResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_sdk_blocksdk_v1_tx_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_sdk_blocksdk_v1_tx_proto_goTypes, - DependencyIndexes: file_sdk_blocksdk_v1_tx_proto_depIdxs, - MessageInfos: file_sdk_blocksdk_v1_tx_proto_msgTypes, - }.Build() - File_sdk_blocksdk_v1_tx_proto = out.File - file_sdk_blocksdk_v1_tx_proto_rawDesc = nil - file_sdk_blocksdk_v1_tx_proto_goTypes = nil - file_sdk_blocksdk_v1_tx_proto_depIdxs = nil -} diff --git a/api/sdk/blocksdk/v1/tx_grpc.pb.go b/api/sdk/blocksdk/v1/tx_grpc.pb.go deleted file mode 100644 index 4b6be64..0000000 --- a/api/sdk/blocksdk/v1/tx_grpc.pb.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc (unknown) -// source: sdk/blocksdk/v1/tx.proto - -package blocksdkv1 - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - Msg_UpdateLane_FullMethodName = "/sdk.blocksdk.v1.Msg/UpdateLane" -) - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type MsgClient interface { - // UpdateLane defines a method to update an existing lane in the store. - UpdateLane(ctx context.Context, in *MsgUpdateLane, opts ...grpc.CallOption) (*MsgUpdateLaneResponse, error) -} - -type msgClient struct { - cc grpc.ClientConnInterface -} - -func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateLane(ctx context.Context, in *MsgUpdateLane, opts ...grpc.CallOption) (*MsgUpdateLaneResponse, error) { - out := new(MsgUpdateLaneResponse) - err := c.cc.Invoke(ctx, Msg_UpdateLane_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -// All implementations must embed UnimplementedMsgServer -// for forward compatibility -type MsgServer interface { - // UpdateLane defines a method to update an existing lane in the store. - UpdateLane(context.Context, *MsgUpdateLane) (*MsgUpdateLaneResponse, error) - mustEmbedUnimplementedMsgServer() -} - -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (UnimplementedMsgServer) UpdateLane(context.Context, *MsgUpdateLane) (*MsgUpdateLaneResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateLane not implemented") -} -func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} - -// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MsgServer will -// result in compilation errors. -type UnsafeMsgServer interface { - mustEmbedUnimplementedMsgServer() -} - -func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { - s.RegisterService(&Msg_ServiceDesc, srv) -} - -func _Msg_UpdateLane_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateLane) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateLane(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Msg_UpdateLane_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateLane(ctx, req.(*MsgUpdateLane)) - } - return interceptor(ctx, in, info, handler) -} - -// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Msg_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.blocksdk.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateLane", - Handler: _Msg_UpdateLane_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "sdk/blocksdk/v1/tx.proto", -} diff --git a/block/mempool.go b/block/mempool.go index d6f9f42..c186cae 100644 --- a/block/mempool.go +++ b/block/mempool.go @@ -8,29 +8,19 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" sdkmempool "github.com/cosmos/cosmos-sdk/types/mempool" - - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) var _ Mempool = (*LanedMempool)(nil) -// LaneFetcher defines the interface to get a lane stored in the x/blocksdk module. -type LaneFetcher interface { - GetLane(ctx sdk.Context, id string) (lane blocksdkmoduletypes.Lane, err error) - GetLanes(ctx sdk.Context) []blocksdkmoduletypes.Lane -} - type ( // Mempool defines the Block SDK mempool interface. Mempool interface { sdkmempool.Mempool - // Registry returns the mempool's lane registry. - Registry(ctx sdk.Context) ([]Lane, error) - + // Registry returns the lanes in the mempool. + Registry() []Lane // Contains returns true if any of the lanes currently contain the transaction. Contains(tx sdk.Tx) bool - // GetTxDistribution returns the number of transactions in each lane. GetTxDistribution() map[string]uint64 } @@ -44,10 +34,6 @@ type ( // according to their priority. The first lane in the registry has the // highest priority and the last lane has the lowest priority. registry []Lane - - // moduleLaneFetcher is the mempool's interface to read on-chain lane - // information in the x/blocksdk module. - moduleLaneFetcher LaneFetcher } ) @@ -59,12 +45,10 @@ type ( func NewLanedMempool( logger log.Logger, lanes []Lane, - laneFetcher LaneFetcher, ) (*LanedMempool, error) { mempool := &LanedMempool{ - logger: logger, - registry: lanes, - moduleLaneFetcher: laneFetcher, + logger: logger, + registry: lanes, } if err := mempool.ValidateBasic(); err != nil { @@ -163,45 +147,9 @@ func (m *LanedMempool) Contains(tx sdk.Tx) (contains bool) { return false } -// Registry returns the mempool's lane registry. -func (m *LanedMempool) Registry(ctx sdk.Context) (newRegistry []Lane, err error) { - if m.moduleLaneFetcher == nil { - return m.registry, fmt.Errorf("module lane fetcher not set") - } - - // TODO add a last block updated check ? - // potential future optimization - chainLanes := m.moduleLaneFetcher.GetLanes(ctx) - - // order lanes and populate the necessary fields (maxBlockSize, etc) - m.registry, err = m.OrderLanes(chainLanes) - return m.registry, err -} - -func (m *LanedMempool) OrderLanes(chainLanes []blocksdkmoduletypes.Lane) (orderedLanes []Lane, err error) { - orderedLanes = make([]Lane, len(chainLanes)) - for _, chainLane := range chainLanes { - // panic protect - if chainLane.GetOrder() >= uint64(len(orderedLanes)) { - return orderedLanes, fmt.Errorf("lane order %d out of bounds, invalid configuration", chainLane.GetOrder()) - } - - _, index, found := FindLane(m.registry, chainLane.Id) - if !found { - return orderedLanes, fmt.Errorf("lane %s not found in registry, invalid configuration", chainLane.Id) - } - - lane := m.registry[index] - lane.SetMaxBlockSpace(chainLane.MaxBlockSpace) - orderedLanes[chainLane.GetOrder()] = lane - - // remove found lane from registry lanes for quicker find() - m.registry[index] = m.registry[len(m.registry)-1] // Copy last element to index i. - m.registry[len(m.registry)-1] = nil // Erase last element (write zero value). - m.registry = m.registry[:len(m.registry)-1] // Truncate slice. - } - - return orderedLanes, nil +// Registry returns the lanes in the mempool. +func (m *LanedMempool) Registry() []Lane { + return m.registry } // ValidateBasic validates the mempools configuration. ValidateBasic ensures @@ -244,9 +192,5 @@ func (m *LanedMempool) ValidateBasic() error { return fmt.Errorf("sum of total block space percentages will be less than 1") } - if m.moduleLaneFetcher == nil { - return fmt.Errorf("moduleLaneFetcher muset be set on mempool") - } - return nil } diff --git a/block/mempool_test.go b/block/mempool_test.go index f28fafa..eae44ab 100644 --- a/block/mempool_test.go +++ b/block/mempool_test.go @@ -5,10 +5,6 @@ import ( "testing" "time" - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" - - "github.com/skip-mev/block-sdk/v2/block/mocks" - "cosmossdk.io/log" "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -39,14 +35,8 @@ type BlockBusterTestSuite struct { freeLane *base.BaseLane gasTokenDenom string - // sdk module lanes - mevSDKLane blocksdkmoduletypes.Lane - baseSDKLane blocksdkmoduletypes.Lane - freeSDKLane blocksdkmoduletypes.Lane - - chainLanes []blocksdkmoduletypes.Lane - lanes []block.Lane - mempool *block.LanedMempool + lanes []block.Lane + mempool *block.LanedMempool // account set up accounts []testutils.Account @@ -85,12 +75,6 @@ func (suite *BlockBusterTestSuite) SetupTest() { factory.MatchHandler(), ) - suite.mevSDKLane = blocksdkmoduletypes.Lane{ - Id: suite.mevLane.Name(), - MaxBlockSpace: suite.mevLane.GetMaxBlockSpace(), - Order: 0, - } - // Free lane set up freeConfig := base.LaneConfig{ Logger: log.NewNopLogger(), @@ -106,12 +90,6 @@ func (suite *BlockBusterTestSuite) SetupTest() { free.DefaultMatchHandler(), ) - suite.freeSDKLane = blocksdkmoduletypes.Lane{ - Id: suite.freeLane.Name(), - MaxBlockSpace: suite.freeLane.GetMaxBlockSpace(), - Order: 1, - } - // Base lane set up baseConfig := base.LaneConfig{ Logger: log.NewNopLogger(), @@ -126,25 +104,13 @@ func (suite *BlockBusterTestSuite) SetupTest() { base.DefaultMatchHandler(), ) - suite.baseSDKLane = blocksdkmoduletypes.Lane{ - Id: suite.baseLane.Name(), - MaxBlockSpace: suite.baseLane.GetMaxBlockSpace(), - Order: 2, - } - // Mempool set up suite.lanes = []block.Lane{suite.mevLane, suite.freeLane, suite.baseLane} - suite.chainLanes = []blocksdkmoduletypes.Lane{suite.mevSDKLane, suite.freeSDKLane, suite.baseSDKLane} var err error suite.mempool, err = block.NewLanedMempool( log.NewNopLogger(), suite.lanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return suite.baseSDKLane, nil - }, func() []blocksdkmoduletypes.Lane { - return suite.chainLanes - }), ) suite.Require().NoError(err) @@ -157,12 +123,6 @@ func (suite *BlockBusterTestSuite) SetupTest() { } func (suite *BlockBusterTestSuite) TestNewMempool() { - fetcher := mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return nil - }) - defaultConfig := base.LaneConfig{ Logger: log.NewNopLogger(), TxEncoder: suite.encodingConfig.TxConfig.TxEncoder(), @@ -206,7 +166,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -217,7 +176,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -228,7 +186,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -239,7 +196,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -250,7 +206,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -261,7 +216,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -272,7 +226,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().NoError(err) }) @@ -283,7 +236,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().Error(err) }) @@ -294,7 +246,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().Error(err) }) @@ -305,7 +256,6 @@ func (suite *BlockBusterTestSuite) TestNewMempool() { _, err := block.NewLanedMempool( log.NewNopLogger(), lanes, - fetcher, ) suite.Require().Error(err) }) @@ -574,229 +524,3 @@ func (suite *BlockBusterTestSuite) fillFreeLane(numTxs uint64) { suite.Require().NoError(suite.mempool.Insert(suite.ctx, tx)) } } - -func (suite *BlockBusterTestSuite) TestLanedMempool_Registry() { - tests := []struct { - name string - chainLanes []blocksdkmoduletypes.Lane - registryLanes []block.Lane - expectedNewRegistry []block.Lane - wantErr bool - }{ - { - name: "invalid lanes in chain", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "invalid duplicate lanes in chain", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.baseSDKLane, // order = 2 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "invalid lanes in registry", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "valid reorder", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - expectedNewRegistry: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - wantErr: false, - }, - { - name: "valid no reorder", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - expectedNewRegistry: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - wantErr: false, - }, - } - for _, tc := range tests { - suite.Run(tc.name, func() { - // setup mock mempool - mempool, err := block.NewLanedMempool( - log.NewNopLogger(), - tc.registryLanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return tc.chainLanes - }), - ) - suite.Require().NoError(err) - - gotOrderedLanes, err := mempool.Registry(suite.ctx) - if tc.wantErr { - suite.Require().Error(err) - return - } - - suite.Require().NoError(err) - suite.Require().Equal(tc.expectedNewRegistry, gotOrderedLanes) - }) - } -} - -func (suite *BlockBusterTestSuite) TestLanedMempool_OrderLanes() { - tests := []struct { - name string - chainLanes []blocksdkmoduletypes.Lane - registryLanes []block.Lane - expectedOrderedLane []block.Lane - wantErr bool - }{ - { - name: "invalid lanes in chain", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "invalid duplicate lanes in chain", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.baseSDKLane, // order = 2 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "invalid lanes in registry", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.baseLane, - }, - wantErr: true, - }, - { - name: "valid reorder", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.freeLane, - suite.mevLane, - suite.baseLane, - }, - expectedOrderedLane: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - wantErr: false, - }, - { - name: "valid no reorder", - chainLanes: []blocksdkmoduletypes.Lane{ - suite.mevSDKLane, // order = 0 - suite.freeSDKLane, // order = 1 - suite.baseSDKLane, // order = 2 - }, - registryLanes: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - expectedOrderedLane: []block.Lane{ - suite.mevLane, - suite.freeLane, - suite.baseLane, - }, - wantErr: false, - }, - } - for _, tc := range tests { - suite.Run(tc.name, func() { - // setup mock mempool - mempool, err := block.NewLanedMempool( - log.NewNopLogger(), - tc.registryLanes, - mocks.NewMockLaneFetcher(func() (blocksdkmoduletypes.Lane, error) { - return blocksdkmoduletypes.Lane{}, nil - }, func() []blocksdkmoduletypes.Lane { - return []blocksdkmoduletypes.Lane{} - }), - ) - suite.Require().NoError(err) - - gotOrderedLanes, err := mempool.OrderLanes(tc.chainLanes) - if tc.wantErr { - suite.Require().Error(err) - return - } - - suite.Require().NoError(err) - suite.Require().Equal(tc.expectedOrderedLane, gotOrderedLanes) - }) - } -} diff --git a/block/mocks/lane_fetcher.go b/block/mocks/lane_fetcher.go deleted file mode 100644 index 6c95fd7..0000000 --- a/block/mocks/lane_fetcher.go +++ /dev/null @@ -1,35 +0,0 @@ -package mocks - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -type MockLaneFetcher struct { - getLaneHandler func() (blocksdkmoduletypes.Lane, error) - getLanesHandler func() []blocksdkmoduletypes.Lane -} - -func NewMockLaneFetcher(getLane func() (blocksdkmoduletypes.Lane, error), getLanes func() []blocksdkmoduletypes.Lane) MockLaneFetcher { - return MockLaneFetcher{ - getLaneHandler: getLane, - getLanesHandler: getLanes, - } -} - -func (m *MockLaneFetcher) SetGetLaneHandler(h func() (blocksdkmoduletypes.Lane, error)) { - m.getLaneHandler = h -} - -func (m MockLaneFetcher) GetLane(_ sdk.Context, _ string) (blocksdkmoduletypes.Lane, error) { - return m.getLaneHandler() -} - -func (m *MockLaneFetcher) SetGetLanesHandler(h func() []blocksdkmoduletypes.Lane) { - m.getLanesHandler = h -} - -func (m MockLaneFetcher) GetLanes(_ sdk.Context) []blocksdkmoduletypes.Lane { - return m.getLanesHandler() -} diff --git a/proto/sdk/blocksdk/module/v1/module.proto b/proto/sdk/blocksdk/module/v1/module.proto deleted file mode 100644 index 63faabc..0000000 --- a/proto/sdk/blocksdk/module/v1/module.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package sdk.blocksdk.module.v1; - -import "cosmos/app/v1alpha1/module.proto"; - -// Module is the config object of the x/blocksdk module. -message Module { - option (cosmos.app.v1alpha1.module) = { - go_import : "github.com/skip-mev/block-sdk/x/blocksdk" - }; - - // Authority defines the custom module authority. If not set, defaults to the - // governance module. - string authority = 1; -} diff --git a/proto/sdk/blocksdk/v1/blocksdk.proto b/proto/sdk/blocksdk/v1/blocksdk.proto deleted file mode 100644 index dfe7956..0000000 --- a/proto/sdk/blocksdk/v1/blocksdk.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; -package sdk.blocksdk.v1; - -import "gogoproto/gogo.proto"; -import "amino/amino.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/skip-mev/block-sdk/x/blocksdk/types"; - -// Lane defines a block-sdk lane and its associated parameters. Only the -// parameters that are critical to consensus are stored on-chain in this object. -// The other associated configuration for a lane can be set and stored locally, -// per-validator. -message Lane { - // id is the unique identifier of a Lane. Maps to a block-sdk laneName. - string id = 1; - - // max_block_space defines the relative percentage of block space that can be - // used by this lane. NOTE: If this is set to zero, then there is no limit - // on the number of transactions that can be included in the block for this - // lane (up to maxTxBytes as provided by the request). This is useful for the - // default lane. - string max_block_space = 2 [ - (cosmos_proto.scalar) = "cosmos.Dec", - (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", - (amino.dont_omitempty) = true, - (gogoproto.nullable) = false - ]; - - // order is the priority ordering of the Lane when processed in - // PrepareProposal and ProcessProposal. Lane orders should be set in order of - // priority starting from 0, monotonically increasing and non-overlapping. A - // lane with a lower order value will have a higher priority over a lane with - // a higher order value. For example, if LaneA has priority of 0 and LaneB - // has a priority of 1, LaneA has priority over LaneB. - uint64 order = 3; -} diff --git a/proto/sdk/blocksdk/v1/genesis.proto b/proto/sdk/blocksdk/v1/genesis.proto deleted file mode 100644 index 933aaab..0000000 --- a/proto/sdk/blocksdk/v1/genesis.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package sdk.blocksdk.v1; - -option go_package = "github.com/skip-mev/block-sdk/x/blocksdk/types"; - -import "gogoproto/gogo.proto"; -import "sdk/blocksdk/v1/blocksdk.proto"; - -// GenesisState defines the genesis state of the x/blocksdk module. -message GenesisState { - // lanes is the list of all configured lanes at genesis time. - repeated Lane lanes = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/sdk/blocksdk/v1/query.proto b/proto/sdk/blocksdk/v1/query.proto deleted file mode 100644 index bc6a4d3..0000000 --- a/proto/sdk/blocksdk/v1/query.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; -package sdk.blocksdk.v1; - -option go_package = "github.com/skip-mev/block-sdk/x/blocksdk/types"; - -import "google/api/annotations.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/query/v1/query.proto"; -import "sdk/blocksdk/v1/blocksdk.proto"; - -// Query defines the x/blocksdk querier service. -service Query { - // Lane queries the a lane by its id. - rpc Lane(QueryLaneRequest) returns (QueryLaneResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/block-sdk/blocksdk/v1/lane/{id}"; - } - - // Lane queries all lanes in the x/blocksdk module - rpc Lanes(QueryLanesRequest) returns (QueryLanesResponse) { - option (cosmos.query.v1.module_query_safe) = true; - option (google.api.http).get = "/block-sdk/blocksdk/v1/lanes"; - } -} - -// QueryLaneRequest is the request type for the Query/Lane RPC method. -message QueryLaneRequest { string id = 1; } - -// QueryLaneResponse is the response type for the Query/Lane RPC method. -message QueryLaneResponse { Lane lane = 1 [ (gogoproto.nullable) = false ]; } - -// QueryLaneRequest is the request type for the Query/Lanes RPC method. -message QueryLanesRequest {} - -// QueryLaneResponse is the response type for the Query/Lanes RPC method. -message QueryLanesResponse { - repeated Lane lanes = 1 [ (gogoproto.nullable) = false ]; -} diff --git a/proto/sdk/blocksdk/v1/tx.proto b/proto/sdk/blocksdk/v1/tx.proto deleted file mode 100644 index c5bb41f..0000000 --- a/proto/sdk/blocksdk/v1/tx.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -package sdk.blocksdk.v1; - -option go_package = "github.com/skip-mev/block-sdk/x/blocksdk/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/msg/v1/msg.proto"; -import "cosmos_proto/cosmos.proto"; -import "amino/amino.proto"; -import "sdk/blocksdk/v1/blocksdk.proto"; - -// Msg defines the x/blocksdk Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // UpdateLane defines a method to update an existing lane in the store. - rpc UpdateLane(MsgUpdateLane) returns (MsgUpdateLaneResponse); -} - -// MsgUpdateLane defines a request to update an existing lane in the store. -message MsgUpdateLane { - option (cosmos.msg.v1.signer) = "authority"; - option (amino.name) = "block-sdk/x/blocksdk/MsgUpdateLane"; - - option (gogoproto.equal) = false; - - string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; - Lane lane = 2 [ (gogoproto.nullable) = false ]; -} - -// MsgUpdateLaneResponse defines a response to update an existing lane in the -// store. -message MsgUpdateLaneResponse {} diff --git a/tests/app/README.md b/tests/app/README.md index 2a2eaa8..2be8d8c 100644 --- a/tests/app/README.md +++ b/tests/app/README.md @@ -92,7 +92,6 @@ mevLane, freeLane, defaultLane := CreateLanes(app) mempool, err := block.NewLanedMempool( app.Logger(), []block.Lane{mevLane, freeLane, defaultLane}, - &app.blocksdkKeeper, ) if err != nil { panic(err) diff --git a/tests/app/app.go b/tests/app/app.go index fd30994..0cbf2a6 100644 --- a/tests/app/app.go +++ b/tests/app/app.go @@ -48,7 +48,6 @@ import ( service "github.com/skip-mev/block-sdk/v2/block/service" "github.com/skip-mev/block-sdk/v2/block/utils" auctionkeeper "github.com/skip-mev/block-sdk/v2/x/auction/keeper" - blocksdkkeeper "github.com/skip-mev/block-sdk/v2/x/blocksdk/keeper" ) const ( @@ -90,7 +89,6 @@ type TestApp struct { ConsensusParamsKeeper consensuskeeper.Keeper CircuitBreakerKeeper circuitkeeper.Keeper auctionkeeper auctionkeeper.Keeper - blocksdkKeeper blocksdkkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper // custom checkTx handler @@ -172,7 +170,6 @@ func New( &app.AuthzKeeper, &app.GroupKeeper, &app.auctionkeeper, - &app.blocksdkKeeper, &app.ConsensusParamsKeeper, &app.FeeGrantKeeper, &app.CircuitBreakerKeeper, @@ -220,7 +217,6 @@ func New( mempool, err := block.NewLanedMempool( app.Logger(), []block.Lane{mevLane, freeLane, defaultLane}, - &app.blocksdkKeeper, ) if err != nil { panic(err) diff --git a/tests/app/config.go b/tests/app/config.go index 5ed0410..1950a36 100644 --- a/tests/app/config.go +++ b/tests/app/config.go @@ -67,11 +67,8 @@ import ( _ "github.com/cosmos/cosmos-sdk/x/staking" // import for side-effects auctionmodulev1 "github.com/skip-mev/block-sdk/v2/api/sdk/auction/module/v1" - blocksdkmodulev1 "github.com/skip-mev/block-sdk/v2/api/sdk/blocksdk/module/v1" _ "github.com/skip-mev/block-sdk/v2/x/auction" // import for side-effects auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - _ "github.com/skip-mev/block-sdk/v2/x/blocksdk" // import for side-effects - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) var ( @@ -155,7 +152,6 @@ var ( consensustypes.ModuleName, circuittypes.ModuleName, auctiontypes.ModuleName, - blocksdktypes.ModuleName, feegrant.ModuleName, }, // When ExportGenesis is not specified, the export genesis module order @@ -252,10 +248,6 @@ var ( Name: auctiontypes.ModuleName, Config: appconfig.WrapAny(&auctionmodulev1.Module{}), }, - { - Name: blocksdktypes.ModuleName, - Config: appconfig.WrapAny(&blocksdkmodulev1.Module{}), - }, }, }), depinject.Supply( diff --git a/tests/e2e/block_sdk_e2e_test.go b/tests/e2e/block_sdk_e2e_test.go index 06c8d0c..f3e0c8f 100644 --- a/tests/e2e/block_sdk_e2e_test.go +++ b/tests/e2e/block_sdk_e2e_test.go @@ -4,8 +4,6 @@ import ( "fmt" "testing" - "cosmossdk.io/math" - testutil "github.com/cosmos/cosmos-sdk/types/module/testutil" interchaintest "github.com/strangelove-ventures/interchaintest/v8" "github.com/strangelove-ventures/interchaintest/v8/chain/cosmos" @@ -13,12 +11,8 @@ import ( ictestutil "github.com/strangelove-ventures/interchaintest/v8/testutil" "github.com/stretchr/testify/suite" - "github.com/skip-mev/block-sdk/v2/lanes/base" - "github.com/skip-mev/block-sdk/v2/lanes/free" - "github.com/skip-mev/block-sdk/v2/lanes/mev" "github.com/skip-mev/block-sdk/v2/tests/e2e" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdkmoduletypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) var ( @@ -41,26 +35,6 @@ var ( Key: "app_state.auction.params.max_bundle_size", Value: 3, }, - { - Key: "app_state.blocksdk.lanes", - Value: []blocksdkmoduletypes.Lane{ - { - Id: mev.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 0, - }, - { - Id: free.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 1, - }, - { - Id: base.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.6"), - Order: 2, - }, - }, - }, } consensusParams = ictestutil.Toml{ @@ -102,7 +76,6 @@ func MakeEncodingConfig() *testutil.TestEncodingConfig { // register auction types auctiontypes.RegisterInterfaces(cfg.InterfaceRegistry) - blocksdkmoduletypes.RegisterInterfaces(cfg.InterfaceRegistry) return &cfg } diff --git a/tests/integration/integration_test.go b/tests/integration/integration_test.go index 85ed292..2219879 100644 --- a/tests/integration/integration_test.go +++ b/tests/integration/integration_test.go @@ -10,7 +10,6 @@ import ( testkeeper "github.com/skip-mev/block-sdk/v2/testutils/keeper" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) type IntegrationTestSuite struct { @@ -29,7 +28,6 @@ func TestIntegrationTestSuite(t *testing.T) { func (s *IntegrationTestSuite) SetupTest() { s.encCfg = encoding.MakeTestEncodingConfig(func(registry types.InterfaceRegistry) { auctiontypes.RegisterInterfaces(registry) - blocksdktypes.RegisterInterfaces(registry) }) s.ctx, s.TestKeepers, s.TestMsgServers = testkeeper.NewTestSetup(s.T()) diff --git a/tests/integration/network/network_test.go b/tests/integration/network/network_test.go index f0ac86b..c9617c2 100644 --- a/tests/integration/network/network_test.go +++ b/tests/integration/network/network_test.go @@ -21,7 +21,6 @@ import ( "github.com/skip-mev/block-sdk/v2/testutils/networksuite" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) // NetworkTestSuite is a test suite for network integration tests. @@ -34,39 +33,6 @@ func TestNetworkTestSuite(t *testing.T) { suite.Run(t, new(NetworkTestSuite)) } -func (s *NetworkTestSuite) TestGetLanes() { - common := []string{ - fmt.Sprintf("--%s=json", tmcli.OutputFlag), - } - for _, tc := range []struct { - name string - - args []string - err error - obj []blocksdktypes.Lane - }{ - { - name: "should return default lanes", - args: common, - obj: s.BlockSDKState.Lanes, - }, - } { - s.T().Run(tc.name, func(t *testing.T) { - tc := tc - resp, err := s.QueryBlockSDKLanes() - if tc.err != nil { - stat, ok := status.FromError(tc.err) - require.True(t, ok) - require.ErrorIs(t, stat.Err(), tc.err) - } else { - require.NoError(t, err) - require.NotNil(t, resp.Lanes) - require.ElementsMatch(t, tc.obj, resp.Lanes) - } - }) - } -} - func (s *NetworkTestSuite) TestGetAuctionParams() { common := []string{ fmt.Sprintf("--%s=json", tmcli.OutputFlag), @@ -111,17 +77,6 @@ func (s *NetworkTestSuite) QueryAuctionParams() (*auctiontypes.QueryParamsRespon return client.Params(context.Background(), &auctiontypes.QueryParamsRequest{}) } -func (s *NetworkTestSuite) QueryBlockSDKLanes() (*blocksdktypes.QueryLanesResponse, error) { - s.T().Helper() - - cc, closeConn, err := s.NetworkSuite.GetGRPC() - s.Require().NoError(err) - defer closeConn() - - client := blocksdktypes.NewQueryClient(cc) - return client.Lanes(context.Background(), &blocksdktypes.QueryLanesRequest{}) -} - func (s *NetworkTestSuite) TestFreeTxNoFees() { val := s.NetworkSuite.Network.Validators[0] acc := *s.Accounts[0] diff --git a/testutils/keeper/keeper.go b/testutils/keeper/keeper.go index 5206a65..e7f607c 100644 --- a/testutils/keeper/keeper.go +++ b/testutils/keeper/keeper.go @@ -4,8 +4,6 @@ package keeper import ( "testing" - "cosmossdk.io/math" - "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" @@ -19,20 +17,14 @@ import ( testkeeper "github.com/skip-mev/chaintestutil/keeper" "github.com/stretchr/testify/require" - "github.com/skip-mev/block-sdk/v2/lanes/base" - "github.com/skip-mev/block-sdk/v2/lanes/free" - "github.com/skip-mev/block-sdk/v2/lanes/mev" auctionkeeper "github.com/skip-mev/block-sdk/v2/x/auction/keeper" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdkkeeper "github.com/skip-mev/block-sdk/v2/x/blocksdk/keeper" - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) // TestKeepers holds all keepers used during keeper tests for all modules type TestKeepers struct { testkeeper.TestKeepers - AuctionKeeper auctionkeeper.Keeper - BlockSDKKeeper blocksdkkeeper.Keeper + AuctionKeeper auctionkeeper.Keeper } // TestMsgServers holds all message servers used during keeper tests for all modules @@ -53,7 +45,6 @@ func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context, // initialize extra keeper auctionKeeper := Auction(tk.Initializer, tk.AccountKeeper, tk.BankKeeper, tk.DistrKeeper, tk.StakingKeeper) - blocksdkKeeper := BlockSDK(tk.Initializer) require.NoError(t, tk.Initializer.LoadLatest()) // initialize msg servers @@ -67,30 +58,9 @@ func NewTestSetup(t testing.TB, options ...testkeeper.SetupOption) (sdk.Context, err := auctionKeeper.SetParams(ctx, auctiontypes.DefaultParams()) require.NoError(t, err) - err = blocksdkKeeper.AddLane(ctx, blocksdktypes.Lane{ - Id: mev.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 0, - }) - require.NoError(t, err) - err = blocksdkKeeper.AddLane(ctx, blocksdktypes.Lane{ - Id: free.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 1, - }) - require.NoError(t, err) - - err = blocksdkKeeper.AddLane(ctx, blocksdktypes.Lane{ - Id: base.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.6"), - Order: 2, - }) - require.NoError(t, err) - testKeepers := TestKeepers{ - TestKeepers: tk, - AuctionKeeper: auctionKeeper, - BlockSDKKeeper: blocksdkKeeper, + TestKeepers: tk, + AuctionKeeper: auctionKeeper, } testMsgServers := TestMsgServers{ @@ -122,17 +92,3 @@ func Auction( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) } - -// BlockSDK initializes the blocksdk module using the testkeepers intializer. -func BlockSDK( - initializer *testkeeper.Initializer, -) blocksdkkeeper.Keeper { - storeKey := storetypes.NewKVStoreKey(blocksdktypes.StoreKey) - initializer.StateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, initializer.DB) - - return blocksdkkeeper.NewKeeper( - initializer.Codec, - storeKey, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), - ) -} diff --git a/testutils/mempool/mempool.go b/testutils/mempool/mempool.go index 9e85d35..1e5b542 100644 --- a/testutils/mempool/mempool.go +++ b/testutils/mempool/mempool.go @@ -4,8 +4,6 @@ import ( "cosmossdk.io/log" "cosmossdk.io/math" - "github.com/skip-mev/block-sdk/v2/block/mocks" - signerextraction "github.com/skip-mev/block-sdk/v2/adapters/signer_extraction_adapter" "github.com/skip-mev/block-sdk/v2/block" "github.com/skip-mev/block-sdk/v2/block/base" @@ -54,7 +52,7 @@ func CreateMempool() *block.LanedMempool { defaultLane := defaultlane.NewDefaultLane(defaultConfig, base.DefaultMatchHandler()) lanes := []block.Lane{mevLane, freeLane, defaultLane} - mempool, err := block.NewLanedMempool(log.NewNopLogger(), lanes, mocks.MockLaneFetcher{}) + mempool, err := block.NewLanedMempool(log.NewNopLogger(), lanes) if err != nil { panic(err) } diff --git a/testutils/networksuite/networksuite.go b/testutils/networksuite/networksuite.go index 53adb3f..af8170a 100644 --- a/testutils/networksuite/networksuite.go +++ b/testutils/networksuite/networksuite.go @@ -25,12 +25,8 @@ import ( "github.com/skip-mev/chaintestutil/account" - "github.com/skip-mev/block-sdk/v2/lanes/base" - "github.com/skip-mev/block-sdk/v2/lanes/free" - "github.com/skip-mev/block-sdk/v2/lanes/mev" "github.com/skip-mev/block-sdk/v2/tests/app" auctiontypes "github.com/skip-mev/block-sdk/v2/x/auction/types" - blocksdktypes "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" ) var ( @@ -43,12 +39,11 @@ var ( type NetworkTestSuite struct { suite.Suite - NetworkSuite *network.TestSuite - AuctionState auctiontypes.GenesisState - BlockSDKState blocksdktypes.GenesisState - AuthState authtypes.GenesisState - BankState banktypes.GenesisState - Accounts []*account.Account + NetworkSuite *network.TestSuite + AuctionState auctiontypes.GenesisState + AuthState authtypes.GenesisState + BankState banktypes.GenesisState + Accounts []*account.Account } // SetupSuite setups the local network with a genesis state. @@ -83,9 +78,6 @@ func (nts *NetworkTestSuite) SetupSuite() { nts.AuctionState = populateAuction(r, nts.AuctionState) updateGenesisConfigState(auctiontypes.ModuleName, &nts.AuctionState) - nts.BlockSDKState = populateBlockSDK(r, nts.BlockSDKState) - updateGenesisConfigState(blocksdktypes.ModuleName, &nts.BlockSDKState) - // add genesis accounts nts.Accounts = []*account.Account{ account.NewAccount(), @@ -135,25 +127,3 @@ func populateAuction(_ *rand.Rand, auctionState auctiontypes.GenesisState) aucti // TODO intercept and populate state randomly if desired return auctionState } - -func populateBlockSDK(_ *rand.Rand, bsdkState blocksdktypes.GenesisState) blocksdktypes.GenesisState { - bsdkState.Lanes = blocksdktypes.Lanes{ - { - Id: mev.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 0, - }, - { - Id: free.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 1, - }, - { - Id: base.LaneName, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.6"), - Order: 2, - }, - } - - return bsdkState -} diff --git a/x/blocksdk/client/cli/query.go b/x/blocksdk/client/cli/query.go deleted file mode 100644 index 57feec3..0000000 --- a/x/blocksdk/client/cli/query.go +++ /dev/null @@ -1,87 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/cosmos/cosmos-sdk/client/flags" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -// GetQueryCmd returns the cli query commands for the blocksdk module. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - CmdQueryLane(), - CmdQueryLanes(), - ) - - return cmd -} - -// CmdQueryLane implements a command that will return a lane by its ID. -func CmdQueryLane() *cobra.Command { - cmd := &cobra.Command{ - Use: "lane", - Short: "Query the a lane by its ID", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - request := &types.QueryLaneRequest{} - response, err := queryClient.Lane(cmd.Context(), request) - if err != nil { - return err - } - - return clientCtx.PrintProto(&response.Lane) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// CmdQueryLanes implements a command that will return all lanes. -func CmdQueryLanes() *cobra.Command { - cmd := &cobra.Command{ - Use: "lanes", - Short: "Query the all lanes", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - request := &types.QueryLanesRequest{} - response, err := queryClient.Lanes(cmd.Context(), request) - if err != nil { - return err - } - - return clientCtx.PrintProto(response) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/blocksdk/client/cli/tx.go b/x/blocksdk/client/cli/tx.go deleted file mode 100644 index c86c59a..0000000 --- a/x/blocksdk/client/cli/tx.go +++ /dev/null @@ -1,24 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -// NewTxCmd returns a root CLI command handler for all x/blocksdk transaction -// commands. -func NewTxCmd() *cobra.Command { - txCmd := &cobra.Command{ - Use: types.ModuleName, - Short: "blocksdk transaction subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - txCmd.AddCommand() - - return txCmd -} diff --git a/x/blocksdk/keeper/genesis.go b/x/blocksdk/keeper/genesis.go deleted file mode 100644 index 1079605..0000000 --- a/x/blocksdk/keeper/genesis.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -// InitGenesis initializes the blocksdk module's state from a given genesis state. -func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState) { - for _, lane := range gs.Lanes { - k.setLane(ctx, lane) - } -} - -// ExportGenesis returns a GenesisState for a given context. -func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { - lanes := k.GetLanes(ctx) - - return &types.GenesisState{Lanes: lanes} -} diff --git a/x/blocksdk/keeper/grpc_query.go b/x/blocksdk/keeper/grpc_query.go deleted file mode 100644 index d3ebae0..0000000 --- a/x/blocksdk/keeper/grpc_query.go +++ /dev/null @@ -1,42 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -var _ types.QueryServer = QueryServer{} - -// QueryServer defines the blocksdk module's gRPC querier service. -type QueryServer struct { - keeper Keeper -} - -// NewQueryServer creates a new gRPC query server for the blocksdk module. -func NewQueryServer(keeper Keeper) *QueryServer { - return &QueryServer{keeper: keeper} -} - -// Lane implements the service to query a Lane by its ID. -func (q QueryServer) Lane(goCtx context.Context, query *types.QueryLaneRequest) (*types.QueryLaneResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - lane, err := q.keeper.GetLane(ctx, query.Id) - if err != nil { - return nil, err - } - - return &types.QueryLaneResponse{Lane: lane}, nil -} - -// Lanes implements the service to query all Lanes in the stores. -func (q QueryServer) Lanes(goCtx context.Context, _ *types.QueryLanesRequest) (*types.QueryLanesResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - lanes := q.keeper.GetLanes(ctx) - - return &types.QueryLanesResponse{Lanes: lanes}, nil -} diff --git a/x/blocksdk/keeper/grpc_query_test.go b/x/blocksdk/keeper/grpc_query_test.go deleted file mode 100644 index 3f060ad..0000000 --- a/x/blocksdk/keeper/grpc_query_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package keeper_test - -import ( - "cosmossdk.io/math" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -func (s *KeeperTestSuite) TestQueryLane() { - // pre-register a lane - registeredLanes := types.Lanes{ - types.Lane{ - Id: "registered1", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - types.Lane{ - Id: "registered2", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 1, - }, - } - - for _, lane := range registeredLanes { - s.Require().NoError(s.blocksdKeeper.AddLane(s.ctx, lane)) - } - - testCases := []struct { - name string - query *types.QueryLaneRequest - expected types.Lane - wantErr bool - }{ - { - name: "invalid lane does not exist", - query: &types.QueryLaneRequest{Id: "invalid"}, - expected: types.Lane{}, - wantErr: true, - }, - { - name: "valid query 1", - query: &types.QueryLaneRequest{Id: registeredLanes[0].Id}, - expected: registeredLanes[0], - wantErr: false, - }, - { - name: "valid query 2", - query: &types.QueryLaneRequest{Id: registeredLanes[1].Id}, - expected: registeredLanes[1], - wantErr: false, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - resp, err := s.queryServer.Lane(s.ctx, tc.query) - if tc.wantErr { - s.Require().Error(err) - return - } - - s.Require().NoError(err) - s.Require().Equal(tc.expected, resp.GetLane()) - }) - } -} - -func (s *KeeperTestSuite) TestQueryLanes() { - // pre-register a lane - registeredLanes := types.Lanes{ - types.Lane{ - Id: "registered1", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - types.Lane{ - Id: "registered2", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 1, - }, - } - - for _, lane := range registeredLanes { - s.Require().NoError(s.blocksdKeeper.AddLane(s.ctx, lane)) - } - - testCases := []struct { - name string - query *types.QueryLanesRequest - expected []types.Lane - }{ - { - name: "valid", - query: &types.QueryLanesRequest{}, - expected: registeredLanes, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - resp, err := s.queryServer.Lanes(s.ctx, tc.query) - s.Require().NoError(err) - s.Require().Equal(tc.expected, resp.GetLanes()) - }) - } -} diff --git a/x/blocksdk/keeper/keeper.go b/x/blocksdk/keeper/keeper.go deleted file mode 100644 index 482aecd..0000000 --- a/x/blocksdk/keeper/keeper.go +++ /dev/null @@ -1,104 +0,0 @@ -package keeper - -import ( - "fmt" - - "cosmossdk.io/log" - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - - // The address that is capable of executing a message. - // Typically, this will be the governance module's address. - authority string -} - -// NewKeeper creates a new x/blocksdk keeper. -func NewKeeper( - cdc codec.BinaryCodec, - storeKey storetypes.StoreKey, - - authority string, -) Keeper { - return Keeper{ - cdc: cdc, - storeKey: storeKey, - - authority: authority, - } -} - -// Logger returns a blocksdk module-specific logger. -func (k *Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+types.ModuleName) -} - -// GetAuthority returns the address that is capable of executing a MsgUpdateParams message. -func (k *Keeper) GetAuthority() string { - return k.authority -} - -// AddLane calls SetLane and provides additional stateful checks that the new -// set of lanes will be valid. -func (k *Keeper) AddLane(ctx sdk.Context, lane types.Lane) error { - currentLanes := k.GetLanes(ctx) - currentLanes = append(currentLanes, lane) - - // validate new set of lanes - if err := types.Lanes(currentLanes).ValidateBasic(); err != nil { - return fmt.Errorf("new lane creates invalid lane configuration: %w", err) - } - - k.setLane(ctx, lane) - return nil -} - -// setLane sets a lane in the store. -func (k *Keeper) setLane(ctx sdk.Context, lane types.Lane) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyLanes) - b := k.cdc.MustMarshal(&lane) - store.Set([]byte(lane.Id), b) -} - -// GetLane returns a lane by its id. -func (k *Keeper) GetLane(ctx sdk.Context, id string) (lane types.Lane, err error) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyLanes) - b := store.Get([]byte(id)) - if b == nil { - return lane, fmt.Errorf("lane not found for ID %s", id) - } - k.cdc.MustUnmarshal(b, &lane) - return lane, nil -} - -// GetLanes returns all lanes. -func (k *Keeper) GetLanes(ctx sdk.Context) (lanes []types.Lane) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyLanes) - iterator := storetypes.KVStorePrefixIterator(store, []byte{}) - - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - var lane types.Lane - k.cdc.MustUnmarshal(iterator.Value(), &lane) - lanes = append(lanes, lane) - } - - return -} - -// DeleteLane deletes an Lane. -func (k *Keeper) DeleteLane(ctx sdk.Context, id string) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyLanes) - // Delete the Lane - store.Delete([]byte(id)) -} diff --git a/x/blocksdk/keeper/keeper_test.go b/x/blocksdk/keeper/keeper_test.go deleted file mode 100644 index e887365..0000000 --- a/x/blocksdk/keeper/keeper_test.go +++ /dev/null @@ -1,131 +0,0 @@ -package keeper_test - -import ( - "testing" - - "cosmossdk.io/math" - - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/cosmos-sdk/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/stretchr/testify/suite" - - testutils "github.com/skip-mev/block-sdk/v2/testutils" - "github.com/skip-mev/block-sdk/v2/x/blocksdk/keeper" - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -type KeeperTestSuite struct { - suite.Suite - - blocksdKeeper keeper.Keeper - encCfg testutils.EncodingConfig - ctx sdk.Context - queryServer types.QueryServer - msgServer types.MsgServer - key *storetypes.KVStoreKey - authorityAccount sdk.AccAddress -} - -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} - -func (s *KeeperTestSuite) SetupTest() { - s.encCfg = testutils.CreateTestEncodingConfig() - s.key = storetypes.NewKVStoreKey(types.StoreKey) - testCtx := testutil.DefaultContextWithDB(s.T(), s.key, storetypes.NewTransientStoreKey("transient_test")) - s.ctx = testCtx.Ctx - s.authorityAccount = []byte("authority") - s.blocksdKeeper = keeper.NewKeeper( - s.encCfg.Codec, - s.key, - s.authorityAccount.String(), - ) - - s.msgServer = keeper.NewMsgServerImpl(s.blocksdKeeper) - s.queryServer = keeper.NewQueryServer(s.blocksdKeeper) -} - -func (s *KeeperTestSuite) TestLane() { - const ( - validLaneID1 = "test1" - validLaneID2 = "test2" - validLaneID3 = "test3" - invalidLaneID = "invalid" - ) - - lanes := []types.Lane{ - { - Id: validLaneID1, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.10"), - Order: 0, - }, - { - Id: validLaneID2, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.10"), - Order: 1, - }, - } - - for _, lane := range lanes { - err := s.blocksdKeeper.AddLane(s.ctx, lane) - s.Require().NoError(err) - } - - s.Run("get lane valid", func() { - gotLane, err := s.blocksdKeeper.GetLane(s.ctx, validLaneID1) - s.Require().NoError(err) - s.Require().Equal(lanes[0], gotLane) - }) - - s.Run("get lane invalid", func() { - _, err := s.blocksdKeeper.GetLane(s.ctx, invalidLaneID) - s.Require().Error(err) - }) - - s.Run("get lanes", func() { - gotLanes := s.blocksdKeeper.GetLanes(s.ctx) - s.Require().Equal(lanes, gotLanes) - }) - - s.Run("add invalid duplicate lane order", func() { - invalidLane := types.Lane{ - Id: validLaneID3, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.10"), - Order: 0, - } - - err := s.blocksdKeeper.AddLane(s.ctx, invalidLane) - s.Require().Error(err) - }) - - s.Run("add invalid duplicate lane ID", func() { - invalidLane := types.Lane{ - Id: validLaneID1, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.10"), - Order: 2, - } - - err := s.blocksdKeeper.AddLane(s.ctx, invalidLane) - s.Require().Error(err) - }) - - s.Run("add invalid non-monotonic order", func() { - invalidLane := types.Lane{ - Id: validLaneID3, - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.10"), - Order: 3, - } - - err := s.blocksdKeeper.AddLane(s.ctx, invalidLane) - s.Require().Error(err) - }) - - s.Run("delete valid", func() { - s.blocksdKeeper.DeleteLane(s.ctx, validLaneID1) - _, err := s.blocksdKeeper.GetLane(s.ctx, validLaneID1) - s.Require().Error(err) - }) -} diff --git a/x/blocksdk/keeper/msg_server.go b/x/blocksdk/keeper/msg_server.go deleted file mode 100644 index 3ada5b2..0000000 --- a/x/blocksdk/keeper/msg_server.go +++ /dev/null @@ -1,47 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -var _ types.MsgServer = MsgServer{} - -// MsgServer is the wrapper for the x/blocksdk module's msg service. -type MsgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the x/blocksdk MsgServer interface. -func NewMsgServerImpl(keeper Keeper) *MsgServer { - return &MsgServer{Keeper: keeper} -} - -// UpdateLane implements the message service for updating a lane that exists in the store. -func (m MsgServer) UpdateLane(goCtx context.Context, msg *types.MsgUpdateLane) (*types.MsgUpdateLaneResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - // ensure that the message signer is the authority - if msg.Authority != m.Keeper.GetAuthority() { - return nil, fmt.Errorf("this message can only be executed by the authority; expected %s, got %s", m.Keeper.GetAuthority(), msg.Authority) - } - - oldLane, err := m.GetLane(ctx, msg.Lane.Id) - if err != nil { - return nil, fmt.Errorf("lane with ID %s not found", msg.Lane.Id) - } - - if oldLane.Order != msg.Lane.Order { - return nil, fmt.Errorf("unable to change lane order using UpdateLane method") - } - - m.setLane(ctx, msg.Lane) - - // TODO emit event - - return nil, nil -} diff --git a/x/blocksdk/keeper/msg_server_test.go b/x/blocksdk/keeper/msg_server_test.go deleted file mode 100644 index f2bec69..0000000 --- a/x/blocksdk/keeper/msg_server_test.go +++ /dev/null @@ -1,144 +0,0 @@ -package keeper_test - -import ( - "math/rand" - "time" - - "cosmossdk.io/math" - - testutils "github.com/skip-mev/block-sdk/v2/testutils" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -func (s *KeeperTestSuite) TestMsgUpdateLane() { - rng := rand.New(rand.NewSource(time.Now().Unix())) - account := testutils.RandomAccounts(rng, 1)[0] - - // pre-register a lane - registeredLane := types.Lane{ - Id: "registered", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - } - - s.Require().NoError(s.blocksdKeeper.AddLane(s.ctx, registeredLane)) - testCases := []struct { - name string - msg *types.MsgUpdateLane - pass bool - passBasic bool - }{ - { - name: "invalid authority", - msg: &types.MsgUpdateLane{ - Authority: "invalid", - Lane: types.Lane{ - Id: "test", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - }, - passBasic: false, - pass: false, - }, - { - name: "invalid unauthorized authority", - msg: &types.MsgUpdateLane{ - Authority: account.Address.String(), - Lane: types.Lane{ - Id: "test", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - }, - passBasic: true, - pass: false, - }, - { - name: "invalid lane ID", - msg: &types.MsgUpdateLane{ - Authority: s.authorityAccount.String(), - Lane: types.Lane{ - Id: "", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - }, - passBasic: false, - pass: false, - }, - - { - name: "invalid MaxBlockSpace", - msg: &types.MsgUpdateLane{ - Authority: s.authorityAccount.String(), - Lane: types.Lane{ - Id: "", - MaxBlockSpace: math.LegacyMustNewDecFromStr("1.1"), - Order: 0, - }, - }, - passBasic: false, - pass: false, - }, - { - name: "invalid lane does not exist", - msg: &types.MsgUpdateLane{ - Authority: s.authorityAccount.String(), - Lane: types.Lane{ - Id: "invalid", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.1"), - Order: 0, - }, - }, - passBasic: true, - pass: false, - }, - { - name: "invalid order modification", - msg: &types.MsgUpdateLane{ - Authority: s.authorityAccount.String(), - Lane: types.Lane{ - Id: "registered", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 1, - }, - }, - passBasic: true, - pass: false, - }, - { - name: "valid", - msg: &types.MsgUpdateLane{ - Authority: s.authorityAccount.String(), - Lane: types.Lane{ - Id: "registered", - MaxBlockSpace: math.LegacyMustNewDecFromStr("0.2"), - Order: 0, - }, - }, - passBasic: true, - pass: true, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - if !tc.passBasic { - s.Require().Error(tc.msg.ValidateBasic()) - return - } - - _, err := s.msgServer.UpdateLane(s.ctx, tc.msg) - if tc.pass { - s.Require().NoError(err) - lane, err := s.blocksdKeeper.GetLane(s.ctx, tc.msg.Lane.Id) - s.Require().NoError(err) - s.Require().Equal(tc.msg.Lane, lane) - - } else { - s.Require().Error(err) - } - }) - } -} diff --git a/x/blocksdk/module.go b/x/blocksdk/module.go deleted file mode 100644 index cdce391..0000000 --- a/x/blocksdk/module.go +++ /dev/null @@ -1,186 +0,0 @@ -package blocksdk - -import ( - "context" - "encoding/json" - "fmt" - - "cosmossdk.io/core/appmodule" - "cosmossdk.io/depinject" - storetypes "cosmossdk.io/store/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - modulev1 "github.com/skip-mev/block-sdk/v2/api/sdk/blocksdk/module/v1" - "github.com/skip-mev/block-sdk/v2/x/blocksdk/client/cli" - "github.com/skip-mev/block-sdk/v2/x/blocksdk/keeper" - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -var ( - _ module.AppModuleBasic = AppModule{} - _ module.HasGenesis = AppModule{} - _ module.HasServices = AppModule{} - _ module.HasInvariants = AppModule{} - - _ appmodule.AppModule = AppModule{} -) - -// ConsensusVersion defines the current x/blocksdk module consensus version. -const ConsensusVersion = 1 - -// AppModuleBasic defines the basic application module used by the blocksdk module. -type AppModuleBasic struct { - cdc codec.Codec -} - -// Name returns the blocksdk module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec registers the blocksdk module's types on the given LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} - -// RegisterInterfaces registers the blocksdk module's interface types. -func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(registry) -} - -// DefaultGenesis returns default genesis state as raw bytes for the blocksdk module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) -} - -// ValidateGenesis performs genesis state validation for the blocksdk module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - - return genState.Validate() -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the blocksdk module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the root tx command for the blocksdk module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.NewTxCmd() -} - -// GetQueryCmd returns the root query command for the blocksdk module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper -} - -var _ appmodule.AppModule = AppModule{} - -// NewAppModule creates a new AppModule object. -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { - return AppModule{ - AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: keeper, - } -} - -// IsAppModule implements the appmodule.AppModule interface. -func (am AppModule) IsAppModule() {} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (am AppModule) IsOnePerModuleType() {} - -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } - -// RegisterServices registers the gRPC Query and Msg services for the x/blocksdk -// module. -func (am AppModule) RegisterServices(cfc module.Configurator) { - types.RegisterMsgServer(cfc.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfc.QueryServer(), keeper.NewQueryServer(am.keeper)) -} - -func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} - -// RegisterInvariants registers the invariants of the module. If an invariant -// deviates from its predicted value, the InvariantRegistry triggers appropriate -// logic (most often the chain will be halted). -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the module's genesis initialization for the blocksdk -// module. It returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { - var genState types.GenesisState - cdc.MustUnmarshalJSON(gs, &genState) - - am.keeper.InitGenesis(ctx, genState) -} - -// ExportGenesis returns the blocksdk module's exported genesis state as raw -// JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := am.keeper.ExportGenesis(ctx) - return cdc.MustMarshalJSON(genState) -} - -func init() { - appmodule.Register( - &modulev1.Module{}, - appmodule.Provide(ProvideModule), - ) -} - -type Inputs struct { - depinject.In - - Config *modulev1.Module - Cdc codec.Codec - Key *storetypes.KVStoreKey -} - -type Outputs struct { - depinject.Out - - BlockSDKkeeper keeper.Keeper - Module appmodule.AppModule -} - -func ProvideModule(in Inputs) Outputs { - // default to governance authority if not provided - authority := authtypes.NewModuleAddress(govtypes.ModuleName) - if in.Config.Authority != "" { - authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) - } - - blocksdkKeeper := keeper.NewKeeper( - in.Cdc, - in.Key, - authority.String(), - ) - - m := NewAppModule(in.Cdc, blocksdkKeeper) - - return Outputs{BlockSDKkeeper: blocksdkKeeper, Module: m} -} diff --git a/x/blocksdk/types/blocksdk.pb.go b/x/blocksdk/types/blocksdk.pb.go deleted file mode 100644 index 3f95149..0000000 --- a/x/blocksdk/types/blocksdk.pb.go +++ /dev/null @@ -1,424 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/blocksdk/v1/blocksdk.proto - -package types - -import ( - cosmossdk_io_math "cosmossdk.io/math" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Lane defines a block-sdk lane and its associated parameters. Only the -// parameters that are critical to consensus are stored on-chain in this object. -// The other associated configuration for a lane can be set and stored locally, -// per-validator. -type Lane struct { - // id is the unique identifier of a Lane. Maps to a block-sdk laneName. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // max_block_space defines the relative percentage of block space that can be - // used by this lane. NOTE: If this is set to zero, then there is no limit - // on the number of transactions that can be included in the block for this - // lane (up to maxTxBytes as provided by the request). This is useful for the - // default lane. - MaxBlockSpace cosmossdk_io_math.LegacyDec `protobuf:"bytes,2,opt,name=max_block_space,json=maxBlockSpace,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"max_block_space"` - // order is the priority ordering of the Lane when processed in - // PrepareProposal and ProcessProposal. Lane orders should be set in order of - // priority starting from 0, monotonically increasing and non-overlapping. A - // lane with a lower order value will have a higher priority over a lane with - // a higher order value. For example, if LaneA has priority of 0 and LaneB - // has a priority of 1, LaneA has priority over LaneB. - Order uint64 `protobuf:"varint,3,opt,name=order,proto3" json:"order,omitempty"` -} - -func (m *Lane) Reset() { *m = Lane{} } -func (m *Lane) String() string { return proto.CompactTextString(m) } -func (*Lane) ProtoMessage() {} -func (*Lane) Descriptor() ([]byte, []int) { - return fileDescriptor_f70e4127b99be786, []int{0} -} -func (m *Lane) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Lane) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Lane.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 *Lane) XXX_Merge(src proto.Message) { - xxx_messageInfo_Lane.Merge(m, src) -} -func (m *Lane) XXX_Size() int { - return m.Size() -} -func (m *Lane) XXX_DiscardUnknown() { - xxx_messageInfo_Lane.DiscardUnknown(m) -} - -var xxx_messageInfo_Lane proto.InternalMessageInfo - -func (m *Lane) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -func (m *Lane) GetOrder() uint64 { - if m != nil { - return m.Order - } - return 0 -} - -func init() { - proto.RegisterType((*Lane)(nil), "sdk.blocksdk.v1.Lane") -} - -func init() { proto.RegisterFile("sdk/blocksdk/v1/blocksdk.proto", fileDescriptor_f70e4127b99be786) } - -var fileDescriptor_f70e4127b99be786 = []byte{ - // 280 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0x4e, 0xc9, 0xd6, - 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x06, 0x31, 0xca, 0x0c, 0xe1, 0x6c, 0xbd, 0x82, 0xa2, 0xfc, 0x92, - 0x7c, 0x21, 0x7e, 0x10, 0x13, 0x2e, 0x56, 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, - 0xd3, 0x07, 0xb1, 0x20, 0xca, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x54, - 0x48, 0x32, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x38, 0x1e, 0xa2, 0x16, 0xc2, 0x81, 0x48, 0x29, 0xf5, - 0x30, 0x72, 0xb1, 0xf8, 0x24, 0xe6, 0xa5, 0x0a, 0xf1, 0x71, 0x31, 0x65, 0xa6, 0x48, 0x30, 0x2a, - 0x30, 0x6a, 0x70, 0x06, 0x31, 0x65, 0xa6, 0x08, 0xc5, 0x71, 0xf1, 0xe7, 0x26, 0x56, 0xc4, 0x83, - 0xed, 0x8b, 0x2f, 0x2e, 0x48, 0x4c, 0x4e, 0x95, 0x60, 0x02, 0x49, 0x3a, 0x99, 0x9d, 0xb8, 0x27, - 0xcf, 0x70, 0xeb, 0x9e, 0xbc, 0x34, 0xc4, 0x1c, 0x90, 0x5b, 0x32, 0xf3, 0xf5, 0x73, 0x13, 0x4b, - 0x32, 0xf4, 0x7c, 0x52, 0xd3, 0x13, 0x93, 0x2b, 0x5d, 0x52, 0x93, 0x2f, 0x6d, 0xd1, 0xe5, 0x82, - 0x5a, 0xe3, 0x92, 0x9a, 0xbc, 0xe2, 0xf9, 0x06, 0x2d, 0xc6, 0x20, 0xde, 0xdc, 0xc4, 0x0a, 0x27, - 0x90, 0x69, 0xc1, 0x20, 0xc3, 0x84, 0x44, 0xb8, 0x58, 0xf3, 0x8b, 0x52, 0x52, 0x8b, 0x24, 0x98, - 0x15, 0x18, 0x35, 0x58, 0x82, 0x20, 0x1c, 0x27, 0x8f, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, - 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, - 0x96, 0x63, 0x88, 0xd2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x2f, - 0xce, 0xce, 0x2c, 0xd0, 0xcd, 0x4d, 0x2d, 0x83, 0x84, 0x90, 0x2e, 0x28, 0xb8, 0x2a, 0x10, 0x21, - 0x57, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0xba, 0xb0, 0x4c, 0x7e, 0x56, 0x01, 0x00, 0x00, -} - -func (m *Lane) 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 *Lane) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Lane) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Order != 0 { - i = encodeVarintBlocksdk(dAtA, i, uint64(m.Order)) - i-- - dAtA[i] = 0x18 - } - { - size := m.MaxBlockSpace.Size() - i -= size - if _, err := m.MaxBlockSpace.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintBlocksdk(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintBlocksdk(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintBlocksdk(dAtA []byte, offset int, v uint64) int { - offset -= sovBlocksdk(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Lane) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovBlocksdk(uint64(l)) - } - l = m.MaxBlockSpace.Size() - n += 1 + l + sovBlocksdk(uint64(l)) - if m.Order != 0 { - n += 1 + sovBlocksdk(uint64(m.Order)) - } - return n -} - -func sovBlocksdk(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozBlocksdk(x uint64) (n int) { - return sovBlocksdk(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Lane) 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 ErrIntOverflowBlocksdk - } - 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: Lane: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Lane: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlocksdk - } - 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 ErrInvalidLengthBlocksdk - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBlocksdk - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBlockSpace", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlocksdk - } - 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 ErrInvalidLengthBlocksdk - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthBlocksdk - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MaxBlockSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType) - } - m.Order = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlocksdk - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Order |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipBlocksdk(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBlocksdk - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipBlocksdk(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBlocksdk - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBlocksdk - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowBlocksdk - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthBlocksdk - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBlocksdk - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBlocksdk - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBlocksdk = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBlocksdk = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBlocksdk = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/blocksdk/types/codec.go b/x/blocksdk/types/codec.go deleted file mode 100644 index 050c486..0000000 --- a/x/blocksdk/types/codec.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/legacy" - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewLegacyAmino() -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - sdk.RegisterLegacyAminoCodec(amino) -} - -// RegisterLegacyAminoCodec registers the necessary x/blocksdk interfaces and -// concrete types on the provided LegacyAmino codec. These types are used for -// Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - legacy.RegisterAminoMsg(cdc, &MsgUpdateLane{}, "block-sdk/x/blocksdk/MsgUpdateLane") -} - -// RegisterInterfaces registers the x/blocksdk interfaces types with the -// interface registry. -func RegisterInterfaces(registry types.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgUpdateLane{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} diff --git a/x/blocksdk/types/genesis.go b/x/blocksdk/types/genesis.go deleted file mode 100644 index e1acc61..0000000 --- a/x/blocksdk/types/genesis.go +++ /dev/null @@ -1,34 +0,0 @@ -package types - -import ( - "encoding/json" - - "github.com/cosmos/cosmos-sdk/codec" -) - -// NewGenesisState creates a new GenesisState instance. -func NewGenesisState() *GenesisState { - return &GenesisState{} -} - -// DefaultGenesisState returns the default GenesisState instance. -func DefaultGenesisState() *GenesisState { - return &GenesisState{} -} - -// Validate performs basic validation of the blocksdk module genesis state. -func (gs GenesisState) Validate() error { - return Lanes(gs.Lanes).ValidateBasic() -} - -// GetGenesisStateFromAppState returns x/blocksdk GenesisState given raw application -// genesis state. -func GetGenesisStateFromAppState(cdc codec.Codec, appState map[string]json.RawMessage) GenesisState { - var genesisState GenesisState - - if appState[ModuleName] != nil { - cdc.MustUnmarshalJSON(appState[ModuleName], &genesisState) - } - - return genesisState -} diff --git a/x/blocksdk/types/genesis.pb.go b/x/blocksdk/types/genesis.pb.go deleted file mode 100644 index 75f371c..0000000 --- a/x/blocksdk/types/genesis.pb.go +++ /dev/null @@ -1,331 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/blocksdk/v1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the genesis state of the x/blocksdk module. -type GenesisState struct { - // lanes is the list of all configured lanes at genesis time. - Lanes []Lane `protobuf:"bytes,1,rep,name=lanes,proto3" json:"lanes"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_b356885c34672c5f, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetLanes() []Lane { - if m != nil { - return m.Lanes - } - return nil -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "sdk.blocksdk.v1.GenesisState") -} - -func init() { proto.RegisterFile("sdk/blocksdk/v1/genesis.proto", fileDescriptor_b356885c34672c5f) } - -var fileDescriptor_b356885c34672c5f = []byte{ - // 199 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x4e, 0xc9, 0xd6, - 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x06, 0x31, 0xca, 0x0c, 0xf5, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, - 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xf8, 0x8b, 0x53, 0xb2, 0xf5, 0x60, 0xd2, 0x7a, - 0x65, 0x86, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, 0x39, 0x7d, 0x10, 0x0b, 0xa2, 0x4c, 0x4a, - 0x0e, 0xdd, 0x14, 0xb8, 0x16, 0xb0, 0xbc, 0x92, 0x23, 0x17, 0x8f, 0x3b, 0xc4, 0xdc, 0xe0, 0x92, - 0xc4, 0x92, 0x54, 0x21, 0x43, 0x2e, 0xd6, 0x9c, 0xc4, 0xbc, 0xd4, 0x62, 0x09, 0x46, 0x05, 0x66, - 0x0d, 0x6e, 0x23, 0x51, 0x3d, 0x34, 0x6b, 0xf4, 0x7c, 0x12, 0xf3, 0x52, 0x9d, 0x58, 0x4e, 0xdc, - 0x93, 0x67, 0x08, 0x82, 0xa8, 0x74, 0xf2, 0x38, 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, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0xfd, 0xe2, 0xec, - 0xcc, 0x02, 0xdd, 0xdc, 0xd4, 0x32, 0x88, 0x03, 0x74, 0x41, 0xae, 0xa9, 0x40, 0x38, 0xac, 0xa4, - 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x26, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x68, - 0xfa, 0x64, 0x9d, 0xfb, 0x00, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Lanes) > 0 { - for iNdEx := len(m.Lanes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Lanes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Lanes) > 0 { - for _, e := range m.Lanes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lanes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Lanes = append(m.Lanes, Lane{}) - if err := m.Lanes[len(m.Lanes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/blocksdk/types/genesis_test.go b/x/blocksdk/types/genesis_test.go deleted file mode 100644 index f70fd9c..0000000 --- a/x/blocksdk/types/genesis_test.go +++ /dev/null @@ -1,4 +0,0 @@ -package types_test - -// TODO add tests if genesis expands. -// Currently is fully covered by TestLanes_ValidateBasic diff --git a/x/blocksdk/types/keys.go b/x/blocksdk/types/keys.go deleted file mode 100644 index 1224e57..0000000 --- a/x/blocksdk/types/keys.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -const ( - // ModuleName is the name of the blocksdk module - ModuleName = "blocksdk" - - // StoreKey is the default store key for the blocksdk module - StoreKey = ModuleName - - // RouterKey is the message route for the blocksdk module - RouterKey = ModuleName - - // QuerierRoute is the querier route for the blocksdk module - QuerierRoute = ModuleName -) - -const ( - prefixLanes = iota -) - -// KeyLanes is the store key for the lanes. -var KeyLanes = []byte{prefixLanes} diff --git a/x/blocksdk/types/lane.go b/x/blocksdk/types/lane.go deleted file mode 100644 index 0d20efa..0000000 --- a/x/blocksdk/types/lane.go +++ /dev/null @@ -1,66 +0,0 @@ -package types - -import ( - "fmt" - - "cosmossdk.io/math" -) - -// Lanes is a type alias for a slice of Lane objects. -type Lanes []Lane - -// ValidateBasic performs stateless validation of a Lane. -func (l *Lane) ValidateBasic() error { - if l.Id == "" { - return fmt.Errorf("lane must have an id specified") - } - - if l.MaxBlockSpace.IsNil() || l.MaxBlockSpace.IsNegative() || l.MaxBlockSpace.GT(math.LegacyOneDec()) { - return fmt.Errorf("max block space must be set to a value between 0 and 1") - } - - return nil -} - -// ValidateBasic performs stateless validation all Lanes. Performs lane.ValidateBasic() -// for each lane, verifies that order is monotonically increasing for all lanes, and -// checks that IDs are unique. -func (ls Lanes) ValidateBasic() error { - encounteredIDs := make(map[string]struct{}) - encounteredOrders := make(map[uint64]struct{}) - - // validate each lane and check that ID and order fields are unique - for _, l := range ls { - if err := l.ValidateBasic(); err != nil { - return err - } - - _, found := encounteredIDs[l.Id] - if found { - return fmt.Errorf("duplicate lane ID found: %s", l.Id) - } - - encounteredIDs[l.Id] = struct{}{} - - _, found = encounteredOrders[l.Order] - if found { - return fmt.Errorf("duplicate lane order found: %d", l.Order) - } - - encounteredOrders[l.Order] = struct{}{} - } - - // check if an order value is outside the expected range - // since all order values are already unique, if a value - // is greater than the total number of lanes it must break - // the rule of monotonicity - numLanes := uint64(len(ls)) - for order := range encounteredOrders { - // subtract 1 since orders starts at 0 - if order > numLanes-1 { - return fmt.Errorf("orders are not set in a monotonically increasing order: order value: %d", order) - } - } - - return nil -} diff --git a/x/blocksdk/types/lane_test.go b/x/blocksdk/types/lane_test.go deleted file mode 100644 index 680ba97..0000000 --- a/x/blocksdk/types/lane_test.go +++ /dev/null @@ -1,187 +0,0 @@ -package types_test - -import ( - "testing" - - "cosmossdk.io/math" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -func TestLane_ValidateBasic(t *testing.T) { - tests := []struct { - name string - lane types.Lane - wantErr bool - }{ - { - name: "invalid no id", - lane: types.Lane{ - Id: "", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - wantErr: true, - }, - { - name: "invalid maxblockspace nil", - lane: types.Lane{ - Id: "free", - Order: 0, - }, - wantErr: true, - }, - { - name: "invalid maxblockspace negative", - lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyMustNewDecFromStr("-1.0"), - Order: 0, - }, - wantErr: true, - }, - { - name: "invalid maxblockspace greater than 1", - lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyMustNewDecFromStr("1.1"), - Order: 0, - }, - wantErr: true, - }, - { - name: "valid", - lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - wantErr: false, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - if err := tc.lane.ValidateBasic(); (err != nil) != tc.wantErr { - t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tc.wantErr) - } - }) - } -} - -func TestLanes_ValidateBasic(t *testing.T) { - tests := []struct { - name string - lanes types.Lanes - wantErr bool - }{ - { - name: "invalid validate basic (no id)", - lanes: types.Lanes{ - types.Lane{ - Id: "", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "invalid duplicate IDs", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 1, - }, - }, - wantErr: true, - }, - { - name: "invalid duplicate orders", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - types.Lane{ - Id: "mev", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "invalid duplicate orders", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - types.Lane{ - Id: "mev", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "invalid orders non-monotonic", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - types.Lane{ - Id: "mev", - MaxBlockSpace: math.LegacyOneDec(), - Order: 2, - }, - }, - wantErr: true, - }, - { - name: "valid single", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: false, - }, - { - name: "valid multiple", - lanes: types.Lanes{ - types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - types.Lane{ - Id: "mev", - MaxBlockSpace: math.LegacyOneDec(), - Order: 1, - }, - }, - wantErr: false, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - if err := tc.lanes.ValidateBasic(); (err != nil) != tc.wantErr { - t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tc.wantErr) - } - }) - } -} diff --git a/x/blocksdk/types/msgs.go b/x/blocksdk/types/msgs.go deleted file mode 100644 index d029b21..0000000 --- a/x/blocksdk/types/msgs.go +++ /dev/null @@ -1,28 +0,0 @@ -package types - -import ( - "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ sdk.Msg = &MsgUpdateLane{} - -// GetSignBytes implements the LegacyMsg interface. -func (m *MsgUpdateLane) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -} - -// GetSigners returns the expected signers for a MsgUpdateLane message. -func (m *MsgUpdateLane) GetSigners() []sdk.AccAddress { - addr, _ := sdk.AccAddressFromBech32(m.Authority) - return []sdk.AccAddress{addr} -} - -// ValidateBasic does a sanity check on the provided data. -func (m *MsgUpdateLane) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(m.Authority); err != nil { - return errors.Wrap(err, "invalid authority address") - } - - return m.Lane.ValidateBasic() -} diff --git a/x/blocksdk/types/msgs_test.go b/x/blocksdk/types/msgs_test.go deleted file mode 100644 index 93b6618..0000000 --- a/x/blocksdk/types/msgs_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package types_test - -import ( - "math/rand" - "testing" - "time" - - "cosmossdk.io/math" - - "github.com/skip-mev/block-sdk/v2/testutils" - - "github.com/skip-mev/block-sdk/v2/x/blocksdk/types" -) - -func TestMsgUpdateLane_ValidateBasic(t *testing.T) { - testAcc := testutils.RandomAccounts(rand.New(rand.NewSource(time.Now().Unix())), 1)[0] - - tests := []struct { - name string - msg types.MsgUpdateLane - wantErr bool - }{ - { - name: "invalid empty authority", - msg: types.MsgUpdateLane{ - Authority: "", - Lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "invalid authority", - msg: types.MsgUpdateLane{ - Authority: "invalid", - Lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "invalid lane", - msg: types.MsgUpdateLane{ - Authority: testAcc.Address.String(), - Lane: types.Lane{ - Id: "", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: true, - }, - { - name: "valid", - msg: types.MsgUpdateLane{ - Authority: testAcc.Address.String(), - Lane: types.Lane{ - Id: "free", - MaxBlockSpace: math.LegacyOneDec(), - Order: 0, - }, - }, - wantErr: false, - }, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - if err := tc.msg.ValidateBasic(); (err != nil) != tc.wantErr { - t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tc.wantErr) - } - }) - } -} diff --git a/x/blocksdk/types/query.pb.go b/x/blocksdk/types/query.pb.go deleted file mode 100644 index beb7e09..0000000 --- a/x/blocksdk/types/query.pb.go +++ /dev/null @@ -1,932 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/blocksdk/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// QueryLaneRequest is the request type for the Query/Lane RPC method. -type QueryLaneRequest struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryLaneRequest) Reset() { *m = QueryLaneRequest{} } -func (m *QueryLaneRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLaneRequest) ProtoMessage() {} -func (*QueryLaneRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0c631e2e97c81d34, []int{0} -} -func (m *QueryLaneRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLaneRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLaneRequest.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 *QueryLaneRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLaneRequest.Merge(m, src) -} -func (m *QueryLaneRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryLaneRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLaneRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLaneRequest proto.InternalMessageInfo - -func (m *QueryLaneRequest) GetId() string { - if m != nil { - return m.Id - } - return "" -} - -// QueryLaneResponse is the response type for the Query/Lane RPC method. -type QueryLaneResponse struct { - Lane Lane `protobuf:"bytes,1,opt,name=lane,proto3" json:"lane"` -} - -func (m *QueryLaneResponse) Reset() { *m = QueryLaneResponse{} } -func (m *QueryLaneResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLaneResponse) ProtoMessage() {} -func (*QueryLaneResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0c631e2e97c81d34, []int{1} -} -func (m *QueryLaneResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLaneResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLaneResponse.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 *QueryLaneResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLaneResponse.Merge(m, src) -} -func (m *QueryLaneResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryLaneResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLaneResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLaneResponse proto.InternalMessageInfo - -func (m *QueryLaneResponse) GetLane() Lane { - if m != nil { - return m.Lane - } - return Lane{} -} - -// QueryLaneRequest is the request type for the Query/Lanes RPC method. -type QueryLanesRequest struct { -} - -func (m *QueryLanesRequest) Reset() { *m = QueryLanesRequest{} } -func (m *QueryLanesRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLanesRequest) ProtoMessage() {} -func (*QueryLanesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_0c631e2e97c81d34, []int{2} -} -func (m *QueryLanesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLanesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLanesRequest.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 *QueryLanesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLanesRequest.Merge(m, src) -} -func (m *QueryLanesRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryLanesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLanesRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLanesRequest proto.InternalMessageInfo - -// QueryLaneResponse is the response type for the Query/Lanes RPC method. -type QueryLanesResponse struct { - Lanes []Lane `protobuf:"bytes,1,rep,name=lanes,proto3" json:"lanes"` -} - -func (m *QueryLanesResponse) Reset() { *m = QueryLanesResponse{} } -func (m *QueryLanesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLanesResponse) ProtoMessage() {} -func (*QueryLanesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_0c631e2e97c81d34, []int{3} -} -func (m *QueryLanesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLanesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLanesResponse.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 *QueryLanesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLanesResponse.Merge(m, src) -} -func (m *QueryLanesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryLanesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLanesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLanesResponse proto.InternalMessageInfo - -func (m *QueryLanesResponse) GetLanes() []Lane { - if m != nil { - return m.Lanes - } - return nil -} - -func init() { - proto.RegisterType((*QueryLaneRequest)(nil), "sdk.blocksdk.v1.QueryLaneRequest") - proto.RegisterType((*QueryLaneResponse)(nil), "sdk.blocksdk.v1.QueryLaneResponse") - proto.RegisterType((*QueryLanesRequest)(nil), "sdk.blocksdk.v1.QueryLanesRequest") - proto.RegisterType((*QueryLanesResponse)(nil), "sdk.blocksdk.v1.QueryLanesResponse") -} - -func init() { proto.RegisterFile("sdk/blocksdk/v1/query.proto", fileDescriptor_0c631e2e97c81d34) } - -var fileDescriptor_0c631e2e97c81d34 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x4a, 0xeb, 0x40, - 0x14, 0x87, 0x93, 0xdc, 0xf6, 0xc2, 0x9d, 0x0b, 0xfe, 0x19, 0x15, 0x4a, 0x5a, 0xc6, 0x3a, 0x6e, - 0x54, 0xe8, 0x0c, 0xad, 0x6f, 0x50, 0x04, 0x5d, 0xb8, 0xb1, 0x4b, 0x77, 0x69, 0x33, 0xc4, 0x21, - 0x6d, 0x26, 0xed, 0xa4, 0xc5, 0x52, 0xdd, 0x74, 0xe5, 0x52, 0xf0, 0x45, 0x7c, 0x8c, 0x2e, 0x0b, - 0x6e, 0x5c, 0x89, 0xb4, 0x82, 0xaf, 0x21, 0x33, 0x49, 0x6d, 0x88, 0x10, 0x77, 0x87, 0x39, 0xdf, - 0x7c, 0xe7, 0x77, 0x86, 0x01, 0x65, 0xe9, 0xfa, 0xb4, 0xdd, 0x15, 0x1d, 0x5f, 0x15, 0xa3, 0x3a, - 0xed, 0x0f, 0xd9, 0x60, 0x4c, 0xc2, 0x81, 0x88, 0x04, 0xdc, 0x94, 0xae, 0x4f, 0x56, 0x4d, 0x32, - 0xaa, 0xdb, 0x15, 0x4f, 0x08, 0xaf, 0xcb, 0xa8, 0x13, 0x72, 0xea, 0x04, 0x81, 0x88, 0x9c, 0x88, - 0x8b, 0x40, 0xc6, 0xb8, 0xbd, 0xeb, 0x09, 0x4f, 0xe8, 0x92, 0xaa, 0x2a, 0x39, 0x2d, 0x77, 0x84, - 0xec, 0x09, 0x19, 0x8b, 0x33, 0x13, 0x6c, 0x94, 0x1d, 0xff, 0x3d, 0x4d, 0xf7, 0x31, 0x06, 0x5b, - 0x57, 0x0a, 0xbf, 0x74, 0x02, 0xd6, 0x62, 0xfd, 0x21, 0x93, 0x11, 0xdc, 0x00, 0x16, 0x77, 0x4b, - 0x66, 0xd5, 0x3c, 0xfa, 0xd7, 0xb2, 0xb8, 0x8b, 0xcf, 0xc0, 0x76, 0x8a, 0x91, 0xa1, 0x08, 0x24, - 0x83, 0x14, 0x14, 0xba, 0x4e, 0xc0, 0x34, 0xf6, 0xbf, 0xb1, 0x47, 0x32, 0x9b, 0x10, 0x05, 0x37, - 0x0b, 0xb3, 0xb7, 0x7d, 0xa3, 0xa5, 0x41, 0xbc, 0x93, 0xb2, 0xc8, 0x64, 0x14, 0x3e, 0x07, 0x30, - 0x7d, 0x98, 0xb8, 0xeb, 0xa0, 0xa8, 0xae, 0xc8, 0x92, 0x59, 0xfd, 0xf3, 0x9b, 0x3c, 0x26, 0x1b, - 0x53, 0x0b, 0x14, 0xb5, 0x09, 0xde, 0x81, 0x82, 0x6a, 0xc3, 0x83, 0x1f, 0xb7, 0xb2, 0x8b, 0xda, - 0x38, 0x0f, 0x89, 0xb3, 0xe0, 0xda, 0xc3, 0xe7, 0xf3, 0x89, 0x39, 0x7d, 0xf9, 0x78, 0xb2, 0x30, - 0xac, 0xc6, 0xcf, 0x57, 0xcb, 0x3e, 0xaa, 0xca, 0x40, 0x27, 0xdc, 0xbd, 0x87, 0x13, 0x50, 0xd4, - 0xbb, 0xc0, 0x1c, 0xf7, 0x6a, 0x7b, 0xfb, 0x30, 0x97, 0x49, 0x02, 0x1c, 0xaf, 0x03, 0x20, 0x58, - 0xc9, 0x09, 0x20, 0x9b, 0x17, 0xb3, 0x05, 0x32, 0xe7, 0x0b, 0x64, 0xbe, 0x2f, 0x90, 0xf9, 0xb8, - 0x44, 0xc6, 0x7c, 0x89, 0x8c, 0xd7, 0x25, 0x32, 0xae, 0x89, 0xc7, 0xa3, 0x9b, 0x61, 0x9b, 0x74, - 0x44, 0x8f, 0x4a, 0x9f, 0x87, 0xb5, 0x1e, 0x1b, 0xa5, 0x54, 0xb7, 0x6b, 0x59, 0x34, 0x0e, 0x99, - 0x6c, 0xff, 0xd5, 0xbf, 0xe3, 0xf4, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x49, 0x58, 0x65, 0x30, 0xbe, - 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Lane queries the a lane by its id. - Lane(ctx context.Context, in *QueryLaneRequest, opts ...grpc.CallOption) (*QueryLaneResponse, error) - // Lane queries all lanes in the x/blocksdk module - Lanes(ctx context.Context, in *QueryLanesRequest, opts ...grpc.CallOption) (*QueryLanesResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Lane(ctx context.Context, in *QueryLaneRequest, opts ...grpc.CallOption) (*QueryLaneResponse, error) { - out := new(QueryLaneResponse) - err := c.cc.Invoke(ctx, "/sdk.blocksdk.v1.Query/Lane", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) Lanes(ctx context.Context, in *QueryLanesRequest, opts ...grpc.CallOption) (*QueryLanesResponse, error) { - out := new(QueryLanesResponse) - err := c.cc.Invoke(ctx, "/sdk.blocksdk.v1.Query/Lanes", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Lane queries the a lane by its id. - Lane(context.Context, *QueryLaneRequest) (*QueryLaneResponse, error) - // Lane queries all lanes in the x/blocksdk module - Lanes(context.Context, *QueryLanesRequest) (*QueryLanesResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Lane(ctx context.Context, req *QueryLaneRequest) (*QueryLaneResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Lane not implemented") -} -func (*UnimplementedQueryServer) Lanes(ctx context.Context, req *QueryLanesRequest) (*QueryLanesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Lanes not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Lane_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLaneRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Lane(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sdk.blocksdk.v1.Query/Lane", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Lane(ctx, req.(*QueryLaneRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_Lanes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLanesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Lanes(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sdk.blocksdk.v1.Query/Lanes", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Lanes(ctx, req.(*QueryLanesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.blocksdk.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Lane", - Handler: _Query_Lane_Handler, - }, - { - MethodName: "Lanes", - Handler: _Query_Lanes_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "sdk/blocksdk/v1/query.proto", -} - -func (m *QueryLaneRequest) 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 *QueryLaneRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLaneRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryLaneResponse) 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 *QueryLaneResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLaneResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Lane.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 *QueryLanesRequest) 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 *QueryLanesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLanesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryLanesResponse) 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 *QueryLanesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLanesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Lanes) > 0 { - for iNdEx := len(m.Lanes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Lanes[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 *QueryLaneRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Id) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryLaneResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Lane.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryLanesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryLanesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Lanes) > 0 { - for _, e := range m.Lanes { - 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 *QueryLaneRequest) 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: QueryLaneRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLaneRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", 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.Id = 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 *QueryLaneResponse) 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: QueryLaneResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLaneResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lane", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Lane.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 *QueryLanesRequest) 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: QueryLanesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLanesRequest: 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 *QueryLanesResponse) 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: QueryLanesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLanesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lanes", 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.Lanes = append(m.Lanes, Lane{}) - if err := m.Lanes[len(m.Lanes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/blocksdk/types/query.pb.gw.go b/x/blocksdk/types/query.pb.gw.go deleted file mode 100644 index 4a69555..0000000 --- a/x/blocksdk/types/query.pb.gw.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: sdk/blocksdk/v1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Lane_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLaneRequest - 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.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.Lane(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Lane_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLaneRequest - 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.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.Lane(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Lanes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLanesRequest - var metadata runtime.ServerMetadata - - msg, err := client.Lanes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Lanes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLanesRequest - var metadata runtime.ServerMetadata - - msg, err := server.Lanes(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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Lane_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_Lane_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_Lane_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Lanes_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_Lanes_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_Lanes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Lane_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_Lane_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_Lane_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Lanes_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_Lanes_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_Lanes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Lane_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"block-sdk", "blocksdk", "v1", "lane", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Lanes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"block-sdk", "blocksdk", "v1", "lanes"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Lane_0 = runtime.ForwardResponseMessage - - forward_Query_Lanes_0 = runtime.ForwardResponseMessage -) diff --git a/x/blocksdk/types/tx.pb.go b/x/blocksdk/types/tx.pb.go deleted file mode 100644 index 156bbea..0000000 --- a/x/blocksdk/types/tx.pb.go +++ /dev/null @@ -1,592 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sdk/blocksdk/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgUpdateLane defines a request to update an existing lane in the store. -type MsgUpdateLane struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - Lane Lane `protobuf:"bytes,2,opt,name=lane,proto3" json:"lane"` -} - -func (m *MsgUpdateLane) Reset() { *m = MsgUpdateLane{} } -func (m *MsgUpdateLane) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateLane) ProtoMessage() {} -func (*MsgUpdateLane) Descriptor() ([]byte, []int) { - return fileDescriptor_fc6ccd9f56097321, []int{0} -} -func (m *MsgUpdateLane) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateLane) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateLane.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 *MsgUpdateLane) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateLane.Merge(m, src) -} -func (m *MsgUpdateLane) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateLane) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateLane.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateLane proto.InternalMessageInfo - -func (m *MsgUpdateLane) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateLane) GetLane() Lane { - if m != nil { - return m.Lane - } - return Lane{} -} - -// MsgUpdateLaneResponse defines a response to update an existing lane in the -// store. -type MsgUpdateLaneResponse struct { -} - -func (m *MsgUpdateLaneResponse) Reset() { *m = MsgUpdateLaneResponse{} } -func (m *MsgUpdateLaneResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateLaneResponse) ProtoMessage() {} -func (*MsgUpdateLaneResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fc6ccd9f56097321, []int{1} -} -func (m *MsgUpdateLaneResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateLaneResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateLaneResponse.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 *MsgUpdateLaneResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateLaneResponse.Merge(m, src) -} -func (m *MsgUpdateLaneResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateLaneResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateLaneResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateLaneResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgUpdateLane)(nil), "sdk.blocksdk.v1.MsgUpdateLane") - proto.RegisterType((*MsgUpdateLaneResponse)(nil), "sdk.blocksdk.v1.MsgUpdateLaneResponse") -} - -func init() { proto.RegisterFile("sdk/blocksdk/v1/tx.proto", fileDescriptor_fc6ccd9f56097321) } - -var fileDescriptor_fc6ccd9f56097321 = []byte{ - // 348 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x4e, 0xc9, 0xd6, - 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x06, 0x31, 0xca, 0x0c, 0xf5, 0x4b, 0x2a, 0xf4, 0x0a, 0x8a, 0xf2, - 0x4b, 0xf2, 0x85, 0xf8, 0x8b, 0x53, 0xb2, 0xf5, 0x60, 0x32, 0x7a, 0x65, 0x86, 0x52, 0x22, 0xe9, - 0xf9, 0xe9, 0xf9, 0x60, 0x39, 0x7d, 0x10, 0x0b, 0xa2, 0x4c, 0x4a, 0x3c, 0x39, 0xbf, 0x38, 0x37, - 0xbf, 0x58, 0x3f, 0xb7, 0x38, 0x1d, 0xa4, 0x3d, 0xb7, 0x38, 0x1d, 0x2a, 0x21, 0x09, 0x91, 0x88, - 0x87, 0xe8, 0x80, 0x70, 0xa0, 0x52, 0x82, 0x89, 0xb9, 0x99, 0x79, 0xf9, 0xfa, 0x60, 0x12, 0x2a, - 0x24, 0x87, 0xee, 0x0e, 0xb8, 0xcd, 0x60, 0x79, 0xa5, 0xcd, 0x8c, 0x5c, 0xbc, 0xbe, 0xc5, 0xe9, - 0xa1, 0x05, 0x29, 0x89, 0x25, 0xa9, 0x3e, 0x89, 0x79, 0xa9, 0x42, 0x66, 0x5c, 0x9c, 0x89, 0xa5, - 0x25, 0x19, 0xf9, 0x45, 0x99, 0x25, 0x95, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, 0x12, 0x97, - 0xb6, 0xe8, 0x8a, 0x40, 0x6d, 0x72, 0x4c, 0x49, 0x29, 0x4a, 0x2d, 0x2e, 0x0e, 0x2e, 0x29, 0xca, - 0xcc, 0x4b, 0x0f, 0x42, 0x28, 0x15, 0xd2, 0xe7, 0x62, 0xc9, 0x49, 0xcc, 0x4b, 0x95, 0x60, 0x52, - 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd5, 0x43, 0xf3, 0xa6, 0x1e, 0xc8, 0x70, 0x27, 0x96, 0x13, 0xf7, - 0xe4, 0x19, 0x82, 0xc0, 0x0a, 0xad, 0x2c, 0x5f, 0x2c, 0x90, 0x67, 0x68, 0x7a, 0xbe, 0x41, 0x0b, - 0x61, 0x48, 0xd7, 0xf3, 0x0d, 0x5a, 0x4a, 0x60, 0x4d, 0xba, 0x20, 0xe7, 0x56, 0x20, 0x5c, 0x8e, - 0xe2, 0x46, 0x25, 0x71, 0x2e, 0x51, 0x14, 0x81, 0xa0, 0xd4, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, - 0xa3, 0x24, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x10, 0x2e, 0x2e, 0x24, 0x1f, 0xc9, 0x61, 0xb8, - 0x05, 0x45, 0xb3, 0x94, 0x1a, 0x7e, 0x79, 0x98, 0xe1, 0x52, 0xac, 0x0d, 0xcf, 0x37, 0x68, 0x31, - 0x3a, 0x79, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, - 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x5e, 0x7a, 0x66, - 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x71, 0x76, 0x66, 0x81, 0x6e, 0x6e, 0x6a, - 0x99, 0x3e, 0x56, 0xef, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xe3, 0xc0, 0x18, 0x10, - 0x00, 0x00, 0xff, 0xff, 0x9b, 0x33, 0x0c, 0xc1, 0x2d, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // UpdateLane defines a method to update an existing lane in the store. - UpdateLane(ctx context.Context, in *MsgUpdateLane, opts ...grpc.CallOption) (*MsgUpdateLaneResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) UpdateLane(ctx context.Context, in *MsgUpdateLane, opts ...grpc.CallOption) (*MsgUpdateLaneResponse, error) { - out := new(MsgUpdateLaneResponse) - err := c.cc.Invoke(ctx, "/sdk.blocksdk.v1.Msg/UpdateLane", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // UpdateLane defines a method to update an existing lane in the store. - UpdateLane(context.Context, *MsgUpdateLane) (*MsgUpdateLaneResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) UpdateLane(ctx context.Context, req *MsgUpdateLane) (*MsgUpdateLaneResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateLane not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_UpdateLane_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateLane) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateLane(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/sdk.blocksdk.v1.Msg/UpdateLane", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateLane(ctx, req.(*MsgUpdateLane)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "sdk.blocksdk.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateLane", - Handler: _Msg_UpdateLane_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "sdk/blocksdk/v1/tx.proto", -} - -func (m *MsgUpdateLane) 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 *MsgUpdateLane) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateLane) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Lane.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 *MsgUpdateLaneResponse) 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 *MsgUpdateLaneResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateLaneResponse) 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 *MsgUpdateLane) 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)) - } - l = m.Lane.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgUpdateLaneResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgUpdateLane) 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: MsgUpdateLane: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateLane: 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 Lane", 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 - } - if err := m.Lane.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 *MsgUpdateLaneResponse) 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: MsgUpdateLaneResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateLaneResponse: 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 skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/blocksdk/types/tx.pb.gw.go b/x/blocksdk/types/tx.pb.gw.go deleted file mode 100644 index cb631e9..0000000 --- a/x/blocksdk/types/tx.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: sdk/blocksdk/v1/tx.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_UpdateLane_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_UpdateLane_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgUpdateLane - 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_Msg_UpdateLane_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UpdateLane(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_UpdateLane_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgUpdateLane - 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_Msg_UpdateLane_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UpdateLane(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_UpdateLane_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_Msg_UpdateLane_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_Msg_UpdateLane_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_UpdateLane_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_Msg_UpdateLane_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_UpdateLane_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_UpdateLane_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"block-sdk", "blocksdk", "v1", "update_lane"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_UpdateLane_0 = runtime.ForwardResponseMessage -)