types: first field in Canonical structs is Type (#2675)

* types: first field in Canonical structs is Type

* fix spec
This commit is contained in:
Ethan Buchman
2018-10-19 14:23:14 -04:00
committed by GitHub
parent 7c6519adbd
commit 30519e8361
3 changed files with 21 additions and 21 deletions

View File

@@ -301,15 +301,15 @@ Where the `"value"` is the base64 encoding of the raw pubkey bytes, and the
Signed messages (eg. votes, proposals) in the consensus are encoded using Amino.
When signing, the elements of a message are re-ordered so the fixed-length fields
are first, making it easy to quickly check the version, height, round, and type.
are first, making it easy to quickly check the type, height, and round.
The `ChainID` is also appended to the end.
We call this encoding the SignBytes. For instance, SignBytes for a vote is the Amino encoding of the following struct:
```go
type CanonicalVote struct {
Type byte
Height int64 `binary:"fixed64"`
Round int64 `binary:"fixed64"`
VoteType byte
Timestamp time.Time
BlockID CanonicalBlockID
ChainID string