diff --git a/lib/block_view_types.go b/lib/block_view_types.go index 948c04624..011bf58b7 100644 --- a/lib/block_view_types.go +++ b/lib/block_view_types.go @@ -6507,10 +6507,11 @@ type DeleteUserAssociationTxindexMetadata struct { } type CreatePostAssociationTxindexMetadata struct { - PostHashHex string - AppPublicKeyBase58Check string - AssociationType string - AssociationValue string + PostHashHex string + AppPublicKeyBase58Check string + AssociationType string + AssociationValue string + PosterPublicKeyBase58Check string } type DeletePostAssociationTxindexMetadata struct { @@ -6546,6 +6547,7 @@ func (associationTxindexMeta *CreatePostAssociationTxindexMetadata) RawEncodeWit data = append(data, EncodeByteArray([]byte(associationTxindexMeta.AppPublicKeyBase58Check))...) data = append(data, EncodeByteArray([]byte(associationTxindexMeta.AssociationType))...) data = append(data, EncodeByteArray([]byte(associationTxindexMeta.AssociationValue))...) + data = append(data, EncodeByteArray([]byte(associationTxindexMeta.PosterPublicKeyBase58Check))...) return data } @@ -6659,6 +6661,13 @@ func (associationTxindexMeta *CreatePostAssociationTxindexMetadata) RawDecodeWit } associationTxindexMeta.AssociationValue = string(associationValueBytes) + // PosterPublicKeyBase58Check + posterPublicKeyBase58CheckBytes, err := DecodeByteArray(rr) + if err != nil { + return errors.Wrapf(err, "CreatePostAssociationTxindexMetadata.Decode: Problem reading PosterPublicKeyBase58Check: ") + } + associationTxindexMeta.PosterPublicKeyBase58Check = string(posterPublicKeyBase58CheckBytes) + return nil } diff --git a/lib/db_utils.go b/lib/db_utils.go index c51609681..df037a1b7 100644 --- a/lib/db_utils.go +++ b/lib/db_utils.go @@ -6475,6 +6475,10 @@ type SubmitPostTxindexMetadata struct { ParentPostHashHex string // ParentPosterPublicKeyBase58Check in AffectedPublicKeys + // We require a related public key for quick feed generation in the case of + // a reclout post or a reply post. + RelatedPublicKeyBase58Check string + // The profiles that are mentioned are in the AffectedPublicKeys // MentionedPublicKeyBase58Check in AffectedPublicKeys } @@ -6484,6 +6488,8 @@ func (txnMeta *SubmitPostTxindexMetadata) RawEncodeWithoutMetadata(blockHeight u data = append(data, EncodeByteArray([]byte(txnMeta.PostHashBeingModifiedHex))...) data = append(data, EncodeByteArray([]byte(txnMeta.ParentPostHashHex))...) + data = append(data, EncodeByteArray([]byte(txnMeta.RelatedPublicKeyBase58Check))...) + return data } @@ -6500,6 +6506,12 @@ func (txnMeta *SubmitPostTxindexMetadata) RawDecodeWithoutMetadata(blockHeight u } txnMeta.ParentPostHashHex = string(parentPostHashHexBytes) + relatedPublicKeyBase58CheckBytes, err := DecodeByteArray(rr) + if err != nil { + return errors.Wrapf(err, "SubmitPostTxindexMetadata.Decode: problem reading RelatedPublicKeyBase58Check") + } + txnMeta.RelatedPublicKeyBase58Check = string(relatedPublicKeyBase58CheckBytes) + return nil }