From 8576ad58bd0972b86f1482db8063f3a08216fc57 Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 11 Dec 2017 20:42:43 +0100 Subject: [PATCH] Cleanup canonical json --- types/block.go | 2 +- types/canonical_json.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/block.go b/types/block.go index 461782fd..4c91c5fe 100644 --- a/types/block.go +++ b/types/block.go @@ -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"` } diff --git a/types/canonical_json.go b/types/canonical_json.go index 7d94d1e0..41c67c24 100644 --- a/types/canonical_json.go +++ b/types/canonical_json.go @@ -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"`