From a7c813f89789cee3110cb0e7599cba378ff2609b Mon Sep 17 00:00:00 2001 From: keruch Date: Thu, 27 Jun 2024 11:57:31 +0200 Subject: [PATCH] feat(da): added interchain-da proto contracts --- proto/get_deps.sh | 15 + proto/protoc.sh | 1 + proto/types/cosmos/base/v1beta1/coin.proto | 43 + proto/types/cosmos/msg/v1/msg.proto | 22 + proto/types/interchain_da/da.proto | 24 + proto/types/interchain_da/query.proto | 39 + proto/types/interchain_da/tx.proto | 40 + third_party/proto/cosmos_proto/cosmos.proto | 112 +++ types/pb/interchain_da/da.pb.go | 576 +++++++++++ types/pb/interchain_da/query.pb.go | 960 +++++++++++++++++++ types/pb/interchain_da/tx.pb.go | 997 ++++++++++++++++++++ 11 files changed, 2829 insertions(+) create mode 100644 proto/types/cosmos/base/v1beta1/coin.proto create mode 100644 proto/types/cosmos/msg/v1/msg.proto create mode 100644 proto/types/interchain_da/da.proto create mode 100644 proto/types/interchain_da/query.proto create mode 100644 proto/types/interchain_da/tx.proto create mode 100644 third_party/proto/cosmos_proto/cosmos.proto create mode 100644 types/pb/interchain_da/da.pb.go create mode 100644 types/pb/interchain_da/query.pb.go create mode 100644 types/pb/interchain_da/tx.pb.go diff --git a/proto/get_deps.sh b/proto/get_deps.sh index c0ce5ca93..40c6558d4 100755 --- a/proto/get_deps.sh +++ b/proto/get_deps.sh @@ -25,3 +25,18 @@ for FILE in "${TM_PROTO_FILES[@]}"; do mkdir -p "tendermint/$(dirname $FILE)" curl -sSL "$TM_PROTO_URL/$FILE" > "tendermint/$FILE" done + +COSMOS_VERSION=v0.46.16 +COSMOS_PROTO_URL=https://raw.githubusercontent.com/cosmos/cosmos-sdk/$COSMOS_VERSION/proto/cosmos + +COSMOS_PROTO_FILES=( + base/v1beta1/coin.proto + msg/v1/msg.proto +) + +echo Fetching protobuf dependencies from Cosmos $COSMOS_VERSION +for FILE in "${COSMOS_PROTO_FILES[@]}"; do + echo Fetching "$FILE" + mkdir -p "cosmos/$(dirname $FILE)" + curl -sSL "$COSMOS_PROTO_URL/$FILE" > "cosmos/$FILE" +done diff --git a/proto/protoc.sh b/proto/protoc.sh index 5ee74f431..6e676b8ac 100755 --- a/proto/protoc.sh +++ b/proto/protoc.sh @@ -5,6 +5,7 @@ set -eo pipefail # Generate the `types` proto files buf generate --path="./proto/types/dalc" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/dymint" --template="buf.gen.yaml" --config="buf.yaml" +buf generate --path="./proto/types/interchain_da" --template="buf.gen.yaml" --config="buf.yaml" # Generate the `test` proto files buf generate --path="./proto/test" --template="buf.gen.yaml" --config="buf.yaml" diff --git a/proto/types/cosmos/base/v1beta1/coin.proto b/proto/types/cosmos/base/v1beta1/coin.proto new file mode 100644 index 000000000..69e67e099 --- /dev/null +++ b/proto/types/cosmos/base/v1beta1/coin.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package cosmos.base.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/types"; +option (gogoproto.goproto_stringer_all) = false; +option (gogoproto.stringer_all) = false; + +// Coin defines a token with a denomination and an amount. +// +// NOTE: The amount field is an Int which implements the custom method +// signatures required by gogoproto. +message Coin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecCoin defines a token with a denomination and a decimal amount. +// +// NOTE: The amount field is an Dec which implements the custom method +// signatures required by gogoproto. +message DecCoin { + option (gogoproto.equal) = true; + + string denom = 1; + string amount = 2 + [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} + +// IntProto defines a Protobuf wrapper around an Int object. +message IntProto { + string int = 1 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; +} + +// DecProto defines a Protobuf wrapper around a Dec object. +message DecProto { + string dec = 1 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; +} diff --git a/proto/types/cosmos/msg/v1/msg.proto b/proto/types/cosmos/msg/v1/msg.proto new file mode 100644 index 000000000..89bdf3129 --- /dev/null +++ b/proto/types/cosmos/msg/v1/msg.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; + +package cosmos.msg.v1; + +import "google/protobuf/descriptor.proto"; + +// TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated. +// We need this right now because gogoproto codegen needs to import the extension. +option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice"; + +extend google.protobuf.MessageOptions { + // signer must be used in cosmos messages in order + // to signal to external clients which fields in a + // given cosmos message must be filled with signer + // information (address). + // The field must be the protobuf name of the message + // field extended with this MessageOption. + // The field must either be of string kind, or of message + // kind in case the signer information is contained within + // a message inside the cosmos message. + repeated string signer = 11110000; +} \ No newline at end of file diff --git a/proto/types/interchain_da/da.proto b/proto/types/interchain_da/da.proto new file mode 100644 index 000000000..f647b9129 --- /dev/null +++ b/proto/types/interchain_da/da.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package dymension.interchain_da; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/interchain_da"; + +message Params { + // CostPerByte defines the coin cost to store each byte of the blob. This + // allows for multidimensional gas pricing on different resources of the + // network. + cosmos.base.v1beta1.Coin cost_per_byte = 1 [ (gogoproto.nullable) = false ]; + // MaxBlobSize is the hard cap of how many bytes a blob can be. + uint32 max_blob_size = 2; + // DisputePeriod is the number of blocks the blob is stored for. + uint64 dispute_period = 3; +} + +// BlobMetadata holds blob metadata, which is stored in the state. +message BlobMetadata { + // BlobHash is the hash of the submitted blob. + string blob_hash = 1; +} diff --git a/proto/types/interchain_da/query.proto b/proto/types/interchain_da/query.proto new file mode 100644 index 000000000..433c12e28 --- /dev/null +++ b/proto/types/interchain_da/query.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package dymension.interchain_da; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "types/interchain_da/da.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/interchain_da"; + +// Query defines the gRPC querier service. +service Query { + // Param queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {} + + // Blob queries the blob by the provided BlobID. + rpc Blob(QueryBlobRequest) returns (QueryBlobResponse) {} +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +// QueryBlobRequest is the request type for the Query/Blob RPC method. +message QueryBlobRequest { + // BlobID is a unique sequential ID of the blob. + uint64 blob_id = 1; +} + +// QueryBlobResponse is the response type for the Query/Blob RPC method. +message QueryBlobResponse { + // BlobMetadata stores stateful blob metadata. + BlobMetadata blob_metadata = 1 [ (gogoproto.nullable) = false ]; + // Blob is the actual blob. May be empty if the dispute period is over. + bytes blob = 2; +} diff --git a/proto/types/interchain_da/tx.proto b/proto/types/interchain_da/tx.proto new file mode 100644 index 000000000..b72214edb --- /dev/null +++ b/proto/types/interchain_da/tx.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package dymension.interchain_da; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "types/interchain_da/da.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/interchain_da"; + +// MsgUpdateParams allows to update module params. +message MsgUpdateParams { + // Authority is the address that controls the module. + option (cosmos.msg.v1.signer) = "authority"; + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // NewParams should be fully populated. + Params new_params = 2 [ (gogoproto.nullable) = false ]; +} + +message MsgUpdateParamsResponse {} + +// MsgSubmitBlob submits a new blob to the host chain. +message MsgSubmitBlob { + // Creator is the bech32 encoded address of the sequencer sending the update. + option (cosmos.msg.v1.signer) = "creator"; + string creator = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + // Blob that is sent. + bytes blob = 2; + // Fees defines the storage fees sent. + cosmos.base.v1beta1.Coin fees = 3 [ (gogoproto.nullable) = false ]; +} + +message MsgSubmitBlobResponse { + // BlobID is a unique sequential ID of the submitted blob. + uint64 blob_id = 1; + // BlobHash is the hash of the submitted blob. + string blob_hash = 2; +} \ No newline at end of file diff --git a/third_party/proto/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto new file mode 100644 index 000000000..ef8a95afe --- /dev/null +++ b/third_party/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto"; + +extend google.protobuf.MethodOptions { + + // method_added_in is used to indicate from which version the method was added. + string method_added_in = 93001; +} + +extend google.protobuf.MessageOptions { + + // implements_interface is used to indicate the type name of the interface + // that a message implements so that it can be used in google.protobuf.Any + // fields that accept that interface. A message can implement multiple + // interfaces. Interfaces should be declared using a declare_interface + // file option. + repeated string implements_interface = 93001; + + // message_added_in is used to indicate from which version the message was added. + string message_added_in = 93002; +} + +extend google.protobuf.FieldOptions { + + // accepts_interface is used to annotate that a google.protobuf.Any + // field accepts messages that implement the specified interface. + // Interfaces should be declared using a declare_interface file option. + string accepts_interface = 93001; + + // scalar is used to indicate that this field follows the formatting defined + // by the named scalar which should be declared with declare_scalar. Code + // generators may choose to use this information to map this field to a + // language-specific type representing the scalar. + string scalar = 93002; + + // field_added_in is used to indicate from which version the field was added. + string field_added_in = 93003; +} + +extend google.protobuf.FileOptions { + + // declare_interface declares an interface type to be used with + // accepts_interface and implements_interface. Interface names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given interface type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/interfaces.proto in the file descriptor set. + repeated InterfaceDescriptor declare_interface = 793021; + + // declare_scalar declares a scalar type to be used with + // the scalar field option. Scalar names are + // expected to follow the following convention such that their declaration + // can be discovered by tools: for a given scalar type a.b.C, it is + // expected that the declaration will be found in a protobuf file named + // a/b/scalars.proto in the file descriptor set. + repeated ScalarDescriptor declare_scalar = 793022; + + // file_added_in is used to indicate from which the version the file was added. + string file_added_in = 793023; +} + +// InterfaceDescriptor describes an interface type to be used with +// accepts_interface and implements_interface and declared by declare_interface. +message InterfaceDescriptor { + + // name is the name of the interface. It should be a short-name (without + // a period) such that the fully qualified name of the interface will be + // package.name, ex. for the package a.b and interface named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the interface and its + // purpose. + string description = 2; +} + +// ScalarDescriptor describes an scalar type to be used with +// the scalar field option and declared by declare_scalar. +// Scalars extend simple protobuf built-in types with additional +// syntax and semantics, for instance to represent big integers. +// Scalars should ideally define an encoding such that there is only one +// valid syntactical representation for a given semantic meaning, +// i.e. the encoding should be deterministic. +message ScalarDescriptor { + + // name is the name of the scalar. It should be a short-name (without + // a period) such that the fully qualified name of the scalar will be + // package.name, ex. for the package a.b and scalar named C, the + // fully-qualified name will be a.b.C. + string name = 1; + + // description is a human-readable description of the scalar and its + // encoding format. For instance a big integer or decimal scalar should + // specify precisely the expected encoding format. + string description = 2; + + // field_type is the type of field with which this scalar can be used. + // Scalars can be used with one and only one type of field so that + // encoding standards and simple and clear. Currently only string and + // bytes fields are supported for scalars. + repeated ScalarType field_type = 3; +} + +enum ScalarType { + SCALAR_TYPE_UNSPECIFIED = 0; + SCALAR_TYPE_STRING = 1; + SCALAR_TYPE_BYTES = 2; +} \ No newline at end of file diff --git a/types/pb/interchain_da/da.pb.go b/types/pb/interchain_da/da.pb.go new file mode 100644 index 000000000..0f7829bca --- /dev/null +++ b/types/pb/interchain_da/da.pb.go @@ -0,0 +1,576 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/interchain_da/da.proto + +package interchain_da + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 + +type Params struct { + // CostPerByte defines the coin cost to store each byte of the blob. This + // allows for multidimensional gas pricing on different resources of the + // network. + CostPerByte types.Coin `protobuf:"bytes,1,opt,name=cost_per_byte,json=costPerByte,proto3" json:"cost_per_byte"` + // MaxBlobSize is the hard cap of how many bytes a blob can be. + MaxBlobSize uint32 `protobuf:"varint,2,opt,name=max_blob_size,json=maxBlobSize,proto3" json:"max_blob_size,omitempty"` + // DisputePeriod is the number of blocks the blob is stored for. + DisputePeriod uint64 `protobuf:"varint,3,opt,name=dispute_period,json=disputePeriod,proto3" json:"dispute_period,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_c9a26af1837c1a56, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetCostPerByte() types.Coin { + if m != nil { + return m.CostPerByte + } + return types.Coin{} +} + +func (m *Params) GetMaxBlobSize() uint32 { + if m != nil { + return m.MaxBlobSize + } + return 0 +} + +func (m *Params) GetDisputePeriod() uint64 { + if m != nil { + return m.DisputePeriod + } + return 0 +} + +// BlobMetadata holds blob metadata, which is stored in the state. +type BlobMetadata struct { + // BlobHash is the hash of the submitted blob. + BlobHash string `protobuf:"bytes,1,opt,name=blob_hash,json=blobHash,proto3" json:"blob_hash,omitempty"` +} + +func (m *BlobMetadata) Reset() { *m = BlobMetadata{} } +func (m *BlobMetadata) String() string { return proto.CompactTextString(m) } +func (*BlobMetadata) ProtoMessage() {} +func (*BlobMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_c9a26af1837c1a56, []int{1} +} +func (m *BlobMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlobMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlobMetadata.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 *BlobMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlobMetadata.Merge(m, src) +} +func (m *BlobMetadata) XXX_Size() int { + return m.Size() +} +func (m *BlobMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_BlobMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_BlobMetadata proto.InternalMessageInfo + +func (m *BlobMetadata) GetBlobHash() string { + if m != nil { + return m.BlobHash + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "dymension.interchain_da.Params") + proto.RegisterType((*BlobMetadata)(nil), "dymension.interchain_da.BlobMetadata") +} + +func init() { proto.RegisterFile("types/interchain_da/da.proto", fileDescriptor_c9a26af1837c1a56) } + +var fileDescriptor_c9a26af1837c1a56 = []byte{ + // 325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xc1, 0x4a, 0xc3, 0x30, + 0x1c, 0xc6, 0x1b, 0x1d, 0xc3, 0x75, 0xd6, 0x43, 0x11, 0x9c, 0x53, 0xea, 0x18, 0x0a, 0x03, 0x21, + 0x61, 0x8a, 0x2f, 0xd0, 0x5d, 0xbc, 0x88, 0xa3, 0xde, 0xbc, 0x94, 0x7f, 0xda, 0xb0, 0x06, 0xd6, + 0xfc, 0x4b, 0x93, 0xc9, 0xba, 0xa7, 0xf0, 0xe8, 0x23, 0xed, 0xb8, 0xa3, 0x27, 0x91, 0xed, 0x45, + 0x24, 0xed, 0x10, 0x76, 0x4b, 0x3e, 0xbe, 0xef, 0x97, 0xf0, 0x73, 0xaf, 0x4d, 0x55, 0x08, 0xcd, + 0xa4, 0x32, 0xa2, 0x4c, 0x32, 0x90, 0x2a, 0x4e, 0x81, 0xa5, 0x40, 0x8b, 0x12, 0x0d, 0xfa, 0x17, + 0x69, 0x95, 0x0b, 0xa5, 0x25, 0x2a, 0x7a, 0xd0, 0xe8, 0x9f, 0xcf, 0x70, 0x86, 0x75, 0x87, 0xd9, + 0x53, 0x53, 0xef, 0xdf, 0x36, 0xb0, 0x04, 0x75, 0x8e, 0x9a, 0x71, 0xd0, 0x82, 0x7d, 0x8c, 0xb9, + 0x30, 0x30, 0x66, 0x09, 0x4a, 0xd5, 0xb4, 0x86, 0x5f, 0xc4, 0x6d, 0x4f, 0xa1, 0x84, 0x5c, 0xfb, + 0x13, 0xd7, 0x4b, 0x50, 0x9b, 0xb8, 0x10, 0x65, 0xcc, 0x2b, 0x23, 0x7a, 0x64, 0x40, 0x46, 0xdd, + 0x87, 0x4b, 0xda, 0x20, 0xa8, 0x45, 0xd0, 0x3d, 0x82, 0x4e, 0x50, 0xaa, 0xb0, 0xb5, 0xfe, 0xb9, + 0x71, 0xa2, 0xae, 0x5d, 0x4d, 0x45, 0x19, 0x56, 0x46, 0xf8, 0x43, 0xd7, 0xcb, 0x61, 0x19, 0xf3, + 0x39, 0xf2, 0x58, 0xcb, 0x95, 0xe8, 0x1d, 0x0d, 0xc8, 0xc8, 0x8b, 0xba, 0x39, 0x2c, 0xc3, 0x39, + 0xf2, 0x37, 0xb9, 0x12, 0xfe, 0x9d, 0x7b, 0x96, 0x4a, 0x5d, 0x2c, 0x8c, 0xb0, 0x6f, 0x49, 0x4c, + 0x7b, 0xc7, 0x03, 0x32, 0x6a, 0x45, 0xde, 0x3e, 0x9d, 0xd6, 0xe1, 0xf0, 0xde, 0x3d, 0xb5, 0x93, + 0x17, 0x61, 0x20, 0x05, 0x03, 0xfe, 0x95, 0xdb, 0xa9, 0xb1, 0x19, 0xe8, 0xac, 0xfe, 0x5b, 0x27, + 0x3a, 0xb1, 0xc1, 0x33, 0xe8, 0x2c, 0x7c, 0x5d, 0x6f, 0x03, 0xb2, 0xd9, 0x06, 0xe4, 0x77, 0x1b, + 0x90, 0xcf, 0x5d, 0xe0, 0x6c, 0x76, 0x81, 0xf3, 0xbd, 0x0b, 0x9c, 0xf7, 0xa7, 0x99, 0x34, 0xd9, + 0x82, 0xd3, 0x04, 0x73, 0xf6, 0x6f, 0x70, 0x59, 0xad, 0xec, 0x45, 0x2a, 0xc3, 0x1a, 0x4d, 0x05, + 0x3f, 0xd4, 0xce, 0xdb, 0xb5, 0x9f, 0xc7, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0xa2, 0x93, + 0xfe, 0x94, 0x01, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.DisputePeriod != 0 { + i = encodeVarintDa(dAtA, i, uint64(m.DisputePeriod)) + i-- + dAtA[i] = 0x18 + } + if m.MaxBlobSize != 0 { + i = encodeVarintDa(dAtA, i, uint64(m.MaxBlobSize)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.CostPerByte.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDa(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BlobMetadata) 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 *BlobMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlobMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlobHash) > 0 { + i -= len(m.BlobHash) + copy(dAtA[i:], m.BlobHash) + i = encodeVarintDa(dAtA, i, uint64(len(m.BlobHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDa(dAtA []byte, offset int, v uint64) int { + offset -= sovDa(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.CostPerByte.Size() + n += 1 + l + sovDa(uint64(l)) + if m.MaxBlobSize != 0 { + n += 1 + sovDa(uint64(m.MaxBlobSize)) + } + if m.DisputePeriod != 0 { + n += 1 + sovDa(uint64(m.DisputePeriod)) + } + return n +} + +func (m *BlobMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BlobHash) + if l > 0 { + n += 1 + l + sovDa(uint64(l)) + } + return n +} + +func sovDa(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDa(x uint64) (n int) { + return sovDa(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowDa + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CostPerByte", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDa + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDa + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CostPerByte.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBlobSize", wireType) + } + m.MaxBlobSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxBlobSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisputePeriod", wireType) + } + m.DisputePeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisputePeriod |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDa(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDa + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlobMetadata) 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 ErrIntOverflowDa + } + 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: BlobMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlobMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDa + } + 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 ErrInvalidLengthDa + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDa + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlobHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDa(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDa + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDa(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, ErrIntOverflowDa + } + 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, ErrIntOverflowDa + } + 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, ErrIntOverflowDa + } + 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, ErrInvalidLengthDa + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDa + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDa + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDa = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDa = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDa = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/pb/interchain_da/query.pb.go b/types/pb/interchain_da/query.pb.go new file mode 100644 index 000000000..f53fb5aab --- /dev/null +++ b/types/pb/interchain_da/query.pb.go @@ -0,0 +1,960 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/interchain_da/query.proto + +package interchain_da + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 + +// QueryParamsRequest is the request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e8224b7b8c94c09f, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is the response type for the Query/Params RPC method. +type QueryParamsResponse struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e8224b7b8c94c09f, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// QueryBlobRequest is the request type for the Query/Blob RPC method. +type QueryBlobRequest struct { + // BlobID is a unique sequential ID of the blob. + BlobId uint64 `protobuf:"varint,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` +} + +func (m *QueryBlobRequest) Reset() { *m = QueryBlobRequest{} } +func (m *QueryBlobRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBlobRequest) ProtoMessage() {} +func (*QueryBlobRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e8224b7b8c94c09f, []int{2} +} +func (m *QueryBlobRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlobRequest.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 *QueryBlobRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlobRequest.Merge(m, src) +} +func (m *QueryBlobRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBlobRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlobRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlobRequest proto.InternalMessageInfo + +func (m *QueryBlobRequest) GetBlobId() uint64 { + if m != nil { + return m.BlobId + } + return 0 +} + +// QueryBlobResponse is the response type for the Query/Blob RPC method. +type QueryBlobResponse struct { + // BlobMetadata stores stateful blob metadata. + BlobMetadata BlobMetadata `protobuf:"bytes,1,opt,name=blob_metadata,json=blobMetadata,proto3" json:"blob_metadata"` + // Blob is the actual blob. May be empty if the dispute period is over. + Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty"` +} + +func (m *QueryBlobResponse) Reset() { *m = QueryBlobResponse{} } +func (m *QueryBlobResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBlobResponse) ProtoMessage() {} +func (*QueryBlobResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e8224b7b8c94c09f, []int{3} +} +func (m *QueryBlobResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBlobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBlobResponse.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 *QueryBlobResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBlobResponse.Merge(m, src) +} +func (m *QueryBlobResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBlobResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBlobResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBlobResponse proto.InternalMessageInfo + +func (m *QueryBlobResponse) GetBlobMetadata() BlobMetadata { + if m != nil { + return m.BlobMetadata + } + return BlobMetadata{} +} + +func (m *QueryBlobResponse) GetBlob() []byte { + if m != nil { + return m.Blob + } + return nil +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "dymension.interchain_da.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "dymension.interchain_da.QueryParamsResponse") + proto.RegisterType((*QueryBlobRequest)(nil), "dymension.interchain_da.QueryBlobRequest") + proto.RegisterType((*QueryBlobResponse)(nil), "dymension.interchain_da.QueryBlobResponse") +} + +func init() { proto.RegisterFile("types/interchain_da/query.proto", fileDescriptor_e8224b7b8c94c09f) } + +var fileDescriptor_e8224b7b8c94c09f = []byte{ + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x4b, 0xf3, 0x40, + 0x10, 0xc6, 0xb3, 0x2f, 0x79, 0xf3, 0xc2, 0xbe, 0x15, 0x74, 0x2d, 0xb4, 0x06, 0x49, 0x4b, 0x40, + 0xa8, 0x56, 0x12, 0xa8, 0x78, 0xf4, 0xd2, 0x9b, 0x07, 0xb1, 0x06, 0x4f, 0x5e, 0xc2, 0x6e, 0xb3, + 0xb4, 0x81, 0x26, 0x9b, 0x66, 0xb7, 0x60, 0xfc, 0x14, 0x7e, 0xac, 0xde, 0xec, 0xd1, 0x93, 0x48, + 0xfb, 0x45, 0x64, 0xff, 0x28, 0x2d, 0x5a, 0xe9, 0x6d, 0x67, 0xe6, 0x37, 0xf3, 0x3c, 0x3b, 0x0c, + 0x6c, 0x89, 0xaa, 0xa0, 0x3c, 0x4c, 0x73, 0x41, 0xcb, 0xe1, 0x18, 0xa7, 0x79, 0x9c, 0xe0, 0x70, + 0x3a, 0xa3, 0x65, 0x15, 0x14, 0x25, 0x13, 0x0c, 0x35, 0x92, 0x2a, 0xa3, 0x39, 0x4f, 0x59, 0x1e, + 0x6c, 0x40, 0x6e, 0x7d, 0xc4, 0x46, 0x4c, 0x31, 0xa1, 0x7c, 0x69, 0xdc, 0x3d, 0x1a, 0x32, 0x9e, + 0x31, 0x1e, 0xeb, 0x82, 0x0e, 0x4c, 0xe9, 0xf8, 0x27, 0xa9, 0x04, 0xeb, 0xaa, 0x5f, 0x87, 0xe8, + 0x4e, 0xca, 0x0e, 0x70, 0x89, 0x33, 0x1e, 0xd1, 0xe9, 0x8c, 0x72, 0xe1, 0xdf, 0xc3, 0xc3, 0x8d, + 0x2c, 0x2f, 0x58, 0xce, 0x29, 0xba, 0x82, 0x4e, 0xa1, 0x32, 0x4d, 0xd0, 0x06, 0x9d, 0xff, 0xbd, + 0x56, 0xb0, 0xc5, 0x65, 0xa0, 0x1b, 0xfb, 0xf6, 0xfc, 0xad, 0x65, 0x45, 0xa6, 0xc9, 0xef, 0xc2, + 0x7d, 0x35, 0xb5, 0x3f, 0x61, 0xc4, 0x28, 0xa1, 0x06, 0xfc, 0x47, 0x26, 0x8c, 0xc4, 0x69, 0xa2, + 0x66, 0xda, 0x91, 0x23, 0xc3, 0xeb, 0xc4, 0xaf, 0xe0, 0xc1, 0x1a, 0x6c, 0x0c, 0x0c, 0xe0, 0x9e, + 0xa2, 0x33, 0x2a, 0x70, 0x82, 0x05, 0x36, 0x3e, 0x4e, 0xb6, 0xfa, 0x90, 0xdd, 0x37, 0x06, 0x36, + 0x6e, 0x6a, 0x64, 0x2d, 0x87, 0x10, 0xb4, 0x65, 0xdc, 0xfc, 0xd3, 0x06, 0x9d, 0x5a, 0xa4, 0xde, + 0xbd, 0x17, 0x00, 0xff, 0x2a, 0x6d, 0x44, 0xa1, 0xa3, 0x7f, 0x82, 0xba, 0x5b, 0x25, 0xbe, 0xaf, + 0xcf, 0x3d, 0xdf, 0x0d, 0xd6, 0x9f, 0xf2, 0x2d, 0x14, 0x43, 0x5b, 0x1a, 0x45, 0xa7, 0xbf, 0xf7, + 0xad, 0xed, 0xcd, 0x3d, 0xdb, 0x05, 0xfd, 0x14, 0xe8, 0xdf, 0xce, 0x97, 0x1e, 0x58, 0x2c, 0x3d, + 0xf0, 0xbe, 0xf4, 0xc0, 0xf3, 0xca, 0xb3, 0x16, 0x2b, 0xcf, 0x7a, 0x5d, 0x79, 0xd6, 0xc3, 0xe5, + 0x28, 0x15, 0xe3, 0x19, 0x09, 0x86, 0x2c, 0x0b, 0xbf, 0x26, 0x3e, 0x56, 0x4f, 0x32, 0x48, 0x73, + 0x11, 0xea, 0xe3, 0x29, 0xc8, 0xe6, 0xfd, 0x10, 0x47, 0x5d, 0xcf, 0xc5, 0x47, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xef, 0x5f, 0xf0, 0x63, 0xc8, 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 { + // Param queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Blob queries the blob by the provided BlobID. + Blob(ctx context.Context, in *QueryBlobRequest, opts ...grpc.CallOption) (*QueryBlobResponse, error) +} + +type queryClient struct { + cc *grpc.ClientConn +} + +func NewQueryClient(cc *grpc.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/dymension.interchain_da.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Blob(ctx context.Context, in *QueryBlobRequest, opts ...grpc.CallOption) (*QueryBlobResponse, error) { + out := new(QueryBlobResponse) + err := c.cc.Invoke(ctx, "/dymension.interchain_da.Query/Blob", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Param queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Blob queries the blob by the provided BlobID. + Blob(context.Context, *QueryBlobRequest) (*QueryBlobResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Blob(ctx context.Context, req *QueryBlobRequest) (*QueryBlobResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Blob not implemented") +} + +func RegisterQueryServer(s *grpc.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymension.interchain_da.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Blob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBlobRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Blob(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymension.interchain_da.Query/Blob", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Blob(ctx, req.(*QueryBlobRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "dymension.interchain_da.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Blob", + Handler: _Query_Blob_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "types/interchain_da/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryBlobRequest) 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 *QueryBlobRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlobRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlobId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlobId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryBlobResponse) 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 *QueryBlobResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBlobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Blob) > 0 { + i -= len(m.Blob) + copy(dAtA[i:], m.Blob) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Blob))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.BlobMetadata.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 *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryBlobRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlobId != 0 { + n += 1 + sovQuery(uint64(m.BlobId)) + } + return n +} + +func (m *QueryBlobResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.BlobMetadata.Size() + n += 1 + l + sovQuery(uint64(l)) + l = len(m.Blob) + if l > 0 { + 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 *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params.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 *QueryBlobRequest) 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: QueryBlobRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlobRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobId", wireType) + } + m.BlobId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlobId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryBlobResponse) 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: QueryBlobResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBlobResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobMetadata", 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.BlobMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) + if m.Blob == nil { + m.Blob = []byte{} + } + 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/types/pb/interchain_da/tx.pb.go b/types/pb/interchain_da/tx.pb.go new file mode 100644 index 000000000..560311486 --- /dev/null +++ b/types/pb/interchain_da/tx.pb.go @@ -0,0 +1,997 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/interchain_da/tx.proto + +package interchain_da + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/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 + +// MsgUpdateParams allows to update module params. +type MsgUpdateParams struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NewParams should be fully populated. + NewParams Params `protobuf:"bytes,2,opt,name=new_params,json=newParams,proto3" json:"new_params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_15fe253ab05473c9, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetNewParams() Params { + if m != nil { + return m.NewParams + } + return Params{} +} + +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15fe253ab05473c9, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +// MsgSubmitBlob submits a new blob to the host chain. +type MsgSubmitBlob struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Blob that is sent. + Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty"` + // Fees defines the storage fees sent. + Fees types.Coin `protobuf:"bytes,3,opt,name=fees,proto3" json:"fees"` +} + +func (m *MsgSubmitBlob) Reset() { *m = MsgSubmitBlob{} } +func (m *MsgSubmitBlob) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitBlob) ProtoMessage() {} +func (*MsgSubmitBlob) Descriptor() ([]byte, []int) { + return fileDescriptor_15fe253ab05473c9, []int{2} +} +func (m *MsgSubmitBlob) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitBlob) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitBlob.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 *MsgSubmitBlob) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitBlob.Merge(m, src) +} +func (m *MsgSubmitBlob) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitBlob) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitBlob.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitBlob proto.InternalMessageInfo + +func (m *MsgSubmitBlob) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgSubmitBlob) GetBlob() []byte { + if m != nil { + return m.Blob + } + return nil +} + +func (m *MsgSubmitBlob) GetFees() types.Coin { + if m != nil { + return m.Fees + } + return types.Coin{} +} + +type MsgSubmitBlobResponse struct { + // BlobID is a unique sequential ID of the submitted blob. + BlobId uint64 `protobuf:"varint,1,opt,name=blob_id,json=blobId,proto3" json:"blob_id,omitempty"` + // BlobHash is the hash of the submitted blob. + BlobHash string `protobuf:"bytes,2,opt,name=blob_hash,json=blobHash,proto3" json:"blob_hash,omitempty"` +} + +func (m *MsgSubmitBlobResponse) Reset() { *m = MsgSubmitBlobResponse{} } +func (m *MsgSubmitBlobResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitBlobResponse) ProtoMessage() {} +func (*MsgSubmitBlobResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_15fe253ab05473c9, []int{3} +} +func (m *MsgSubmitBlobResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitBlobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitBlobResponse.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 *MsgSubmitBlobResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitBlobResponse.Merge(m, src) +} +func (m *MsgSubmitBlobResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitBlobResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitBlobResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitBlobResponse proto.InternalMessageInfo + +func (m *MsgSubmitBlobResponse) GetBlobId() uint64 { + if m != nil { + return m.BlobId + } + return 0 +} + +func (m *MsgSubmitBlobResponse) GetBlobHash() string { + if m != nil { + return m.BlobHash + } + return "" +} + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "dymension.interchain_da.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dymension.interchain_da.MsgUpdateParamsResponse") + proto.RegisterType((*MsgSubmitBlob)(nil), "dymension.interchain_da.MsgSubmitBlob") + proto.RegisterType((*MsgSubmitBlobResponse)(nil), "dymension.interchain_da.MsgSubmitBlobResponse") +} + +func init() { proto.RegisterFile("types/interchain_da/tx.proto", fileDescriptor_15fe253ab05473c9) } + +var fileDescriptor_15fe253ab05473c9 = []byte{ + // 450 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xb1, 0x6e, 0x13, 0x31, + 0x18, 0xc7, 0x73, 0x10, 0xb5, 0x9c, 0x29, 0x20, 0x59, 0x45, 0x49, 0x0a, 0x5c, 0xab, 0x88, 0xa1, + 0x42, 0xe2, 0xac, 0xb4, 0x82, 0xa1, 0x1b, 0x81, 0x01, 0x86, 0x08, 0x74, 0x15, 0x0b, 0x4b, 0x64, + 0x9f, 0xcd, 0x9d, 0xa5, 0x9e, 0x7d, 0xf2, 0xe7, 0xb4, 0x0d, 0x23, 0x4f, 0xc0, 0xcc, 0xc2, 0x2b, + 0x30, 0xf0, 0x10, 0x1d, 0x2b, 0x26, 0x26, 0x84, 0x92, 0x81, 0xd7, 0x40, 0xb6, 0x2f, 0x44, 0x87, + 0x40, 0x4c, 0xe7, 0xcf, 0xff, 0xff, 0xfd, 0xbf, 0x9f, 0xfd, 0x19, 0xdd, 0xb5, 0xf3, 0x5a, 0x00, + 0x91, 0xca, 0x0a, 0x93, 0x97, 0x54, 0xaa, 0x29, 0xa7, 0xc4, 0x9e, 0xa7, 0xb5, 0xd1, 0x56, 0xe3, + 0x1e, 0x9f, 0x57, 0x42, 0x81, 0xd4, 0x2a, 0x6d, 0x39, 0x76, 0xb6, 0x0b, 0x5d, 0x68, 0xef, 0x21, + 0x6e, 0x15, 0xec, 0x3b, 0xf7, 0x43, 0x58, 0xae, 0xa1, 0xd2, 0x40, 0x18, 0x05, 0x41, 0x4e, 0x47, + 0x4c, 0x58, 0x3a, 0x22, 0xb9, 0x96, 0xaa, 0x71, 0x0d, 0x82, 0x3e, 0x0d, 0xbf, 0x87, 0xa2, 0x91, + 0xee, 0xb5, 0x02, 0x2a, 0x28, 0xc8, 0xe9, 0xc8, 0x7d, 0x1a, 0xf9, 0xaf, 0xb0, 0x9c, 0x06, 0x75, + 0xf8, 0x29, 0x42, 0xb7, 0x26, 0x50, 0xbc, 0xae, 0x39, 0xb5, 0xe2, 0x15, 0x35, 0xb4, 0x02, 0xfc, + 0x18, 0xc5, 0x74, 0x66, 0x4b, 0x6d, 0xa4, 0x9d, 0xf7, 0xa3, 0xbd, 0x68, 0x3f, 0x1e, 0xf7, 0xbf, + 0x7e, 0x79, 0xb8, 0xdd, 0x74, 0x7d, 0xc2, 0xb9, 0x11, 0x00, 0xc7, 0xd6, 0x48, 0x55, 0x64, 0x6b, + 0x2b, 0x7e, 0x86, 0x90, 0x12, 0x67, 0xd3, 0xda, 0xa7, 0xf4, 0xaf, 0xec, 0x45, 0xfb, 0xd7, 0x0f, + 0x76, 0xd3, 0x7f, 0xdc, 0x46, 0x1a, 0x9a, 0x8d, 0xbb, 0x17, 0xdf, 0x77, 0x3b, 0x59, 0xac, 0xc4, + 0x59, 0xd8, 0x38, 0xba, 0xf9, 0xfe, 0xe7, 0xe7, 0x07, 0xeb, 0xd4, 0xe1, 0x00, 0xf5, 0xfe, 0x00, + 0xcc, 0x04, 0xd4, 0x5a, 0x81, 0x18, 0x7e, 0x8c, 0xd0, 0x8d, 0x09, 0x14, 0xc7, 0x33, 0x56, 0x49, + 0x3b, 0x3e, 0xd1, 0x0c, 0x1f, 0xa0, 0xcd, 0xdc, 0x08, 0x6a, 0xb5, 0xf9, 0x2f, 0xf8, 0xca, 0x88, + 0x31, 0xea, 0xb2, 0x13, 0xcd, 0x3c, 0xf0, 0x56, 0xe6, 0xd7, 0xf8, 0x10, 0x75, 0xdf, 0x0a, 0x01, + 0xfd, 0xab, 0xfe, 0x10, 0x83, 0xb4, 0x49, 0x70, 0xd3, 0x49, 0x9b, 0xe9, 0xa4, 0x4f, 0xb5, 0x54, + 0x0d, 0xbe, 0x37, 0x1f, 0x6d, 0x39, 0xf2, 0x55, 0xec, 0x70, 0x82, 0x6e, 0xb7, 0xd8, 0x56, 0xd4, + 0xb8, 0x87, 0x36, 0x5d, 0x8f, 0xa9, 0xe4, 0x9e, 0xb1, 0x9b, 0x6d, 0xb8, 0xf2, 0x05, 0xc7, 0x77, + 0x50, 0xec, 0x85, 0x92, 0x42, 0xe9, 0x69, 0xe2, 0xec, 0x9a, 0xdb, 0x78, 0x4e, 0xa1, 0x1c, 0xbf, + 0xbc, 0x58, 0x24, 0xd1, 0xe5, 0x22, 0x89, 0x7e, 0x2c, 0x92, 0xe8, 0xc3, 0x32, 0xe9, 0x5c, 0x2e, + 0x93, 0xce, 0xb7, 0x65, 0xd2, 0x79, 0xf3, 0xa8, 0x90, 0xb6, 0x9c, 0xb1, 0x34, 0xd7, 0x15, 0xf9, + 0x7d, 0xd9, 0xe7, 0xf3, 0x77, 0xae, 0x90, 0xca, 0x92, 0x30, 0xff, 0x9a, 0xb5, 0x9f, 0x00, 0xdb, + 0xf0, 0x0f, 0xe0, 0xf0, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xd6, 0xe5, 0x40, 0xcd, 0x02, + 0x00, 0x00, +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.NewParams.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSubmitBlob) 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 *MsgSubmitBlob) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitBlob) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Fees.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Blob) > 0 { + i -= len(m.Blob) + copy(dAtA[i:], m.Blob) + i = encodeVarintTx(dAtA, i, uint64(len(m.Blob))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitBlobResponse) 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 *MsgSubmitBlobResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitBlobResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlobHash) > 0 { + i -= len(m.BlobHash) + copy(dAtA[i:], m.BlobHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BlobHash))) + i-- + dAtA[i] = 0x12 + } + if m.BlobId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BlobId)) + i-- + dAtA[i] = 0x8 + } + 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 *MsgUpdateParams) 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.NewParams.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitBlob) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Blob) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Fees.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSubmitBlobResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlobId != 0 { + n += 1 + sovTx(uint64(m.BlobId)) + } + l = len(m.BlobHash) + if l > 0 { + n += 1 + l + sovTx(uint64(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 *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: 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 NewParams", 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.NewParams.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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitBlob) 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: MsgSubmitBlob: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitBlob: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) + if m.Blob == nil { + m.Blob = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fees", 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.Fees.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 *MsgSubmitBlobResponse) 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: MsgSubmitBlobResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitBlobResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobId", wireType) + } + m.BlobId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlobId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlobHash", 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.BlobHash = string(dAtA[iNdEx:postIndex]) + 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 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") +)