Skip to content

Commit

Permalink
Merge branch 'master' into illia-malachyn/767-block-payload-response-…
Browse files Browse the repository at this point in the history
…object
  • Loading branch information
illia-malachyn authored Nov 5, 2024
2 parents 6b92f6a + cfbd2f5 commit 8a3527c
Show file tree
Hide file tree
Showing 32 changed files with 888 additions and 774 deletions.
8 changes: 6 additions & 2 deletions access/grpc/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,16 @@ func QuorumCertificateToMessage(qc flow.QuorumCertificate) (*entities.QuorumCert
}, nil
}

func MessageToBlockDigest(m *access.SubscribeBlockDigestsResponse) flow.BlockDigest {
func MessageToBlockDigest(m *access.SubscribeBlockDigestsResponse) (flow.BlockDigest, error) {
if m == nil {
return flow.BlockDigest{}, ErrEmptyMessage
}

return flow.BlockDigest{
BlockID: flow.BytesToID(m.GetBlockId()),
Height: m.GetBlockHeight(),
Timestamp: m.GetBlockTimestamp().AsTime(),
}
}, nil
}

func BlockDigestToMessage(blockDigest flow.BlockDigest) *access.SubscribeBlockDigestsResponse {
Expand Down
Loading

0 comments on commit 8a3527c

Please sign in to comment.