From e1a47a6d38c801570337a78c954a922b62de38e9 Mon Sep 17 00:00:00 2001 From: frojdidymylja Date: Wed, 30 Sep 2020 18:28:03 +0200 Subject: [PATCH 1/4] change: move first msg to protobuf --- Makefile | 13 +++++++++++++ go.mod | 2 ++ runtimes/README.md | 8 ++++++++ runtimes/protobuild.dockerfile | 28 ++++++++++++++++++++++++++++ x/starname/types/msgs.go | 16 ---------------- x/starname/types/msgs.proto | 27 +++++++++++++++++++++++++++ x/starname/types/types.proto | 3 +++ 7 files changed, 81 insertions(+), 16 deletions(-) create mode 100644 runtimes/README.md create mode 100644 runtimes/protobuild.dockerfile create mode 100644 x/starname/types/msgs.proto create mode 100644 x/starname/types/types.proto diff --git a/Makefile b/Makefile index 4a15ca7e..15b7f392 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,11 @@ build: go.sum GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -o ./build/iovnsd -mod=readonly $(BUILD_FLAGS) ./cmd/iovnsd GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go build -o ./build/iovnscli -mod=readonly $(BUILD_FLAGS) ./cmd/iovnscli +# dev-container makes you join the dev-container which contains all the tools required to build iovns and proto related files +dev-container: + docker build -t dev-container:local -f ./runtimes/protobuild.dockerfile . + docker run -v="${CURDIR}:/src" -w="/src" -it dev-container:local + go.sum: go.mod @echo "--> Ensure dependencies have not been modified" GO111MODULE=on go mod verify @@ -75,6 +80,14 @@ lint: @golangci-lint run @go mod verify +# proto builds protobuf files, each newly added .proto should be +# added here, and in case paths are changed they should be updated +proto: + protoc -I=. \ + -I=${GOPATH}/src/github.com/gogo/protobuf \ + -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ + --gofast_out=. x/starname/types/msgs.proto x/starname/types/types.proto + test: @# iovnscli binary is required for it tests go install -mod=readonly $(BUILD_FLAGS) ./cmd/iovnscli diff --git a/go.mod b/go.mod index 590672e1..9b8fc37f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,9 @@ go 1.14 require ( github.com/cosmos/cosmos-sdk v0.39.1 github.com/fatih/structs v1.1.0 + github.com/gogo/protobuf v1.3.1 github.com/golang/mock v1.3.1 // indirect + github.com/golang/protobuf v1.4.0 github.com/gorilla/mux v1.7.4 github.com/gorilla/websocket v1.4.2 github.com/iov-one/cosmos-sdk-crud v0.0.0-20200804183153-2b7470a92e52 diff --git a/runtimes/README.md b/runtimes/README.md new file mode 100644 index 00000000..1f6eee3e --- /dev/null +++ b/runtimes/README.md @@ -0,0 +1,8 @@ +# Runtimes + +Contains a series of dockerfiles that can be used to build images that can be used a runtimes to run certain pieces of softwares. + +## protobuild.dockerfile +It's the docker image used to build the .proto files, this is because we need to leverage gogoproto which is not currently + supported by latest protobuf versions of protobuf. And also it exists so you do not have to download the whole protobuf, +protoc-gen-go executable. The image will build everything for you. \ No newline at end of file diff --git a/runtimes/protobuild.dockerfile b/runtimes/protobuild.dockerfile new file mode 100644 index 00000000..6d5cfbf6 --- /dev/null +++ b/runtimes/protobuild.dockerfile @@ -0,0 +1,28 @@ +FROM alpine as protoc + +ARG PROTOC_VERSION="3.13.0" +ARG PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-aarch_64.zip + +RUN apk --no-cache add curl +WORKDIR /protoc +RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP} +RUN unzip -o $PROTOC_ZIP +RUN ls -al +RUN ls -al ./include + +FROM golang:1.15-alpine +# add g++ required for ledger +RUN apk add g++ +# add make +RUN apk add make +# install protobuf +RUN apk add protobuf +# copy protobuf includes +COPY --from=protoc /protoc/include /protobuf/include +# include protobuf in path +ENV PATH=$PATH:/protobuf:/go/bin +# INSTALL GIT +RUN apk --no-cache add git +# INSTALL gogoproto +RUN go get github.com/gogo/protobuf/protoc-gen-gofast +CMD ["sh"] \ No newline at end of file diff --git a/x/starname/types/msgs.go b/x/starname/types/msgs.go index 7ec4a0d4..78ad85d4 100644 --- a/x/starname/types/msgs.go +++ b/x/starname/types/msgs.go @@ -12,22 +12,6 @@ type MsgWithFeePayer interface { FeePayer() sdk.AccAddress } -// MsgAddAccountCertificates is the message used -// when a user wants to add new certificates -// to his account -type MsgAddAccountCertificates struct { - // Domain is the domain of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // NewCertificate is the new certificate to add - NewCertificate []byte `json:"new_certificate"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgAddAccountCertificates)(nil) // FeePayer implements FeePayer interface diff --git a/x/starname/types/msgs.proto b/x/starname/types/msgs.proto new file mode 100644 index 00000000..8ae08035 --- /dev/null +++ b/x/starname/types/msgs.proto @@ -0,0 +1,27 @@ +syntax="proto3"; + +option go_package="github.com/iov-one/iovns/x/starname/types"; + +import "gogoproto/gogo.proto"; + +// MsgAddAccountCertificates is the message used +// when a user wants to add new certificates +// to his account +message MsgAddAccountCertificates { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // NewCertificate is the new certificate to add + bytes NewCertificate = 4 [(gogoproto.jsontag) = "new_certificate"]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 5 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; +} \ No newline at end of file diff --git a/x/starname/types/types.proto b/x/starname/types/types.proto new file mode 100644 index 00000000..6d604b89 --- /dev/null +++ b/x/starname/types/types.proto @@ -0,0 +1,3 @@ +syntax="proto3"; + +option go_package="github.com/iov-one/iovns/x/starname/types"; From 6eff21539e6f9fee8fe1c24ce45657475694cbfb Mon Sep 17 00:00:00 2001 From: frojdidymylja Date: Wed, 30 Sep 2020 18:30:00 +0200 Subject: [PATCH 2/4] add: golang proto files --- x/starname/types/msgs.pb.go | 557 +++++++++++++++++++++++++++++++++++ x/starname/types/types.pb.go | 32 ++ 2 files changed, 589 insertions(+) create mode 100644 x/starname/types/msgs.pb.go create mode 100644 x/starname/types/types.pb.go diff --git a/x/starname/types/msgs.pb.go b/x/starname/types/msgs.pb.go new file mode 100644 index 00000000..ba46a876 --- /dev/null +++ b/x/starname/types/msgs.pb.go @@ -0,0 +1,557 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: x/starname/types/msgs.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package + +// MsgAddAccountCertificates is the message used +// when a user wants to add new certificates +// to his account +type MsgAddAccountCertificates struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // NewCertificate is the new certificate to add + NewCertificate []byte `protobuf:"bytes,4,opt,name=NewCertificate,proto3" json:"new_certificate"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgAddAccountCertificates) Reset() { *m = MsgAddAccountCertificates{} } +func (m *MsgAddAccountCertificates) String() string { return proto.CompactTextString(m) } +func (*MsgAddAccountCertificates) ProtoMessage() {} +func (*MsgAddAccountCertificates) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{0} +} +func (m *MsgAddAccountCertificates) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddAccountCertificates) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddAccountCertificates.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 *MsgAddAccountCertificates) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddAccountCertificates.Merge(m, src) +} +func (m *MsgAddAccountCertificates) XXX_Size() int { + return m.Size() +} +func (m *MsgAddAccountCertificates) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddAccountCertificates.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddAccountCertificates proto.InternalMessageInfo + +func (m *MsgAddAccountCertificates) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgAddAccountCertificates) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgAddAccountCertificates) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgAddAccountCertificates) GetNewCertificate() []byte { + if m != nil { + return m.NewCertificate + } + return nil +} + +func (m *MsgAddAccountCertificates) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func init() { + proto.RegisterType((*MsgAddAccountCertificates)(nil), "MsgAddAccountCertificates") +} + +func init() { proto.RegisterFile("x/starname/types/msgs.proto", fileDescriptor_67a31da34b6acae6) } + +var fileDescriptor_67a31da34b6acae6 = []byte{ + // 304 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xcd, 0x4a, 0x03, 0x31, + 0x14, 0x85, 0x4d, 0xed, 0x14, 0x1b, 0x8a, 0xc2, 0x28, 0x38, 0xfe, 0x30, 0x29, 0x5d, 0x75, 0xd3, + 0xce, 0xc2, 0x9d, 0x82, 0x30, 0x55, 0xdc, 0x59, 0xcb, 0x2c, 0xdd, 0x94, 0x34, 0xb9, 0x1d, 0x07, + 0xc9, 0xa4, 0x24, 0x29, 0xb5, 0x6f, 0xe2, 0x23, 0xb9, 0xec, 0x13, 0x04, 0x19, 0x77, 0xf3, 0x08, + 0xae, 0x64, 0x32, 0x05, 0x7f, 0x76, 0xae, 0x72, 0x39, 0xe7, 0x9e, 0x8f, 0x93, 0x8b, 0xcf, 0x5e, + 0x22, 0x6d, 0xa8, 0xca, 0xa9, 0x80, 0xc8, 0xac, 0x17, 0xa0, 0x23, 0xa1, 0x53, 0x3d, 0x5c, 0x28, + 0x69, 0xe4, 0xe9, 0x51, 0x2a, 0x53, 0xe9, 0xc6, 0xa8, 0x9a, 0x6a, 0xb5, 0xb7, 0x69, 0xe0, 0x93, + 0x7b, 0x9d, 0xc6, 0x9c, 0xc7, 0x8c, 0xc9, 0x65, 0x6e, 0x6e, 0x40, 0x99, 0x6c, 0x9e, 0x31, 0x6a, + 0x40, 0xfb, 0x3d, 0xdc, 0xba, 0x95, 0x82, 0x66, 0x79, 0x80, 0xba, 0xa8, 0xdf, 0x1e, 0xe1, 0xd2, + 0x92, 0x16, 0x77, 0x4a, 0xb2, 0x75, 0xfc, 0x73, 0xdc, 0x1c, 0x53, 0x01, 0x41, 0xc3, 0x6d, 0xec, + 0x95, 0x96, 0x34, 0xab, 0x02, 0x89, 0x53, 0xfd, 0x09, 0xf6, 0x1e, 0x56, 0x39, 0xa8, 0x60, 0xb7, + 0x8b, 0xfa, 0x9d, 0xd1, 0x65, 0x69, 0x89, 0x27, 0x2b, 0xe1, 0xd3, 0x92, 0x41, 0x9a, 0x99, 0xa7, + 0xe5, 0x6c, 0xc8, 0xa4, 0x88, 0x98, 0xd4, 0x42, 0xea, 0xed, 0x33, 0xd0, 0xfc, 0xb9, 0xfe, 0xc0, + 0x30, 0x66, 0x2c, 0xe6, 0x5c, 0x81, 0xd6, 0x49, 0x0d, 0xf2, 0xaf, 0xf0, 0xfe, 0x18, 0x56, 0x3f, + 0x6a, 0x06, 0x4d, 0x87, 0x3e, 0x2c, 0x2d, 0x39, 0xc8, 0x61, 0x35, 0x65, 0xdf, 0x56, 0xf2, 0x67, + 0xd5, 0x9f, 0xe1, 0xce, 0x1d, 0xc0, 0x84, 0xae, 0x41, 0x55, 0xd8, 0xc0, 0x73, 0xd1, 0xeb, 0xd2, + 0x92, 0xf6, 0x1c, 0x60, 0xba, 0xa8, 0x8c, 0xff, 0x37, 0xfb, 0xc5, 0x1c, 0x1d, 0xbf, 0x15, 0x21, + 0xda, 0x14, 0x21, 0x7a, 0x2f, 0x42, 0xf4, 0xfa, 0x11, 0xee, 0x3c, 0x7a, 0x2e, 0x31, 0x6b, 0xb9, + 0x93, 0x5f, 0x7c, 0x05, 0x00, 0x00, 0xff, 0xff, 0xda, 0x99, 0x74, 0xdb, 0xa7, 0x01, 0x00, 0x00, +} + +func (m *MsgAddAccountCertificates) 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 *MsgAddAccountCertificates) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddAccountCertificates) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x2a + } + if len(m.NewCertificate) > 0 { + i -= len(m.NewCertificate) + copy(dAtA[i:], m.NewCertificate) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewCertificate))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAddAccountCertificates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.NewCertificate) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMsgs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgs(x uint64) (n int) { + return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAddAccountCertificates) 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 ErrIntOverflowMsgs + } + 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: MsgAddAccountCertificates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddAccountCertificates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewCertificate", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewCertificate = append(m.NewCertificate[:0], dAtA[iNdEx:postIndex]...) + if m.NewCertificate == nil { + m.NewCertificate = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgs(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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrInvalidLengthMsgs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/starname/types/types.pb.go b/x/starname/types/types.pb.go new file mode 100644 index 00000000..02dd5bcb --- /dev/null +++ b/x/starname/types/types.pb.go @@ -0,0 +1,32 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: x/starname/types/types.proto + +package types + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// 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.ProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("x/starname/types/types.proto", fileDescriptor_cb68cf137d2ded7a) } + +var fileDescriptor_cb68cf137d2ded7a = []byte{ + // 74 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xa9, 0xd0, 0x2f, 0x2e, + 0x49, 0x2c, 0xca, 0x4b, 0xcc, 0x4d, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x86, 0x90, 0x7a, 0x05, + 0x45, 0xf9, 0x25, 0xf9, 0x4e, 0x02, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, + 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0x60, 0x09, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xa8, 0x73, 0xe7, 0x42, 0x38, 0x00, 0x00, 0x00, +} From b6744fc7f385e7af8af8534217433bcc3df3b9d5 Mon Sep 17 00:00:00 2001 From: frojdidymylja Date: Thu, 1 Oct 2020 13:42:51 +0200 Subject: [PATCH 3/4] change: move starname types and msg to protobuf --- Makefile | 10 +- x/starname/account_handlers.go | 4 +- x/starname/account_handlers_test.go | 66 +- x/starname/client/cli/tx.go | 4 +- x/starname/controllers/account/account.go | 11 +- .../controllers/account/account_test.go | 4 +- x/starname/domain_handlers_test.go | 8 +- x/starname/genesis_test.go | 4 +- x/starname/keeper/executor/account.go | 2 +- x/starname/keeper/executor/account_test.go | 2 +- x/starname/keeper/executor/main_test.go | 4 +- x/starname/keeper/queries.go | 2 +- x/starname/keeper/queries_test.go | 10 +- x/starname/types/msgs.go | 161 - x/starname/types/msgs.pb.go | 4528 ++++++++++++++++- x/starname/types/msgs.proto | 257 +- x/starname/types/types.go | 91 +- x/starname/types/types.pb.go | 1333 ++++- x/starname/types/types.proto | 59 + 19 files changed, 6129 insertions(+), 431 deletions(-) diff --git a/Makefile b/Makefile index 15b7f392..fcd52c5a 100644 --- a/Makefile +++ b/Makefile @@ -84,9 +84,13 @@ lint: # added here, and in case paths are changed they should be updated proto: protoc -I=. \ - -I=${GOPATH}/src/github.com/gogo/protobuf \ - -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ - --gofast_out=. x/starname/types/msgs.proto x/starname/types/types.proto + -I=${GOPATH}/src/github.com/gogo/protobuf \ + -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ + --gofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,paths=source_relative:. x/starname/types/types.proto + protoc -I=. \ + -I=${GOPATH}/src/github.com/gogo/protobuf \ + -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ + --gofast_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,paths=source_relative:. x/starname/types/msgs.proto test: @# iovnscli binary is required for it tests diff --git a/x/starname/account_handlers.go b/x/starname/account_handlers.go index edd9ec94..cc043ea3 100644 --- a/x/starname/account_handlers.go +++ b/x/starname/account_handlers.go @@ -282,7 +282,7 @@ func handlerMsgTransferAccount(ctx sdk.Context, k keeper.Keeper, msg *types.MsgT MustExist(). NotExpired(). TransferableBy(msg.Owner). - ResettableBy(msg.Owner, msg.Reset). + ResettableBy(msg.Owner, msg.ToReset). Validate(); err != nil { return nil, err } @@ -297,7 +297,7 @@ func handlerMsgTransferAccount(ctx sdk.Context, k keeper.Keeper, msg *types.MsgT } // transfer account ex := executor.NewAccount(ctx, k, accountCtrl.Account()) - ex.Transfer(msg.NewOwner, msg.Reset) + ex.Transfer(msg.NewOwner, msg.ToReset) // success, todo emit event? return &sdk.Result{}, nil } diff --git a/x/starname/account_handlers_test.go b/x/starname/account_handlers_test.go index 02481c6e..eff0be2b 100644 --- a/x/starname/account_handlers_test.go +++ b/x/starname/account_handlers_test.go @@ -229,7 +229,7 @@ func Test_Common_handlerMsgAddAccountCertificates(t *testing.T) { Name: utils.StrPtr("test"), ValidUntil: utils.TimeToSeconds(ctx.BlockTime().Add(1000 * time.Hour)), Owner: keeper.AliceKey, - Certificates: []types.Certificate{[]byte("test")}, + Certificates: [][]byte{[]byte("test")}, }).Create() }, Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { @@ -308,7 +308,7 @@ func Test_Common_handlerMsgAddAccountCertificates(t *testing.T) { Name: utils.StrPtr("test"), ValidUntil: utils.TimeToSeconds(ctx.BlockTime().Add(1000 * time.Hour)), Owner: keeper.AliceKey, - Certificates: []types.Certificate{[]byte("1")}, + Certificates: [][]byte{[]byte("1")}, }).Create() }, Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { @@ -366,7 +366,7 @@ func Test_Common_handlerMsgAddAccountCertificates(t *testing.T) { } }, AfterTest: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { - expected := []types.Certificate{[]byte("test")} + expected := [][]byte{[]byte("test")} account := new(types.Account) ok := k.AccountStore(ctx).Read((&types.Account{Domain: "test", Name: utils.StrPtr("test")}).PrimaryKey(), account) if !ok { @@ -397,7 +397,7 @@ func Test_Closed_handlerMsgDeleteAccountCertificate(t *testing.T) { Name: utils.StrPtr("test"), ValidUntil: 0, Owner: keeper.AliceKey, - Certificates: []types.Certificate{[]byte("test")}, + Certificates: [][]byte{[]byte("test")}, }).Create() }, Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { @@ -446,7 +446,7 @@ func Test_Open_handlerMsgDeleteAccountCertificate(t *testing.T) { Name: utils.StrPtr("test"), ValidUntil: 0, Owner: keeper.AliceKey, - Certificates: []types.Certificate{[]byte("test")}, + Certificates: [][]byte{[]byte("test")}, }).Create() }, Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { @@ -592,7 +592,7 @@ func Test_Common_handlerMsgDeleteAccountCertificate(t *testing.T) { Name: utils.StrPtr("test"), ValidUntil: utils.TimeToSeconds(ctx.BlockTime().Add(1000 * time.Hour)), Owner: keeper.AliceKey, - Certificates: []types.Certificate{[]byte("test")}, + Certificates: [][]byte{[]byte("test")}, }).Create() }, Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { @@ -1238,7 +1238,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "test", Owner: keeper.BobKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "won't work", @@ -1276,7 +1276,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "test", Owner: keeper.BobKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "invalid blockchain id", Resource: "valid blockchain address", @@ -1316,7 +1316,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "this won't match", Owner: keeper.AliceKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1348,7 +1348,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "this does not exist", Name: "works", Owner: keeper.AliceKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1389,7 +1389,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "test", Owner: keeper.AliceKey, // invalid owner - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1429,7 +1429,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "test", Owner: keeper.BobKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1479,7 +1479,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Domain: "test", Name: "exists", Owner: keeper.BobKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1520,7 +1520,7 @@ func Test_Common_handleMsgRegisterAccount(t *testing.T) { Name: "test", Owner: keeper.BobKey, Registerer: keeper.BobKey, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -1752,7 +1752,7 @@ func Test_Closed_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -1800,7 +1800,7 @@ func Test_Open_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -1846,7 +1846,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "invalid", Resource: "invalid", @@ -1886,7 +1886,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -1908,7 +1908,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err = handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "invalid", Resource: "invalid", @@ -1926,7 +1926,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err = handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "invalid", Resource: "invalid", @@ -1952,7 +1952,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "does not exist", Name: "", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -1983,7 +1983,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { Test: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -2016,7 +2016,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "does not exist", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -2056,7 +2056,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -2097,7 +2097,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { _, err := handlerMsgReplaceAccountResources(ctx, k, &types.MsgReplaceAccountResources{ Domain: "test", Name: "test", - NewResources: []types.Resource{ + NewResources: []*types.Resource{ { URI: "valid", Resource: "valid", @@ -2110,7 +2110,7 @@ func Test_Common_handlerMsgReplaceAccountResources(t *testing.T) { } }, AfterTest: func(t *testing.T, k keeper.Keeper, ctx sdk.Context, mocks *keeper.Mocks) { - expected := []types.Resource{{ + expected := []*types.Resource{{ URI: "valid", Resource: "valid", }} @@ -2480,8 +2480,8 @@ func Test_Closed_handlerAccountTransfer(t *testing.T) { Owner: keeper.BobKey, ValidUntil: utils.TimeToSeconds(ctx.BlockTime().Add(1000 * time.Hour)), MetadataURI: "lol", - Certificates: []types.Certificate{[]byte("test")}, - Resources: []types.Resource{ + Certificates: [][]byte{[]byte("test")}, + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -2496,7 +2496,7 @@ func Test_Closed_handlerAccountTransfer(t *testing.T) { Name: "test", Owner: keeper.AliceKey, NewOwner: keeper.CharlieKey, - Reset: true, + ToReset: true, }) if err != nil { t.Fatalf("handlerMsgTransferAccount() got error: %s", err) @@ -2550,7 +2550,7 @@ func Test_Open_handlerAccountTransfer(t *testing.T) { Name: "test", Owner: keeper.AliceKey, NewOwner: keeper.CharlieKey, - Reset: false, + ToReset: false, }) if !errors.Is(err, types.ErrUnauthorized) { t.Fatalf("handlerMsgTransferAccount() got error: %s", err) @@ -2594,8 +2594,8 @@ func Test_Open_handlerAccountTransfer(t *testing.T) { Owner: keeper.BobKey, ValidUntil: utils.TimeToSeconds(ctx.BlockTime().Add(1000 * time.Hour)), MetadataURI: "lol", - Certificates: []types.Certificate{[]byte("test")}, - Resources: []types.Resource{ + Certificates: [][]byte{[]byte("test")}, + Resources: []*types.Resource{ { URI: "works", Resource: "works", @@ -2610,7 +2610,7 @@ func Test_Open_handlerAccountTransfer(t *testing.T) { Name: "test", Owner: keeper.AliceKey, NewOwner: keeper.CharlieKey, - Reset: true, + ToReset: true, }) if !errors.Is(err, types.ErrUnauthorized) { t.Fatalf("handlerMsgTransferAccount() got error: %s", err) diff --git a/x/starname/client/cli/tx.go b/x/starname/client/cli/tx.go index 47dcd9e7..f48d4c81 100644 --- a/x/starname/client/cli/tx.go +++ b/x/starname/client/cli/tx.go @@ -163,7 +163,7 @@ func getCmdTransferAccount(cdc *codec.Codec) *cobra.Command { Name: name, Owner: cliCtx.GetFromAddress(), NewOwner: newOwnerAddr, - Reset: resetBool, + ToReset: resetBool, FeePayerAddr: feePayer, } // check if valid @@ -211,7 +211,7 @@ func getmCmdReplaceAccountResources(cdc *codec.Codec) *cobra.Command { } defer f.Close() // unmarshal resources - var resources []types.Resource + var resources []*types.Resource err = json.NewDecoder(f).Decode(&resources) if err != nil { return diff --git a/x/starname/controllers/account/account.go b/x/starname/controllers/account/account.go index 435be475..a72ede37 100644 --- a/x/starname/controllers/account/account.go +++ b/x/starname/controllers/account/account.go @@ -138,7 +138,7 @@ func (a *Account) CertificateExists(cert []byte, certIndex *int) *Account { } // ValidResources verifies that the provided resources are valid for the account -func (a *Account) ValidResources(resources []types.Resource) *Account { +func (a *Account) ValidResources(resources []*types.Resource) *Account { a.validators = append(a.validators, func(ctrl *Account) error { return ctrl.validResources(resources) }) @@ -162,7 +162,7 @@ func (a *Account) ResettableBy(addr sdk.AccAddress, reset bool) *Account { } // ResettableBy checks if the account attributes resettable by the provided address -func (a *Account) ResourceLimitNotExceeded(resources []types.Resource) *Account { +func (a *Account) ResourceLimitNotExceeded(resources []*types.Resource) *Account { a.validators = append(a.validators, func(ctrl *Account) error { return ctrl.resourceLimitNotExceeded(resources) }) @@ -411,7 +411,7 @@ func (a *Account) deletableBy(addr sdk.AccAddress) error { } // validResources validates different resources -func (a *Account) validResources(resources []types.Resource) error { +func (a *Account) validResources(resources []*types.Resource) error { a.requireConfiguration() validURI := regexp.MustCompile(a.conf.ValidURI) validResource := regexp.MustCompile(a.conf.ValidResource) @@ -419,6 +419,9 @@ func (a *Account) validResources(resources []types.Resource) error { sets := make(map[string]struct{}, len(resources)) // iterate over resources to check their validity for _, resource := range resources { + if resource == nil { + return sdkerrors.Wrap(types.ErrInvalidResource, "nil resource provided") + } // check if URI was already specified if _, ok := sets[resource.URI]; ok { return sdkerrors.Wrapf(types.ErrInvalidResource, "duplicate URI %s", resource.URI) @@ -493,7 +496,7 @@ func (a *Account) gracePeriodFinished() error { return sdkerrors.Wrapf(types.ErrAccountGracePeriodNotFinished, "account %s grace period has not finished", *a.account.Name) } -func (a *Account) resourceLimitNotExceeded(resources []types.Resource) error { +func (a *Account) resourceLimitNotExceeded(resources []*types.Resource) error { if err := a.requireAccount(); err != nil { panic("validation check is not allowed on a non existing account") } diff --git a/x/starname/controllers/account/account_test.go b/x/starname/controllers/account/account_test.go index 4b094100..a3b9adf1 100644 --- a/x/starname/controllers/account/account_test.go +++ b/x/starname/controllers/account/account_test.go @@ -186,7 +186,7 @@ func TestAccount_certNotExist(t *testing.T) { t.Run("success", func(t *testing.T) { acc := &Account{ account: &types.Account{ - Certificates: []types.Certificate{[]byte("test-cert")}, + Certificates: [][]byte{[]byte("test-cert")}, }, } err := acc.CertificateNotExist([]byte("does not exist")).Validate() @@ -197,7 +197,7 @@ func TestAccount_certNotExist(t *testing.T) { t.Run("cert exists", func(t *testing.T) { acc := &Account{ account: &types.Account{ - Certificates: []types.Certificate{[]byte("test-cert"), []byte("exists")}, + Certificates: [][]byte{[]byte("test-cert"), []byte("exists")}, }, } i := new(int) diff --git a/x/starname/domain_handlers_test.go b/x/starname/domain_handlers_test.go index 271729ba..53862f31 100644 --- a/x/starname/domain_handlers_test.go +++ b/x/starname/domain_handlers_test.go @@ -745,11 +745,11 @@ func Test_handlerMsgTransferDomain(t *testing.T) { Name: utils.StrPtr("1"), Owner: keeper.AliceKey, ValidUntil: 0, - Resources: []types.Resource{{ + Resources: []*types.Resource{{ URI: "test", Resource: "test", }}, - Certificates: []types.Certificate{[]byte("cert")}, + Certificates: [][]byte{[]byte("cert")}, Broker: nil, }).Create() // add account 2 @@ -758,11 +758,11 @@ func Test_handlerMsgTransferDomain(t *testing.T) { Name: utils.StrPtr("2"), Owner: keeper.AliceKey, ValidUntil: 0, - Resources: []types.Resource{{ + Resources: []*types.Resource{{ URI: "test", Resource: "test", }}, - Certificates: []types.Certificate{[]byte("cert")}, + Certificates: [][]byte{[]byte("cert")}, Broker: nil, }).Create() }, diff --git a/x/starname/genesis_test.go b/x/starname/genesis_test.go index 96f82080..f1f490d7 100644 --- a/x/starname/genesis_test.go +++ b/x/starname/genesis_test.go @@ -11,7 +11,7 @@ import ( ) func TestExportGenesis(t *testing.T) { - expected := `{"domains":[{"name":"test","admin":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","valid_until":100,"type":"open","broker":""}],"accounts":[{"domain":"test","name":"","owner":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","valid_until":100,"resources":null,"certificates":null,"broker":"","metadata_uri":""},{"domain":"test","name":"test","owner":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","valid_until":100,"resources":null,"certificates":null,"broker":"","metadata_uri":""}]}` + expected := `{"domains":[{"name":"test","admin":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","broker":"","valid_until":100,"type":"open"}],"accounts":[{"domain":"test","name":"","owner":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","broker":"","valid_until":100,"resources":null,"certificates":null,"metadata_uri":""},{"domain":"test","name":"test","owner":"cosmos1ze7y9qwdddejmy7jlw4cymqqlt2wh05ytm076d","broker":"","valid_until":100,"resources":null,"certificates":null,"metadata_uri":""}]}` k, ctx, _ := keeper.NewTestKeeper(t, true) executor.NewDomain(ctx, k, types.Domain{ Name: "test", @@ -32,6 +32,6 @@ func TestExportGenesis(t *testing.T) { t.Fatal(err) } if string(b) != expected { - t.Fatal("unexpected genesis state") + t.Fatalf("unexpected genesis state:\nGot: %s\nWanted: %s", b, expected) } } diff --git a/x/starname/keeper/executor/account.go b/x/starname/keeper/executor/account.go index dba0e51d..b16c2dcd 100644 --- a/x/starname/keeper/executor/account.go +++ b/x/starname/keeper/executor/account.go @@ -53,7 +53,7 @@ func (a *Account) UpdateMetadata(newMetadata string) { } // ReplaceResources replaces account's resources -func (a *Account) ReplaceResources(newTargets []types.Resource) { +func (a *Account) ReplaceResources(newTargets []*types.Resource) { if a.account == nil { panic("cannot replace targets on non specified account") } diff --git a/x/starname/keeper/executor/account_test.go b/x/starname/keeper/executor/account_test.go index ce757dc6..57600a64 100644 --- a/x/starname/keeper/executor/account_test.go +++ b/x/starname/keeper/executor/account_test.go @@ -58,7 +58,7 @@ func TestAccount_Renew(t *testing.T) { func TestAccount_ReplaceResources(t *testing.T) { testCtx, _ := testCtx.CacheContext() - newRes := []types.Resource{{ + newRes := []*types.Resource{{ URI: "uri", Resource: "res", }} diff --git a/x/starname/keeper/executor/main_test.go b/x/starname/keeper/executor/main_test.go index 03e6257f..9f785e26 100644 --- a/x/starname/keeper/executor/main_test.go +++ b/x/starname/keeper/executor/main_test.go @@ -36,13 +36,13 @@ var testAccount = types.Account{ Name: utils.StrPtr("a-super-account"), Owner: aliceKey, ValidUntil: 10000, - Resources: []types.Resource{ + Resources: []*types.Resource{ { URI: "a-super-uri", Resource: "a-super-res", }, }, - Certificates: []types.Certificate{types.Certificate("a-random-cert")}, + Certificates: [][]byte{[]byte("a-random-cert")}, Broker: nil, MetadataURI: "metadata", } diff --git a/x/starname/keeper/queries.go b/x/starname/keeper/queries.go index e5ed47c2..327733b6 100644 --- a/x/starname/keeper/queries.go +++ b/x/starname/keeper/queries.go @@ -583,7 +583,7 @@ func queryResourceAccountHandler(ctx sdk.Context, _ []string, req abci.RequestQu // iterate keys as := k.AccountStore(ctx) accounts := make([]types.Account, 0, len(keys)) - filter := as.Filter(&types.Account{Resources: []types.Resource{q.Resource}}) + filter := as.Filter(&types.Account{Resources: []*types.Resource{&q.Resource}}) for { if !filter.Valid() { break diff --git a/x/starname/keeper/queries_test.go b/x/starname/keeper/queries_test.go index edb331aa..8df66d5f 100644 --- a/x/starname/keeper/queries_test.go +++ b/x/starname/keeper/queries_test.go @@ -228,7 +228,7 @@ func Test_queryResourceAccountsHandler(t *testing.T) { "success": { BeforeTest: func(t *testing.T, ctx sdk.Context, k Keeper) { as := k.AccountStore(ctx) - resource := types.Resource{ + resource := &types.Resource{ URI: "id-1", Resource: "addr-1", } @@ -237,14 +237,14 @@ func Test_queryResourceAccountsHandler(t *testing.T) { Name: utils.StrPtr("1"), Owner: bobAddr, ValidUntil: 0, - Resources: []types.Resource{resource}, + Resources: []*types.Resource{resource}, }) as.Create(&types.Account{ Domain: "test", Name: utils.StrPtr("2"), Owner: bobAddr, ValidUntil: 0, - Resources: []types.Resource{resource}, + Resources: []*types.Resource{resource}, }) }, Request: &QueryResolveResource{ @@ -262,7 +262,7 @@ func Test_queryResourceAccountsHandler(t *testing.T) { Name: utils.StrPtr("1"), Owner: bobAddr, ValidUntil: 0, - Resources: []types.Resource{{ + Resources: []*types.Resource{{ URI: "id-1", Resource: "addr-1", }}, @@ -272,7 +272,7 @@ func Test_queryResourceAccountsHandler(t *testing.T) { Name: utils.StrPtr("2"), Owner: bobAddr, ValidUntil: 0, - Resources: []types.Resource{{ + Resources: []*types.Resource{{ URI: "id-1", Resource: "addr-1", }}, diff --git a/x/starname/types/msgs.go b/x/starname/types/msgs.go index 78ad85d4..5eb8b4d6 100644 --- a/x/starname/types/msgs.go +++ b/x/starname/types/msgs.go @@ -60,22 +60,6 @@ func (m *MsgAddAccountCertificates) GetSigners() []sdk.AccAddress { } } -// MsgDeleteAccountCertificate is the request -// model used to remove certificates from an -// account -type MsgDeleteAccountCertificate struct { - // Domain is the name of the domain of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // DeleteCertificate is the certificate to delete - DeleteCertificate []byte `json:"delete_certificate"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgDeleteAccountCertificate)(nil) // FeePayer implements FeePayer interface @@ -124,19 +108,6 @@ func (m *MsgDeleteAccountCertificate) GetSigners() []sdk.AccAddress { } } -// MsgDeleteAccount is the request model -// used to delete an account -type MsgDeleteAccount struct { - // Domain is the name of the domain of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgDeleteAccount)(nil) // FeePayer implements FeePayer interface @@ -186,17 +157,6 @@ func (m *MsgDeleteAccount) GetSigners() []sdk.AccAddress { } } -// MsgDeleteDomain is the request -// model to delete a domain -type MsgDeleteDomain struct { - // Domain is the domain to delete - Domain string `json:"domain"` - // Owner is the owner of the domain - Owner sdk.AccAddress `json:"owner"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgDeleteDomain)(nil) // FeePayer implements FeePayer interface @@ -243,25 +203,6 @@ func (m *MsgDeleteDomain) GetSigners() []sdk.AccAddress { } } -// MsgRegisterAccount is the request -// model used to register new accounts -type MsgRegisterAccount struct { - // Domain is the domain of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // Registerer is the user who registers this account - Registerer sdk.AccAddress `json:"registerer"` - // Resources are the blockchain addresses of the account - Resources []Resource `json:"resources"` - // Broker is the account that facilitated the transaction - Broker sdk.AccAddress `json:"broker"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgRegisterAccount)(nil) // FeePayer implements FeePayer interface @@ -310,20 +251,6 @@ func (m *MsgRegisterAccount) GetSigners() []sdk.AccAddress { } } -// MsgRegisterDomain is the request used to register new domains -type MsgRegisterDomain struct { - // Name is the name of the domain we want to register - Name string `json:"domain" arg:"--domain" helper:"name of the domain"` - // Admin is the address of the newly registered domain - Admin sdk.AccAddress `json:"admin"` - // DomainType defines the type of the domain - DomainType DomainType `json:"type"` - // Broker TODO document - Broker sdk.AccAddress `json:"broker" arg:"--broker" helper:"the broker"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgRegisterDomain)(nil) // FeePayer implements FeePayer interface @@ -370,19 +297,6 @@ func (m *MsgRegisterDomain) GetSigners() []sdk.AccAddress { } } -// MsgRenewAccount is the request -// model used to renew accounts -type MsgRenewAccount struct { - // Domain is the domain of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // Signer is the signer of the request - Signer sdk.AccAddress `json:"signer"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgRenewAccount)(nil) // FeePayer implements FeePayer interface @@ -425,17 +339,6 @@ func (m *MsgRenewAccount) GetSigners() []sdk.AccAddress { } } -// MsgRenewDomain is the request -// model used to renew a domain -type MsgRenewDomain struct { - // Domain is the domain name to renew - Domain string `json:"domain"` - // Signer is the request signer - Signer sdk.AccAddress `json:"signer"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgRenewDomain)(nil) // FeePayer implements FeePayer interface @@ -478,22 +381,6 @@ func (m *MsgRenewDomain) GetSigners() []sdk.AccAddress { } } -// MsgReplaceAccountResources is the request model -// used to renew resources associated -// with an account -type MsgReplaceAccountResources struct { - // Domain is the domain name of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // NewResources are the new resources - NewResources []Resource `json:"new_resources"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgReplaceAccountResources)(nil) // FeePayer implements FeePayer interface @@ -542,22 +429,6 @@ func (m *MsgReplaceAccountResources) GetSigners() []sdk.AccAddress { } } -// MsgReplaceAccountMetadata is the function used -// to set accounts metadata -type MsgReplaceAccountMetadata struct { - // Domain is the domain name of the account - Domain string `json:"domain"` - // Name is the name of the account - Name string `json:"name"` - // NewMetadataURI is the metadata URI of the account - // we want to update or insert - NewMetadataURI string `json:"new_metadata_uri"` - // Owner is the owner of the account - Owner sdk.AccAddress `json:"owner"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgReplaceAccountMetadata)(nil) // FeePayer implements FeePayer interface @@ -606,23 +477,6 @@ func (m *MsgReplaceAccountMetadata) GetSigners() []sdk.AccAddress { } } -// MsgTransferAccount is the request -// model used to transfer accounts -type MsgTransferAccount struct { - // Domain is the domain name of the account - Domain string `json:"domain"` - // Account is the account name - Name string `json:"name"` - // Owner is the actual owner of the account - Owner sdk.AccAddress `json:"owner"` - // NewOwner is the new owner of the account - NewOwner sdk.AccAddress `json:"new_owner"` - // Reset indicates if the accounts content will be reset - Reset bool `json:"reset"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgTransferAccount)(nil) // FeePayer implements FeePayer interface @@ -689,21 +543,6 @@ const ( TransferAll ) -// MsgTransferDomain is the request model -// used to transfer a domain -type MsgTransferDomain struct { - // Domain is the name of the domain - Domain string `json:"domain"` - // Owner is the address of the owner of the domain - Owner sdk.AccAddress `json:"owner"` - // NewAdmin is the address of the entity that will own the domain - NewAdmin sdk.AccAddress `json:"new_admin"` - // TransferFlag is the flag used to determine how to transfer the domain and the related accounts - TransferFlag TransferFlag `json:"transfer_flag"` - // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr sdk.AccAddress `json:"fee_payer"` -} - var _ MsgWithFeePayer = (*MsgTransferDomain)(nil) // FeePayer implements FeePayer interface diff --git a/x/starname/types/msgs.pb.go b/x/starname/types/msgs.pb.go index ba46a876..0757743c 100644 --- a/x/starname/types/msgs.pb.go +++ b/x/starname/types/msgs.pb.go @@ -34,13 +34,13 @@ type MsgAddAccountCertificates struct { Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` // Owner is the owner of the account Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` - // NewCertificate is the new certificate to add - NewCertificate []byte `protobuf:"bytes,4,opt,name=NewCertificate,proto3" json:"new_certificate"` // FeePayerAddr is the address of the entity that has to pay product fees - FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // NewCertificate is the new certificate to add + NewCertificate []byte `protobuf:"bytes,5,opt,name=NewCertificate,proto3" json:"new_certificate"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *MsgAddAccountCertificates) Reset() { *m = MsgAddAccountCertificates{} } @@ -97,161 +97,4204 @@ func (m *MsgAddAccountCertificates) GetOwner() github_com_cosmos_cosmos_sdk_type return nil } -func (m *MsgAddAccountCertificates) GetNewCertificate() []byte { +func (m *MsgAddAccountCertificates) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { if m != nil { - return m.NewCertificate + return m.FeePayerAddr } return nil } -func (m *MsgAddAccountCertificates) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { +func (m *MsgAddAccountCertificates) GetNewCertificate() []byte { if m != nil { - return m.FeePayerAddr + return m.NewCertificate } return nil } -func init() { - proto.RegisterType((*MsgAddAccountCertificates)(nil), "MsgAddAccountCertificates") +// MsgDeleteAccountCertificate is the request +// model used to remove certificates from an +// account +type MsgDeleteAccountCertificate struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // DeleteCertificate is the certificate to delete + DeleteCertificate []byte `protobuf:"bytes,5,opt,name=DeleteCertificate,proto3" json:"delete_certificate"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func init() { proto.RegisterFile("x/starname/types/msgs.proto", fileDescriptor_67a31da34b6acae6) } - -var fileDescriptor_67a31da34b6acae6 = []byte{ - // 304 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0xcd, 0x4a, 0x03, 0x31, - 0x14, 0x85, 0x4d, 0xed, 0x14, 0x1b, 0x8a, 0xc2, 0x28, 0x38, 0xfe, 0x30, 0x29, 0x5d, 0x75, 0xd3, - 0xce, 0xc2, 0x9d, 0x82, 0x30, 0x55, 0xdc, 0x59, 0xcb, 0x2c, 0xdd, 0x94, 0x34, 0xb9, 0x1d, 0x07, - 0xc9, 0xa4, 0x24, 0x29, 0xb5, 0x6f, 0xe2, 0x23, 0xb9, 0xec, 0x13, 0x04, 0x19, 0x77, 0xf3, 0x08, - 0xae, 0x64, 0x32, 0x05, 0x7f, 0x76, 0xae, 0x72, 0x39, 0xe7, 0x9e, 0x8f, 0x93, 0x8b, 0xcf, 0x5e, - 0x22, 0x6d, 0xa8, 0xca, 0xa9, 0x80, 0xc8, 0xac, 0x17, 0xa0, 0x23, 0xa1, 0x53, 0x3d, 0x5c, 0x28, - 0x69, 0xe4, 0xe9, 0x51, 0x2a, 0x53, 0xe9, 0xc6, 0xa8, 0x9a, 0x6a, 0xb5, 0xb7, 0x69, 0xe0, 0x93, - 0x7b, 0x9d, 0xc6, 0x9c, 0xc7, 0x8c, 0xc9, 0x65, 0x6e, 0x6e, 0x40, 0x99, 0x6c, 0x9e, 0x31, 0x6a, - 0x40, 0xfb, 0x3d, 0xdc, 0xba, 0x95, 0x82, 0x66, 0x79, 0x80, 0xba, 0xa8, 0xdf, 0x1e, 0xe1, 0xd2, - 0x92, 0x16, 0x77, 0x4a, 0xb2, 0x75, 0xfc, 0x73, 0xdc, 0x1c, 0x53, 0x01, 0x41, 0xc3, 0x6d, 0xec, - 0x95, 0x96, 0x34, 0xab, 0x02, 0x89, 0x53, 0xfd, 0x09, 0xf6, 0x1e, 0x56, 0x39, 0xa8, 0x60, 0xb7, - 0x8b, 0xfa, 0x9d, 0xd1, 0x65, 0x69, 0x89, 0x27, 0x2b, 0xe1, 0xd3, 0x92, 0x41, 0x9a, 0x99, 0xa7, - 0xe5, 0x6c, 0xc8, 0xa4, 0x88, 0x98, 0xd4, 0x42, 0xea, 0xed, 0x33, 0xd0, 0xfc, 0xb9, 0xfe, 0xc0, - 0x30, 0x66, 0x2c, 0xe6, 0x5c, 0x81, 0xd6, 0x49, 0x0d, 0xf2, 0xaf, 0xf0, 0xfe, 0x18, 0x56, 0x3f, - 0x6a, 0x06, 0x4d, 0x87, 0x3e, 0x2c, 0x2d, 0x39, 0xc8, 0x61, 0x35, 0x65, 0xdf, 0x56, 0xf2, 0x67, - 0xd5, 0x9f, 0xe1, 0xce, 0x1d, 0xc0, 0x84, 0xae, 0x41, 0x55, 0xd8, 0xc0, 0x73, 0xd1, 0xeb, 0xd2, - 0x92, 0xf6, 0x1c, 0x60, 0xba, 0xa8, 0x8c, 0xff, 0x37, 0xfb, 0xc5, 0x1c, 0x1d, 0xbf, 0x15, 0x21, - 0xda, 0x14, 0x21, 0x7a, 0x2f, 0x42, 0xf4, 0xfa, 0x11, 0xee, 0x3c, 0x7a, 0x2e, 0x31, 0x6b, 0xb9, - 0x93, 0x5f, 0x7c, 0x05, 0x00, 0x00, 0xff, 0xff, 0xda, 0x99, 0x74, 0xdb, 0xa7, 0x01, 0x00, 0x00, +func (m *MsgDeleteAccountCertificate) Reset() { *m = MsgDeleteAccountCertificate{} } +func (m *MsgDeleteAccountCertificate) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAccountCertificate) ProtoMessage() {} +func (*MsgDeleteAccountCertificate) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{1} +} +func (m *MsgDeleteAccountCertificate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAccountCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAccountCertificate.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 *MsgDeleteAccountCertificate) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAccountCertificate.Merge(m, src) +} +func (m *MsgDeleteAccountCertificate) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAccountCertificate) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAccountCertificate.DiscardUnknown(m) } -func (m *MsgAddAccountCertificates) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +var xxx_messageInfo_MsgDeleteAccountCertificate proto.InternalMessageInfo + +func (m *MsgDeleteAccountCertificate) GetDomain() string { + if m != nil { + return m.Domain } - return dAtA[:n], nil + return "" } -func (m *MsgAddAccountCertificates) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *MsgDeleteAccountCertificate) GetName() string { + if m != nil { + return m.Name + } + return "" } -func (m *MsgAddAccountCertificates) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *MsgDeleteAccountCertificate) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner } - if len(m.FeePayerAddr) > 0 { - i -= len(m.FeePayerAddr) - copy(dAtA[i:], m.FeePayerAddr) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) - i-- - dAtA[i] = 0x2a + return nil +} + +func (m *MsgDeleteAccountCertificate) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr } - if len(m.NewCertificate) > 0 { - i -= len(m.NewCertificate) - copy(dAtA[i:], m.NewCertificate) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewCertificate))) - i-- - dAtA[i] = 0x22 + return nil +} + +func (m *MsgDeleteAccountCertificate) GetDeleteCertificate() []byte { + if m != nil { + return m.DeleteCertificate } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x1a + return nil +} + +// MsgDeleteAccount is the request model +// used to delete an account +type MsgDeleteAccount struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDeleteAccount) Reset() { *m = MsgDeleteAccount{} } +func (m *MsgDeleteAccount) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAccount) ProtoMessage() {} +func (*MsgDeleteAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{2} +} +func (m *MsgDeleteAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 +} +func (m *MsgDeleteAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAccount.Merge(m, src) +} +func (m *MsgDeleteAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteAccount proto.InternalMessageInfo + +func (m *MsgDeleteAccount) GetDomain() string { + if m != nil { + return m.Domain } - if len(m.Domain) > 0 { - i -= len(m.Domain) - copy(dAtA[i:], m.Domain) - i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *MsgDeleteAccount) GetName() string { + if m != nil { + return m.Name } - return len(dAtA) - i, nil + return "" } -func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { - offset -= sovMsgs(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *MsgDeleteAccount) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner } - dAtA[offset] = uint8(v) - return base + return nil } -func (m *MsgAddAccountCertificates) Size() (n int) { - if m == nil { - return 0 + +func (m *MsgDeleteAccount) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr } - var l int - _ = l - l = len(m.Domain) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) + return nil +} + +// MsgDeleteDomain is the request +// model to delete a domain +type MsgDeleteDomain struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgDeleteDomain) Reset() { *m = MsgDeleteDomain{} } +func (m *MsgDeleteDomain) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteDomain) ProtoMessage() {} +func (*MsgDeleteDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{3} +} +func (m *MsgDeleteDomain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteDomain.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) +} +func (m *MsgDeleteDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteDomain.Merge(m, src) +} +func (m *MsgDeleteDomain) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteDomain) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteDomain.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteDomain proto.InternalMessageInfo + +func (m *MsgDeleteDomain) GetDomain() string { + if m != nil { + return m.Domain } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) + return "" +} + +func (m *MsgDeleteDomain) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner } - l = len(m.NewCertificate) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) + return nil +} + +func (m *MsgDeleteDomain) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr } - l = len(m.FeePayerAddr) - if l > 0 { - n += 1 + l + sovMsgs(uint64(l)) + return nil +} + +// MsgRegisterAccount is the request +// model used to register new accounts +type MsgRegisterAccount struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // Broker is the account that facilitated the transaction + Broker github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=Broker,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"broker"` + // Registerer is the user who registers this account + Registerer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,6,opt,name=Registerer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"registerer"` + // Resources are the blockchain addresses of the account + Resources []*Resource `protobuf:"bytes,7,rep,name=Resources,proto3" json:"resources"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgRegisterAccount) Reset() { *m = MsgRegisterAccount{} } +func (m *MsgRegisterAccount) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterAccount) ProtoMessage() {} +func (*MsgRegisterAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{4} +} +func (m *MsgRegisterAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterAccount.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +} +func (m *MsgRegisterAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterAccount.Merge(m, src) +} +func (m *MsgRegisterAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterAccount proto.InternalMessageInfo + +func (m *MsgRegisterAccount) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgRegisterAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgRegisterAccount) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgRegisterAccount) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgRegisterAccount) GetBroker() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Broker + } + return nil +} + +func (m *MsgRegisterAccount) GetRegisterer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Registerer + } + return nil +} + +func (m *MsgRegisterAccount) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +// MsgRegisterDomain is the request used to register new domains +type MsgRegisterDomain struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"name"` + Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // Broker is the account that facilitated the transaction + Broker github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=Broker,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"broker"` + // DomainType defines the type of the domain + DomainType DomainType `protobuf:"bytes,5,opt,name=DomainType,proto3,casttype=DomainType" json:"domain_type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgRegisterDomain) Reset() { *m = MsgRegisterDomain{} } +func (m *MsgRegisterDomain) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDomain) ProtoMessage() {} +func (*MsgRegisterDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{5} +} +func (m *MsgRegisterDomain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDomain.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 *MsgRegisterDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDomain.Merge(m, src) +} +func (m *MsgRegisterDomain) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDomain) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDomain.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterDomain proto.InternalMessageInfo + +func (m *MsgRegisterDomain) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgRegisterDomain) GetAdmin() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Admin + } + return nil +} + +func (m *MsgRegisterDomain) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgRegisterDomain) GetBroker() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Broker + } + return nil +} + +func (m *MsgRegisterDomain) GetDomainType() DomainType { + if m != nil { + return m.DomainType + } + return "" +} + +// MsgRenewAccount is the request +// model used to renew accounts +type MsgRenewAccount struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Signer is the signer of the request + Signer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Signer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"signer"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgRenewAccount) Reset() { *m = MsgRenewAccount{} } +func (m *MsgRenewAccount) String() string { return proto.CompactTextString(m) } +func (*MsgRenewAccount) ProtoMessage() {} +func (*MsgRenewAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{6} +} +func (m *MsgRenewAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRenewAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRenewAccount.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 *MsgRenewAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRenewAccount.Merge(m, src) +} +func (m *MsgRenewAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgRenewAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRenewAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRenewAccount proto.InternalMessageInfo + +func (m *MsgRenewAccount) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgRenewAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgRenewAccount) GetSigner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Signer + } + return nil +} + +func (m *MsgRenewAccount) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +// MsgRenewDomain is the request +// model used to renew a domain +type MsgRenewDomain struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Signer is the signer of the request + Signer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Signer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"signer"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgRenewDomain) Reset() { *m = MsgRenewDomain{} } +func (m *MsgRenewDomain) String() string { return proto.CompactTextString(m) } +func (*MsgRenewDomain) ProtoMessage() {} +func (*MsgRenewDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{7} +} +func (m *MsgRenewDomain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRenewDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRenewDomain.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 *MsgRenewDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRenewDomain.Merge(m, src) +} +func (m *MsgRenewDomain) XXX_Size() int { + return m.Size() +} +func (m *MsgRenewDomain) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRenewDomain.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRenewDomain proto.InternalMessageInfo + +func (m *MsgRenewDomain) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgRenewDomain) GetSigner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Signer + } + return nil +} + +func (m *MsgRenewDomain) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +// MsgReplaceAccountResources is the request model +// used to renew resources associated with an account +type MsgReplaceAccountResources struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // NewResources are the new resources + NewResources []*Resource `protobuf:"bytes,5,rep,name=NewResources,proto3" json:"new_resources"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgReplaceAccountResources) Reset() { *m = MsgReplaceAccountResources{} } +func (m *MsgReplaceAccountResources) String() string { return proto.CompactTextString(m) } +func (*MsgReplaceAccountResources) ProtoMessage() {} +func (*MsgReplaceAccountResources) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{8} +} +func (m *MsgReplaceAccountResources) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReplaceAccountResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReplaceAccountResources.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 *MsgReplaceAccountResources) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReplaceAccountResources.Merge(m, src) +} +func (m *MsgReplaceAccountResources) XXX_Size() int { + return m.Size() +} +func (m *MsgReplaceAccountResources) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReplaceAccountResources.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReplaceAccountResources proto.InternalMessageInfo + +func (m *MsgReplaceAccountResources) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgReplaceAccountResources) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgReplaceAccountResources) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgReplaceAccountResources) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgReplaceAccountResources) GetNewResources() []*Resource { + if m != nil { + return m.NewResources + } + return nil +} + +// MsgReplaceAccountMetadata is the function used +// to set accounts metadata +type MsgReplaceAccountMetadata struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // NewMetadataURI is the metadata URI of the account + // we want to update or insert + NewMetadataURI string `protobuf:"bytes,5,opt,name=NewMetadataURI,proto3" json:"new_metadata_uri"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgReplaceAccountMetadata) Reset() { *m = MsgReplaceAccountMetadata{} } +func (m *MsgReplaceAccountMetadata) String() string { return proto.CompactTextString(m) } +func (*MsgReplaceAccountMetadata) ProtoMessage() {} +func (*MsgReplaceAccountMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{9} +} +func (m *MsgReplaceAccountMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReplaceAccountMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReplaceAccountMetadata.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 *MsgReplaceAccountMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReplaceAccountMetadata.Merge(m, src) +} +func (m *MsgReplaceAccountMetadata) XXX_Size() int { + return m.Size() +} +func (m *MsgReplaceAccountMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReplaceAccountMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReplaceAccountMetadata proto.InternalMessageInfo + +func (m *MsgReplaceAccountMetadata) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgReplaceAccountMetadata) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgReplaceAccountMetadata) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgReplaceAccountMetadata) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgReplaceAccountMetadata) GetNewMetadataURI() string { + if m != nil { + return m.NewMetadataURI + } + return "" +} + +// MsgTransferAccount is the request +// model used to transfer accounts +type MsgTransferAccount struct { + // Domain is the domain of the account + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name"` + // Owner is the owner of the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // NewOwner is the new owner of the account + NewOwner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=NewOwner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_owner"` + // ToReset if true, removes all old data from account + ToReset bool `protobuf:"varint,6,opt,name=ToReset,proto3" json:"reset"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgTransferAccount) Reset() { *m = MsgTransferAccount{} } +func (m *MsgTransferAccount) String() string { return proto.CompactTextString(m) } +func (*MsgTransferAccount) ProtoMessage() {} +func (*MsgTransferAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{10} +} +func (m *MsgTransferAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferAccount.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 *MsgTransferAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferAccount.Merge(m, src) +} +func (m *MsgTransferAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferAccount proto.InternalMessageInfo + +func (m *MsgTransferAccount) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgTransferAccount) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgTransferAccount) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgTransferAccount) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgTransferAccount) GetNewOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.NewOwner + } + return nil +} + +func (m *MsgTransferAccount) GetToReset() bool { + if m != nil { + return m.ToReset + } + return false +} + +// MsgTransferDomain is the request model +// used to transfer a domain +type MsgTransferDomain struct { + // Domain is the name of the domain + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Owner is the owner of the domain + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // FeePayerAddr is the address of the entity that has to pay product fees + FeePayerAddr github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=FeePayerAddr,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"fee_payer"` + // NewAdmin is the new owner of the domain + NewAdmin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=NewAdmin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"new_admin"` + TransferFlag TransferFlag `protobuf:"varint,5,opt,name=TransferFlag,proto3,casttype=TransferFlag" json:"transfer_flag"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgTransferDomain) Reset() { *m = MsgTransferDomain{} } +func (m *MsgTransferDomain) String() string { return proto.CompactTextString(m) } +func (*MsgTransferDomain) ProtoMessage() {} +func (*MsgTransferDomain) Descriptor() ([]byte, []int) { + return fileDescriptor_67a31da34b6acae6, []int{11} +} +func (m *MsgTransferDomain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferDomain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferDomain.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 *MsgTransferDomain) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferDomain.Merge(m, src) +} +func (m *MsgTransferDomain) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferDomain) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferDomain.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferDomain proto.InternalMessageInfo + +func (m *MsgTransferDomain) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *MsgTransferDomain) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *MsgTransferDomain) GetFeePayerAddr() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.FeePayerAddr + } + return nil +} + +func (m *MsgTransferDomain) GetNewAdmin() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.NewAdmin + } + return nil +} + +func (m *MsgTransferDomain) GetTransferFlag() TransferFlag { + if m != nil { + return m.TransferFlag + } + return 0 +} + +func init() { + proto.RegisterType((*MsgAddAccountCertificates)(nil), "MsgAddAccountCertificates") + proto.RegisterType((*MsgDeleteAccountCertificate)(nil), "MsgDeleteAccountCertificate") + proto.RegisterType((*MsgDeleteAccount)(nil), "MsgDeleteAccount") + proto.RegisterType((*MsgDeleteDomain)(nil), "MsgDeleteDomain") + proto.RegisterType((*MsgRegisterAccount)(nil), "MsgRegisterAccount") + proto.RegisterType((*MsgRegisterDomain)(nil), "MsgRegisterDomain") + proto.RegisterType((*MsgRenewAccount)(nil), "MsgRenewAccount") + proto.RegisterType((*MsgRenewDomain)(nil), "MsgRenewDomain") + proto.RegisterType((*MsgReplaceAccountResources)(nil), "MsgReplaceAccountResources") + proto.RegisterType((*MsgReplaceAccountMetadata)(nil), "MsgReplaceAccountMetadata") + proto.RegisterType((*MsgTransferAccount)(nil), "MsgTransferAccount") + proto.RegisterType((*MsgTransferDomain)(nil), "MsgTransferDomain") +} + +func init() { proto.RegisterFile("x/starname/types/msgs.proto", fileDescriptor_67a31da34b6acae6) } + +var fileDescriptor_67a31da34b6acae6 = []byte{ + // 790 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x98, 0x4d, 0x6f, 0xd3, 0x4c, + 0x10, 0xc7, 0x1f, 0x3b, 0x2f, 0x6d, 0xb6, 0xe9, 0x9b, 0x9f, 0xea, 0x51, 0x9e, 0xb6, 0xc4, 0xc5, + 0x5c, 0xca, 0xa1, 0x8d, 0x04, 0x12, 0x07, 0xca, 0x5b, 0x4c, 0xa9, 0xc4, 0x21, 0xa1, 0x72, 0xcb, + 0xa5, 0x97, 0xc8, 0xb1, 0x27, 0xc6, 0x6a, 0xec, 0x8d, 0x76, 0x1d, 0x42, 0xbf, 0x02, 0x02, 0x89, + 0x23, 0x1f, 0x89, 0x63, 0xb9, 0x70, 0x41, 0xb2, 0x50, 0xb9, 0x19, 0xf1, 0x05, 0xc2, 0x05, 0xed, + 0xda, 0x4e, 0x9c, 0x44, 0x48, 0x24, 0x6a, 0x7a, 0x20, 0x5c, 0xe2, 0xcd, 0xcc, 0xee, 0xdf, 0x3b, + 0xbf, 0xf1, 0x8e, 0x47, 0x46, 0x1b, 0xaf, 0x4a, 0xd4, 0xd3, 0x89, 0xab, 0x3b, 0x50, 0xf2, 0xce, + 0x5a, 0x40, 0x4b, 0x0e, 0xb5, 0xe8, 0x6e, 0x8b, 0x60, 0x0f, 0xaf, 0xaf, 0x59, 0xd8, 0xc2, 0x7c, + 0x58, 0x62, 0xa3, 0xc8, 0xba, 0x39, 0xb2, 0x84, 0xff, 0x86, 0x5e, 0xe5, 0x5c, 0x44, 0xff, 0x57, + 0xa8, 0x55, 0x36, 0xcd, 0xb2, 0x61, 0xe0, 0xb6, 0xeb, 0x3d, 0x06, 0xe2, 0xd9, 0x0d, 0xdb, 0xd0, + 0x3d, 0xa0, 0x92, 0x82, 0xb2, 0xfb, 0xd8, 0xd1, 0x6d, 0xb7, 0x20, 0x6c, 0x09, 0xdb, 0x39, 0x15, + 0x05, 0xbe, 0x9c, 0x35, 0xb9, 0x45, 0x8b, 0x3c, 0xd2, 0x26, 0x4a, 0x57, 0x75, 0x07, 0x0a, 0x22, + 0x9f, 0x31, 0x1f, 0xf8, 0x72, 0x9a, 0xdd, 0x4b, 0xe3, 0x56, 0xe9, 0x10, 0x65, 0x9e, 0x75, 0x5c, + 0x20, 0x85, 0xd4, 0x96, 0xb0, 0x9d, 0x57, 0xef, 0x06, 0xbe, 0x9c, 0xc1, 0xcc, 0xd0, 0xf5, 0xe5, + 0x1d, 0xcb, 0xf6, 0x5e, 0xb4, 0xeb, 0xbb, 0x06, 0x76, 0x4a, 0x06, 0xa6, 0x0e, 0xa6, 0xd1, 0x65, + 0x87, 0x9a, 0xa7, 0xd1, 0x2e, 0xcb, 0x86, 0x51, 0x36, 0x4d, 0x02, 0x94, 0x6a, 0xa1, 0x90, 0x54, + 0x47, 0xf9, 0x03, 0x80, 0x43, 0xfd, 0x0c, 0x08, 0xf3, 0x14, 0xd2, 0x5c, 0xf8, 0x41, 0xe0, 0xcb, + 0xb9, 0x06, 0x40, 0xad, 0xc5, 0x1c, 0xe3, 0x8b, 0x0f, 0x68, 0x4a, 0x7b, 0x68, 0xa9, 0x0a, 0x9d, + 0x04, 0x8a, 0x42, 0x86, 0xdf, 0xe5, 0xdf, 0xc0, 0x97, 0x97, 0x5d, 0xe8, 0xd4, 0x8c, 0xbe, 0x4b, + 0x1b, 0x9a, 0xaa, 0x7c, 0x16, 0xd1, 0x46, 0x85, 0x5a, 0xfb, 0xd0, 0x04, 0x0f, 0x46, 0xa9, 0xce, + 0x2c, 0xd4, 0x7d, 0xb4, 0x1a, 0x32, 0x19, 0xe5, 0xfa, 0x5f, 0xe0, 0xcb, 0x92, 0xc9, 0x9d, 0x03, + 0x68, 0x47, 0x17, 0x28, 0xaf, 0x45, 0xb4, 0x32, 0x4c, 0x77, 0x56, 0x91, 0x2a, 0xdf, 0x04, 0xb4, + 0xdc, 0x83, 0x11, 0xc5, 0xf9, 0x3b, 0x2c, 0x7a, 0xd1, 0x8a, 0xd3, 0x8a, 0x36, 0x35, 0x85, 0x68, + 0xbb, 0x29, 0x24, 0x55, 0xa8, 0xa5, 0x81, 0x65, 0x53, 0x0f, 0xc8, 0x8c, 0x27, 0x5f, 0x3a, 0x42, + 0x59, 0x95, 0xe0, 0x53, 0x20, 0xd1, 0x21, 0xda, 0x63, 0x71, 0xd7, 0xb9, 0x65, 0x7c, 0xe9, 0x48, + 0x4a, 0xaa, 0x21, 0x14, 0xf3, 0x05, 0x52, 0xc8, 0x72, 0xe1, 0x87, 0x81, 0x2f, 0x23, 0xd2, 0xb3, + 0x8e, 0x2f, 0x9e, 0x90, 0x94, 0xee, 0xa0, 0x9c, 0x06, 0x14, 0xb7, 0x89, 0x01, 0xb4, 0x30, 0xb7, + 0x95, 0xda, 0x5e, 0xb8, 0x95, 0xdb, 0x8d, 0x2d, 0xea, 0x22, 0x23, 0x44, 0x62, 0xbf, 0xd6, 0x9f, + 0xaa, 0xfc, 0x10, 0xd1, 0x6a, 0x22, 0xf9, 0x43, 0x79, 0x15, 0x7e, 0x95, 0xd7, 0xb2, 0xe9, 0xd8, + 0x6e, 0xf2, 0x31, 0xd7, 0x99, 0x61, 0x82, 0xbc, 0x72, 0xa1, 0xab, 0x78, 0xcc, 0x13, 0x79, 0x4d, + 0x5f, 0x5e, 0x5e, 0xef, 0x23, 0x14, 0x22, 0x3b, 0x3e, 0x6b, 0x85, 0x55, 0x37, 0xa7, 0x5e, 0x0b, + 0x7c, 0x79, 0x21, 0x3c, 0x28, 0x35, 0xb6, 0xb0, 0xeb, 0xcb, 0x89, 0x49, 0x5a, 0x62, 0xac, 0xbc, + 0x11, 0x79, 0xa1, 0xd1, 0xc0, 0x85, 0xce, 0xe5, 0x9d, 0xbb, 0x23, 0x94, 0x3d, 0xb2, 0xad, 0xfe, + 0xc1, 0xe3, 0x91, 0x52, 0x6e, 0x99, 0x20, 0xd2, 0x50, 0xea, 0x4a, 0xea, 0xee, 0x77, 0x01, 0x2d, + 0xc5, 0x38, 0xc6, 0x28, 0xbb, 0xfd, 0x78, 0xc5, 0xe9, 0xc5, 0x3b, 0x8d, 0xca, 0xfb, 0x49, 0x44, + 0xeb, 0x3c, 0xde, 0x56, 0x53, 0x37, 0xe2, 0xb7, 0x6e, 0xef, 0x6c, 0xce, 0x6c, 0x05, 0x7e, 0x84, + 0xf2, 0x55, 0xe8, 0xf4, 0xcb, 0x59, 0x66, 0xb8, 0x9c, 0xad, 0x06, 0xbe, 0xbc, 0xc8, 0xfa, 0xc5, + 0x7e, 0x49, 0x1b, 0x58, 0xa1, 0x7c, 0x0c, 0xdb, 0xef, 0x41, 0xb0, 0x15, 0xf0, 0x74, 0x53, 0xf7, + 0xf4, 0x99, 0xe5, 0x7a, 0x8f, 0xb7, 0xdf, 0x31, 0x86, 0xe7, 0xda, 0xd3, 0xa8, 0x60, 0xad, 0x05, + 0xbe, 0xbc, 0xc2, 0x70, 0x3a, 0x91, 0xab, 0xd6, 0x26, 0xb6, 0x36, 0x34, 0x57, 0x79, 0x1b, 0xb6, + 0x09, 0xc7, 0x44, 0x77, 0x69, 0xe3, 0x6f, 0x9b, 0x70, 0x82, 0xe6, 0xab, 0xd0, 0x09, 0x37, 0x9e, + 0xe9, 0xeb, 0x33, 0x8c, 0x13, 0x6e, 0xbe, 0xa7, 0x27, 0xdd, 0x40, 0x73, 0xc7, 0x58, 0x03, 0x0a, + 0x1e, 0x6f, 0x15, 0xe6, 0xd5, 0x1c, 0x63, 0x42, 0x98, 0x41, 0x8b, 0x3d, 0xca, 0xbb, 0x14, 0x7f, + 0x73, 0xc7, 0xf9, 0xf8, 0xd3, 0xdb, 0xd4, 0x08, 0x78, 0xd8, 0x78, 0xa4, 0x07, 0x81, 0x4f, 0xd8, + 0x7c, 0xf4, 0xf4, 0xa4, 0x27, 0x28, 0x1f, 0x73, 0x3c, 0x68, 0xea, 0x16, 0x4f, 0x68, 0x4a, 0xbd, + 0xce, 0xca, 0x8c, 0x17, 0xd9, 0x6b, 0x8d, 0xa6, 0x6e, 0x75, 0x7d, 0x79, 0x60, 0xa2, 0x36, 0xf0, + 0x4f, 0xdd, 0xfb, 0x70, 0x51, 0x14, 0xce, 0x2f, 0x8a, 0xc2, 0x97, 0x8b, 0xa2, 0xf0, 0xfe, 0x6b, + 0xf1, 0x9f, 0x93, 0x9b, 0x89, 0x1d, 0xd9, 0xf8, 0xe5, 0x0e, 0x76, 0x81, 0x5d, 0x5d, 0x5a, 0x1a, + 0xfe, 0x7c, 0x50, 0xcf, 0xf2, 0x2f, 0x07, 0xb7, 0x7f, 0x06, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xe4, + 0xcf, 0xbd, 0x8c, 0x10, 0x00, 0x00, +} + +func (m *MsgAddAccountCertificates) 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 *MsgAddAccountCertificates) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddAccountCertificates) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.NewCertificate) > 0 { + i -= len(m.NewCertificate) + copy(dAtA[i:], m.NewCertificate) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewCertificate))) + i-- + dAtA[i] = 0x2a + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAccountCertificate) 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 *MsgDeleteAccountCertificate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAccountCertificate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DeleteCertificate) > 0 { + i -= len(m.DeleteCertificate) + copy(dAtA[i:], m.DeleteCertificate) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.DeleteCertificate))) + i-- + dAtA[i] = 0x2a + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAccount) 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 *MsgDeleteAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteDomain) 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 *MsgDeleteDomain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterAccount) 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 *MsgRegisterAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.Registerer) > 0 { + i -= len(m.Registerer) + copy(dAtA[i:], m.Registerer) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Registerer))) + i-- + dAtA[i] = 0x32 + } + if len(m.Broker) > 0 { + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0x2a + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterDomain) 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 *MsgRegisterDomain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DomainType) > 0 { + i -= len(m.DomainType) + copy(dAtA[i:], m.DomainType) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.DomainType))) + i-- + dAtA[i] = 0x2a + } + if len(m.Broker) > 0 { + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0x22 + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRenewAccount) 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 *MsgRenewAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRenewAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRenewDomain) 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 *MsgRenewDomain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRenewDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReplaceAccountResources) 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 *MsgReplaceAccountResources) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReplaceAccountResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.NewResources) > 0 { + for iNdEx := len(m.NewResources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NewResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReplaceAccountMetadata) 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 *MsgReplaceAccountMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReplaceAccountMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.NewMetadataURI) > 0 { + i -= len(m.NewMetadataURI) + copy(dAtA[i:], m.NewMetadataURI) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewMetadataURI))) + i-- + dAtA[i] = 0x2a + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferAccount) 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 *MsgTransferAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ToReset { + i-- + if m.ToReset { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.NewOwner) > 0 { + i -= len(m.NewOwner) + copy(dAtA[i:], m.NewOwner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewOwner))) + i-- + dAtA[i] = 0x2a + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferDomain) 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 *MsgTransferDomain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.TransferFlag != 0 { + i = encodeVarintMsgs(dAtA, i, uint64(m.TransferFlag)) + i-- + dAtA[i] = 0x28 + } + if len(m.NewAdmin) > 0 { + i -= len(m.NewAdmin) + copy(dAtA[i:], m.NewAdmin) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.NewAdmin))) + i-- + dAtA[i] = 0x22 + } + if len(m.FeePayerAddr) > 0 { + i -= len(m.FeePayerAddr) + copy(dAtA[i:], m.FeePayerAddr) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.FeePayerAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAddAccountCertificates) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.NewCertificate) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgDeleteAccountCertificate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.DeleteCertificate) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgDeleteAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgDeleteDomain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgRegisterAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Broker) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Registerer) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgRegisterDomain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Broker) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.DomainType) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgRenewAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgRenewDomain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgReplaceAccountResources) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if len(m.NewResources) > 0 { + for _, e := range m.NewResources { + l = e.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgReplaceAccountMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.NewMetadataURI) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgTransferAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.ToReset { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgTransferDomain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.FeePayerAddr) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.NewAdmin) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.TransferFlag != 0 { + n += 1 + sovMsgs(uint64(m.TransferFlag)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMsgs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgs(x uint64) (n int) { + return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAddAccountCertificates) 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 ErrIntOverflowMsgs + } + 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: MsgAddAccountCertificates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddAccountCertificates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewCertificate", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewCertificate = append(m.NewCertificate[:0], dAtA[iNdEx:postIndex]...) + if m.NewCertificate == nil { + m.NewCertificate = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteAccountCertificate) 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 ErrIntOverflowMsgs + } + 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: MsgDeleteAccountCertificate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteAccountCertificate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DeleteCertificate", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DeleteCertificate = append(m.DeleteCertificate[:0], dAtA[iNdEx:postIndex]...) + if m.DeleteCertificate == nil { + m.DeleteCertificate = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteAccount) 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 ErrIntOverflowMsgs + } + 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: MsgDeleteAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteDomain) 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 ErrIntOverflowMsgs + } + 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: MsgDeleteDomain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteDomain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterAccount) 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 ErrIntOverflowMsgs + } + 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: MsgRegisterAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = append(m.Broker[:0], dAtA[iNdEx:postIndex]...) + if m.Broker == nil { + m.Broker = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Registerer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Registerer = append(m.Registerer[:0], dAtA[iNdEx:postIndex]...) + if m.Registerer == nil { + m.Registerer = []byte{} + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterDomain) 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 ErrIntOverflowMsgs + } + 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: MsgRegisterDomain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterDomain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = append(m.Admin[:0], dAtA[iNdEx:postIndex]...) + if m.Admin == nil { + m.Admin = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = append(m.Broker[:0], dAtA[iNdEx:postIndex]...) + if m.Broker == nil { + m.Broker = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DomainType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DomainType = DomainType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRenewAccount) 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 ErrIntOverflowMsgs + } + 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: MsgRenewAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRenewAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = append(m.Signer[:0], dAtA[iNdEx:postIndex]...) + if m.Signer == nil { + m.Signer = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRenewDomain) 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 ErrIntOverflowMsgs + } + 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: MsgRenewDomain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRenewDomain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = append(m.Signer[:0], dAtA[iNdEx:postIndex]...) + if m.Signer == nil { + m.Signer = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReplaceAccountResources) 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 ErrIntOverflowMsgs + } + 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: MsgReplaceAccountResources: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReplaceAccountResources: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewResources = append(m.NewResources, &Resource{}) + if err := m.NewResources[len(m.NewResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReplaceAccountMetadata) 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 ErrIntOverflowMsgs + } + 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: MsgReplaceAccountMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReplaceAccountMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewMetadataURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewMetadataURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } } - return n -} -func sovMsgs(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMsgs(x uint64) (n int) { - return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil } -func (m *MsgAddAccountCertificates) Unmarshal(dAtA []byte) error { +func (m *MsgTransferAccount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -274,10 +4317,10 @@ func (m *MsgAddAccountCertificates) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAddAccountCertificates: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTransferAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAddAccountCertificates: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTransferAccount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -380,7 +4423,7 @@ func (m *MsgAddAccountCertificates) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewCertificate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -407,12 +4450,186 @@ func (m *MsgAddAccountCertificates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NewCertificate = append(m.NewCertificate[:0], dAtA[iNdEx:postIndex]...) - if m.NewCertificate == nil { - m.NewCertificate = []byte{} + m.FeePayerAddr = append(m.FeePayerAddr[:0], dAtA[iNdEx:postIndex]...) + if m.FeePayerAddr == nil { + m.FeePayerAddr = []byte{} } iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewOwner = append(m.NewOwner[:0], dAtA[iNdEx:postIndex]...) + if m.NewOwner == nil { + m.NewOwner = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ToReset", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ToReset = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgTransferDomain) 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 ErrIntOverflowMsgs + } + 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: MsgTransferDomain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferDomain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + 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 ErrInvalidLengthMsgs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FeePayerAddr", wireType) } @@ -446,6 +4663,59 @@ func (m *MsgAddAccountCertificates) Unmarshal(dAtA []byte) error { m.FeePayerAddr = []byte{} } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NewAdmin = append(m.NewAdmin[:0], dAtA[iNdEx:postIndex]...) + if m.NewAdmin == nil { + m.NewAdmin = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferFlag", wireType) + } + m.TransferFlag = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TransferFlag |= TransferFlag(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipMsgs(dAtA[iNdEx:]) diff --git a/x/starname/types/msgs.proto b/x/starname/types/msgs.proto index 8ae08035..29f4157e 100644 --- a/x/starname/types/msgs.proto +++ b/x/starname/types/msgs.proto @@ -3,6 +3,7 @@ syntax="proto3"; option go_package="github.com/iov-one/iovns/x/starname/types"; import "gogoproto/gogo.proto"; +import "x/starname/types/types.proto"; // MsgAddAccountCertificates is the message used // when a user wants to add new certificates @@ -17,11 +18,259 @@ message MsgAddAccountCertificates { (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", (gogoproto.jsontag) = "owner" ]; - // NewCertificate is the new certificate to add - bytes NewCertificate = 4 [(gogoproto.jsontag) = "new_certificate"]; // FeePayerAddr is the address of the entity that has to pay product fees - bytes FeePayerAddr = 5 [ + bytes FeePayerAddr = 4 [ (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", (gogoproto.jsontag) = "fee_payer" ]; -} \ No newline at end of file + // NewCertificate is the new certificate to add + bytes NewCertificate = 5 [(gogoproto.jsontag) = "new_certificate"]; +} +// MsgDeleteAccountCertificate is the request +// model used to remove certificates from an +// account +message MsgDeleteAccountCertificate { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // DeleteCertificate is the certificate to delete + bytes DeleteCertificate = 5 [(gogoproto.jsontag) = "delete_certificate"]; +} + +// MsgDeleteAccount is the request model +// used to delete an account +message MsgDeleteAccount { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; +} + +// MsgDeleteDomain is the request +// model to delete a domain +message MsgDeleteDomain { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Owner is the owner of the account + bytes Owner = 2 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; +} + +// MsgRegisterAccount is the request +// model used to register new accounts +message MsgRegisterAccount { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // Broker is the account that facilitated the transaction + bytes Broker = 5 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "broker" + ]; + // Registerer is the user who registers this account + bytes Registerer = 6 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "registerer" + ]; + // Resources are the blockchain addresses of the account + repeated Resource Resources = 7 [(gogoproto.jsontag) = "resources"]; +} + +// MsgRegisterDomain is the request used to register new domains +message MsgRegisterDomain { + string Name = 1 [(gogoproto.jsontag) = "name"]; + bytes Admin = 2 [ + (gogoproto.jsontag) = "admin", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // Broker is the account that facilitated the transaction + bytes Broker = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "broker" + ]; + // DomainType defines the type of the domain + string DomainType = 5 [ + (gogoproto.casttype) = "DomainType", + (gogoproto.jsontag) = "domain_type" + ]; +} + +// MsgRenewAccount is the request +// model used to renew accounts +message MsgRenewAccount { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Signer is the signer of the request + bytes Signer = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "signer" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; +} + +// MsgRenewDomain is the request +// model used to renew a domain +message MsgRenewDomain { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Signer is the signer of the request + bytes Signer = 2 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "signer" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; +} + +// MsgReplaceAccountResources is the request model +// used to renew resources associated with an account +message MsgReplaceAccountResources { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // NewResources are the new resources + repeated Resource NewResources = 5 [ + (gogoproto.jsontag) = "new_resources" + ]; +} + +// MsgReplaceAccountMetadata is the function used +// to set accounts metadata +message MsgReplaceAccountMetadata { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // NewMetadataURI is the metadata URI of the account + // we want to update or insert + string NewMetadataURI = 5 [(gogoproto.jsontag) = "new_metadata_uri"]; +} + +// MsgTransferAccount is the request +// model used to transfer accounts +message MsgTransferAccount { + // Domain is the domain of the account + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + string Name = 2 [(gogoproto.jsontag) = "name"]; + // Owner is the owner of the account + bytes Owner = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // NewOwner is the new owner of the account + bytes NewOwner = 5 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "new_owner" + ]; + // ToReset if true, removes all old data from account + bool ToReset = 6 [ // TODO json tag needs to be changed once backwards compatibility is guaranteed + (gogoproto.jsontag) = "reset" + ]; +} + +// MsgTransferDomain is the request model +// used to transfer a domain +message MsgTransferDomain { + // Domain is the name of the domain + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Owner is the owner of the domain + bytes Owner = 2 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "owner" + ]; + // FeePayerAddr is the address of the entity that has to pay product fees + bytes FeePayerAddr = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "fee_payer" + ]; + // NewAdmin is the new owner of the domain + bytes NewAdmin = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "new_admin" + ]; + + int64 TransferFlag = 5 [ + (gogoproto.casttype) = "TransferFlag", + (gogoproto.jsontag) = "transfer_flag" + ]; +} diff --git a/x/starname/types/types.go b/x/starname/types/types.go index 0cb4addc..9be2dfe6 100644 --- a/x/starname/types/types.go +++ b/x/starname/types/types.go @@ -8,8 +8,6 @@ import ( "github.com/iov-one/iovns/pkg/utils" "github.com/cosmos/cosmos-sdk/types/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" ) const DomainAdminIndex = 0x1 @@ -20,32 +18,18 @@ const AccountResourcesIndex = 0x3 // StarnameSeparator defines the starname separator identifier const StarnameSeparator = "*" -// Domain defines a domain -type Domain struct { - // Name is the name of the domain - Name string `json:"name" crud:"primaryKey"` - // Owner is the owner of the domain - Admin sdk.AccAddress `json:"admin" crud:"01"` - // ValidUntil is a unix timestamp defines the time when the domain will become invalid - ValidUntil int64 `json:"valid_until"` - // Type defines the type of the domain - Type DomainType `json:"type"` - // Broker TODO needs comment - Broker sdk.AccAddress `json:"broker"` -} - -func (d *Domain) PrimaryKey() crud.PrimaryKey { - if d.Name == "" { +func (m *Domain) PrimaryKey() crud.PrimaryKey { + if m.Name == "" { return nil } - return crud.NewPrimaryKeyFromString(d.Name) + return crud.NewPrimaryKeyFromString(m.Name) } -func (d *Domain) SecondaryKeys() []crud.SecondaryKey { - if d.Admin.Empty() { +func (m *Domain) SecondaryKeys() []crud.SecondaryKey { + if m.Admin.Empty() { return nil } - return []crud.SecondaryKey{crud.NewSecondaryKey(DomainAdminIndex, d.Admin)} + return []crud.SecondaryKey{crud.NewSecondaryKey(DomainAdminIndex, m.Admin)} } // DomainType defines the type of the domain @@ -67,72 +51,49 @@ func ValidateDomainType(typ DomainType) error { } } -// Account defines an account that belongs to a domain -// NOTE: It should not be confused with cosmos-sdk auth account -// github.com/cosmos/cosmos-sdk/x/auth.Account -type Account struct { - // Domain references the domain this account belongs to - Domain string `json:"domain"` - // Name is the name of the account - Name *string `json:"name"` - // Owner is the address that owns the account - Owner sdk.AccAddress `json:"owner"` - // ValidUntil defines a unix timestamp of the expiration of the account - ValidUntil int64 `json:"valid_until"` - // Resources is the list of resources an account resolves to - Resources []Resource `json:"resources"` - // Certificates contains the list of certificates to identify the account owner - Certificates []Certificate `json:"certificates"` - // Broker can be empty - // it identifies an entity that facilitated the transaction of the account - Broker sdk.AccAddress `json:"broker"` - // MetadataURI contains a link to extra information regarding the account - MetadataURI string `json:"metadata_uri"` -} - type accountCodecAlias struct { Underlying *Account NameNil bool } -func (a *Account) MarshalCRUD() interface{} { +func (m *Account) MarshalCRUD() interface{} { return accountCodecAlias{ - Underlying: a, - NameNil: a.Name == nil, + Underlying: m, + NameNil: m.Name == nil, } } -func (a *Account) UnmarshalCRUD(cdc *codec.Codec, b []byte) { +func (m *Account) UnmarshalCRUD(cdc *codec.Codec, b []byte) { trg := new(accountCodecAlias) cdc.MustUnmarshalBinaryBare(b, trg) - *a = *trg.Underlying - if a.Name == nil && !trg.NameNil { - a.Name = utils.StrPtr("") + *m = *trg.Underlying + if m.Name == nil && !trg.NameNil { + m.Name = utils.StrPtr("") } } -func (a *Account) PrimaryKey() crud.PrimaryKey { - if len(a.Domain) == 0 || a.Name == nil { +func (m *Account) PrimaryKey() crud.PrimaryKey { + if len(m.Domain) == 0 || m.Name == nil { return nil } - j := strings.Join([]string{a.Domain, *a.Name}, "*") + j := strings.Join([]string{m.Domain, *m.Name}, "*") return crud.NewPrimaryKeyFromString(j) } -func (a *Account) SecondaryKeys() []crud.SecondaryKey { +func (m *Account) SecondaryKeys() []crud.SecondaryKey { var sk []crud.SecondaryKey // index by owner - if !a.Owner.Empty() { - ownerIndex := crud.NewSecondaryKey(AccountAdminIndex, a.Owner) + if !m.Owner.Empty() { + ownerIndex := crud.NewSecondaryKey(AccountAdminIndex, m.Owner) sk = append(sk, ownerIndex) } // index by domain - if len(a.Domain) != 0 { - domainIndex := crud.NewSecondaryKey(AccountDomainIndex, []byte(a.Domain)) + if len(m.Domain) != 0 { + domainIndex := crud.NewSecondaryKey(AccountDomainIndex, []byte(m.Domain)) sk = append(sk, domainIndex) } // index by resources - for _, res := range a.Resources { + for _, res := range m.Resources { // exclude empty resources if res.Resource == "" || res.URI == "" { continue @@ -145,13 +106,5 @@ func (a *Account) SecondaryKeys() []crud.SecondaryKey { return sk } -// Resource defines a resource an account can resolve to -type Resource struct { - // URI defines the ID of the resource - URI string `json:"uri"` - // Resource is the resource - Resource string `json:"resource"` -} - // Certificate defines a certificate type Certificate []byte diff --git a/x/starname/types/types.pb.go b/x/starname/types/types.pb.go index 02dd5bcb..fbf00dca 100644 --- a/x/starname/types/types.pb.go +++ b/x/starname/types/types.pb.go @@ -5,8 +5,14 @@ package types import ( fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" proto "github.com/golang/protobuf/proto" + io "io" math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. @@ -20,13 +26,1328 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +// Resource defines a resource an account can resolve to +type Resource struct { + // URI defines the ID of the resource + URI string `protobuf:"bytes,1,opt,name=URI,proto3" json:"uri"` + // Resource is the resource + Resource string `protobuf:"bytes,2,opt,name=Resource,proto3" json:"resource"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Resource) Reset() { *m = Resource{} } +func (m *Resource) String() string { return proto.CompactTextString(m) } +func (*Resource) ProtoMessage() {} +func (*Resource) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68cf137d2ded7a, []int{0} +} +func (m *Resource) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Resource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Resource.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 *Resource) XXX_Merge(src proto.Message) { + xxx_messageInfo_Resource.Merge(m, src) +} +func (m *Resource) XXX_Size() int { + return m.Size() +} +func (m *Resource) XXX_DiscardUnknown() { + xxx_messageInfo_Resource.DiscardUnknown(m) +} + +var xxx_messageInfo_Resource proto.InternalMessageInfo + +func (m *Resource) GetURI() string { + if m != nil { + return m.URI + } + return "" +} + +func (m *Resource) GetResource() string { + if m != nil { + return m.Resource + } + return "" +} + +// Domain defines a domain +type Domain struct { + // Name is the name of the domain + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"name"` + // Admin is the owner of the domain + Admin github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Admin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"admin"` + Broker github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Broker,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"broker"` + // ValidUntil is a unix timestamp defines the time when the domain will become invalid in seconds + ValidUntil int64 `protobuf:"varint,4,opt,name=ValidUntil,proto3" json:"valid_until"` + // Type defines the type of the domain + Type DomainType `protobuf:"bytes,5,opt,name=Type,proto3,casttype=DomainType" json:"type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Domain) Reset() { *m = Domain{} } +func (m *Domain) String() string { return proto.CompactTextString(m) } +func (*Domain) ProtoMessage() {} +func (*Domain) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68cf137d2ded7a, []int{1} +} +func (m *Domain) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Domain.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 *Domain) XXX_Merge(src proto.Message) { + xxx_messageInfo_Domain.Merge(m, src) +} +func (m *Domain) XXX_Size() int { + return m.Size() +} +func (m *Domain) XXX_DiscardUnknown() { + xxx_messageInfo_Domain.DiscardUnknown(m) +} + +var xxx_messageInfo_Domain proto.InternalMessageInfo + +func (m *Domain) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Domain) GetAdmin() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Admin + } + return nil +} + +func (m *Domain) GetBroker() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Broker + } + return nil +} + +func (m *Domain) GetValidUntil() int64 { + if m != nil { + return m.ValidUntil + } + return 0 +} + +func (m *Domain) GetType() DomainType { + if m != nil { + return m.Type + } + return "" +} + +// Account defines an account that belongs to a domain +// NOTE: It should not be confused with cosmos-sdk auth account +// github.com/cosmos/cosmos-sdk/x/auth.Account +type Account struct { + // Domain references the domain this account belongs to + Domain string `protobuf:"bytes,1,opt,name=Domain,proto3" json:"domain"` + // Name is the name of the account + Name *string `protobuf:"bytes,2,opt,name=Name,proto3,wktptr" json:"name"` + // Owner is the address that owns the account + Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=Owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner"` + // Broker can be empty + // it identifies an entity that facilitated the transaction of the account + Broker github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=Broker,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"broker"` + // ValidUntil defines a unix timestamp of the expiration of the account in seconds + ValidUntil int64 `protobuf:"varint,5,opt,name=ValidUntil,proto3" json:"valid_until"` + // Resources is the list of resources an account resolves to + Resources []*Resource `protobuf:"bytes,6,rep,name=Resources,proto3" json:"resources"` + // Certificates contains the list of certificates to identify the account owner + Certificates [][]byte `protobuf:"bytes,7,rep,name=Certificates,proto3" json:"certificates"` + // MetadataURI contains a link to extra information regarding the account + MetadataURI string `protobuf:"bytes,8,opt,name=MetadataURI,proto3" json:"metadata_uri"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Account) Reset() { *m = Account{} } +func (m *Account) String() string { return proto.CompactTextString(m) } +func (*Account) ProtoMessage() {} +func (*Account) Descriptor() ([]byte, []int) { + return fileDescriptor_cb68cf137d2ded7a, []int{2} +} +func (m *Account) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Account.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 *Account) XXX_Merge(src proto.Message) { + xxx_messageInfo_Account.Merge(m, src) +} +func (m *Account) XXX_Size() int { + return m.Size() +} +func (m *Account) XXX_DiscardUnknown() { + xxx_messageInfo_Account.DiscardUnknown(m) +} + +var xxx_messageInfo_Account proto.InternalMessageInfo + +func (m *Account) GetDomain() string { + if m != nil { + return m.Domain + } + return "" +} + +func (m *Account) GetName() *string { + if m != nil { + return m.Name + } + return nil +} + +func (m *Account) GetOwner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Owner + } + return nil +} + +func (m *Account) GetBroker() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Broker + } + return nil +} + +func (m *Account) GetValidUntil() int64 { + if m != nil { + return m.ValidUntil + } + return 0 +} + +func (m *Account) GetResources() []*Resource { + if m != nil { + return m.Resources + } + return nil +} + +func (m *Account) GetCertificates() [][]byte { + if m != nil { + return m.Certificates + } + return nil +} + +func (m *Account) GetMetadataURI() string { + if m != nil { + return m.MetadataURI + } + return "" +} + +func init() { + proto.RegisterType((*Resource)(nil), "Resource") + proto.RegisterType((*Domain)(nil), "Domain") + proto.RegisterType((*Account)(nil), "Account") +} + func init() { proto.RegisterFile("x/starname/types/types.proto", fileDescriptor_cb68cf137d2ded7a) } var fileDescriptor_cb68cf137d2ded7a = []byte{ - // 74 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xa9, 0xd0, 0x2f, 0x2e, - 0x49, 0x2c, 0xca, 0x4b, 0xcc, 0x4d, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x86, 0x90, 0x7a, 0x05, - 0x45, 0xf9, 0x25, 0xf9, 0x4e, 0x02, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, - 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0x60, 0x09, 0x63, 0x40, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xa8, 0x73, 0xe7, 0x42, 0x38, 0x00, 0x00, 0x00, + // 526 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4f, 0x8b, 0x13, 0x3d, + 0x1c, 0xc7, 0x9f, 0xd9, 0xe9, 0xdf, 0xb4, 0x0f, 0x4a, 0x10, 0x19, 0xa5, 0x34, 0xa5, 0xa7, 0x2a, + 0x74, 0x06, 0xaa, 0x78, 0x70, 0x41, 0xe8, 0xe8, 0xc5, 0x83, 0xae, 0x64, 0xdd, 0x3d, 0x78, 0x59, + 0xd2, 0x99, 0xec, 0x18, 0xb6, 0x33, 0x29, 0x49, 0x66, 0xd7, 0x7d, 0x27, 0x1e, 0x3d, 0xfb, 0x4a, + 0x3c, 0xfa, 0x0a, 0xa2, 0xd4, 0x83, 0x30, 0x2f, 0x61, 0x4f, 0x92, 0x34, 0xb3, 0xad, 0x5e, 0x44, + 0xc1, 0x4b, 0x27, 0xfd, 0xe4, 0x97, 0x2f, 0xc9, 0xe7, 0x97, 0x80, 0xc1, 0xbb, 0x48, 0x2a, 0x22, + 0x0a, 0x92, 0xd3, 0x48, 0x5d, 0xae, 0xa8, 0xdc, 0xfc, 0x86, 0x2b, 0xc1, 0x15, 0xbf, 0x7b, 0x2b, + 0xe3, 0x19, 0xb7, 0xc3, 0xc8, 0x8c, 0x1c, 0x1d, 0x66, 0x9c, 0x67, 0x4b, 0x1a, 0xd9, 0x7f, 0x8b, + 0xf2, 0x34, 0xba, 0x10, 0x64, 0xb5, 0xa2, 0xc2, 0xad, 0x1a, 0x1f, 0x80, 0x0e, 0xa6, 0x92, 0x97, + 0x22, 0xa1, 0xf0, 0x0e, 0xf0, 0x8f, 0xf0, 0xf3, 0xc0, 0x1b, 0x79, 0x93, 0x6e, 0xdc, 0xae, 0x34, + 0xf2, 0x4b, 0xc1, 0xb0, 0x61, 0x70, 0xb2, 0x2d, 0x0b, 0xf6, 0xec, 0x7c, 0xbf, 0xd2, 0xa8, 0x23, + 0x1c, 0xc3, 0xd7, 0xb3, 0xe3, 0x8f, 0x7b, 0xa0, 0xf5, 0x8c, 0xe7, 0x84, 0x15, 0x70, 0x00, 0x1a, + 0x2f, 0x49, 0x4e, 0x5d, 0x60, 0xa7, 0xd2, 0xa8, 0x61, 0xf6, 0x8e, 0x2d, 0x85, 0xaf, 0x40, 0x73, + 0x9e, 0xe6, 0xac, 0xb0, 0x79, 0xfd, 0xf8, 0x71, 0xa5, 0x51, 0x93, 0x18, 0x70, 0xa5, 0xd1, 0x34, + 0x63, 0xea, 0x6d, 0xb9, 0x08, 0x13, 0x9e, 0x47, 0x09, 0x97, 0x39, 0x97, 0xee, 0x33, 0x95, 0xe9, + 0x99, 0x3b, 0xf5, 0x3c, 0x49, 0xe6, 0x69, 0x2a, 0xa8, 0x94, 0x78, 0x13, 0x04, 0x0f, 0x41, 0x2b, + 0x16, 0xfc, 0x8c, 0x8a, 0xc0, 0xb7, 0x91, 0xfb, 0x95, 0x46, 0xad, 0x85, 0x25, 0x7f, 0x9e, 0xe9, + 0xa2, 0x60, 0x04, 0xc0, 0x31, 0x59, 0xb2, 0xf4, 0xa8, 0x50, 0x6c, 0x19, 0x34, 0x46, 0xde, 0xc4, + 0x8f, 0x6f, 0x54, 0x1a, 0xf5, 0xce, 0x0d, 0x3d, 0x29, 0x0d, 0xc6, 0x3b, 0x25, 0xf0, 0x3e, 0x68, + 0xbc, 0xbe, 0x5c, 0xd1, 0xa0, 0x69, 0x4f, 0x7d, 0xdb, 0x9c, 0xda, 0x84, 0x5f, 0x69, 0x04, 0x36, + 0x5e, 0xcc, 0x2c, 0xb6, 0x35, 0xe3, 0xef, 0x3e, 0x68, 0xcf, 0x93, 0x84, 0x97, 0x85, 0x82, 0xe3, + 0xda, 0x9b, 0xf3, 0x05, 0xcc, 0xee, 0x53, 0x4b, 0x70, 0x6d, 0xf4, 0x89, 0x33, 0x6a, 0x94, 0xf5, + 0x66, 0x83, 0x70, 0xd3, 0xdc, 0xb0, 0x6e, 0x6e, 0x78, 0xa8, 0x04, 0x2b, 0xb2, 0x63, 0xb2, 0x2c, + 0xa9, 0x6d, 0x90, 0xf5, 0xfd, 0xe1, 0x0b, 0xf2, 0xb6, 0xce, 0x0f, 0x2e, 0x8a, 0x6b, 0x41, 0xd6, + 0x39, 0x37, 0xe0, 0x2f, 0x9c, 0xdb, 0xa0, 0x1d, 0xe7, 0x8d, 0x7f, 0xe5, 0xbc, 0xf9, 0x7b, 0xe7, + 0x8f, 0x40, 0xb7, 0xbe, 0x80, 0x32, 0x68, 0x8d, 0xfc, 0x49, 0x6f, 0xd6, 0x0d, 0x6b, 0x12, 0xff, + 0x5f, 0x69, 0xd4, 0xad, 0xaf, 0xaa, 0xc4, 0xdb, 0x52, 0xf8, 0x10, 0xf4, 0x9f, 0x52, 0xa1, 0xd8, + 0x29, 0x4b, 0x88, 0xa2, 0x32, 0x68, 0x8f, 0xfc, 0x49, 0x3f, 0xbe, 0x59, 0x69, 0xd4, 0x4f, 0x76, + 0x38, 0xfe, 0xa9, 0x0a, 0xce, 0x40, 0xef, 0x05, 0x55, 0x24, 0x25, 0x8a, 0x98, 0xf7, 0xd2, 0xb1, + 0xed, 0xb2, 0x8b, 0x72, 0x87, 0x4f, 0xcc, 0xc3, 0xd9, 0x2d, 0x8a, 0xf7, 0x3f, 0xad, 0x87, 0xde, + 0xe7, 0xf5, 0xd0, 0xfb, 0xba, 0x1e, 0x7a, 0xef, 0xbf, 0x0d, 0xff, 0x7b, 0x73, 0x6f, 0xc7, 0x0d, + 0xe3, 0xe7, 0x53, 0x5e, 0x50, 0xf3, 0x2d, 0x64, 0xf4, 0xeb, 0x33, 0x5f, 0xb4, 0x6c, 0x83, 0x1f, + 0xfc, 0x08, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x4f, 0x55, 0xd0, 0x01, 0x04, 0x00, 0x00, } + +func (m *Resource) 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 *Resource) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Resource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Resource) > 0 { + i -= len(m.Resource) + copy(dAtA[i:], m.Resource) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Resource))) + i-- + dAtA[i] = 0x12 + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintTypes(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Domain) 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 *Domain) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Domain) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x2a + } + if m.ValidUntil != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ValidUntil)) + i-- + dAtA[i] = 0x20 + } + if len(m.Broker) > 0 { + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0x1a + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Admin))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Account) 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 *Account) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.MetadataURI) > 0 { + i -= len(m.MetadataURI) + copy(dAtA[i:], m.MetadataURI) + i = encodeVarintTypes(dAtA, i, uint64(len(m.MetadataURI))) + i-- + dAtA[i] = 0x42 + } + if len(m.Certificates) > 0 { + for iNdEx := len(m.Certificates) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Certificates[iNdEx]) + copy(dAtA[i:], m.Certificates[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Certificates[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Resources) > 0 { + for iNdEx := len(m.Resources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Resources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.ValidUntil != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ValidUntil)) + i-- + dAtA[i] = 0x28 + } + if len(m.Broker) > 0 { + i -= len(m.Broker) + copy(dAtA[i:], m.Broker) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Broker))) + i-- + dAtA[i] = 0x22 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if m.Name != nil { + n1, err1 := github_com_gogo_protobuf_types.StdStringMarshalTo(*m.Name, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdString(*m.Name):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintTypes(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + } + if len(m.Domain) > 0 { + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Domain))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Resource) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.URI) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Resource) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Domain) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Admin) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Broker) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidUntil != 0 { + n += 1 + sovTypes(uint64(m.ValidUntil)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Account) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Domain) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.Name != nil { + l = github_com_gogo_protobuf_types.SizeOfStdString(*m.Name) + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.Broker) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.ValidUntil != 0 { + n += 1 + sovTypes(uint64(m.ValidUntil)) + } + if len(m.Resources) > 0 { + for _, e := range m.Resources { + l = e.Size() + n += 1 + l + sovTypes(uint64(l)) + } + } + if len(m.Certificates) > 0 { + for _, b := range m.Certificates { + l = len(b) + n += 1 + l + sovTypes(uint64(l)) + } + } + l = len(m.MetadataURI) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Resource) 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 ErrIntOverflowTypes + } + 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: Resource: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Resource: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Domain) 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 ErrIntOverflowTypes + } + 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: Domain: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Domain: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Admin = append(m.Admin[:0], dAtA[iNdEx:postIndex]...) + if m.Admin == nil { + m.Admin = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = append(m.Broker[:0], dAtA[iNdEx:postIndex]...) + if m.Broker == nil { + m.Broker = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidUntil", wireType) + } + m.ValidUntil = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidUntil |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = DomainType(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Account) 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 ErrIntOverflowTypes + } + 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: Account: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Account: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Domain", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Domain = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Name == nil { + m.Name = new(string) + } + if err := github_com_gogo_protobuf_types.StdStringUnmarshal(m.Name, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) + if m.Owner == nil { + m.Owner = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Broker", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Broker = append(m.Broker[:0], dAtA[iNdEx:postIndex]...) + if m.Broker == nil { + m.Broker = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidUntil", wireType) + } + m.ValidUntil = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidUntil |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Resources = append(m.Resources, &Resource{}) + if err := m.Resources[len(m.Resources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Certificates", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Certificates = append(m.Certificates, make([]byte, postIndex-iNdEx)) + copy(m.Certificates[len(m.Certificates)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetadataURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetadataURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/starname/types/types.proto b/x/starname/types/types.proto index 6d604b89..9008d5f8 100644 --- a/x/starname/types/types.proto +++ b/x/starname/types/types.proto @@ -1,3 +1,62 @@ syntax="proto3"; option go_package="github.com/iov-one/iovns/x/starname/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/wrappers.proto"; + +// Resource defines a resource an account can resolve to +message Resource { + // URI defines the ID of the resource + string URI = 1 [(gogoproto.jsontag) = "uri"]; + // Resource is the resource + string Resource = 2 [(gogoproto.jsontag) = "resource"]; +} + +// Domain defines a domain +message Domain { + // Name is the name of the domain + string Name = 1 [(gogoproto.jsontag) = "name"]; + // Admin is the owner of the domain + bytes Admin = 2 [ + (gogoproto.jsontag) = "admin", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + bytes Broker = 3 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "broker" + ]; + // ValidUntil is a unix timestamp defines the time when the domain will become invalid in seconds + int64 ValidUntil = 4 [(gogoproto.jsontag) = "valid_until"]; + // Type defines the type of the domain + string Type = 5 [(gogoproto.jsontag) = "type", (gogoproto.casttype) = "DomainType"]; +} + +// Account defines an account that belongs to a domain +// NOTE: It should not be confused with cosmos-sdk auth account +// github.com/cosmos/cosmos-sdk/x/auth.Account +message Account { + // Domain references the domain this account belongs to + string Domain = 1 [(gogoproto.jsontag) = "domain"]; + // Name is the name of the account + google.protobuf.StringValue Name = 2 [(gogoproto.wktpointer) = true, (gogoproto.jsontag) = "name"]; + // Owner is the address that owns the account + bytes Owner = 3 [ + (gogoproto.jsontag) = "owner", + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + // Broker can be empty + // it identifies an entity that facilitated the transaction of the account + bytes Broker = 4 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.jsontag) = "broker" + ]; + // ValidUntil defines a unix timestamp of the expiration of the account in seconds + int64 ValidUntil = 5 [(gogoproto.jsontag) = "valid_until"]; + // Resources is the list of resources an account resolves to + repeated Resource Resources = 6 [(gogoproto.jsontag) = "resources"]; + // Certificates contains the list of certificates to identify the account owner + repeated bytes Certificates = 7 [(gogoproto.jsontag) = "certificates"]; + // MetadataURI contains a link to extra information regarding the account + string MetadataURI = 8 [(gogoproto.jsontag) = "metadata_uri"]; +} \ No newline at end of file From a9b355d3835f6f8038ac3137f1556a169027cb56 Mon Sep 17 00:00:00 2001 From: frojdidymylja Date: Tue, 20 Oct 2020 10:49:53 +0200 Subject: [PATCH 4/4] change: move configuration to proto --- Makefile | 8 +- runtimes/protobuild.dockerfile | 17 +- x/configuration/handler.go | 2 +- x/configuration/types/fees.go | 52 - x/configuration/types/msgs.go | 19 +- x/configuration/types/msgs.pb.go | 652 ++++++++ x/configuration/types/msgs.proto | 27 + x/configuration/types/types.go | 1 + x/configuration/types/types.pb.go | 2441 +++++++++++++++++++++++++++++ x/configuration/types/types.proto | 171 ++ 10 files changed, 3317 insertions(+), 73 deletions(-) create mode 100644 x/configuration/types/msgs.pb.go create mode 100644 x/configuration/types/msgs.proto create mode 100644 x/configuration/types/types.go create mode 100644 x/configuration/types/types.pb.go create mode 100644 x/configuration/types/types.proto diff --git a/Makefile b/Makefile index fcd52c5a..99aa160b 100644 --- a/Makefile +++ b/Makefile @@ -86,11 +86,15 @@ proto: protoc -I=. \ -I=${GOPATH}/src/github.com/gogo/protobuf \ -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ - --gofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,paths=source_relative:. x/starname/types/types.proto + --gofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,paths=source_relative:. \ + x/starname/types/msgs.proto x/starname/types/types.proto + protoc -I=. \ -I=${GOPATH}/src/github.com/gogo/protobuf \ -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf \ - --gofast_out=Mgoogle/protobuf/descriptor.proto=github.com/golang/protobuf/protoc-gen-go/descriptor,paths=source_relative:. x/starname/types/msgs.proto + -I=/proto_includes \ + --gofast_out=Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,paths=source_relative:. \ + x/configuration/types/msgs.proto x/configuration/types/types.proto test: @# iovnscli binary is required for it tests diff --git a/runtimes/protobuild.dockerfile b/runtimes/protobuild.dockerfile index 6d5cfbf6..6f04bffa 100644 --- a/runtimes/protobuild.dockerfile +++ b/runtimes/protobuild.dockerfile @@ -2,13 +2,12 @@ FROM alpine as protoc ARG PROTOC_VERSION="3.13.0" ARG PROTOC_ZIP=protoc-${PROTOC_VERSION}-linux-aarch_64.zip +ARG COSMOS_VERSION=master RUN apk --no-cache add curl WORKDIR /protoc RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP} RUN unzip -o $PROTOC_ZIP -RUN ls -al -RUN ls -al ./include FROM golang:1.15-alpine # add g++ required for ledger @@ -25,4 +24,18 @@ ENV PATH=$PATH:/protobuf:/go/bin RUN apk --no-cache add git # INSTALL gogoproto RUN go get github.com/gogo/protobuf/protoc-gen-gofast +# install cosmos dependencies +WORKDIR /tmp +RUN git clone https://github.com/cosmos/cosmos-sdk.git +WORKDIR /tmp/cosmos-sdk +# checkout to pinned version +RUN git checkout ${COSMOS_VERSION} +# save proto includes from cosmos-sdk +WORKDIR /proto_includes +RUN mv /tmp/cosmos-sdk/proto/cosmos /proto_includes/cosmos +RUN mv /tmp/cosmos-sdk/proto/ibc /proto_includes/ibc +# remove cosmos repository +RUN rm -rf /tmp/cosmos-sdk +# switch to default dir +WORKDIR /src CMD ["sh"] \ No newline at end of file diff --git a/x/configuration/handler.go b/x/configuration/handler.go index e5a1a313..47e9f05a 100644 --- a/x/configuration/handler.go +++ b/x/configuration/handler.go @@ -36,7 +36,7 @@ func handleUpdateConfig(ctx sdk.Context, msg types.MsgUpdateConfig, k Keeper) (* return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to update configuration", msg.Signer) } // if allowed update configuration - k.SetConfig(ctx, msg.NewConfiguration) + k.SetConfig(ctx, *msg.NewConfiguration) // TODO emit event return &sdk.Result{}, nil } diff --git a/x/configuration/types/fees.go b/x/configuration/types/fees.go index 0cf3b96a..2994d7b6 100644 --- a/x/configuration/types/fees.go +++ b/x/configuration/types/fees.go @@ -11,58 +11,6 @@ func NewFees() *Fees { return &Fees{} } -// Fees contains different type of fees -// to calculate coins to detract when -// processing different messages -type Fees struct { - // FeeCoinDenom defines the denominator of the coin used to process fees - FeeCoinDenom string `json:"fee_coin_denom"` - // FeeCoinPrice defines the price of the coin - FeeCoinPrice sdk.Dec `json:"fee_coin_price"` - // FeeDefault is the parameter defining the default fee - FeeDefault sdk.Dec `json:"fee_default"` - // account fees - // RegisterAccountClosed is the fee to be paid to register an account in a closed domain - RegisterAccountClosed sdk.Dec `json:"register_account_closed"` - // RegisterAccountOpen is the fee to be paid to register an account in an open domain - RegisterAccountOpen sdk.Dec `json:"register_account_open"` - // TransferAccountClosed is the fee to be paid to register an account in a closed domain - TransferAccountClosed sdk.Dec `json:"transfer_account_closed"` - // TransferAccountOpen is the fee to be paid to register an account in an open domain - TransferAccountOpen sdk.Dec `json:"transfer_account_open"` - // ReplaceAccountResources is the fee to be paid to replace account's resources - ReplaceAccountResources sdk.Dec `json:"replace_account_resources"` - // AddAccountCertificate is the fee to be paid to add a certificate to an account - AddAccountCertificate sdk.Dec `json:"add_account_certificate"` - // DelAccountCertificate is the feed to be paid to delete a certificate in an account - DelAccountCertificate sdk.Dec `json:"del_account_certificate"` - // SetAccountMetadata is the fee to be paid to set account's metadata - SetAccountMetadata sdk.Dec `json:"set_account_metadata"` - // domain fees - // Register domain - // RegisterDomain1 is the fee to be paid to register a domain with one character - RegisterDomain1 sdk.Dec `json:"register_domain_1"` - // RegisterDomain2 is the fee to be paid to register a domain with two characters - RegisterDomain2 sdk.Dec `json:"register_domain_2"` - // RegisterDomain3 is the fee to be paid to register a domain with three characters - RegisterDomain3 sdk.Dec `json:"register_domain_3"` - // RegisterDomain4 is the fee to be paid to register a domain with four characters - RegisterDomain4 sdk.Dec `json:"register_domain_4"` - // RegisterDomain5 is the fee to be paid to register a domain with five characters - RegisterDomain5 sdk.Dec `json:"register_domain_5"` - // RegisterDomainDefault is the fee to be paid to register a domain with more than five characters - RegisterDomainDefault sdk.Dec `json:"register_domain_default"` - // RegisterDomainMultiplier is the multiplication applied to fees in register domain operations if they're of open type - RegisterOpenDomainMultiplier sdk.Dec `json:"register_open_domain_multiplier"` - // TransferDomain - // TransferDomainClosed is the fee to be paid to transfer a closed domain - TransferDomainClosed sdk.Dec `json:"transfer_domain_closed"` - // TransferDomainOpen is the fee to be paid to transfer open domains - TransferDomainOpen sdk.Dec `json:"transfer_domain_open"` - // RenewDomainOpen is the fee to be paid to renew an open domain - RenewDomainOpen sdk.Dec `json:"renew_domain_open"` -} - // Validate validates the fee object func (f *Fees) Validate() error { if f == nil { diff --git a/x/configuration/types/msgs.go b/x/configuration/types/msgs.go index 37ea3c31..5eb81a2e 100644 --- a/x/configuration/types/msgs.go +++ b/x/configuration/types/msgs.go @@ -5,15 +5,6 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// MsgUpdateConfig is used to update -// configuration using a multisig strategy -type MsgUpdateConfig struct { - // Signer is the address of the entity who is doing the transaction - Signer sdk.AccAddress - // NewConfiguration contains the new configuration data - NewConfiguration Config -} - var _ sdk.Msg = (*MsgUpdateConfig)(nil) // Route implements sdk.Msg @@ -24,6 +15,9 @@ func (m MsgUpdateConfig) Type() string { return "update_config" } // ValidateBasic implements sdk.Msg func (m MsgUpdateConfig) ValidateBasic() error { + if m.NewConfiguration == nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "missing configuration") + } if m.Signer.Empty() { return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "no signer specified") } @@ -36,13 +30,6 @@ func (m MsgUpdateConfig) GetSignBytes() []byte { return sdk.MustSortJSON(ModuleC // GetSigners implements sdk.Msg func (m MsgUpdateConfig) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{m.Signer} } -type MsgUpdateFees struct { - // Fees represent the new fees to apply - Fees *Fees - // Configurer is the address that is singing the message - Configurer sdk.AccAddress -} - // Route implements sdk.Msg func (m MsgUpdateFees) Route() string { return RouterKey diff --git a/x/configuration/types/msgs.pb.go b/x/configuration/types/msgs.pb.go new file mode 100644 index 00000000..dc992e3e --- /dev/null +++ b/x/configuration/types/msgs.pb.go @@ -0,0 +1,652 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: x/configuration/types/msgs.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateConfig is used to update +// configuration using a multisig strategy +type MsgUpdateConfig struct { + // Signer is the address of the entity who is doing the transaction + Signer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=Signer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"Signer,omitempty"` + // NewConfiguration contains the new configuration data + NewConfiguration *Config `protobuf:"bytes,2,opt,name=NewConfiguration,proto3" json:"NewConfiguration,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgUpdateConfig) Reset() { *m = MsgUpdateConfig{} } +func (m *MsgUpdateConfig) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateConfig) ProtoMessage() {} +func (*MsgUpdateConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_5be913bfc2b9176b, []int{0} +} +func (m *MsgUpdateConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateConfig.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 *MsgUpdateConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateConfig.Merge(m, src) +} +func (m *MsgUpdateConfig) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateConfig) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateConfig proto.InternalMessageInfo + +func (m *MsgUpdateConfig) GetSigner() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Signer + } + return nil +} + +func (m *MsgUpdateConfig) GetNewConfiguration() *Config { + if m != nil { + return m.NewConfiguration + } + return nil +} + +// MsgUpdateFees is used to update +// the product fees required when interacting +// with the starname module. +type MsgUpdateFees struct { + Fees *Fees `protobuf:"bytes,1,opt,name=Fees,proto3" json:"Fees,omitempty"` + Configurer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,2,opt,name=Configurer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"Configurer,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MsgUpdateFees) Reset() { *m = MsgUpdateFees{} } +func (m *MsgUpdateFees) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateFees) ProtoMessage() {} +func (*MsgUpdateFees) Descriptor() ([]byte, []int) { + return fileDescriptor_5be913bfc2b9176b, []int{1} +} +func (m *MsgUpdateFees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateFees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateFees.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 *MsgUpdateFees) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateFees.Merge(m, src) +} +func (m *MsgUpdateFees) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateFees) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateFees.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateFees proto.InternalMessageInfo + +func (m *MsgUpdateFees) GetFees() *Fees { + if m != nil { + return m.Fees + } + return nil +} + +func (m *MsgUpdateFees) GetConfigurer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Configurer + } + return nil +} + +func init() { + proto.RegisterType((*MsgUpdateConfig)(nil), "MsgUpdateConfig") + proto.RegisterType((*MsgUpdateFees)(nil), "MsgUpdateFees") +} + +func init() { proto.RegisterFile("x/configuration/types/msgs.proto", fileDescriptor_5be913bfc2b9176b) } + +var fileDescriptor_5be913bfc2b9176b = []byte{ + // 270 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xa8, 0xd0, 0x4f, 0xce, + 0xcf, 0x4b, 0xcb, 0x4c, 0x2f, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0xcf, 0x2d, 0x4e, 0x2f, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x97, 0x12, 0x49, 0xcf, + 0x4f, 0xcf, 0x07, 0x33, 0xf5, 0x41, 0x2c, 0xa8, 0xa8, 0x22, 0x76, 0x7d, 0x60, 0x12, 0xa2, 0x44, + 0x69, 0x3a, 0x23, 0x17, 0xbf, 0x6f, 0x71, 0x7a, 0x68, 0x41, 0x4a, 0x62, 0x49, 0xaa, 0x33, 0x58, + 0xb1, 0x90, 0x27, 0x17, 0x5b, 0x70, 0x66, 0x7a, 0x5e, 0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, + 0x8f, 0x93, 0xe1, 0xaf, 0x7b, 0xf2, 0xba, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, + 0xb9, 0xfa, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0x50, 0x4a, 0xb7, 0x38, 0x25, 0x1b, 0x6a, 0xa2, + 0x63, 0x72, 0xb2, 0x63, 0x4a, 0x4a, 0x51, 0x6a, 0x71, 0x71, 0x10, 0xd4, 0x00, 0x21, 0x4b, 0x2e, + 0x01, 0xbf, 0xd4, 0x72, 0x67, 0x64, 0x47, 0x48, 0x30, 0x29, 0x30, 0x6a, 0x70, 0x1b, 0xb1, 0xeb, + 0x41, 0x44, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x0c, 0xc2, 0x50, 0xa6, 0x54, 0xcb, 0xc5, 0x0b, + 0x77, 0x98, 0x5b, 0x6a, 0x6a, 0xb1, 0x90, 0x24, 0x17, 0x0b, 0x88, 0x06, 0x3b, 0x8a, 0xdb, 0x88, + 0x55, 0x0f, 0xc4, 0x09, 0x02, 0x0b, 0x09, 0x05, 0x72, 0x71, 0xc1, 0x34, 0xa7, 0x16, 0x81, 0x2d, + 0x20, 0xcb, 0xd5, 0x48, 0x86, 0x38, 0x39, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, + 0x83, 0x47, 0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0x21, 0x19, 0x96, 0x99, 0x5f, 0xa6, + 0x9b, 0x9f, 0x97, 0x0a, 0xa2, 0xf3, 0x8a, 0xf5, 0xb1, 0x06, 0x73, 0x12, 0x1b, 0x38, 0x84, 0x8d, + 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x85, 0x7d, 0x3f, 0xea, 0xbe, 0x01, 0x00, 0x00, +} + +func (m *MsgUpdateConfig) 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 *MsgUpdateConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.NewConfiguration != nil { + { + size, err := m.NewConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateFees) 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 *MsgUpdateFees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateFees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Configurer) > 0 { + i -= len(m.Configurer) + copy(dAtA[i:], m.Configurer) + i = encodeVarintMsgs(dAtA, i, uint64(len(m.Configurer))) + i-- + dAtA[i] = 0x12 + } + if m.Fees != nil { + { + size, err := m.Fees.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMsgs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMsgs(dAtA []byte, offset int, v uint64) int { + offset -= sovMsgs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.NewConfiguration != nil { + l = m.NewConfiguration.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *MsgUpdateFees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Fees != nil { + l = m.Fees.Size() + n += 1 + l + sovMsgs(uint64(l)) + } + l = len(m.Configurer) + if l > 0 { + n += 1 + l + sovMsgs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovMsgs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMsgs(x uint64) (n int) { + return sovMsgs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateConfig) 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 ErrIntOverflowMsgs + } + 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: MsgUpdateConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = append(m.Signer[:0], dAtA[iNdEx:postIndex]...) + if m.Signer == nil { + m.Signer = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewConfiguration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewConfiguration == nil { + m.NewConfiguration = &Config{} + } + if err := m.NewConfiguration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateFees) 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 ErrIntOverflowMsgs + } + 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: MsgUpdateFees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateFees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fees == nil { + m.Fees = &Fees{} + } + if err := m.Fees.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configurer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMsgs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMsgs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMsgs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Configurer = append(m.Configurer[:0], dAtA[iNdEx:postIndex]...) + if m.Configurer == nil { + m.Configurer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMsgs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMsgs + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMsgs(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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrIntOverflowMsgs + } + 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, ErrInvalidLengthMsgs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMsgs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMsgs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMsgs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMsgs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMsgs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/configuration/types/msgs.proto b/x/configuration/types/msgs.proto new file mode 100644 index 00000000..26b19d78 --- /dev/null +++ b/x/configuration/types/msgs.proto @@ -0,0 +1,27 @@ +syntax="proto3"; + +option go_package="github.com/iov-one/iovns/x/configuration/types"; + +import "gogoproto/gogo.proto"; +import "x/configuration/types/types.proto"; + +// MsgUpdateConfig is used to update +// configuration using a multisig strategy +message MsgUpdateConfig { + // Signer is the address of the entity who is doing the transaction + bytes Signer = 1 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; + // NewConfiguration contains the new configuration data + Config NewConfiguration = 2 [(gogoproto.nullable)=true]; +} + +// MsgUpdateFees is used to update +// the product fees required when interacting +// with the starname module. +message MsgUpdateFees { + Fees Fees = 1; + bytes Configurer = 2 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress" + ]; +} \ No newline at end of file diff --git a/x/configuration/types/types.go b/x/configuration/types/types.go new file mode 100644 index 00000000..ab1254f4 --- /dev/null +++ b/x/configuration/types/types.go @@ -0,0 +1 @@ +package types diff --git a/x/configuration/types/types.pb.go b/x/configuration/types/types.pb.go new file mode 100644 index 00000000..44669bd3 --- /dev/null +++ b/x/configuration/types/types.pb.go @@ -0,0 +1,2441 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: x/configuration/types/types.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + types "github.com/gogo/protobuf/types" + proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package + +// Config is the configuration of the network +type Config struct { + // Configurer is the configuration owner, the addresses allowed to handle fees + // and register domains with no superuser + Configurer github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=Configurer,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"configurer"` + // ValidDomainName defines a regexp that determines if a domain name is valid or not + ValidDomainName string `protobuf:"bytes,2,opt,name=ValidDomainName,proto3" json:"valid_domain_name"` + // ValidAccountName defines a regexp that determines if an account name is valid or not + ValidAccountName string `protobuf:"bytes,3,opt,name=ValidAccountName,proto3" json:"valid_account_name"` + // ValidURI defines a regexp that determines if resource uri is valid or not + ValidURI string `protobuf:"bytes,4,opt,name=ValidURI,proto3" json:"valid_uri"` + // ValidResource determines a regexp for a resource content + ValidResource string `protobuf:"bytes,5,opt,name=ValidResource,proto3" json:"valid_resource"` + // DomainRenewalPeriod defines the duration of the domain renewal period in seconds + DomainRenewalPeriod types.Duration `protobuf:"bytes,6,opt,name=DomainRenewalPeriod,proto3" json:"domain_renewal_period"` + // DomainRenewalCountMax defines maximum number of domain renewals a user can do + DomainRenewalCountMax uint32 `protobuf:"varint,7,opt,name=DomainRenewalCountMax,proto3" json:"domain_renewal_count_max"` + // DomainGracePeriod defines the grace period for a domain deletion in seconds + DomainGracePeriod types.Duration `protobuf:"bytes,8,opt,name=DomainGracePeriod,proto3" json:"domain_grace_period"` + // AccountRenewalPeriod defines the duration of the account renewal period in seconds + AccountRenewalPeriod types.Duration `protobuf:"bytes,9,opt,name=AccountRenewalPeriod,proto3" json:"account_renewal_period"` + // AccountRenewalCountMax defines maximum number of account renewals a user can do + AccountRenewalCountMax uint32 `protobuf:"varint,10,opt,name=AccountRenewalCountMax,proto3" json:"account_renewal_count_max"` + // DomainGracePeriod defines the grace period for a domain deletion in seconds + AccountGracePeriod types.Duration `protobuf:"bytes,11,opt,name=AccountGracePeriod,proto3" json:"account_grace_period"` + // ResourcesMax defines maximum number of resources could be saved under an account + ResourcesMax uint32 `protobuf:"varint,12,opt,name=ResourcesMax,proto3" json:"resources_max"` + // CertificateSizeMax defines maximum size of a certificate that could be saved under an account + CertificateSizeMax uint64 `protobuf:"varint,13,opt,name=CertificateSizeMax,proto3" json:"certificate_size_max"` + // CertificateCountMax defines maximum number of certificates that could be saved under an account + CertificateCountMax uint32 `protobuf:"varint,14,opt,name=CertificateCountMax,proto3" json:"certificate_count_max"` + // MetadataSizeMax defines maximum size of metadata that could be saved under an account + MetadataSizeMax uint64 `protobuf:"varint,15,opt,name=MetadataSizeMax,proto3" json:"metadata_size_max"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { + return fileDescriptor_c149be06521486db, []int{0} +} +func (m *Config) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Config.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 *Config) XXX_Merge(src proto.Message) { + xxx_messageInfo_Config.Merge(m, src) +} +func (m *Config) XXX_Size() int { + return m.Size() +} +func (m *Config) XXX_DiscardUnknown() { + xxx_messageInfo_Config.DiscardUnknown(m) +} + +var xxx_messageInfo_Config proto.InternalMessageInfo + +func (m *Config) GetConfigurer() github_com_cosmos_cosmos_sdk_types.AccAddress { + if m != nil { + return m.Configurer + } + return nil +} + +func (m *Config) GetValidDomainName() string { + if m != nil { + return m.ValidDomainName + } + return "" +} + +func (m *Config) GetValidAccountName() string { + if m != nil { + return m.ValidAccountName + } + return "" +} + +func (m *Config) GetValidURI() string { + if m != nil { + return m.ValidURI + } + return "" +} + +func (m *Config) GetValidResource() string { + if m != nil { + return m.ValidResource + } + return "" +} + +func (m *Config) GetDomainRenewalPeriod() types.Duration { + if m != nil { + return m.DomainRenewalPeriod + } + return types.Duration{} +} + +func (m *Config) GetDomainRenewalCountMax() uint32 { + if m != nil { + return m.DomainRenewalCountMax + } + return 0 +} + +func (m *Config) GetDomainGracePeriod() types.Duration { + if m != nil { + return m.DomainGracePeriod + } + return types.Duration{} +} + +func (m *Config) GetAccountRenewalPeriod() types.Duration { + if m != nil { + return m.AccountRenewalPeriod + } + return types.Duration{} +} + +func (m *Config) GetAccountRenewalCountMax() uint32 { + if m != nil { + return m.AccountRenewalCountMax + } + return 0 +} + +func (m *Config) GetAccountGracePeriod() types.Duration { + if m != nil { + return m.AccountGracePeriod + } + return types.Duration{} +} + +func (m *Config) GetResourcesMax() uint32 { + if m != nil { + return m.ResourcesMax + } + return 0 +} + +func (m *Config) GetCertificateSizeMax() uint64 { + if m != nil { + return m.CertificateSizeMax + } + return 0 +} + +func (m *Config) GetCertificateCountMax() uint32 { + if m != nil { + return m.CertificateCountMax + } + return 0 +} + +func (m *Config) GetMetadataSizeMax() uint64 { + if m != nil { + return m.MetadataSizeMax + } + return 0 +} + +// Fees contains different type of fees +// to calculate coins to detract when +// processing different messages +type Fees struct { + // FeeCoinDenom defines the denominator of the coin used to process fees + FeeCoinDenom string `protobuf:"bytes,1,opt,name=FeeCoinDenom,proto3" json:"fee_coin_denom"` + // FeeCoinPrice defines the price of the coin + FeeCoinPrice *types1.DecProto `protobuf:"bytes,2,opt,name=FeeCoinPrice,proto3" json:"fee_coin_price"` + // FeeDefault is the parameter defining the default fee + FeeDefault *types1.DecProto `protobuf:"bytes,3,opt,name=FeeDefault,proto3" json:"fee_default"` + // RegisterAccountClosed is the fee to be paid to register an account in a closed domain + RegisterAccountClosed *types1.DecProto `protobuf:"bytes,4,opt,name=RegisterAccountClosed,proto3" json:"register_account_closed"` + // RegisterAccountOpen is the fee to be paid to register an account in an open domain + RegisterAccountOpen *types1.DecProto `protobuf:"bytes,5,opt,name=RegisterAccountOpen,proto3" json:"register_account_open"` + // TransferAccountClosed is the fee to be paid to register an account in a closed domain + TransferAccountClosed *types1.DecProto `protobuf:"bytes,6,opt,name=TransferAccountClosed,proto3" json:"transfer_account_closed"` + // TransferAccountOpen is the fee to be paid to register an account in an open domain + TransferAccountOpen *types1.DecProto `protobuf:"bytes,7,opt,name=TransferAccountOpen,proto3" json:"transfer_account_open"` + // ReplaceAccountResources is the fee to be paid to replace account's resources + ReplaceAccountResources *types1.DecProto `protobuf:"bytes,8,opt,name=ReplaceAccountResources,proto3" json:"replace_account_resources"` + // AddAccountCertificate is the fee to be paid to add a certificate to an account + AddAccountCertificate *types1.DecProto `protobuf:"bytes,9,opt,name=AddAccountCertificate,proto3" json:"add_account_certificate"` + // DelAccountCertificate is the feed to be paid to delete a certificate in an account + DelAccountCertificate *types1.DecProto `protobuf:"bytes,10,opt,name=DelAccountCertificate,proto3" json:"del_account_certificate"` + // SetAccountMetadata is the fee to be paid to set account's metadata + SetAccountMetadata *types1.DecProto `protobuf:"bytes,11,opt,name=SetAccountMetadata,proto3" json:"set_account_metadata"` + // RegisterDomain1 is the fee to be paid to register a domain with one character + RegisterDomain1 *types1.DecProto `protobuf:"bytes,12,opt,name=RegisterDomain1,proto3" json:"register_domain_1"` + // RegisterDomain2 is the fee to be paid to register a domain with two characters + RegisterDomain2 *types1.DecProto `protobuf:"bytes,13,opt,name=RegisterDomain2,proto3" json:"register_domain_2"` + // RegisterDomain3 is the fee to be paid to register a domain with three characters + RegisterDomain3 *types1.DecProto `protobuf:"bytes,14,opt,name=RegisterDomain3,proto3" json:"register_domain_3"` + // RegisterDomain4 is the fee to be paid to register a domain with four characters + RegisterDomain4 *types1.DecProto `protobuf:"bytes,15,opt,name=RegisterDomain4,proto3" json:"register_domain_4"` + // RegisterDomain5 is the fee to be paid to register a domain with five characters + RegisterDomain5 *types1.DecProto `protobuf:"bytes,16,opt,name=RegisterDomain5,proto3" json:"register_domain_5"` + // RegisterDomainDefault is the fee to be paid to register a domain with more than five characters + RegisterDomainDefault *types1.DecProto `protobuf:"bytes,17,opt,name=RegisterDomainDefault,proto3" json:"register_domain_default"` + // RegisterDomainMultiplier is the multiplication applied to fees in register domain operations if they're of open type + RegisterOpenDomainMultiplier *types1.DecProto `protobuf:"bytes,18,opt,name=RegisterOpenDomainMultiplier,proto3" json:"register_open_domain_multiplier"` + // TransferDomainClosed is the fee to be paid to transfer a closed domain + TransferDomainClosed *types1.DecProto `protobuf:"bytes,19,opt,name=TransferDomainClosed,proto3" json:"transfer_domain_closed"` + // TransferDomainOpen is the fee to be paid to transfer open domains + TransferDomainOpen *types1.DecProto `protobuf:"bytes,20,opt,name=TransferDomainOpen,proto3" json:"transfer_domain_open"` + // RenewDomainOpen is the fee to be paid to renew an open domain + RenewDomainOpen github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,21,opt,name=RenewDomainOpen,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"renew_domain_open"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Fees) Reset() { *m = Fees{} } +func (m *Fees) String() string { return proto.CompactTextString(m) } +func (*Fees) ProtoMessage() {} +func (*Fees) Descriptor() ([]byte, []int) { + return fileDescriptor_c149be06521486db, []int{1} +} +func (m *Fees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Fees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Fees.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 *Fees) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fees.Merge(m, src) +} +func (m *Fees) XXX_Size() int { + return m.Size() +} +func (m *Fees) XXX_DiscardUnknown() { + xxx_messageInfo_Fees.DiscardUnknown(m) +} + +var xxx_messageInfo_Fees proto.InternalMessageInfo + +func (m *Fees) GetFeeCoinDenom() string { + if m != nil { + return m.FeeCoinDenom + } + return "" +} + +func (m *Fees) GetFeeCoinPrice() *types1.DecProto { + if m != nil { + return m.FeeCoinPrice + } + return nil +} + +func (m *Fees) GetFeeDefault() *types1.DecProto { + if m != nil { + return m.FeeDefault + } + return nil +} + +func (m *Fees) GetRegisterAccountClosed() *types1.DecProto { + if m != nil { + return m.RegisterAccountClosed + } + return nil +} + +func (m *Fees) GetRegisterAccountOpen() *types1.DecProto { + if m != nil { + return m.RegisterAccountOpen + } + return nil +} + +func (m *Fees) GetTransferAccountClosed() *types1.DecProto { + if m != nil { + return m.TransferAccountClosed + } + return nil +} + +func (m *Fees) GetTransferAccountOpen() *types1.DecProto { + if m != nil { + return m.TransferAccountOpen + } + return nil +} + +func (m *Fees) GetReplaceAccountResources() *types1.DecProto { + if m != nil { + return m.ReplaceAccountResources + } + return nil +} + +func (m *Fees) GetAddAccountCertificate() *types1.DecProto { + if m != nil { + return m.AddAccountCertificate + } + return nil +} + +func (m *Fees) GetDelAccountCertificate() *types1.DecProto { + if m != nil { + return m.DelAccountCertificate + } + return nil +} + +func (m *Fees) GetSetAccountMetadata() *types1.DecProto { + if m != nil { + return m.SetAccountMetadata + } + return nil +} + +func (m *Fees) GetRegisterDomain1() *types1.DecProto { + if m != nil { + return m.RegisterDomain1 + } + return nil +} + +func (m *Fees) GetRegisterDomain2() *types1.DecProto { + if m != nil { + return m.RegisterDomain2 + } + return nil +} + +func (m *Fees) GetRegisterDomain3() *types1.DecProto { + if m != nil { + return m.RegisterDomain3 + } + return nil +} + +func (m *Fees) GetRegisterDomain4() *types1.DecProto { + if m != nil { + return m.RegisterDomain4 + } + return nil +} + +func (m *Fees) GetRegisterDomain5() *types1.DecProto { + if m != nil { + return m.RegisterDomain5 + } + return nil +} + +func (m *Fees) GetRegisterDomainDefault() *types1.DecProto { + if m != nil { + return m.RegisterDomainDefault + } + return nil +} + +func (m *Fees) GetRegisterOpenDomainMultiplier() *types1.DecProto { + if m != nil { + return m.RegisterOpenDomainMultiplier + } + return nil +} + +func (m *Fees) GetTransferDomainClosed() *types1.DecProto { + if m != nil { + return m.TransferDomainClosed + } + return nil +} + +func (m *Fees) GetTransferDomainOpen() *types1.DecProto { + if m != nil { + return m.TransferDomainOpen + } + return nil +} + +func init() { + proto.RegisterType((*Config)(nil), "Config") + proto.RegisterType((*Fees)(nil), "Fees") +} + +func init() { proto.RegisterFile("x/configuration/types/types.proto", fileDescriptor_c149be06521486db) } + +var fileDescriptor_c149be06521486db = []byte{ + // 1117 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x97, 0xcd, 0x72, 0xe3, 0x44, + 0x17, 0x86, 0x47, 0xdf, 0x17, 0x32, 0x93, 0x4e, 0x32, 0x99, 0x74, 0x7e, 0x46, 0x99, 0x49, 0x2c, + 0x33, 0x54, 0x51, 0x66, 0x11, 0xa9, 0xe2, 0x24, 0x14, 0xbb, 0x21, 0xb6, 0x2b, 0x40, 0x51, 0x19, + 0x52, 0x3d, 0x84, 0x05, 0x0b, 0x5c, 0x6d, 0xe9, 0xd8, 0x08, 0x24, 0xb5, 0x4b, 0x92, 0x93, 0x30, + 0x17, 0x40, 0x71, 0x09, 0xdc, 0x09, 0xb7, 0x30, 0x4b, 0xd6, 0x2c, 0x54, 0x54, 0xd8, 0xe9, 0x12, + 0x58, 0x51, 0xfd, 0x23, 0x59, 0x92, 0x35, 0xd8, 0x64, 0x13, 0x3b, 0x7d, 0xfa, 0x3c, 0xef, 0xe9, + 0xd3, 0xdd, 0xaf, 0x64, 0xf4, 0xfe, 0xad, 0x65, 0xb3, 0x60, 0xe8, 0x8e, 0x26, 0x21, 0x8d, 0x5d, + 0x16, 0x58, 0xf1, 0x4f, 0x63, 0x88, 0xe4, 0x5f, 0x73, 0x1c, 0xb2, 0x98, 0x3d, 0xdb, 0x1e, 0xb1, + 0x11, 0x13, 0x5f, 0x2d, 0xfe, 0x4d, 0x8d, 0x36, 0x46, 0x8c, 0x8d, 0x3c, 0xb0, 0xc4, 0x7f, 0x83, + 0xc9, 0xd0, 0x72, 0x14, 0x21, 0x8b, 0xdb, 0x2c, 0xf2, 0x59, 0x64, 0x0d, 0x68, 0x04, 0xd6, 0xf5, + 0xd1, 0x00, 0x62, 0x7a, 0x64, 0xd9, 0xcc, 0x55, 0xf1, 0x17, 0xbf, 0xad, 0xa0, 0xe5, 0xae, 0x50, + 0xc6, 0x7d, 0x84, 0xba, 0xaa, 0x06, 0x08, 0x75, 0xad, 0xa9, 0xb5, 0xd6, 0x3a, 0x2f, 0xd3, 0xc4, + 0x40, 0x76, 0x3e, 0xfa, 0x77, 0x62, 0x1c, 0x8e, 0xdc, 0xf8, 0xfb, 0xc9, 0xc0, 0xb4, 0x99, 0x6f, + 0x29, 0xb6, 0xfc, 0x38, 0x8c, 0x9c, 0x1f, 0x55, 0xc1, 0x67, 0xb6, 0x7d, 0xe6, 0x38, 0x21, 0x44, + 0x11, 0x29, 0x20, 0xf1, 0x4b, 0xb4, 0xf1, 0x0d, 0xf5, 0x5c, 0xa7, 0xc7, 0x7c, 0xea, 0x06, 0xaf, + 0xa8, 0x0f, 0xfa, 0xff, 0x9a, 0x5a, 0x6b, 0xa5, 0xb3, 0x93, 0x26, 0xc6, 0xe6, 0x35, 0x0f, 0xf5, + 0x1d, 0x11, 0xeb, 0x07, 0xd4, 0x07, 0x52, 0x9d, 0x8d, 0x3b, 0xe8, 0x89, 0x18, 0x3a, 0xb3, 0x6d, + 0x36, 0x09, 0x62, 0x41, 0xf8, 0xbf, 0x20, 0xec, 0xa6, 0x89, 0x81, 0x25, 0x81, 0xca, 0xa0, 0x44, + 0xcc, 0xcc, 0xc7, 0x1f, 0xa1, 0x47, 0x62, 0xec, 0x8a, 0x7c, 0xa1, 0x2f, 0x89, 0xdc, 0xf5, 0x34, + 0x31, 0x56, 0x64, 0xee, 0x24, 0x74, 0x49, 0x1e, 0xc6, 0x9f, 0xa0, 0x75, 0xf1, 0x9d, 0x40, 0xc4, + 0x26, 0xa1, 0x0d, 0xfa, 0x7b, 0x62, 0x3e, 0x4e, 0x13, 0xe3, 0xb1, 0x9c, 0x1f, 0xaa, 0x08, 0x29, + 0x4f, 0xc4, 0x3f, 0xa0, 0x2d, 0x59, 0x36, 0x81, 0x00, 0x6e, 0xa8, 0x77, 0x09, 0xa1, 0xcb, 0x1c, + 0x7d, 0xb9, 0xa9, 0xb5, 0x56, 0xdb, 0x7b, 0xa6, 0xdc, 0x33, 0x33, 0xdb, 0x33, 0xb3, 0xa7, 0xf6, + 0xac, 0x73, 0xf0, 0x36, 0x31, 0x1e, 0xa4, 0x89, 0xb1, 0xa3, 0xda, 0x10, 0xca, 0xf4, 0xfe, 0x58, + 0xe4, 0x93, 0x3a, 0x28, 0x26, 0x68, 0xa7, 0x34, 0xdc, 0xe5, 0x4b, 0xbd, 0xa0, 0xb7, 0xfa, 0xc3, + 0xa6, 0xd6, 0x5a, 0xef, 0xec, 0xa7, 0x89, 0xa1, 0x57, 0x70, 0xb2, 0x41, 0x3e, 0xbd, 0x25, 0xf5, + 0xa9, 0xd8, 0x41, 0x9b, 0x32, 0xf0, 0x59, 0x48, 0x6d, 0x50, 0xd5, 0x3f, 0x9a, 0x57, 0xfd, 0x73, + 0x55, 0xfd, 0x96, 0x92, 0x1b, 0xf1, 0xe4, 0xac, 0xf6, 0x59, 0x20, 0xf6, 0xd1, 0xb6, 0xda, 0x99, + 0x72, 0x9b, 0x56, 0xe6, 0x09, 0x35, 0x94, 0xd0, 0x6e, 0xb6, 0xd7, 0x95, 0x3e, 0xd5, 0x62, 0xf1, + 0x15, 0xda, 0x2d, 0x8f, 0xe7, 0x9d, 0x42, 0xa2, 0x53, 0x07, 0x69, 0x62, 0xec, 0x55, 0x89, 0xd3, + 0x56, 0xbd, 0x23, 0x19, 0x8f, 0x10, 0x56, 0x91, 0x62, 0xb3, 0x56, 0xe7, 0xad, 0x61, 0x5f, 0xad, + 0x61, 0x3b, 0x53, 0x2c, 0x75, 0xab, 0x06, 0x89, 0x4f, 0xd1, 0x5a, 0x76, 0xc0, 0x22, 0x5e, 0xf5, + 0x9a, 0xa8, 0x7a, 0x33, 0x4d, 0x8c, 0xf5, 0xec, 0x1c, 0x46, 0xa2, 0xd2, 0xd2, 0x34, 0xfc, 0x39, + 0xc2, 0x5d, 0x08, 0x63, 0x77, 0xe8, 0xda, 0x34, 0x86, 0xd7, 0xee, 0x1b, 0xe0, 0xc9, 0xeb, 0x4d, + 0xad, 0xb5, 0xd4, 0xd1, 0x79, 0x01, 0xf6, 0x34, 0xda, 0x8f, 0xdc, 0x37, 0x20, 0x18, 0x35, 0x39, + 0xf8, 0x4b, 0xb4, 0x55, 0x18, 0xcd, 0xbb, 0xf7, 0x58, 0xd4, 0xb1, 0xc7, 0x8f, 0x6d, 0x11, 0x35, + 0xed, 0x5c, 0x5d, 0x16, 0x37, 0x83, 0x0b, 0x88, 0xa9, 0x43, 0x63, 0x9a, 0xd5, 0xb4, 0x21, 0x6a, + 0x12, 0x66, 0xe0, 0xab, 0xd0, 0xb4, 0xa0, 0xea, 0xec, 0x17, 0xbf, 0x6c, 0xa2, 0xa5, 0x73, 0x80, + 0x08, 0x7f, 0x8c, 0xd6, 0xce, 0x01, 0xba, 0xcc, 0x0d, 0x7a, 0x10, 0x30, 0x5f, 0x38, 0x97, 0xba, + 0xa5, 0x43, 0xe0, 0x75, 0xb8, 0x41, 0xdf, 0xe1, 0x11, 0x52, 0x9a, 0x87, 0xaf, 0xf2, 0xbc, 0xcb, + 0xd0, 0xb5, 0xa5, 0x17, 0xad, 0xb6, 0x0f, 0x4c, 0x69, 0x67, 0x26, 0x77, 0x4c, 0x53, 0x39, 0xa6, + 0xd9, 0x03, 0xfb, 0x92, 0x6f, 0x61, 0x05, 0x3b, 0xe6, 0x89, 0xa4, 0x84, 0xc1, 0xaf, 0x10, 0x3a, + 0x07, 0xe8, 0xc1, 0x90, 0x4e, 0xbc, 0x58, 0xd8, 0xd3, 0x5c, 0xe8, 0x46, 0x9a, 0x18, 0xab, 0x1c, + 0xea, 0xc8, 0x2c, 0x52, 0x20, 0xe0, 0x31, 0xda, 0x21, 0x30, 0x72, 0xa3, 0x18, 0x42, 0x75, 0x28, + 0xba, 0x1e, 0x8b, 0xc0, 0x11, 0xee, 0x35, 0x17, 0xfd, 0x3c, 0x4d, 0x8c, 0xa7, 0xa1, 0xca, 0xcf, + 0xbd, 0xd1, 0x16, 0x04, 0x52, 0x0f, 0xe6, 0xee, 0x55, 0x09, 0x7c, 0x35, 0x86, 0x40, 0xb8, 0xdf, + 0x5c, 0x3d, 0x71, 0x0c, 0x66, 0xf4, 0xd8, 0x18, 0x02, 0x52, 0x07, 0xe5, 0xab, 0xfb, 0x3a, 0xa4, + 0x41, 0x34, 0xac, 0xae, 0x6e, 0x79, 0xe1, 0xd5, 0xc5, 0x2a, 0x7f, 0x66, 0x75, 0xb5, 0x60, 0xbe, + 0xba, 0x4a, 0x40, 0xac, 0xee, 0xe1, 0xc2, 0xab, 0x9b, 0xd1, 0x93, 0xab, 0xab, 0x81, 0xe2, 0x6b, + 0xf4, 0x94, 0xc0, 0xd8, 0xa3, 0x36, 0xe4, 0xe6, 0xa1, 0x6e, 0xa6, 0x72, 0xd3, 0x39, 0x7a, 0xc2, + 0x92, 0x42, 0x49, 0xe8, 0x4f, 0xad, 0x49, 0x31, 0xc8, 0xbb, 0xe0, 0xbc, 0xab, 0x67, 0x4e, 0xf6, + 0xd8, 0x2b, 0xdc, 0x3e, 0x65, 0xad, 0x8b, 0x74, 0x95, 0x3a, 0xd3, 0x47, 0x69, 0xe1, 0x5a, 0x93, + 0x7a, 0x30, 0x57, 0xec, 0x81, 0x57, 0xa3, 0x88, 0x16, 0x56, 0x74, 0xc0, 0xab, 0x57, 0xac, 0x05, + 0x73, 0xdf, 0x7d, 0x0d, 0xb1, 0x0a, 0x64, 0xe6, 0xa0, 0x7c, 0x77, 0x8e, 0x9c, 0xb0, 0xbd, 0x08, + 0xe2, 0x5c, 0x2e, 0xb3, 0x1b, 0x52, 0x83, 0xc4, 0xdf, 0xa1, 0x8d, 0xec, 0xe4, 0xca, 0x67, 0xd8, + 0x91, 0xb0, 0xde, 0xb9, 0x2a, 0xc2, 0xc8, 0xf2, 0xab, 0xa0, 0x9e, 0x89, 0x47, 0xa4, 0x0a, 0x9b, + 0xe5, 0xb7, 0x85, 0x3b, 0xdf, 0x8f, 0xdf, 0xae, 0xf2, 0xdb, 0xb3, 0xfc, 0x63, 0x61, 0xd9, 0xf7, + 0xe3, 0x1f, 0x57, 0xf9, 0xc7, 0xb3, 0xfc, 0x13, 0xe1, 0xe4, 0xf7, 0xe3, 0x9f, 0x54, 0xf9, 0x27, + 0xb3, 0xfc, 0x53, 0xfd, 0xc9, 0xbd, 0xf9, 0xa7, 0x55, 0xfe, 0x69, 0xd1, 0x60, 0xe5, 0x50, 0xe6, + 0xdd, 0x9b, 0xff, 0xdd, 0x60, 0x95, 0x4a, 0xe6, 0xe3, 0xf5, 0x60, 0xfc, 0xb3, 0x86, 0xf6, 0xb3, + 0x08, 0xf7, 0x09, 0x19, 0xbd, 0x98, 0x78, 0xb1, 0x3b, 0xf6, 0x5c, 0x08, 0x75, 0xbc, 0x88, 0xf2, + 0x07, 0x69, 0x62, 0x18, 0xb9, 0x32, 0x37, 0xa1, 0x4c, 0xde, 0xcf, 0x49, 0xe4, 0x5f, 0x75, 0xf8, + 0x1b, 0x58, 0x66, 0x5b, 0x32, 0xa6, 0xcc, 0x77, 0x6b, 0x11, 0xfd, 0x67, 0xfc, 0x0d, 0x2c, 0x37, + 0x43, 0x25, 0xad, 0xbc, 0xb7, 0x16, 0xcb, 0xaf, 0x6c, 0x79, 0x5c, 0x38, 0xef, 0xf6, 0xc2, 0x57, + 0xb6, 0x2a, 0x26, 0x8c, 0xb7, 0x06, 0x89, 0x7d, 0x7e, 0x64, 0x02, 0xb8, 0x29, 0xa8, 0xec, 0x88, + 0xb7, 0x82, 0x2e, 0x7f, 0xeb, 0xfa, 0x23, 0x31, 0x3e, 0x5c, 0xe0, 0x57, 0x4c, 0x0f, 0x6c, 0x79, + 0x82, 0x02, 0xb8, 0x29, 0x29, 0x56, 0xd9, 0x9d, 0x4f, 0xdf, 0xde, 0x35, 0xb4, 0xdf, 0xef, 0x1a, + 0xda, 0x9f, 0x77, 0x0d, 0xed, 0xd7, 0xbf, 0x1a, 0x0f, 0xbe, 0x35, 0x0b, 0x7c, 0x97, 0x5d, 0x1f, + 0xb2, 0x00, 0xf8, 0x67, 0x10, 0x59, 0xb5, 0x3f, 0xf4, 0x06, 0xcb, 0xe2, 0x05, 0xf1, 0xf8, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, 0x81, 0xf7, 0x42, 0x08, 0x0e, 0x00, 0x00, +} + +func (m *Config) 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 *Config) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.MetadataSizeMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.MetadataSizeMax)) + i-- + dAtA[i] = 0x78 + } + if m.CertificateCountMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.CertificateCountMax)) + i-- + dAtA[i] = 0x70 + } + if m.CertificateSizeMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.CertificateSizeMax)) + i-- + dAtA[i] = 0x68 + } + if m.ResourcesMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.ResourcesMax)) + i-- + dAtA[i] = 0x60 + } + { + size, err := m.AccountGracePeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + if m.AccountRenewalCountMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.AccountRenewalCountMax)) + i-- + dAtA[i] = 0x50 + } + { + size, err := m.AccountRenewalPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + { + size, err := m.DomainGracePeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + if m.DomainRenewalCountMax != 0 { + i = encodeVarintTypes(dAtA, i, uint64(m.DomainRenewalCountMax)) + i-- + dAtA[i] = 0x38 + } + { + size, err := m.DomainRenewalPeriod.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if len(m.ValidResource) > 0 { + i -= len(m.ValidResource) + copy(dAtA[i:], m.ValidResource) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidResource))) + i-- + dAtA[i] = 0x2a + } + if len(m.ValidURI) > 0 { + i -= len(m.ValidURI) + copy(dAtA[i:], m.ValidURI) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidURI))) + i-- + dAtA[i] = 0x22 + } + if len(m.ValidAccountName) > 0 { + i -= len(m.ValidAccountName) + copy(dAtA[i:], m.ValidAccountName) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidAccountName))) + i-- + dAtA[i] = 0x1a + } + if len(m.ValidDomainName) > 0 { + i -= len(m.ValidDomainName) + copy(dAtA[i:], m.ValidDomainName) + i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidDomainName))) + i-- + dAtA[i] = 0x12 + } + if len(m.Configurer) > 0 { + i -= len(m.Configurer) + copy(dAtA[i:], m.Configurer) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Configurer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Fees) 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 *Fees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Fees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.RenewDomainOpen) > 0 { + i -= len(m.RenewDomainOpen) + copy(dAtA[i:], m.RenewDomainOpen) + i = encodeVarintTypes(dAtA, i, uint64(len(m.RenewDomainOpen))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if m.TransferDomainOpen != nil { + { + size, err := m.TransferDomainOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.TransferDomainClosed != nil { + { + size, err := m.TransferDomainClosed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.RegisterOpenDomainMultiplier != nil { + { + size, err := m.RegisterOpenDomainMultiplier.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if m.RegisterDomainDefault != nil { + { + size, err := m.RegisterDomainDefault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.RegisterDomain5 != nil { + { + size, err := m.RegisterDomain5.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.RegisterDomain4 != nil { + { + size, err := m.RegisterDomain4.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if m.RegisterDomain3 != nil { + { + size, err := m.RegisterDomain3.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if m.RegisterDomain2 != nil { + { + size, err := m.RegisterDomain2.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + if m.RegisterDomain1 != nil { + { + size, err := m.RegisterDomain1.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if m.SetAccountMetadata != nil { + { + size, err := m.SetAccountMetadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + if m.DelAccountCertificate != nil { + { + size, err := m.DelAccountCertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.AddAccountCertificate != nil { + { + size, err := m.AddAccountCertificate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.ReplaceAccountResources != nil { + { + size, err := m.ReplaceAccountResources.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.TransferAccountOpen != nil { + { + size, err := m.TransferAccountOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.TransferAccountClosed != nil { + { + size, err := m.TransferAccountClosed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.RegisterAccountOpen != nil { + { + size, err := m.RegisterAccountOpen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.RegisterAccountClosed != nil { + { + size, err := m.RegisterAccountClosed.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.FeeDefault != nil { + { + size, err := m.FeeDefault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.FeeCoinPrice != nil { + { + size, err := m.FeeCoinPrice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.FeeCoinDenom) > 0 { + i -= len(m.FeeCoinDenom) + copy(dAtA[i:], m.FeeCoinDenom) + i = encodeVarintTypes(dAtA, i, uint64(len(m.FeeCoinDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { + offset -= sovTypes(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Config) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Configurer) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidDomainName) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidAccountName) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidURI) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = len(m.ValidResource) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + l = m.DomainRenewalPeriod.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.DomainRenewalCountMax != 0 { + n += 1 + sovTypes(uint64(m.DomainRenewalCountMax)) + } + l = m.DomainGracePeriod.Size() + n += 1 + l + sovTypes(uint64(l)) + l = m.AccountRenewalPeriod.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.AccountRenewalCountMax != 0 { + n += 1 + sovTypes(uint64(m.AccountRenewalCountMax)) + } + l = m.AccountGracePeriod.Size() + n += 1 + l + sovTypes(uint64(l)) + if m.ResourcesMax != 0 { + n += 1 + sovTypes(uint64(m.ResourcesMax)) + } + if m.CertificateSizeMax != 0 { + n += 1 + sovTypes(uint64(m.CertificateSizeMax)) + } + if m.CertificateCountMax != 0 { + n += 1 + sovTypes(uint64(m.CertificateCountMax)) + } + if m.MetadataSizeMax != 0 { + n += 1 + sovTypes(uint64(m.MetadataSizeMax)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Fees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeeCoinDenom) + if l > 0 { + n += 1 + l + sovTypes(uint64(l)) + } + if m.FeeCoinPrice != nil { + l = m.FeeCoinPrice.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.FeeDefault != nil { + l = m.FeeDefault.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterAccountClosed != nil { + l = m.RegisterAccountClosed.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterAccountOpen != nil { + l = m.RegisterAccountOpen.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.TransferAccountClosed != nil { + l = m.TransferAccountClosed.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.TransferAccountOpen != nil { + l = m.TransferAccountOpen.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.ReplaceAccountResources != nil { + l = m.ReplaceAccountResources.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.AddAccountCertificate != nil { + l = m.AddAccountCertificate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.DelAccountCertificate != nil { + l = m.DelAccountCertificate.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.SetAccountMetadata != nil { + l = m.SetAccountMetadata.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterDomain1 != nil { + l = m.RegisterDomain1.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterDomain2 != nil { + l = m.RegisterDomain2.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterDomain3 != nil { + l = m.RegisterDomain3.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterDomain4 != nil { + l = m.RegisterDomain4.Size() + n += 1 + l + sovTypes(uint64(l)) + } + if m.RegisterDomain5 != nil { + l = m.RegisterDomain5.Size() + n += 2 + l + sovTypes(uint64(l)) + } + if m.RegisterDomainDefault != nil { + l = m.RegisterDomainDefault.Size() + n += 2 + l + sovTypes(uint64(l)) + } + if m.RegisterOpenDomainMultiplier != nil { + l = m.RegisterOpenDomainMultiplier.Size() + n += 2 + l + sovTypes(uint64(l)) + } + if m.TransferDomainClosed != nil { + l = m.TransferDomainClosed.Size() + n += 2 + l + sovTypes(uint64(l)) + } + if m.TransferDomainOpen != nil { + l = m.TransferDomainOpen.Size() + n += 2 + l + sovTypes(uint64(l)) + } + l = len(m.RenewDomainOpen) + if l > 0 { + n += 2 + l + sovTypes(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovTypes(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTypes(x uint64) (n int) { + return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Config) 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 ErrIntOverflowTypes + } + 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: Config: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Config: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Configurer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Configurer = append(m.Configurer[:0], dAtA[iNdEx:postIndex]...) + if m.Configurer == nil { + m.Configurer = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidDomainName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidDomainName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidAccountName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidAccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidURI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidURI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidResource", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidResource = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DomainRenewalPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DomainRenewalPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DomainRenewalCountMax", wireType) + } + m.DomainRenewalCountMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DomainRenewalCountMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DomainGracePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DomainGracePeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountRenewalPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AccountRenewalPeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountRenewalCountMax", wireType) + } + m.AccountRenewalCountMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AccountRenewalCountMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountGracePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AccountGracePeriod.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourcesMax", wireType) + } + m.ResourcesMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResourcesMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CertificateSizeMax", wireType) + } + m.CertificateSizeMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CertificateSizeMax |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CertificateCountMax", wireType) + } + m.CertificateCountMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CertificateCountMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MetadataSizeMax", wireType) + } + m.MetadataSizeMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MetadataSizeMax |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Fees) 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 ErrIntOverflowTypes + } + 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: Fees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Fees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCoinDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeCoinDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeCoinPrice", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FeeCoinPrice == nil { + m.FeeCoinPrice = &types1.DecProto{} + } + if err := m.FeeCoinPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeDefault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FeeDefault == nil { + m.FeeDefault = &types1.DecProto{} + } + if err := m.FeeDefault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterAccountClosed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterAccountClosed == nil { + m.RegisterAccountClosed = &types1.DecProto{} + } + if err := m.RegisterAccountClosed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterAccountOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterAccountOpen == nil { + m.RegisterAccountOpen = &types1.DecProto{} + } + if err := m.RegisterAccountOpen.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferAccountClosed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferAccountClosed == nil { + m.TransferAccountClosed = &types1.DecProto{} + } + if err := m.TransferAccountClosed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferAccountOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferAccountOpen == nil { + m.TransferAccountOpen = &types1.DecProto{} + } + if err := m.TransferAccountOpen.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReplaceAccountResources", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ReplaceAccountResources == nil { + m.ReplaceAccountResources = &types1.DecProto{} + } + if err := m.ReplaceAccountResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddAccountCertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AddAccountCertificate == nil { + m.AddAccountCertificate = &types1.DecProto{} + } + if err := m.AddAccountCertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DelAccountCertificate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DelAccountCertificate == nil { + m.DelAccountCertificate = &types1.DecProto{} + } + if err := m.DelAccountCertificate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SetAccountMetadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SetAccountMetadata == nil { + m.SetAccountMetadata = &types1.DecProto{} + } + if err := m.SetAccountMetadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomain1", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomain1 == nil { + m.RegisterDomain1 = &types1.DecProto{} + } + if err := m.RegisterDomain1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomain2", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomain2 == nil { + m.RegisterDomain2 = &types1.DecProto{} + } + if err := m.RegisterDomain2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomain3", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomain3 == nil { + m.RegisterDomain3 = &types1.DecProto{} + } + if err := m.RegisterDomain3.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomain4", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomain4 == nil { + m.RegisterDomain4 = &types1.DecProto{} + } + if err := m.RegisterDomain4.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomain5", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomain5 == nil { + m.RegisterDomain5 = &types1.DecProto{} + } + if err := m.RegisterDomain5.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterDomainDefault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterDomainDefault == nil { + m.RegisterDomainDefault = &types1.DecProto{} + } + if err := m.RegisterDomainDefault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisterOpenDomainMultiplier", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RegisterOpenDomainMultiplier == nil { + m.RegisterOpenDomainMultiplier = &types1.DecProto{} + } + if err := m.RegisterOpenDomainMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferDomainClosed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferDomainClosed == nil { + m.TransferDomainClosed = &types1.DecProto{} + } + if err := m.TransferDomainClosed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransferDomainOpen", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TransferDomainOpen == nil { + m.TransferDomainOpen = &types1.DecProto{} + } + if err := m.TransferDomainOpen.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RenewDomainOpen", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RenewDomainOpen = github_com_cosmos_cosmos_sdk_types.Dec(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTypes(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTypes + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTypes(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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrIntOverflowTypes + } + 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, ErrInvalidLengthTypes + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTypes + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTypes + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/configuration/types/types.proto b/x/configuration/types/types.proto new file mode 100644 index 00000000..f5e0b48d --- /dev/null +++ b/x/configuration/types/types.proto @@ -0,0 +1,171 @@ +syntax="proto3"; + +option go_package="github.com/iov-one/iovns/x/configuration/types"; + +import "gogoproto/gogo.proto"; +import "google/protobuf/duration.proto"; +import "cosmos/base/v1beta1/coin.proto"; + + +// Config is the configuration of the network +message Config { + // Configurer is the configuration owner, the addresses allowed to handle fees + // and register domains with no superuser + bytes Configurer = 1 [(gogoproto.jsontag) = "configurer", (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"]; + // ValidDomainName defines a regexp that determines if a domain name is valid or not + string ValidDomainName = 2 [(gogoproto.jsontag) = "valid_domain_name"]; + // ValidAccountName defines a regexp that determines if an account name is valid or not + string ValidAccountName = 3 [(gogoproto.jsontag) = "valid_account_name"]; + // ValidURI defines a regexp that determines if resource uri is valid or not + string ValidURI = 4 [(gogoproto.jsontag) = "valid_uri"]; + // ValidResource determines a regexp for a resource content + string ValidResource = 5 [(gogoproto.jsontag) = "valid_resource"]; + // DomainRenewalPeriod defines the duration of the domain renewal period in seconds + google.protobuf.Duration DomainRenewalPeriod = 6 [(gogoproto.jsontag) = "domain_renewal_period", (gogoproto.nullable) =false]; + // DomainRenewalCountMax defines maximum number of domain renewals a user can do + uint32 DomainRenewalCountMax = 7 [(gogoproto.jsontag) = "domain_renewal_count_max"]; + // DomainGracePeriod defines the grace period for a domain deletion in seconds + google.protobuf.Duration DomainGracePeriod = 8 [(gogoproto.jsontag) = "domain_grace_period", (gogoproto.nullable) =false]; + // AccountRenewalPeriod defines the duration of the account renewal period in seconds + google.protobuf.Duration AccountRenewalPeriod = 9 [(gogoproto.jsontag) = "account_renewal_period", (gogoproto.nullable) =false]; + // AccountRenewalCountMax defines maximum number of account renewals a user can do + uint32 AccountRenewalCountMax = 10 [(gogoproto.jsontag) = "account_renewal_count_max"]; + // DomainGracePeriod defines the grace period for a domain deletion in seconds + google.protobuf.Duration AccountGracePeriod = 11 [(gogoproto.jsontag) = "account_grace_period", (gogoproto.nullable) =false]; + // ResourcesMax defines maximum number of resources could be saved under an account + uint32 ResourcesMax = 12 [(gogoproto.jsontag) = "resources_max"]; + // CertificateSizeMax defines maximum size of a certificate that could be saved under an account + uint64 CertificateSizeMax = 13 [(gogoproto.jsontag) = "certificate_size_max"]; + // CertificateCountMax defines maximum number of certificates that could be saved under an account + uint32 CertificateCountMax = 14 [(gogoproto.jsontag) = "certificate_count_max"]; + // MetadataSizeMax defines maximum size of metadata that could be saved under an account + uint64 MetadataSizeMax = 15 [(gogoproto.jsontag) = "metadata_size_max"]; +} + +// Fees contains different type of fees +// to calculate coins to detract when +// processing different messages +message Fees { + // FeeCoinDenom defines the denominator of the coin used to process fees + string FeeCoinDenom = 1 [(gogoproto.jsontag) = "fee_coin_denom"]; + // FeeCoinPrice defines the price of the coin + cosmos.base.v1beta1.DecProto FeeCoinPrice = 2 [ + (gogoproto.jsontag) = "fee_coin_price", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // FeeDefault is the parameter defining the default fee + cosmos.base.v1beta1.DecProto FeeDefault = 3 [ + (gogoproto.jsontag) = "fee_default", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterAccountClosed is the fee to be paid to register an account in a closed domain + cosmos.base.v1beta1.DecProto RegisterAccountClosed = 4 [ + (gogoproto.jsontag) = "register_account_closed", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterAccountOpen is the fee to be paid to register an account in an open domain + cosmos.base.v1beta1.DecProto RegisterAccountOpen = 5 [ + (gogoproto.jsontag) = "register_account_open", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // TransferAccountClosed is the fee to be paid to register an account in a closed domain + cosmos.base.v1beta1.DecProto TransferAccountClosed = 6 [ + (gogoproto.jsontag) = "transfer_account_closed", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // TransferAccountOpen is the fee to be paid to register an account in an open domain + cosmos.base.v1beta1.DecProto TransferAccountOpen = 7 [ + (gogoproto.jsontag) = "transfer_account_open", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // ReplaceAccountResources is the fee to be paid to replace account's resources + cosmos.base.v1beta1.DecProto ReplaceAccountResources = 8 [ + (gogoproto.jsontag) = "replace_account_resources", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // AddAccountCertificate is the fee to be paid to add a certificate to an account + cosmos.base.v1beta1.DecProto AddAccountCertificate = 9 [ + (gogoproto.jsontag) = "add_account_certificate", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // DelAccountCertificate is the feed to be paid to delete a certificate in an account + cosmos.base.v1beta1.DecProto DelAccountCertificate = 10 [ + (gogoproto.jsontag) = "del_account_certificate", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // SetAccountMetadata is the fee to be paid to set account's metadata + cosmos.base.v1beta1.DecProto SetAccountMetadata = 11 [ + (gogoproto.jsontag) = "set_account_metadata", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomain1 is the fee to be paid to register a domain with one character + cosmos.base.v1beta1.DecProto RegisterDomain1 = 12 [ + (gogoproto.jsontag) = "register_domain_1", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomain2 is the fee to be paid to register a domain with two characters + cosmos.base.v1beta1.DecProto RegisterDomain2 = 13 [ + (gogoproto.jsontag) = "register_domain_2", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomain3 is the fee to be paid to register a domain with three characters + cosmos.base.v1beta1.DecProto RegisterDomain3 = 14 [ + (gogoproto.jsontag) = "register_domain_3", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomain4 is the fee to be paid to register a domain with four characters + cosmos.base.v1beta1.DecProto RegisterDomain4 = 15 [ + (gogoproto.jsontag) = "register_domain_4", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomain5 is the fee to be paid to register a domain with five characters + cosmos.base.v1beta1.DecProto RegisterDomain5 = 16 [ + (gogoproto.jsontag) = "register_domain_5", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomainDefault is the fee to be paid to register a domain with more than five characters + cosmos.base.v1beta1.DecProto RegisterDomainDefault = 17 [ + (gogoproto.jsontag) = "register_domain_default", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RegisterDomainMultiplier is the multiplication applied to fees in register domain operations if they're of open type + cosmos.base.v1beta1.DecProto RegisterOpenDomainMultiplier = 18 [ + (gogoproto.jsontag) = "register_open_domain_multiplier", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // TransferDomainClosed is the fee to be paid to transfer a closed domain + cosmos.base.v1beta1.DecProto TransferDomainClosed = 19 [ + (gogoproto.jsontag) = "transfer_domain_closed", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // TransferDomainOpen is the fee to be paid to transfer open domains + cosmos.base.v1beta1.DecProto TransferDomainOpen = 20 [ + (gogoproto.jsontag) = "transfer_domain_open", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + // RenewDomainOpen is the fee to be paid to renew an open domain + string RenewDomainOpen = 21 [ + (gogoproto.jsontag) = "renew_domain_open", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file