Cleanup canonical json

This commit is contained in:
Ethan Frey 2017-12-11 20:42:43 +01:00
parent c4860f6c29
commit 8576ad58bd
2 changed files with 4 additions and 3 deletions

View File

@ -420,7 +420,7 @@ func (data *Data) StringIndented(indent string) string {
// BlockID defines the unique ID of a block as its Hash and its PartSetHeader
type BlockID struct {
Hash data.Bytes `json:"hash,omitempty"`
Hash data.Bytes `json:"hash"`
PartsHeader PartSetHeader `json:"parts"`
}

View File

@ -3,13 +3,14 @@ package types
import (
"time"
wire "github.com/tendermint/go-wire"
"github.com/tendermint/go-wire/data"
)
// canonical json is go-wire's json for structs with fields in alphabetical order
// timeFormat is RFC3339Millis, used for generating the sigs
const timeFormat = "2006-01-02T15:04:05.999Z07:00"
// timeFormat is used for generating the sigs
const timeFormat = wire.RFC3339Millis
type CanonicalJSONBlockID struct {
Hash data.Bytes `json:"hash,omitempty"`