Browse Source

types: add string format to 64-bit integer JSON fields (#7787)

This picks up a few remaining cases that I missed during my previous round of
adding these tags.
pull/7792/head
M. J. Fromberger 2 years ago
committed by GitHub
parent
commit
205bfca66f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions
  1. +1
    -1
      rpc/coretypes/responses.go
  2. +2
    -2
      types/block_meta.go
  3. +7
    -7
      types/events.go

+ 1
- 1
rpc/coretypes/responses.go View File

@ -208,7 +208,7 @@ type ResultValidators struct {
// ConsensusParams for given height
type ResultConsensusParams struct {
BlockHeight int64 `json:"block_height"`
BlockHeight int64 `json:"block_height,string"`
ConsensusParams types.ConsensusParams `json:"consensus_params"`
}


+ 2
- 2
types/block_meta.go View File

@ -11,9 +11,9 @@ import (
// BlockMeta contains meta information.
type BlockMeta struct {
BlockID BlockID `json:"block_id"`
BlockSize int `json:"block_size"`
BlockSize int `json:"block_size,string"`
Header Header `json:"header"`
NumTxs int `json:"num_txs"`
NumTxs int `json:"num_txs,string"`
}
// NewBlockMeta returns a new BlockMeta.


+ 7
- 7
types/events.go View File

@ -124,7 +124,7 @@ func (EventDataNewBlock) TypeTag() string { return "tendermint/event/NewBlock" }
type EventDataNewBlockHeader struct {
Header Header `json:"header"`
NumTxs int64 `json:"num_txs"` // Number of txs in a block
NumTxs int64 `json:"num_txs,string"` // Number of txs in a block
ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"`
ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"`
}
@ -135,7 +135,7 @@ func (EventDataNewBlockHeader) TypeTag() string { return "tendermint/event/NewBl
type EventDataNewEvidence struct {
Evidence Evidence `json:"evidence"`
Height int64 `json:"height"`
Height int64 `json:"height,string"`
}
// TypeTag implements the required method of jsontypes.Tagged.
@ -151,7 +151,7 @@ func (EventDataTx) TypeTag() string { return "tendermint/event/Tx" }
// NOTE: This goes into the replay WAL
type EventDataRoundState struct {
Height int64 `json:"height"`
Height int64 `json:"height,string"`
Round int32 `json:"round"`
Step string `json:"step"`
}
@ -165,7 +165,7 @@ type ValidatorInfo struct {
}
type EventDataNewRound struct {
Height int64 `json:"height"`
Height int64 `json:"height,string"`
Round int32 `json:"round"`
Step string `json:"step"`
@ -176,7 +176,7 @@ type EventDataNewRound struct {
func (EventDataNewRound) TypeTag() string { return "tendermint/event/NewRound" }
type EventDataCompleteProposal struct {
Height int64 `json:"height"`
Height int64 `json:"height,string"`
Round int32 `json:"round"`
Step string `json:"step"`
@ -209,7 +209,7 @@ func (EventDataValidatorSetUpdates) TypeTag() string { return "tendermint/event/
// height when the node state sync mechanism changes.
type EventDataBlockSyncStatus struct {
Complete bool `json:"complete"`
Height int64 `json:"height"`
Height int64 `json:"height,string"`
}
// TypeTag implements the required method of jsontypes.Tagged.
@ -219,7 +219,7 @@ func (EventDataBlockSyncStatus) TypeTag() string { return "tendermint/event/Fast
// height when the node state sync mechanism changes.
type EventDataStateSyncStatus struct {
Complete bool `json:"complete"`
Height int64 `json:"height"`
Height int64 `json:"height,string"`
}
// TypeTag implements the required method of jsontypes.Tagged.


Loading…
Cancel
Save