Improve InfoResult.

This commit modifies InfoResult to remove all of the omitempty tags since
the fields should be present in the marshalled JSON regardless of them
being zero values or not.
This commit is contained in:
Dave Collins 2014-05-03 14:05:07 -05:00
parent d0a2506a96
commit d443b48994

View file

@ -12,22 +12,22 @@ import (
// InfoResult contains the data returned by the getinfo command. // InfoResult contains the data returned by the getinfo command.
type InfoResult struct { type InfoResult struct {
Version int `json:"version,omitempty"` Version int `json:"version"`
ProtocolVersion int `json:"protocolversion,omitempty"` ProtocolVersion int `json:"protocolversion"`
WalletVersion int `json:"walletversion,omitempty"` WalletVersion int `json:"walletversion,omitempty"`
Balance float64 `json:"balance,omitempty"` Balance float64 `json:"balance,omitempty"`
Blocks int `json:"blocks,omitempty"` Blocks int `json:"blocks"`
TimeOffset int64 `json:"timeoffset,omitempty"` TimeOffset int64 `json:"timeoffset"`
Connections int `json:"connections,omitempty"` Connections int `json:"connections"`
Proxy string `json:"proxy,omitempty"` Proxy string `json:"proxy"`
Difficulty float64 `json:"difficulty,omitempty"` Difficulty float64 `json:"difficulty"`
TestNet bool `json:"testnet,omitempty"` TestNet bool `json:"testnet"`
KeypoolOldest int64 `json:"keypoololdest,omitempty"` KeypoolOldest int64 `json:"keypoololdest,omitempty"`
KeypoolSize int `json:"keypoolsize,omitempty"` KeypoolSize int `json:"keypoolsize,omitempty"`
UnlockedUntil int64 `json:"unlocked_until,omitempty"` UnlockedUntil int64 `json:"unlocked_until,omitempty"`
PaytxFee float64 `json:"paytxfee,omitempty"` PaytxFee float64 `json:"paytxfee,omitempty"`
RelayFee float64 `json:"relayfee,omitempty"` RelayFee float64 `json:"relayfee"`
Errors string `json:"errors,omitempty"` Errors string `json:"errors"`
} }
// BlockResult models the data from the getblock command when the verbose flag // BlockResult models the data from the getblock command when the verbose flag