From c54836bca002cc7dfca2cc0335f59a7ecbce1e3b Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Sun, 28 Apr 2019 19:10:07 -0400 Subject: [PATCH] Added based types to serialization. --- claim/serialization.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/claim/serialization.go b/claim/serialization.go index ce85d2f..8922d51 100644 --- a/claim/serialization.go +++ b/claim/serialization.go @@ -24,13 +24,26 @@ func (c *ClaimHelper) serialized() ([]byte, error) { } func (c *ClaimHelper) getProtobuf() *pb.Claim { + claim := &pb.Claim{ + Title: c.Title, + Description: c.Description, + Thumbnail: c.Thumbnail, + Tags: c.Tags, + Languages: c.Languages, + Locations: c.Locations, + } + return c.Claim if c.GetChannel() != nil { - return &pb.Claim{Type: &pb.Claim_Channel{Channel: c.GetChannel()}} + claim.Type = &pb.Claim_Channel{Channel: c.GetChannel()} } else if c.GetStream() != nil { - return &pb.Claim{Type: &pb.Claim_Stream{Stream: c.GetStream()}} + claim.Type = &pb.Claim_Stream{Stream: c.GetStream()} + } else if c.GetCollection() != nil { + claim.Type = &pb.Claim_Collection{Collection: c.GetCollection()} + } else if c.GetRepost() != nil { + claim.Type = &pb.Claim_Repost{Repost: c.GetRepost()} } - return nil + return claim } func (c *ClaimHelper) getLegacyProtobuf() *legacy.Claim {