Add some missing comments on exported items.

This commit is contained in:
John C. Vernaleo 2014-02-04 17:10:37 -05:00
parent ae21689a57
commit 0d1539118b
2 changed files with 8 additions and 2 deletions

View file

@ -115,10 +115,12 @@ type Vin struct {
Sequence uint32 `json:"sequence"` Sequence uint32 `json:"sequence"`
} }
// IsCoinBase returns a bool to show if a Vin is a Coinbase one or not.
func (v *Vin) IsCoinBase() bool { func (v *Vin) IsCoinBase() bool {
return len(v.Coinbase) > 0 return len(v.Coinbase) > 0
} }
// MarshalJSON provides a custom Marshal method for Vin.
func (v *Vin) MarshalJSON() ([]byte, error) { func (v *Vin) MarshalJSON() ([]byte, error) {
if v.IsCoinBase() { if v.IsCoinBase() {
coinbaseStruct := struct { coinbaseStruct := struct {
@ -192,11 +194,14 @@ type ValidateAddressResult struct {
Account string `json:"account,omitempty"` Account string `json:"account,omitempty"`
} }
// SignRawTransactionResult models the data from the signrawtransaction
// command.
type SignRawTransactionResult struct { type SignRawTransactionResult struct {
Hex string `json:"hex"` Hex string `json:"hex"`
Complete bool `json:"complete"` Complete bool `json:"complete"`
} }
// ListUnSpentResult models the data from the ListUnSpentResult command.
type ListUnSpentResult struct { type ListUnSpentResult struct {
TxId string `json:"txid"` TxId string `json:"txid"`
Vout float64 `json:"vout"` Vout float64 `json:"vout"`

View file

@ -37,7 +37,7 @@ type RawCmd struct {
Params []interface{} `json:"params"` Params []interface{} `json:"params"`
} }
// ParseRawCmd is a function to create a custom Cmd from a RawCmd. // RawCmdParser is a function to create a custom Cmd from a RawCmd.
type RawCmdParser func(*RawCmd) (Cmd, error) type RawCmdParser func(*RawCmd) (Cmd, error)
type cmd struct { type cmd struct {
@ -70,7 +70,7 @@ func ParseMarshaledCmd(b []byte) (Cmd, error) {
} }
// Return a custom command type for recognized // Return a custom command type for recognized
var cmd Cmd = nil var cmd Cmd
switch r.Method { switch r.Method {
case "addmultisigaddress": case "addmultisigaddress":
cmd = new(AddMultisigAddressCmd) cmd = new(AddMultisigAddressCmd)
@ -6225,6 +6225,7 @@ func (cmd *SignMessageCmd) UnmarshalJSON(b []byte) error {
return nil return nil
} }
// RawTxInput models the data needed for a raw tx input.
type RawTxInput struct { type RawTxInput struct {
Txid string `json:"txid"` Txid string `json:"txid"`
Vout int `json:"vout"` Vout int `json:"vout"`