From 8315de6463b5479958ef2856fb044e44d9a4d715 Mon Sep 17 00:00:00 2001 From: SHA Date: Tue, 8 Oct 2019 17:33:07 +0700 Subject: [PATCH 1/7] Add ListAddressMapperMapping for support multi-chain mapping --- .../types/address_mapper/address_mapper.pb.go | 111 ++++++++++++------ .../types/address_mapper/address_mapper.proto | 5 +- 2 files changed, 79 insertions(+), 37 deletions(-) diff --git a/builtin/types/address_mapper/address_mapper.pb.go b/builtin/types/address_mapper/address_mapper.pb.go index 946b0021..538064dc 100644 --- a/builtin/types/address_mapper/address_mapper.pb.go +++ b/builtin/types/address_mapper/address_mapper.pb.go @@ -36,7 +36,7 @@ func (m *AddressMapperMapping) Reset() { *m = AddressMapperMapping{} } func (m *AddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*AddressMapperMapping) ProtoMessage() {} func (*AddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{0} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{0} } func (m *AddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperMapping.Unmarshal(m, b) @@ -70,6 +70,44 @@ func (m *AddressMapperMapping) GetTo() *types.Address { return nil } +type ListAddressMapperMapping struct { + Mappings []*AddressMapperMapping `protobuf:"bytes,1,rep,name=mappings" json:"mappings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListAddressMapperMapping) Reset() { *m = ListAddressMapperMapping{} } +func (m *ListAddressMapperMapping) String() string { return proto.CompactTextString(m) } +func (*ListAddressMapperMapping) ProtoMessage() {} +func (*ListAddressMapperMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{1} +} +func (m *ListAddressMapperMapping) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListAddressMapperMapping.Unmarshal(m, b) +} +func (m *ListAddressMapperMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListAddressMapperMapping.Marshal(b, m, deterministic) +} +func (dst *ListAddressMapperMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListAddressMapperMapping.Merge(dst, src) +} +func (m *ListAddressMapperMapping) XXX_Size() int { + return xxx_messageInfo_ListAddressMapperMapping.Size(m) +} +func (m *ListAddressMapperMapping) XXX_DiscardUnknown() { + xxx_messageInfo_ListAddressMapperMapping.DiscardUnknown(m) +} + +var xxx_messageInfo_ListAddressMapperMapping proto.InternalMessageInfo + +func (m *ListAddressMapperMapping) GetMappings() []*AddressMapperMapping { + if m != nil { + return m.Mappings + } + return nil +} + type AddressMapperInitRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -80,7 +118,7 @@ func (m *AddressMapperInitRequest) Reset() { *m = AddressMapperInitReque func (m *AddressMapperInitRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperInitRequest) ProtoMessage() {} func (*AddressMapperInitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{1} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{2} } func (m *AddressMapperInitRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperInitRequest.Unmarshal(m, b) @@ -118,7 +156,7 @@ func (m *AddressMapperAddIdentityMappingRequest) Reset() { func (m *AddressMapperAddIdentityMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperAddIdentityMappingRequest) ProtoMessage() {} func (*AddressMapperAddIdentityMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{2} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{3} } func (m *AddressMapperAddIdentityMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperAddIdentityMappingRequest.Unmarshal(m, b) @@ -169,7 +207,7 @@ func (m *AddressMapperRemoveMappingRequest) Reset() { *m = AddressMapper func (m *AddressMapperRemoveMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperRemoveMappingRequest) ProtoMessage() {} func (*AddressMapperRemoveMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{3} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{4} } func (m *AddressMapperRemoveMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperRemoveMappingRequest.Unmarshal(m, b) @@ -200,7 +238,7 @@ func (m *AddressMapperGetMappingRequest) Reset() { *m = AddressMapperGet func (m *AddressMapperGetMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingRequest) ProtoMessage() {} func (*AddressMapperGetMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{4} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{5} } func (m *AddressMapperGetMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingRequest.Unmarshal(m, b) @@ -239,7 +277,7 @@ func (m *AddressMapperGetMappingResponse) Reset() { *m = AddressMapperGe func (m *AddressMapperGetMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingResponse) ProtoMessage() {} func (*AddressMapperGetMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{5} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{6} } func (m *AddressMapperGetMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingResponse.Unmarshal(m, b) @@ -283,7 +321,7 @@ func (m *AddressMapperListMappingRequest) Reset() { *m = AddressMapperLi func (m *AddressMapperListMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingRequest) ProtoMessage() {} func (*AddressMapperListMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{6} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{7} } func (m *AddressMapperListMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingRequest.Unmarshal(m, b) @@ -314,7 +352,7 @@ func (m *AddressMapperListMappingResponse) Reset() { *m = AddressMapperL func (m *AddressMapperListMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingResponse) ProtoMessage() {} func (*AddressMapperListMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{7} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{8} } func (m *AddressMapperListMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingResponse.Unmarshal(m, b) @@ -352,7 +390,7 @@ func (m *AddressMapperHasMappingRequest) Reset() { *m = AddressMapperHas func (m *AddressMapperHasMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingRequest) ProtoMessage() {} func (*AddressMapperHasMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{8} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{9} } func (m *AddressMapperHasMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingRequest.Unmarshal(m, b) @@ -390,7 +428,7 @@ func (m *AddressMapperHasMappingResponse) Reset() { *m = AddressMapperHa func (m *AddressMapperHasMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingResponse) ProtoMessage() {} func (*AddressMapperHasMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f6edfeb09aa42ff, []int{9} + return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{10} } func (m *AddressMapperHasMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingResponse.Unmarshal(m, b) @@ -419,6 +457,7 @@ func (m *AddressMapperHasMappingResponse) GetHasMapping() bool { func init() { proto.RegisterType((*AddressMapperMapping)(nil), "AddressMapperMapping") + proto.RegisterType((*ListAddressMapperMapping)(nil), "ListAddressMapperMapping") proto.RegisterType((*AddressMapperInitRequest)(nil), "AddressMapperInitRequest") proto.RegisterType((*AddressMapperAddIdentityMappingRequest)(nil), "AddressMapperAddIdentityMappingRequest") proto.RegisterType((*AddressMapperRemoveMappingRequest)(nil), "AddressMapperRemoveMappingRequest") @@ -431,30 +470,30 @@ func init() { } func init() { - proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_0f6edfeb09aa42ff) -} - -var fileDescriptor_address_mapper_0f6edfeb09aa42ff = []byte{ - // 322 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xc1, 0x4b, 0xf3, 0x40, - 0x10, 0xc5, 0x49, 0xfb, 0xf1, 0x51, 0xa7, 0x9e, 0x8a, 0x42, 0x28, 0xc5, 0xa6, 0x2b, 0x48, 0x2f, - 0x26, 0x5a, 0xef, 0x42, 0xbd, 0x68, 0x41, 0x45, 0x02, 0x1e, 0x3c, 0x49, 0x6a, 0xc6, 0x74, 0xb1, - 0xbb, 0x13, 0x77, 0x27, 0x4a, 0x2f, 0xfe, 0xed, 0xd2, 0x24, 0x54, 0x13, 0x2d, 0xd2, 0x5e, 0x16, - 0x76, 0xe6, 0xcd, 0xef, 0x3d, 0x86, 0x81, 0xbb, 0x44, 0xf2, 0x2c, 0x9b, 0xfa, 0x4f, 0xa4, 0x82, - 0x39, 0x91, 0xd2, 0xc8, 0xef, 0x64, 0x5e, 0x82, 0x84, 0x8e, 0x97, 0xdf, 0x60, 0x9a, 0xc9, 0x39, - 0x4b, 0x1d, 0xf0, 0x22, 0x45, 0x1b, 0x44, 0x71, 0x6c, 0xd0, 0xda, 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0xa6, - 0xea, 0x43, 0x7b, 0x16, 0x15, 0xe7, 0x2c, 0x75, 0x92, 0x73, 0x5a, 0x21, 0xcc, 0x56, 0xc2, 0xe9, - 0xff, 0xfc, 0x60, 0xcf, 0x3e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x46, 0x10, 0x29, 0xe7, 0x36, 0x03, - 0x00, 0x00, + proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_0f24f7422e5d2dc7) +} + +var fileDescriptor_address_mapper_0f24f7422e5d2dc7 = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x4b, 0xeb, 0x40, + 0x10, 0x80, 0x49, 0xfb, 0x78, 0xd4, 0xa9, 0xa7, 0xa2, 0xb0, 0x94, 0x62, 0xd3, 0x15, 0xa4, 0x17, + 0x13, 0xad, 0x77, 0xa1, 0x5e, 0xb4, 0x60, 0x45, 0x02, 0x1e, 0x3c, 0x49, 0x6a, 0xc6, 0x74, 0xb1, + 0xd9, 0x89, 0xd9, 0x89, 0xd2, 0x8b, 0xbf, 0x5d, 0x9a, 0xd4, 0x6a, 0x96, 0x16, 0x69, 0x2f, 0x4b, + 0x76, 0xf7, 0x9b, 0x6f, 0x26, 0x33, 0x09, 0xdc, 0xc7, 0x8a, 0xa7, 0xf9, 0xc4, 0x7b, 0xa6, 0xc4, + 0x9f, 0x11, 0x25, 0x1a, 0xf9, 0x83, 0xb2, 0x57, 0x3f, 0xa6, 0xd3, 0xc5, 0xd6, 0x9f, 0xe4, 0x6a, + 0xc6, 0x4a, 0xfb, 0x3c, 0x4f, 0xd1, 0xf8, 0x61, 0x14, 0x65, 0x68, 0xcc, 0x53, 0x12, 0xa6, 0x29, + 0x66, 0xd6, 0xd6, 0x4b, 0x33, 0x62, 0x6a, 0x9f, 0xfd, 0x61, 0x2c, 0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, 0x4a, 0xc7, 0x85, 0xa7, 0x11, 0xc0, 0x74, 0x05, 0x4e, 0xfe, 0x17, 0xdf, 0xff, 0xc5, 0x57, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x40, 0x35, 0x44, 0x85, 0x03, 0x00, 0x00, } diff --git a/builtin/types/address_mapper/address_mapper.proto b/builtin/types/address_mapper/address_mapper.proto index 68a79a73..e4894e1c 100644 --- a/builtin/types/address_mapper/address_mapper.proto +++ b/builtin/types/address_mapper/address_mapper.proto @@ -12,6 +12,10 @@ message AddressMapperMapping { Address to = 2; } +message ListAddressMapperMapping { + repeated AddressMapperMapping mappings = 1; +} + // Genesis message AddressMapperInitRequest { @@ -49,7 +53,6 @@ message AddressMapperListMappingResponse { repeated AddressMapperMapping mappings = 1; // mapping address } - message AddressMapperHasMappingRequest { Address from = 1; } From 981d7495bfc6dc57010d8a16074df2f2edf5012a Mon Sep 17 00:00:00 2001 From: SHA Date: Wed, 9 Oct 2019 10:53:59 +0700 Subject: [PATCH 2/7] Add protobuf for GetMultiChainMapping --- .../types/address_mapper/address_mapper.pb.go | 208 ++++++++++++++---- .../types/address_mapper/address_mapper.proto | 15 ++ 2 files changed, 186 insertions(+), 37 deletions(-) diff --git a/builtin/types/address_mapper/address_mapper.pb.go b/builtin/types/address_mapper/address_mapper.pb.go index 538064dc..6b15a0a1 100644 --- a/builtin/types/address_mapper/address_mapper.pb.go +++ b/builtin/types/address_mapper/address_mapper.pb.go @@ -36,7 +36,7 @@ func (m *AddressMapperMapping) Reset() { *m = AddressMapperMapping{} } func (m *AddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*AddressMapperMapping) ProtoMessage() {} func (*AddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{0} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{0} } func (m *AddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperMapping.Unmarshal(m, b) @@ -81,7 +81,7 @@ func (m *ListAddressMapperMapping) Reset() { *m = ListAddressMapperMappi func (m *ListAddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*ListAddressMapperMapping) ProtoMessage() {} func (*ListAddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{1} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{1} } func (m *ListAddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListAddressMapperMapping.Unmarshal(m, b) @@ -108,6 +108,134 @@ func (m *ListAddressMapperMapping) GetMappings() []*AddressMapperMapping { return nil } +type AddressMapperMultichainGetMappingRequest struct { + From *types.Address `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperMultichainGetMappingRequest) Reset() { + *m = AddressMapperMultichainGetMappingRequest{} +} +func (m *AddressMapperMultichainGetMappingRequest) String() string { return proto.CompactTextString(m) } +func (*AddressMapperMultichainGetMappingRequest) ProtoMessage() {} +func (*AddressMapperMultichainGetMappingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{2} +} +func (m *AddressMapperMultichainGetMappingRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Unmarshal(m, b) +} +func (m *AddressMapperMultichainGetMappingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Marshal(b, m, deterministic) +} +func (dst *AddressMapperMultichainGetMappingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Merge(dst, src) +} +func (m *AddressMapperMultichainGetMappingRequest) XXX_Size() int { + return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Size(m) +} +func (m *AddressMapperMultichainGetMappingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperMultichainGetMappingRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperMultichainGetMappingRequest proto.InternalMessageInfo + +func (m *AddressMapperMultichainGetMappingRequest) GetFrom() *types.Address { + if m != nil { + return m.From + } + return nil +} + +type AddressMapperMultichainMapping struct { + // Address on a blockchain + From *types.Address `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` + // Corresponding address on another blockchain + To *types.Address `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperMultichainMapping) Reset() { *m = AddressMapperMultichainMapping{} } +func (m *AddressMapperMultichainMapping) String() string { return proto.CompactTextString(m) } +func (*AddressMapperMultichainMapping) ProtoMessage() {} +func (*AddressMapperMultichainMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{3} +} +func (m *AddressMapperMultichainMapping) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperMultichainMapping.Unmarshal(m, b) +} +func (m *AddressMapperMultichainMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperMultichainMapping.Marshal(b, m, deterministic) +} +func (dst *AddressMapperMultichainMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperMultichainMapping.Merge(dst, src) +} +func (m *AddressMapperMultichainMapping) XXX_Size() int { + return xxx_messageInfo_AddressMapperMultichainMapping.Size(m) +} +func (m *AddressMapperMultichainMapping) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperMultichainMapping.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperMultichainMapping proto.InternalMessageInfo + +func (m *AddressMapperMultichainMapping) GetFrom() *types.Address { + if m != nil { + return m.From + } + return nil +} + +func (m *AddressMapperMultichainMapping) GetTo() *types.Address { + if m != nil { + return m.To + } + return nil +} + +type AddressMapperMultichainGetMappingResponse struct { + Mappings []*AddressMapperMultichainMapping `protobuf:"bytes,1,rep,name=mappings" json:"mappings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperMultichainGetMappingResponse) Reset() { + *m = AddressMapperMultichainGetMappingResponse{} +} +func (m *AddressMapperMultichainGetMappingResponse) String() string { return proto.CompactTextString(m) } +func (*AddressMapperMultichainGetMappingResponse) ProtoMessage() {} +func (*AddressMapperMultichainGetMappingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{4} +} +func (m *AddressMapperMultichainGetMappingResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Unmarshal(m, b) +} +func (m *AddressMapperMultichainGetMappingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Marshal(b, m, deterministic) +} +func (dst *AddressMapperMultichainGetMappingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Merge(dst, src) +} +func (m *AddressMapperMultichainGetMappingResponse) XXX_Size() int { + return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Size(m) +} +func (m *AddressMapperMultichainGetMappingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperMultichainGetMappingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperMultichainGetMappingResponse proto.InternalMessageInfo + +func (m *AddressMapperMultichainGetMappingResponse) GetMappings() []*AddressMapperMultichainMapping { + if m != nil { + return m.Mappings + } + return nil +} + type AddressMapperInitRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -118,7 +246,7 @@ func (m *AddressMapperInitRequest) Reset() { *m = AddressMapperInitReque func (m *AddressMapperInitRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperInitRequest) ProtoMessage() {} func (*AddressMapperInitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{2} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{5} } func (m *AddressMapperInitRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperInitRequest.Unmarshal(m, b) @@ -156,7 +284,7 @@ func (m *AddressMapperAddIdentityMappingRequest) Reset() { func (m *AddressMapperAddIdentityMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperAddIdentityMappingRequest) ProtoMessage() {} func (*AddressMapperAddIdentityMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{3} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{6} } func (m *AddressMapperAddIdentityMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperAddIdentityMappingRequest.Unmarshal(m, b) @@ -207,7 +335,7 @@ func (m *AddressMapperRemoveMappingRequest) Reset() { *m = AddressMapper func (m *AddressMapperRemoveMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperRemoveMappingRequest) ProtoMessage() {} func (*AddressMapperRemoveMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{4} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{7} } func (m *AddressMapperRemoveMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperRemoveMappingRequest.Unmarshal(m, b) @@ -238,7 +366,7 @@ func (m *AddressMapperGetMappingRequest) Reset() { *m = AddressMapperGet func (m *AddressMapperGetMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingRequest) ProtoMessage() {} func (*AddressMapperGetMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{5} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{8} } func (m *AddressMapperGetMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingRequest.Unmarshal(m, b) @@ -277,7 +405,7 @@ func (m *AddressMapperGetMappingResponse) Reset() { *m = AddressMapperGe func (m *AddressMapperGetMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingResponse) ProtoMessage() {} func (*AddressMapperGetMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{6} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{9} } func (m *AddressMapperGetMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingResponse.Unmarshal(m, b) @@ -321,7 +449,7 @@ func (m *AddressMapperListMappingRequest) Reset() { *m = AddressMapperLi func (m *AddressMapperListMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingRequest) ProtoMessage() {} func (*AddressMapperListMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{7} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{10} } func (m *AddressMapperListMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingRequest.Unmarshal(m, b) @@ -352,7 +480,7 @@ func (m *AddressMapperListMappingResponse) Reset() { *m = AddressMapperL func (m *AddressMapperListMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingResponse) ProtoMessage() {} func (*AddressMapperListMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{8} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{11} } func (m *AddressMapperListMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingResponse.Unmarshal(m, b) @@ -390,7 +518,7 @@ func (m *AddressMapperHasMappingRequest) Reset() { *m = AddressMapperHas func (m *AddressMapperHasMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingRequest) ProtoMessage() {} func (*AddressMapperHasMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{9} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{12} } func (m *AddressMapperHasMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingRequest.Unmarshal(m, b) @@ -428,7 +556,7 @@ func (m *AddressMapperHasMappingResponse) Reset() { *m = AddressMapperHa func (m *AddressMapperHasMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingResponse) ProtoMessage() {} func (*AddressMapperHasMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_0f24f7422e5d2dc7, []int{10} + return fileDescriptor_address_mapper_154e2540c176bcf9, []int{13} } func (m *AddressMapperHasMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingResponse.Unmarshal(m, b) @@ -458,6 +586,9 @@ func (m *AddressMapperHasMappingResponse) GetHasMapping() bool { func init() { proto.RegisterType((*AddressMapperMapping)(nil), "AddressMapperMapping") proto.RegisterType((*ListAddressMapperMapping)(nil), "ListAddressMapperMapping") + proto.RegisterType((*AddressMapperMultichainGetMappingRequest)(nil), "AddressMapperMultichainGetMappingRequest") + proto.RegisterType((*AddressMapperMultichainMapping)(nil), "AddressMapperMultichainMapping") + proto.RegisterType((*AddressMapperMultichainGetMappingResponse)(nil), "AddressMapperMultichainGetMappingResponse") proto.RegisterType((*AddressMapperInitRequest)(nil), "AddressMapperInitRequest") proto.RegisterType((*AddressMapperAddIdentityMappingRequest)(nil), "AddressMapperAddIdentityMappingRequest") proto.RegisterType((*AddressMapperRemoveMappingRequest)(nil), "AddressMapperRemoveMappingRequest") @@ -470,30 +601,33 @@ func init() { } func init() { - proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_0f24f7422e5d2dc7) -} - -var fileDescriptor_address_mapper_0f24f7422e5d2dc7 = []byte{ - // 333 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x41, 0x4b, 0xeb, 0x40, - 0x10, 0x80, 0x49, 0xfb, 0x78, 0xd4, 0xa9, 0xa7, 0xa2, 0xb0, 0x94, 0x62, 0xd3, 0x15, 0xa4, 0x17, - 0x13, 0xad, 0x77, 0xa1, 0x5e, 0xb4, 0x60, 0x45, 0x02, 0x1e, 0x3c, 0x49, 0x6a, 0xc6, 0x74, 0xb1, - 0xd9, 0x89, 0xd9, 0x89, 0xd2, 0x8b, 0xbf, 0x5d, 0x9a, 0xd4, 0x6a, 0x96, 0x16, 0x69, 0x2f, 0x4b, - 0x76, 0xf7, 0x9b, 0x6f, 0x26, 0x33, 0x09, 0xdc, 0xc7, 0x8a, 0xa7, 0xf9, 0xc4, 0x7b, 0xa6, 0xc4, - 0x9f, 0x11, 0x25, 0x1a, 0xf9, 0x83, 0xb2, 0x57, 0x3f, 0xa6, 0xd3, 0xc5, 0xd6, 0x9f, 0xe4, 0x6a, - 0xc6, 0x4a, 0xfb, 0x3c, 0x4f, 0xd1, 0xf8, 0x61, 0x14, 0x65, 0x68, 0xcc, 0x53, 0x12, 0xa6, 0x29, - 0x66, 0xd6, 0xd6, 0x4b, 0x33, 0x62, 0x6a, 0x9f, 0xfd, 0x61, 0x2c, 0x4d, 0xc5, 0x5a, 0x46, 0xc8, - 0x3b, 0x38, 0x18, 0x96, 0xa6, 0x71, 0x21, 0x5a, 0xac, 0x4a, 0xc7, 0xad, 0x0e, 0xfc, 0x7b, 0xc9, - 0x28, 0x11, 0x8e, 0xeb, 0xf4, 0x9b, 0x83, 0x86, 0xb7, 0x84, 0x82, 0xe2, 0xb4, 0x25, 0xa0, 0xc6, - 0x24, 0x6a, 0xd6, 0x5d, 0x8d, 0x49, 0x8e, 0x41, 0xdc, 0x2a, 0xc3, 0x6b, 0x9d, 0xe7, 0xd0, 0x48, - 0xca, 0x47, 0x23, 0x1c, 0xb7, 0xde, 0x6f, 0x0e, 0x0e, 0xbd, 0x75, 0x60, 0xb0, 0xc2, 0x64, 0x1b, - 0x44, 0x85, 0x18, 0x69, 0xc5, 0x01, 0xbe, 0xe5, 0x68, 0x58, 0x7e, 0xc2, 0x49, 0xe5, 0x6e, 0x18, - 0x45, 0xa3, 0x08, 0x35, 0x2b, 0x9e, 0x7f, 0x8b, 0x4a, 0x72, 0xd7, 0x97, 0x69, 0x75, 0x60, 0xcf, - 0xa8, 0x58, 0x87, 0x9c, 0x67, 0x28, 0xea, 0xae, 0xd3, 0xdf, 0x0f, 0x7e, 0x0e, 0xe4, 0x31, 0xf4, - 0x2a, 0xf9, 0x03, 0x4c, 0xe8, 0x1d, 0xab, 0xa9, 0xe5, 0x25, 0x1c, 0x55, 0xa0, 0x6b, 0xe4, 0x6d, - 0x8a, 0x93, 0x8f, 0xd0, 0xdd, 0x18, 0x6f, 0x52, 0xd2, 0x06, 0x77, 0x1e, 0x55, 0xcf, 0x52, 0x2f, - 0xe6, 0x66, 0x55, 0xff, 0x00, 0xee, 0x66, 0x64, 0x99, 0x7e, 0x87, 0xa9, 0xda, 0x4d, 0xb9, 0x09, - 0xcd, 0x56, 0x4d, 0xb9, 0xb2, 0x2a, 0xff, 0x1d, 0xbf, 0xac, 0xaa, 0x0b, 0xcd, 0x69, 0x58, 0xfe, - 0x1d, 0x4a, 0xc7, 0x85, 0xa7, 0x11, 0xc0, 0x74, 0x05, 0x4e, 0xfe, 0x17, 0xdf, 0xff, 0xc5, 0x57, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x40, 0x35, 0x44, 0x85, 0x03, 0x00, 0x00, + proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_154e2540c176bcf9) +} + +var fileDescriptor_address_mapper_154e2540c176bcf9 = []byte{ + // 376 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x4b, 0xeb, 0x40, + 0x10, 0x26, 0xed, 0xe3, 0xd1, 0x37, 0x7d, 0xa7, 0xa0, 0x10, 0x4a, 0xb1, 0xe9, 0x0a, 0x12, 0x0f, + 0x26, 0x5a, 0x8f, 0x82, 0x50, 0x2f, 0xb6, 0x60, 0x45, 0x02, 0x82, 0x9e, 0x24, 0x6d, 0xd6, 0x64, + 0xb1, 0xd9, 0x8d, 0xd9, 0x89, 0xd2, 0x8b, 0x7f, 0xbb, 0x34, 0x89, 0xb5, 0x59, 0x9b, 0x6a, 0xeb, + 0x65, 0xd9, 0x1f, 0xdf, 0x7c, 0xf3, 0xcd, 0x37, 0xcb, 0xc0, 0x4d, 0xc0, 0x30, 0x4c, 0xc7, 0xf6, + 0x44, 0x44, 0xce, 0x54, 0x88, 0x88, 0x53, 0x7c, 0x15, 0xc9, 0x93, 0x13, 0x88, 0xa3, 0xf9, 0xd1, + 0x19, 0xa7, 0x6c, 0x8a, 0x8c, 0x3b, 0x38, 0x8b, 0xa9, 0x74, 0x3c, 0xdf, 0x4f, 0xa8, 0x94, 0x0f, + 0x91, 0x17, 0xc7, 0x34, 0x51, 0x8e, 0x76, 0x9c, 0x08, 0x14, 0xad, 0xe3, 0x6f, 0x18, 0x73, 0xa6, + 0x6c, 0xcd, 0x23, 0xc8, 0x35, 0xec, 0xf4, 0x73, 0xa6, 0x51, 0x46, 0x34, 0x5f, 0x19, 0x0f, 0xf4, + 0x36, 0xfc, 0x79, 0x4c, 0x44, 0x64, 0x68, 0xa6, 0x66, 0x35, 0x7b, 0x0d, 0xbb, 0x00, 0xb9, 0xd9, + 0xad, 0x6e, 0x40, 0x0d, 0x85, 0x51, 0x53, 0xde, 0x6a, 0x28, 0xc8, 0x08, 0x8c, 0x2b, 0x26, 0x71, + 0x25, 0xe7, 0x09,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 0xd3, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xa0, 0xa4, 0x2e, 0x44, 0x93, 0x04, 0x00, 0x00, } diff --git a/builtin/types/address_mapper/address_mapper.proto b/builtin/types/address_mapper/address_mapper.proto index e4894e1c..643715a7 100644 --- a/builtin/types/address_mapper/address_mapper.proto +++ b/builtin/types/address_mapper/address_mapper.proto @@ -16,6 +16,21 @@ message ListAddressMapperMapping { repeated AddressMapperMapping mappings = 1; } +message AddressMapperMultichainGetMappingRequest { + Address from = 1; +} + +message AddressMapperMultichainMapping { + // Address on a blockchain + Address from = 1; + // Corresponding address on another blockchain + Address to = 2; +} + +message AddressMapperMultichainGetMappingResponse { + repeated AddressMapperMultichainMapping mappings = 1; +} + // Genesis message AddressMapperInitRequest { From 3f63b409775c9a04298ba5dfb8a04f288bf2a048 Mon Sep 17 00:00:00 2001 From: SHA Date: Wed, 9 Oct 2019 23:10:08 +0700 Subject: [PATCH 3/7] update protobuf --- .../types/address_mapper/address_mapper.pb.go | 217 +++++++----------- .../types/address_mapper/address_mapper.proto | 14 +- 2 files changed, 92 insertions(+), 139 deletions(-) diff --git a/builtin/types/address_mapper/address_mapper.pb.go b/builtin/types/address_mapper/address_mapper.pb.go index 6b15a0a1..247dbe86 100644 --- a/builtin/types/address_mapper/address_mapper.pb.go +++ b/builtin/types/address_mapper/address_mapper.pb.go @@ -36,7 +36,7 @@ func (m *AddressMapperMapping) Reset() { *m = AddressMapperMapping{} } func (m *AddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*AddressMapperMapping) ProtoMessage() {} func (*AddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{0} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{0} } func (m *AddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperMapping.Unmarshal(m, b) @@ -81,7 +81,7 @@ func (m *ListAddressMapperMapping) Reset() { *m = ListAddressMapperMappi func (m *ListAddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*ListAddressMapperMapping) ProtoMessage() {} func (*ListAddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{1} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{1} } func (m *ListAddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListAddressMapperMapping.Unmarshal(m, b) @@ -108,128 +108,88 @@ func (m *ListAddressMapperMapping) GetMappings() []*AddressMapperMapping { return nil } -type AddressMapperMultichainGetMappingRequest struct { +type AddressMapperGetMultichainMappingRequest struct { From *types.Address `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chainId,proto3" json:"chainId,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *AddressMapperMultichainGetMappingRequest) Reset() { - *m = AddressMapperMultichainGetMappingRequest{} +func (m *AddressMapperGetMultichainMappingRequest) Reset() { + *m = AddressMapperGetMultichainMappingRequest{} } -func (m *AddressMapperMultichainGetMappingRequest) String() string { return proto.CompactTextString(m) } -func (*AddressMapperMultichainGetMappingRequest) ProtoMessage() {} -func (*AddressMapperMultichainGetMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{2} +func (m *AddressMapperGetMultichainMappingRequest) String() string { return proto.CompactTextString(m) } +func (*AddressMapperGetMultichainMappingRequest) ProtoMessage() {} +func (*AddressMapperGetMultichainMappingRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{2} } -func (m *AddressMapperMultichainGetMappingRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Unmarshal(m, b) +func (m *AddressMapperGetMultichainMappingRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperGetMultichainMappingRequest.Unmarshal(m, b) } -func (m *AddressMapperMultichainGetMappingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Marshal(b, m, deterministic) +func (m *AddressMapperGetMultichainMappingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperGetMultichainMappingRequest.Marshal(b, m, deterministic) } -func (dst *AddressMapperMultichainGetMappingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Merge(dst, src) +func (dst *AddressMapperGetMultichainMappingRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperGetMultichainMappingRequest.Merge(dst, src) } -func (m *AddressMapperMultichainGetMappingRequest) XXX_Size() int { - return xxx_messageInfo_AddressMapperMultichainGetMappingRequest.Size(m) +func (m *AddressMapperGetMultichainMappingRequest) XXX_Size() int { + return xxx_messageInfo_AddressMapperGetMultichainMappingRequest.Size(m) } -func (m *AddressMapperMultichainGetMappingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_AddressMapperMultichainGetMappingRequest.DiscardUnknown(m) +func (m *AddressMapperGetMultichainMappingRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperGetMultichainMappingRequest.DiscardUnknown(m) } -var xxx_messageInfo_AddressMapperMultichainGetMappingRequest proto.InternalMessageInfo +var xxx_messageInfo_AddressMapperGetMultichainMappingRequest proto.InternalMessageInfo -func (m *AddressMapperMultichainGetMappingRequest) GetFrom() *types.Address { +func (m *AddressMapperGetMultichainMappingRequest) GetFrom() *types.Address { if m != nil { return m.From } return nil } -type AddressMapperMultichainMapping struct { - // Address on a blockchain - From *types.Address `protobuf:"bytes,1,opt,name=from" json:"from,omitempty"` - // Corresponding address on another blockchain - To *types.Address `protobuf:"bytes,2,opt,name=to" json:"to,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *AddressMapperMultichainMapping) Reset() { *m = AddressMapperMultichainMapping{} } -func (m *AddressMapperMultichainMapping) String() string { return proto.CompactTextString(m) } -func (*AddressMapperMultichainMapping) ProtoMessage() {} -func (*AddressMapperMultichainMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{3} -} -func (m *AddressMapperMultichainMapping) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddressMapperMultichainMapping.Unmarshal(m, b) -} -func (m *AddressMapperMultichainMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddressMapperMultichainMapping.Marshal(b, m, deterministic) -} -func (dst *AddressMapperMultichainMapping) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressMapperMultichainMapping.Merge(dst, src) -} -func (m *AddressMapperMultichainMapping) XXX_Size() int { - return xxx_messageInfo_AddressMapperMultichainMapping.Size(m) -} -func (m *AddressMapperMultichainMapping) XXX_DiscardUnknown() { - xxx_messageInfo_AddressMapperMultichainMapping.DiscardUnknown(m) -} - -var xxx_messageInfo_AddressMapperMultichainMapping proto.InternalMessageInfo - -func (m *AddressMapperMultichainMapping) GetFrom() *types.Address { - if m != nil { - return m.From - } - return nil -} - -func (m *AddressMapperMultichainMapping) GetTo() *types.Address { +func (m *AddressMapperGetMultichainMappingRequest) GetChainId() string { if m != nil { - return m.To + return m.ChainId } - return nil + return "" } -type AddressMapperMultichainGetMappingResponse struct { - Mappings []*AddressMapperMultichainMapping `protobuf:"bytes,1,rep,name=mappings" json:"mappings,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type AddressMapperGetMultichainMappingResponse struct { + Mappings []*AddressMapperMapping `protobuf:"bytes,1,rep,name=mappings" json:"mappings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *AddressMapperMultichainGetMappingResponse) Reset() { - *m = AddressMapperMultichainGetMappingResponse{} +func (m *AddressMapperGetMultichainMappingResponse) Reset() { + *m = AddressMapperGetMultichainMappingResponse{} } -func (m *AddressMapperMultichainGetMappingResponse) String() string { return proto.CompactTextString(m) } -func (*AddressMapperMultichainGetMappingResponse) ProtoMessage() {} -func (*AddressMapperMultichainGetMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{4} +func (m *AddressMapperGetMultichainMappingResponse) String() string { return proto.CompactTextString(m) } +func (*AddressMapperGetMultichainMappingResponse) ProtoMessage() {} +func (*AddressMapperGetMultichainMappingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{3} } -func (m *AddressMapperMultichainGetMappingResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Unmarshal(m, b) +func (m *AddressMapperGetMultichainMappingResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperGetMultichainMappingResponse.Unmarshal(m, b) } -func (m *AddressMapperMultichainGetMappingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Marshal(b, m, deterministic) +func (m *AddressMapperGetMultichainMappingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperGetMultichainMappingResponse.Marshal(b, m, deterministic) } -func (dst *AddressMapperMultichainGetMappingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Merge(dst, src) +func (dst *AddressMapperGetMultichainMappingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperGetMultichainMappingResponse.Merge(dst, src) } -func (m *AddressMapperMultichainGetMappingResponse) XXX_Size() int { - return xxx_messageInfo_AddressMapperMultichainGetMappingResponse.Size(m) +func (m *AddressMapperGetMultichainMappingResponse) XXX_Size() int { + return xxx_messageInfo_AddressMapperGetMultichainMappingResponse.Size(m) } -func (m *AddressMapperMultichainGetMappingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_AddressMapperMultichainGetMappingResponse.DiscardUnknown(m) +func (m *AddressMapperGetMultichainMappingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperGetMultichainMappingResponse.DiscardUnknown(m) } -var xxx_messageInfo_AddressMapperMultichainGetMappingResponse proto.InternalMessageInfo +var xxx_messageInfo_AddressMapperGetMultichainMappingResponse proto.InternalMessageInfo -func (m *AddressMapperMultichainGetMappingResponse) GetMappings() []*AddressMapperMultichainMapping { +func (m *AddressMapperGetMultichainMappingResponse) GetMappings() []*AddressMapperMapping { if m != nil { return m.Mappings } @@ -246,7 +206,7 @@ func (m *AddressMapperInitRequest) Reset() { *m = AddressMapperInitReque func (m *AddressMapperInitRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperInitRequest) ProtoMessage() {} func (*AddressMapperInitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{5} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{4} } func (m *AddressMapperInitRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperInitRequest.Unmarshal(m, b) @@ -284,7 +244,7 @@ func (m *AddressMapperAddIdentityMappingRequest) Reset() { func (m *AddressMapperAddIdentityMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperAddIdentityMappingRequest) ProtoMessage() {} func (*AddressMapperAddIdentityMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{6} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{5} } func (m *AddressMapperAddIdentityMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperAddIdentityMappingRequest.Unmarshal(m, b) @@ -335,7 +295,7 @@ func (m *AddressMapperRemoveMappingRequest) Reset() { *m = AddressMapper func (m *AddressMapperRemoveMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperRemoveMappingRequest) ProtoMessage() {} func (*AddressMapperRemoveMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{7} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{6} } func (m *AddressMapperRemoveMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperRemoveMappingRequest.Unmarshal(m, b) @@ -366,7 +326,7 @@ func (m *AddressMapperGetMappingRequest) Reset() { *m = AddressMapperGet func (m *AddressMapperGetMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingRequest) ProtoMessage() {} func (*AddressMapperGetMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{8} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{7} } func (m *AddressMapperGetMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingRequest.Unmarshal(m, b) @@ -405,7 +365,7 @@ func (m *AddressMapperGetMappingResponse) Reset() { *m = AddressMapperGe func (m *AddressMapperGetMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingResponse) ProtoMessage() {} func (*AddressMapperGetMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{9} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{8} } func (m *AddressMapperGetMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingResponse.Unmarshal(m, b) @@ -449,7 +409,7 @@ func (m *AddressMapperListMappingRequest) Reset() { *m = AddressMapperLi func (m *AddressMapperListMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingRequest) ProtoMessage() {} func (*AddressMapperListMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{10} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{9} } func (m *AddressMapperListMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingRequest.Unmarshal(m, b) @@ -480,7 +440,7 @@ func (m *AddressMapperListMappingResponse) Reset() { *m = AddressMapperL func (m *AddressMapperListMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingResponse) ProtoMessage() {} func (*AddressMapperListMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{11} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{10} } func (m *AddressMapperListMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingResponse.Unmarshal(m, b) @@ -518,7 +478,7 @@ func (m *AddressMapperHasMappingRequest) Reset() { *m = AddressMapperHas func (m *AddressMapperHasMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingRequest) ProtoMessage() {} func (*AddressMapperHasMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{12} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{11} } func (m *AddressMapperHasMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingRequest.Unmarshal(m, b) @@ -556,7 +516,7 @@ func (m *AddressMapperHasMappingResponse) Reset() { *m = AddressMapperHa func (m *AddressMapperHasMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingResponse) ProtoMessage() {} func (*AddressMapperHasMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_154e2540c176bcf9, []int{13} + return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{12} } func (m *AddressMapperHasMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingResponse.Unmarshal(m, b) @@ -586,9 +546,8 @@ func (m *AddressMapperHasMappingResponse) GetHasMapping() bool { func init() { proto.RegisterType((*AddressMapperMapping)(nil), "AddressMapperMapping") proto.RegisterType((*ListAddressMapperMapping)(nil), "ListAddressMapperMapping") - proto.RegisterType((*AddressMapperMultichainGetMappingRequest)(nil), "AddressMapperMultichainGetMappingRequest") - proto.RegisterType((*AddressMapperMultichainMapping)(nil), "AddressMapperMultichainMapping") - proto.RegisterType((*AddressMapperMultichainGetMappingResponse)(nil), "AddressMapperMultichainGetMappingResponse") + proto.RegisterType((*AddressMapperGetMultichainMappingRequest)(nil), "AddressMapperGetMultichainMappingRequest") + proto.RegisterType((*AddressMapperGetMultichainMappingResponse)(nil), "AddressMapperGetMultichainMappingResponse") proto.RegisterType((*AddressMapperInitRequest)(nil), "AddressMapperInitRequest") proto.RegisterType((*AddressMapperAddIdentityMappingRequest)(nil), "AddressMapperAddIdentityMappingRequest") proto.RegisterType((*AddressMapperRemoveMappingRequest)(nil), "AddressMapperRemoveMappingRequest") @@ -601,33 +560,33 @@ func init() { } func init() { - proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_154e2540c176bcf9) -} - -var fileDescriptor_address_mapper_154e2540c176bcf9 = []byte{ - // 376 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x4b, 0xeb, 0x40, - 0x10, 0x26, 0xed, 0xe3, 0xd1, 0x37, 0x7d, 0xa7, 0xa0, 0x10, 0x4a, 0xb1, 0xe9, 0x0a, 0x12, 0x0f, - 0x26, 0x5a, 0x8f, 0x82, 0x50, 0x2f, 0xb6, 0x60, 0x45, 0x02, 0x82, 0x9e, 0x24, 0x6d, 0xd6, 0x64, - 0xb1, 0xd9, 0x8d, 0xd9, 0x89, 0xd2, 0x8b, 0x7f, 0xbb, 0x34, 0x89, 0xb5, 0x59, 0x9b, 0x6a, 0xeb, - 0x65, 0xd9, 0x1f, 0xdf, 0x7c, 0xf3, 0xcd, 0x37, 0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, - 0xeb, 0xfb, 0xfe, 0xd0, 0xa7, 0x1c, 0x19, 0xce, 0x36, 0xf1, 0xa9, 0xba, 0x4e, 0xbd, 0x0d, 0xff, - 0x24, 0x0b, 0xb8, 0x87, 0x69, 0x42, 0x8d, 0xba, 0xa9, 0x59, 0xff, 0xdd, 0xcf, 0x0b, 0xb2, 0x0f, - 0xdd, 0x52, 0x7e, 0x97, 0x46, 0xe2, 0x85, 0x96, 0x53, 0x93, 0x73, 0xa5, 0x09, 0x9b, 0x36, 0xf1, - 0x1e, 0x3a, 0x95, 0xf1, 0x85, 0xc1, 0xdb, 0x76, 0xb1, 0xab, 0x50, 0xcf, 0x7f, 0xb1, 0xa2, 0xfe, - 0x16, 0xcc, 0x6a, 0x48, 0x91, 0x7e, 0x8b, 0x3f, 0xae, 0x9a, 0x32, 0xf0, 0xe4, 0x46, 0xa6, 0x5c, - 0x28, 0xca, 0x97, 0xe3, 0x0b, 0x55, 0x1d, 0x68, 0x86, 0x5e, 0x3e, 0x2b, 0x18, 0x0f, 0x32, 0x9e, - 0x86, 0x0b, 0xe1, 0x02, 0x38, 0xfe, 0x9b, 0x4d, 0x83, 0xd3, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xa0, 0xa4, 0x2e, 0x44, 0x93, 0x04, 0x00, 0x00, + proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_57c8be54ca8d9a50) +} + +var fileDescriptor_address_mapper_57c8be54ca8d9a50 = []byte{ + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xd1, 0x4f, 0xea, 0x30, + 0x14, 0xc6, 0x33, 0xb8, 0xb9, 0x17, 0x0e, 0xf7, 0x89, 0x68, 0xd2, 0x10, 0x22, 0xa3, 0x26, 0x66, + 0x3e, 0xb8, 0x29, 0xbe, 0x9b, 0xe0, 0x8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37, 0xdd, 0x45, + 0x48, 0x1f, 0xe1, 0xf8, 0x17, 0x35, 0x54, 0x22, 0x85, 0x62, 0xbb, 0x9c, 0xa1, 0x03, 0xa4, 0x44, + 0x8c, 0x04, 0xc7, 0xc2, 0x33, 0xfd, 0x80, 0xa3, 0xd2, 0xde, 0x30, 0x08, 0x46, 0x01, 0x13, 0xc8, + 0x71, 0xb6, 0xe5, 0xe9, 0xd6, 0x5c, 0x48, 0xbb, 0x0b, 0x4d, 0xc5, 0x43, 0xe1, 0x61, 0x96, 0x32, + 0x52, 0x37, 0x0d, 0xeb, 0xbf, 0xfb, 0xb5, 0x40, 0x0f, 0xa1, 0x5f, 0xaa, 0xef, 0xb2, 0x58, 0xbe, + 0xb1, 0x72, 0x69, 0x7a, 0x01, 0x07, 0x3f, 0x1a, 0xb4, 0x85, 0x39, 0xfa, 0x00, 0xbd, 0xb5, 0xf9, + 0x45, 0x5b, 0x77, 0x7d, 0x6e, 0xfd, 0x8a, 0xf4, 0xfc, 0xed, 0x55, 0xdc, 0xdf, 0x83, 0xb9, 0x1e, + 0xd9, 0xfd, 0x56, 0xab, 0x4d, 0xb9, 0xf6, 0xd4, 0x56, 0x4d, 0xb9, 0xac, 0x38, 0xff, 0x9e, 0x5f, + 0xb8, 0xea, 0x41, 0x2b, 0xf2, 0xf2, 0x1f, 0xce, 0x45, 0xa8, 0x75, 0x1a, 0x2e, 0x44, 0x4b, 0xd0, + 0xff, 0xab, 0xff, 0xf0, 0xf9, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xce, 0x58, 0x0f, 0x29, 0x49, + 0x04, 0x00, 0x00, } diff --git a/builtin/types/address_mapper/address_mapper.proto b/builtin/types/address_mapper/address_mapper.proto index 643715a7..c62af992 100644 --- a/builtin/types/address_mapper/address_mapper.proto +++ b/builtin/types/address_mapper/address_mapper.proto @@ -16,19 +16,13 @@ message ListAddressMapperMapping { repeated AddressMapperMapping mappings = 1; } -message AddressMapperMultichainGetMappingRequest { +message AddressMapperGetMultichainMappingRequest { Address from = 1; + string chainId = 2; } -message AddressMapperMultichainMapping { - // Address on a blockchain - Address from = 1; - // Corresponding address on another blockchain - Address to = 2; -} - -message AddressMapperMultichainGetMappingResponse { - repeated AddressMapperMultichainMapping mappings = 1; +message AddressMapperGetMultichainMappingResponse { + repeated AddressMapperMapping mappings = 1; } // Genesis From fe3aea8b30635caf2ad54331bfb5507cc5c1b899 Mon Sep 17 00:00:00 2001 From: SHA Date: Thu, 10 Oct 2019 18:42:57 +0700 Subject: [PATCH 4/7] update protubuf --- .../types/address_mapper/address_mapper.pb.go | 259 +++++++++++++++--- .../types/address_mapper/address_mapper.proto | 19 ++ 2 files changed, 236 insertions(+), 42 deletions(-) diff --git a/builtin/types/address_mapper/address_mapper.pb.go b/builtin/types/address_mapper/address_mapper.pb.go index 247dbe86..71a8c678 100644 --- a/builtin/types/address_mapper/address_mapper.pb.go +++ b/builtin/types/address_mapper/address_mapper.pb.go @@ -36,7 +36,7 @@ func (m *AddressMapperMapping) Reset() { *m = AddressMapperMapping{} } func (m *AddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*AddressMapperMapping) ProtoMessage() {} func (*AddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{0} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{0} } func (m *AddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperMapping.Unmarshal(m, b) @@ -81,7 +81,7 @@ func (m *ListAddressMapperMapping) Reset() { *m = ListAddressMapperMappi func (m *ListAddressMapperMapping) String() string { return proto.CompactTextString(m) } func (*ListAddressMapperMapping) ProtoMessage() {} func (*ListAddressMapperMapping) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{1} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{1} } func (m *ListAddressMapperMapping) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ListAddressMapperMapping.Unmarshal(m, b) @@ -122,7 +122,7 @@ func (m *AddressMapperGetMultichainMappingRequest) Reset() { func (m *AddressMapperGetMultichainMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMultichainMappingRequest) ProtoMessage() {} func (*AddressMapperGetMultichainMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{2} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{2} } func (m *AddressMapperGetMultichainMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMultichainMappingRequest.Unmarshal(m, b) @@ -169,7 +169,7 @@ func (m *AddressMapperGetMultichainMappingResponse) Reset() { func (m *AddressMapperGetMultichainMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMultichainMappingResponse) ProtoMessage() {} func (*AddressMapperGetMultichainMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{3} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{3} } func (m *AddressMapperGetMultichainMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMultichainMappingResponse.Unmarshal(m, b) @@ -196,6 +196,174 @@ func (m *AddressMapperGetMultichainMappingResponse) GetMappings() []*AddressMapp return nil } +type AddressMapperSetNonceRequest struct { + Address *types.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperSetNonceRequest) Reset() { *m = AddressMapperSetNonceRequest{} } +func (m *AddressMapperSetNonceRequest) String() string { return proto.CompactTextString(m) } +func (*AddressMapperSetNonceRequest) ProtoMessage() {} +func (*AddressMapperSetNonceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_a116edb8efde1905, []int{4} +} +func (m *AddressMapperSetNonceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperSetNonceRequest.Unmarshal(m, b) +} +func (m *AddressMapperSetNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperSetNonceRequest.Marshal(b, m, deterministic) +} +func (dst *AddressMapperSetNonceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperSetNonceRequest.Merge(dst, src) +} +func (m *AddressMapperSetNonceRequest) XXX_Size() int { + return xxx_messageInfo_AddressMapperSetNonceRequest.Size(m) +} +func (m *AddressMapperSetNonceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperSetNonceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperSetNonceRequest proto.InternalMessageInfo + +func (m *AddressMapperSetNonceRequest) GetAddress() *types.Address { + if m != nil { + return m.Address + } + return nil +} + +type AddressMapperGetNonceRequest struct { + Address *types.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperGetNonceRequest) Reset() { *m = AddressMapperGetNonceRequest{} } +func (m *AddressMapperGetNonceRequest) String() string { return proto.CompactTextString(m) } +func (*AddressMapperGetNonceRequest) ProtoMessage() {} +func (*AddressMapperGetNonceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_a116edb8efde1905, []int{5} +} +func (m *AddressMapperGetNonceRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperGetNonceRequest.Unmarshal(m, b) +} +func (m *AddressMapperGetNonceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperGetNonceRequest.Marshal(b, m, deterministic) +} +func (dst *AddressMapperGetNonceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperGetNonceRequest.Merge(dst, src) +} +func (m *AddressMapperGetNonceRequest) XXX_Size() int { + return xxx_messageInfo_AddressMapperGetNonceRequest.Size(m) +} +func (m *AddressMapperGetNonceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperGetNonceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperGetNonceRequest proto.InternalMessageInfo + +func (m *AddressMapperGetNonceRequest) GetAddress() *types.Address { + if m != nil { + return m.Address + } + return nil +} + +type AddressMapperGetNonceResponse struct { + Address *types.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperGetNonceResponse) Reset() { *m = AddressMapperGetNonceResponse{} } +func (m *AddressMapperGetNonceResponse) String() string { return proto.CompactTextString(m) } +func (*AddressMapperGetNonceResponse) ProtoMessage() {} +func (*AddressMapperGetNonceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_a116edb8efde1905, []int{6} +} +func (m *AddressMapperGetNonceResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperGetNonceResponse.Unmarshal(m, b) +} +func (m *AddressMapperGetNonceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperGetNonceResponse.Marshal(b, m, deterministic) +} +func (dst *AddressMapperGetNonceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperGetNonceResponse.Merge(dst, src) +} +func (m *AddressMapperGetNonceResponse) XXX_Size() int { + return xxx_messageInfo_AddressMapperGetNonceResponse.Size(m) +} +func (m *AddressMapperGetNonceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperGetNonceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperGetNonceResponse proto.InternalMessageInfo + +func (m *AddressMapperGetNonceResponse) GetAddress() *types.Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *AddressMapperGetNonceResponse) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +type AddressMapperNonce struct { + Address *types.Address `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AddressMapperNonce) Reset() { *m = AddressMapperNonce{} } +func (m *AddressMapperNonce) String() string { return proto.CompactTextString(m) } +func (*AddressMapperNonce) ProtoMessage() {} +func (*AddressMapperNonce) Descriptor() ([]byte, []int) { + return fileDescriptor_address_mapper_a116edb8efde1905, []int{7} +} +func (m *AddressMapperNonce) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AddressMapperNonce.Unmarshal(m, b) +} +func (m *AddressMapperNonce) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AddressMapperNonce.Marshal(b, m, deterministic) +} +func (dst *AddressMapperNonce) XXX_Merge(src proto.Message) { + xxx_messageInfo_AddressMapperNonce.Merge(dst, src) +} +func (m *AddressMapperNonce) XXX_Size() int { + return xxx_messageInfo_AddressMapperNonce.Size(m) +} +func (m *AddressMapperNonce) XXX_DiscardUnknown() { + xxx_messageInfo_AddressMapperNonce.DiscardUnknown(m) +} + +var xxx_messageInfo_AddressMapperNonce proto.InternalMessageInfo + +func (m *AddressMapperNonce) GetAddress() *types.Address { + if m != nil { + return m.Address + } + return nil +} + +func (m *AddressMapperNonce) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + type AddressMapperInitRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -206,7 +374,7 @@ func (m *AddressMapperInitRequest) Reset() { *m = AddressMapperInitReque func (m *AddressMapperInitRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperInitRequest) ProtoMessage() {} func (*AddressMapperInitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{4} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{8} } func (m *AddressMapperInitRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperInitRequest.Unmarshal(m, b) @@ -244,7 +412,7 @@ func (m *AddressMapperAddIdentityMappingRequest) Reset() { func (m *AddressMapperAddIdentityMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperAddIdentityMappingRequest) ProtoMessage() {} func (*AddressMapperAddIdentityMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{5} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{9} } func (m *AddressMapperAddIdentityMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperAddIdentityMappingRequest.Unmarshal(m, b) @@ -295,7 +463,7 @@ func (m *AddressMapperRemoveMappingRequest) Reset() { *m = AddressMapper func (m *AddressMapperRemoveMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperRemoveMappingRequest) ProtoMessage() {} func (*AddressMapperRemoveMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{6} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{10} } func (m *AddressMapperRemoveMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperRemoveMappingRequest.Unmarshal(m, b) @@ -326,7 +494,7 @@ func (m *AddressMapperGetMappingRequest) Reset() { *m = AddressMapperGet func (m *AddressMapperGetMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingRequest) ProtoMessage() {} func (*AddressMapperGetMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{7} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{11} } func (m *AddressMapperGetMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingRequest.Unmarshal(m, b) @@ -365,7 +533,7 @@ func (m *AddressMapperGetMappingResponse) Reset() { *m = AddressMapperGe func (m *AddressMapperGetMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperGetMappingResponse) ProtoMessage() {} func (*AddressMapperGetMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{8} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{12} } func (m *AddressMapperGetMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperGetMappingResponse.Unmarshal(m, b) @@ -409,7 +577,7 @@ func (m *AddressMapperListMappingRequest) Reset() { *m = AddressMapperLi func (m *AddressMapperListMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingRequest) ProtoMessage() {} func (*AddressMapperListMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{9} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{13} } func (m *AddressMapperListMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingRequest.Unmarshal(m, b) @@ -440,7 +608,7 @@ func (m *AddressMapperListMappingResponse) Reset() { *m = AddressMapperL func (m *AddressMapperListMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperListMappingResponse) ProtoMessage() {} func (*AddressMapperListMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{10} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{14} } func (m *AddressMapperListMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperListMappingResponse.Unmarshal(m, b) @@ -478,7 +646,7 @@ func (m *AddressMapperHasMappingRequest) Reset() { *m = AddressMapperHas func (m *AddressMapperHasMappingRequest) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingRequest) ProtoMessage() {} func (*AddressMapperHasMappingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{11} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{15} } func (m *AddressMapperHasMappingRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingRequest.Unmarshal(m, b) @@ -516,7 +684,7 @@ func (m *AddressMapperHasMappingResponse) Reset() { *m = AddressMapperHa func (m *AddressMapperHasMappingResponse) String() string { return proto.CompactTextString(m) } func (*AddressMapperHasMappingResponse) ProtoMessage() {} func (*AddressMapperHasMappingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_address_mapper_57c8be54ca8d9a50, []int{12} + return fileDescriptor_address_mapper_a116edb8efde1905, []int{16} } func (m *AddressMapperHasMappingResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AddressMapperHasMappingResponse.Unmarshal(m, b) @@ -548,6 +716,10 @@ func init() { proto.RegisterType((*ListAddressMapperMapping)(nil), "ListAddressMapperMapping") proto.RegisterType((*AddressMapperGetMultichainMappingRequest)(nil), "AddressMapperGetMultichainMappingRequest") proto.RegisterType((*AddressMapperGetMultichainMappingResponse)(nil), "AddressMapperGetMultichainMappingResponse") + proto.RegisterType((*AddressMapperSetNonceRequest)(nil), "AddressMapperSetNonceRequest") + proto.RegisterType((*AddressMapperGetNonceRequest)(nil), "AddressMapperGetNonceRequest") + proto.RegisterType((*AddressMapperGetNonceResponse)(nil), "AddressMapperGetNonceResponse") + proto.RegisterType((*AddressMapperNonce)(nil), "AddressMapperNonce") proto.RegisterType((*AddressMapperInitRequest)(nil), "AddressMapperInitRequest") proto.RegisterType((*AddressMapperAddIdentityMappingRequest)(nil), "AddressMapperAddIdentityMappingRequest") proto.RegisterType((*AddressMapperRemoveMappingRequest)(nil), "AddressMapperRemoveMappingRequest") @@ -560,33 +732,36 @@ func init() { } func init() { - proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_57c8be54ca8d9a50) -} - -var fileDescriptor_address_mapper_57c8be54ca8d9a50 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xd1, 0x4f, 0xea, 0x30, - 0x14, 0xc6, 0x33, 0xb8, 0xb9, 0x17, 0x0e, 0xf7, 0x89, 0x68, 0xd2, 0x10, 0x22, 0xa3, 0x26, 0x66, - 0x3e, 0xb8, 0x29, 0xbe, 0x9b, 0xe0, 0x8b, 0x92, 0x88, 0x31, 0x4b, 0x7c, 0xf0, 0x45, 0xb3, 0xb1, - 0xba, 0x35, 0xb2, 0x76, 0xae, 0x67, 0x1a, 0x5e, 0xfc, 0xdb, 0x0d, 0xdd, 0x40, 0x37, 0x21, 0x08, - 0x2f, 0x4d, 0x4f, 0xfb, 0x3b, 0xdf, 0xf9, 0x7a, 0xda, 0xc2, 0x5d, 0xc8, 0x31, 0xca, 0x7c, 0x7b, - 0x22, 0x63, 0x67, 0x2a, 0x65, 0x2c, 0x18, 0xbe, 0xcb, 0xf4, 0xc5, 0x09, 0xe5, 0xc9, 0x3c, 0x74, - 0xfc, 0x8c, 0x4f, 0x91, 0x0b, 0x07, 0x67, 0x09, 0x53, 0x8e, 0x17, 0x04, 0x29, 0x53, 0xea, 0x29, - 0xf6, 0x92, 0x84, 0xa5, 0x95, 0xd0, 0x4e, 0x52, 0x89, 0xb2, 0x73, 0xba, 0x41, 0x31, 0x57, 0xd2, - 0x63, 0x9e, 0x41, 0x6f, 0x61, 0x6f, 0x98, 0x2b, 0x8d, 0xb5, 0xd0, 0x7c, 0xe4, 0x22, 0x6c, 0x77, - 0xe1, 0xcf, 0x73, 0x2a, 0x63, 0x62, 0x98, 0x86, 0xd5, 0x1a, 0x34, 0xec, 0x02, 0x72, 0xf5, 0x6a, - 0x9b, 0x40, 0x0d, 0x25, 0xa9, 0x55, 0xf6, 0x6a, 0x28, 0xe9, 0x18, 0xc8, 0x0d, 0x57, 0xb8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xf9, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xce, 0x58, 0x0f, 0x29, 0x49, - 0x04, 0x00, 0x00, + proto.RegisterFile("github.com/loomnetwork/go-loom/builtin/types/address_mapper/address_mapper.proto", fileDescriptor_address_mapper_a116edb8efde1905) +} + +var fileDescriptor_address_mapper_a116edb8efde1905 = []byte{ + // 428 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0xc1, 0x8f, 0x93, 0x40, + 0x14, 0xc6, 0x43, 0x77, 0x75, 0xbb, 0xaf, 0x9e, 0xc8, 0x9a, 0x90, 0x4d, 0xb5, 0x74, 0x4c, 0x0c, + 0x1e, 0x04, 0xad, 0x77, 0x93, 0xf6, 0x52, 0x9b, 0xd8, 0xc6, 0x60, 0x3c, 0xf4, 0xa2, 0x81, 0x32, + 0xc2, 0xc4, 0x32, 0x83, 0xcc, 0x43, 0xd3, 0x8b, 0x7f, 0xbb, 0x61, 0x80, 0x2a, 0xb4, 0xa4, 0x2d, + 0x7b, 0x21, 0xbc, 0x99, 0xef, 0xfd, 0xe6, 0x9b, 0x99, 0xf7, 0x06, 0x3e, 0x85, 0x0c, 0xa3, 0xcc, + 0xb7, 0x37, 0x22, 0x76, 0xb6, 0x42, 0xc4, 0x9c, 0xe2, 0x6f, 0x91, 0xfe, 0x70, 0x42, 0xf1, 0x3a, + 0x0f, 0x1d, 0x3f, 0x63, 0x5b, 0x64, 0xdc, 0xc1, 0x5d, 0x42, 0xa5, 0xe3, 0x05, 0x41, 0x4a, 0xa5, + 0xfc, 0x16, 0x7b, 0x49, 0x42, 0xd3, 0x46, 0x68, 0x27, 0xa9, 0x40, 0x71, 0xff, 0xe6, 0x04, 0xb1, + 0x20, 0xa9, 0x6f, 0x91, 0x41, 0x56, 0x70, 0x37, 0x2d, 0x48, 0x4b, 0x05, 0xca, 0xbf, 0x8c, 0x87, + 0xfa, 0x10, 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0x6a, 0x5c, 0x99, 0x9a, 0xf5, 0xc4, 0xfd, 0x37, + 0x40, 0x5e, 0xc0, 0xb8, 0xb6, 0xbe, 0x4b, 0x63, 0xf1, 0x8b, 0xd6, 0x97, 0x26, 0xef, 0xe1, 0xf9, + 0x41, 0x4d, 0x5d, 0x60, 0x8e, 0xac, 0x61, 0xd4, 0x9a, 0x5f, 0xde, 0x56, 0xd7, 0x0e, 0x1d, 0x37, + 0xd0, 0x79, 0xbb, 0x36, 0xdc, 0x7f, 0x01, 0xb3, 0x5d, 0xd2, 0xbd, 0x11, 0x9a, 0x87, 0xf2, 0xc1, + 0x93, 0x17, 0x1d, 0xca, 0xac, 0xe1, 0xfc, 0xff, 0xfc, 0xd2, 0xd5, 0x08, 0x06, 0x91, 0x57, 0x3c, + 0x8a, 0x8c, 0x87, 0x8a, 0xd3, 0x77, 0x21, 0xda, 0x0b, 0xfd, 0xc7, 0xea, 0xd9, 0x7b, 0xf7, 0x37, + 0x00, 0x00, 0xff, 0xff, 0x05, 0xd7, 0x38, 0xeb, 0x7c, 0x05, 0x00, 0x00, } diff --git a/builtin/types/address_mapper/address_mapper.proto b/builtin/types/address_mapper/address_mapper.proto index c62af992..3694e73a 100644 --- a/builtin/types/address_mapper/address_mapper.proto +++ b/builtin/types/address_mapper/address_mapper.proto @@ -25,6 +25,25 @@ message AddressMapperGetMultichainMappingResponse { repeated AddressMapperMapping mappings = 1; } +message AddressMapperSetNonceRequest { + Address address = 1; +} + +message AddressMapperGetNonceRequest { + Address address = 1; +} + +message AddressMapperGetNonceResponse { + Address address = 1; + uint64 nonce = 2; +} + +message AddressMapperNonce { + Address address = 1; + uint64 nonce = 2; +} + + // Genesis message AddressMapperInitRequest { From 16e26207ab5020cd178aceb4572514adb63dd381 Mon Sep 17 00:00:00 2001 From: SHA Date: Wed, 16 Oct 2019 12:42:23 +0700 Subject: [PATCH 5/7] Add chainId to signIdentity mapping --- .../dappchain_address_mapper.go | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/client/address_mapper/dappchain_address_mapper.go b/client/address_mapper/dappchain_address_mapper.go index c900ee69..847e4ea2 100644 --- a/client/address_mapper/dappchain_address_mapper.go +++ b/client/address_mapper/dappchain_address_mapper.go @@ -14,6 +14,10 @@ import ( ssha "github.com/miguelmota/go-solidity-sha3" ) +var ( + SupportedChainID = []string{"eth", "tron", "binance"} +) + type DAppChainAddressMapper struct { contract *client.Contract chainID string @@ -54,6 +58,22 @@ func (am *DAppChainAddressMapper) HasIdentityMapping(account loom.Address) (bool return resp.HasMapping, nil } +func (am *DAppChainAddressMapper) GetNonce(account loom.Address) (uint64, error) { + fmt.Println("GetNONCE CALLED") + req := &address_mapper.AddressMapperGetNonceRequest{ + Address: account.MarshalPB(), + } + resp := &address_mapper.AddressMapperGetNonceResponse{} + fmt.Printf("CALL GETNONCE with REQUEST %+v \n", req.Address.String()) + _, err := am.contract.StaticCall("GetNonce", req, account, resp) + if err != nil { + fmt.Println("GETNONCE ERROR IN go-loom") + return uint64(0), err + } + fmt.Println("GetNONCE PASS IN go-loom") + return resp.Nonce, nil +} + // AddIdentityMapping creates a bi-directional mapping between a Mainnet & DAppChain account. func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) error { mainnetAddrBytes, err := loom.LocalAddressFromHexString(identity.MainnetAddr.Hex()) @@ -77,8 +97,12 @@ func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) return nil } + nonce, err := am.GetNonce(to) + if err != nil { + return err + } fmt.Printf("Mapping account %v to %v\n", from, to) - sig, err := signIdentityMapping(from, to, identity.MainnetPrivKey) + sig, err := signIdentityMapping(from, to, identity.MainnetPrivKey, nonce) if err != nil { return err } @@ -91,10 +115,23 @@ func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) return err } -func signIdentityMapping(from, to loom.Address, key *ecdsa.PrivateKey) ([]byte, error) { +func signIdentityMapping(from, to loom.Address, key *ecdsa.PrivateKey, nonce uint64) ([]byte, error) { + var foreignChainID string + for _, c := range SupportedChainID { + if from.ChainID == c { + foreignChainID = c + break + } + if to.ChainID == c { + foreignChainID = c + break + } + } hash := ssha.SoliditySHA3( ssha.Address(common.BytesToAddress(from.Local)), ssha.Address(common.BytesToAddress(to.Local)), + // ssha.Uint64(nonce), + ssha.String(foreignChainID), ) sig, err := evmcompat.SoliditySign(hash, key) if err != nil { From c46f29be17f52b9ce338d9dbea92c1ed2623f00d Mon Sep 17 00:00:00 2001 From: SHA Date: Wed, 16 Oct 2019 15:20:28 +0700 Subject: [PATCH 6/7] add nonce to signIdentity Mapping --- client/address_mapper/dappchain_address_mapper.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/client/address_mapper/dappchain_address_mapper.go b/client/address_mapper/dappchain_address_mapper.go index 847e4ea2..563a1a54 100644 --- a/client/address_mapper/dappchain_address_mapper.go +++ b/client/address_mapper/dappchain_address_mapper.go @@ -116,21 +116,17 @@ func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) } func signIdentityMapping(from, to loom.Address, key *ecdsa.PrivateKey, nonce uint64) ([]byte, error) { - var foreignChainID string + foreignChainID := to.ChainID for _, c := range SupportedChainID { if from.ChainID == c { foreignChainID = c break } - if to.ChainID == c { - foreignChainID = c - break - } } hash := ssha.SoliditySHA3( ssha.Address(common.BytesToAddress(from.Local)), ssha.Address(common.BytesToAddress(to.Local)), - // ssha.Uint64(nonce), + ssha.Uint64(nonce), ssha.String(foreignChainID), ) sig, err := evmcompat.SoliditySign(hash, key) From 585afe1e84a4a0ca95092efc1cddfb063e83a2e6 Mon Sep 17 00:00:00 2001 From: SHA Date: Fri, 25 Oct 2019 17:13:05 +0700 Subject: [PATCH 7/7] revert signing method --- .../address_mapper/dappchain_address_mapper.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/client/address_mapper/dappchain_address_mapper.go b/client/address_mapper/dappchain_address_mapper.go index 563a1a54..45414071 100644 --- a/client/address_mapper/dappchain_address_mapper.go +++ b/client/address_mapper/dappchain_address_mapper.go @@ -97,12 +97,8 @@ func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) return nil } - nonce, err := am.GetNonce(to) - if err != nil { - return err - } fmt.Printf("Mapping account %v to %v\n", from, to) - sig, err := signIdentityMapping(from, to, identity.MainnetPrivKey, nonce) + sig, err := signIdentityMapping(from, to, identity.MainnetPrivKey) if err != nil { return err } @@ -115,19 +111,10 @@ func (am *DAppChainAddressMapper) AddIdentityMapping(identity *client.Identity) return err } -func signIdentityMapping(from, to loom.Address, key *ecdsa.PrivateKey, nonce uint64) ([]byte, error) { - foreignChainID := to.ChainID - for _, c := range SupportedChainID { - if from.ChainID == c { - foreignChainID = c - break - } - } +func signIdentityMapping(from, to loom.Address, key *ecdsa.PrivateKey) ([]byte, error) { hash := ssha.SoliditySHA3( ssha.Address(common.BytesToAddress(from.Local)), ssha.Address(common.BytesToAddress(to.Local)), - ssha.Uint64(nonce), - ssha.String(foreignChainID), ) sig, err := evmcompat.SoliditySign(hash, key) if err != nil {