Browse Source

Cleanup canonical json

pull/953/head
Ethan Frey 7 years ago
parent
commit
8576ad58bd
2 changed files with 4 additions and 3 deletions
  1. +1
    -1
      types/block.go
  2. +3
    -2
      types/canonical_json.go

+ 1
- 1
types/block.go 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"`
}


+ 3
- 2
types/canonical_json.go 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"`


Loading…
Cancel
Save