diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 67b6edc..809986a 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -47678,14 +47678,12 @@ paths: properties: zigbeeID: type: string - dirigeraID: - type: string - dirigeraMAC: - type: string plmntAddress: type: string liquidAddress: type: string + metadataJson: + type: string default: description: An unexpected error response. schema: @@ -77540,14 +77538,12 @@ definitions: properties: zigbeeID: type: string - dirigeraID: - type: string - dirigeraMAC: - type: string plmntAddress: type: string liquidAddress: type: string + metadataJson: + type: string planetmintgo.der.LiquidDerAsset: type: object properties: @@ -77572,14 +77568,12 @@ definitions: properties: zigbeeID: type: string - dirigeraID: - type: string - dirigeraMAC: - type: string plmntAddress: type: string liquidAddress: type: string + metadataJson: + type: string planetmintgo.der.QueryNftResponse: type: object properties: diff --git a/proto/planetmintgo/der/der.proto b/proto/planetmintgo/der/der.proto index 0f69f88..074f027 100644 --- a/proto/planetmintgo/der/der.proto +++ b/proto/planetmintgo/der/der.proto @@ -6,8 +6,8 @@ option go_package = "github.com/planetmint/planetmint-go/x/der/types"; message DER { string zigbeeID = 1; - string dirigeraID = 2; - string dirigeraMAC = 3; - string plmntAddress = 4; - string liquidAddress = 5; + string plmntAddress = 2; + string liquidAddress = 3; + string metadataJson = 4; + } diff --git a/tests/e2e/der/suite.go b/tests/e2e/der/suite.go index a3d58f7..f156834 100644 --- a/tests/e2e/der/suite.go +++ b/tests/e2e/der/suite.go @@ -50,10 +50,9 @@ func (s *E2ETestSuite) TestRegisterDER() { der := dertypes.DER{ ZigbeeID: "0123456789123456", - DirigeraID: "1123456789123456", - DirigeraMAC: "", PlmntAddress: val.Address.String(), LiquidAddress: "liquidder", + MetadataJson: "{\"dirigeraID\": \"0123456789123456\", \"dirigeraMac\": \"00:00:00:00:00:00\"}", } msg1 := dertypes.NewMsgRegisterDER(val.Address.String(), &der) diff --git a/x/der/types/der.pb.go b/x/der/types/der.pb.go index ffc0c26..32fe11f 100644 --- a/x/der/types/der.pb.go +++ b/x/der/types/der.pb.go @@ -24,10 +24,9 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DER struct { ZigbeeID string `protobuf:"bytes,1,opt,name=zigbeeID,proto3" json:"zigbeeID,omitempty"` - DirigeraID string `protobuf:"bytes,2,opt,name=dirigeraID,proto3" json:"dirigeraID,omitempty"` - DirigeraMAC string `protobuf:"bytes,3,opt,name=dirigeraMAC,proto3" json:"dirigeraMAC,omitempty"` - PlmntAddress string `protobuf:"bytes,4,opt,name=plmntAddress,proto3" json:"plmntAddress,omitempty"` - LiquidAddress string `protobuf:"bytes,5,opt,name=liquidAddress,proto3" json:"liquidAddress,omitempty"` + PlmntAddress string `protobuf:"bytes,2,opt,name=plmntAddress,proto3" json:"plmntAddress,omitempty"` + LiquidAddress string `protobuf:"bytes,3,opt,name=liquidAddress,proto3" json:"liquidAddress,omitempty"` + MetadataJson string `protobuf:"bytes,4,opt,name=metadataJson,proto3" json:"metadataJson,omitempty"` } func (m *DER) Reset() { *m = DER{} } @@ -70,20 +69,6 @@ func (m *DER) GetZigbeeID() string { return "" } -func (m *DER) GetDirigeraID() string { - if m != nil { - return m.DirigeraID - } - return "" -} - -func (m *DER) GetDirigeraMAC() string { - if m != nil { - return m.DirigeraMAC - } - return "" -} - func (m *DER) GetPlmntAddress() string { if m != nil { return m.PlmntAddress @@ -98,6 +83,13 @@ func (m *DER) GetLiquidAddress() string { return "" } +func (m *DER) GetMetadataJson() string { + if m != nil { + return m.MetadataJson + } + return "" +} + func init() { proto.RegisterType((*DER)(nil), "planetmintgo.der.DER") } @@ -105,21 +97,20 @@ func init() { func init() { proto.RegisterFile("planetmintgo/der/der.proto", fileDescriptor_6380e8122e200808) } var fileDescriptor_6380e8122e200808 = []byte{ - // 222 bytes of a gzipped FileDescriptorProto + // 208 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0xc8, 0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00, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0x87, 0x89, - 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x47, 0x01, 0xf0, 0x5d, 0x31, 0x01, 0x00, 0x00, + 0xa2, 0xfc, 0x92, 0x7c, 0x21, 0x01, 0x64, 0x39, 0xbd, 0x94, 0xd4, 0x22, 0xa5, 0x7e, 0x46, 0x2e, + 0x66, 0x17, 0xd7, 0x20, 0x21, 0x29, 0x2e, 0x8e, 0xaa, 0xcc, 0xf4, 0xa4, 0xd4, 0x54, 0x4f, 0x17, + 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x38, 0x5f, 0x48, 0x89, 0x8b, 0xa7, 0x20, 0x27, 0x37, + 0xaf, 0xc4, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x58, 0x82, 0x09, 0x2c, 0x8f, 0x22, 0x26, 0xa4, + 0xc2, 0xc5, 0x9b, 0x93, 0x59, 0x58, 0x9a, 0x99, 0x02, 0x53, 0xc4, 0x0c, 0x56, 0x84, 0x2a, 0x08, + 0x32, 0x29, 0x37, 0xb5, 0x24, 0x31, 0x25, 0xb1, 0x24, 0xd1, 0xab, 0x38, 0x3f, 0x4f, 0x82, 0x05, + 0x62, 0x12, 0xb2, 0x98, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, + 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, + 0xe9, 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x3c, 0x82, 0xc4, + 0xd4, 0x4d, 0xcf, 0xd7, 0xaf, 0x00, 0x7b, 0xb9, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, + 0x6b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x13, 0x8b, 0x8b, 0x13, 0x01, 0x00, 0x00, } func (m *DER) Marshal() (dAtA []byte, err error) { @@ -142,32 +133,25 @@ func (m *DER) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.MetadataJson) > 0 { + i -= len(m.MetadataJson) + copy(dAtA[i:], m.MetadataJson) + i = encodeVarintDer(dAtA, i, uint64(len(m.MetadataJson))) + i-- + dAtA[i] = 0x22 + } if len(m.LiquidAddress) > 0 { i -= len(m.LiquidAddress) copy(dAtA[i:], m.LiquidAddress) i = encodeVarintDer(dAtA, i, uint64(len(m.LiquidAddress))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x1a } if len(m.PlmntAddress) > 0 { i -= len(m.PlmntAddress) copy(dAtA[i:], m.PlmntAddress) i = encodeVarintDer(dAtA, i, uint64(len(m.PlmntAddress))) i-- - dAtA[i] = 0x22 - } - if len(m.DirigeraMAC) > 0 { - i -= len(m.DirigeraMAC) - copy(dAtA[i:], m.DirigeraMAC) - i = encodeVarintDer(dAtA, i, uint64(len(m.DirigeraMAC))) - i-- - dAtA[i] = 0x1a - } - if len(m.DirigeraID) > 0 { - i -= len(m.DirigeraID) - copy(dAtA[i:], m.DirigeraID) - i = encodeVarintDer(dAtA, i, uint64(len(m.DirigeraID))) - i-- dAtA[i] = 0x12 } if len(m.ZigbeeID) > 0 { @@ -201,14 +185,6 @@ func (m *DER) Size() (n int) { if l > 0 { n += 1 + l + sovDer(uint64(l)) } - l = len(m.DirigeraID) - if l > 0 { - n += 1 + l + sovDer(uint64(l)) - } - l = len(m.DirigeraMAC) - if l > 0 { - n += 1 + l + sovDer(uint64(l)) - } l = len(m.PlmntAddress) if l > 0 { n += 1 + l + sovDer(uint64(l)) @@ -217,6 +193,10 @@ func (m *DER) Size() (n int) { if l > 0 { n += 1 + l + sovDer(uint64(l)) } + l = len(m.MetadataJson) + if l > 0 { + n += 1 + l + sovDer(uint64(l)) + } return n } @@ -288,70 +268,6 @@ func (m *DER) Unmarshal(dAtA []byte) error { m.ZigbeeID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DirigeraID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDer - } - 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 ErrInvalidLengthDer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DirigeraID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DirigeraMAC", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDer - } - 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 ErrInvalidLengthDer - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDer - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DirigeraMAC = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PlmntAddress", wireType) } @@ -383,7 +299,7 @@ func (m *DER) Unmarshal(dAtA []byte) error { } m.PlmntAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LiquidAddress", wireType) } @@ -415,6 +331,38 @@ func (m *DER) Unmarshal(dAtA []byte) error { } m.LiquidAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MetadataJson", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDer + } + 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 ErrInvalidLengthDer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MetadataJson = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDer(dAtA[iNdEx:])