Add Timestamp to Proposal for issue #929

Store it as time.Timestamp locally, encode it as RFC3339 with milliseconds
before signing the canonical form.
This commit is contained in:
Ethan Frey
2017-12-11 18:15:39 +01:00
parent 5ecae52bf1
commit 7deda53b7c
4 changed files with 33 additions and 9 deletions

View File

@ -22,6 +22,7 @@ type CanonicalJSONProposal struct {
POLBlockID CanonicalJSONBlockID `json:"pol_block_id"`
POLRound int `json:"pol_round"`
Round int `json:"round"`
Timestamp string `json:"timestamp"`
}
type CanonicalJSONVote struct {
@ -78,6 +79,7 @@ func CanonicalProposal(proposal *Proposal) CanonicalJSONProposal {
return CanonicalJSONProposal{
BlockPartsHeader: CanonicalPartSetHeader(proposal.BlockPartsHeader),
Height: proposal.Height,
Timestamp: proposal.TimeString(),
POLBlockID: CanonicalBlockID(proposal.POLBlockID),
POLRound: proposal.POLRound,
Round: proposal.Round,