Added based types to serialization.

This commit is contained in:
Mark Beamer Jr 2019-04-28 19:10:07 -04:00
parent 322c658307
commit c54836bca0
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -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 {