Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dcrjson: add generatevote and remove some unused pieces #652

Merged
merged 1 commit into from
Apr 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 18 additions & 20 deletions dcrjson/dcrwalletextcmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,25 @@ func NewCreateRawSSRtxCmd(inputs []TransactionInput, fee *float64) *CreateRawSSR
}
}

// GetBalanceToMaintainCmd is a type handling custom marshaling and
// unmarshaling of getbalancetomaintain JSON wallet extension
// commands.
type GetBalanceToMaintainCmd struct {
// GenerateVoteCmd is a type handling custom marshaling and
// unmarshaling of generatevote JSON wallet extension commands.
type GenerateVoteCmd struct {
BlockHash string
Height int64
TicketHash string
VoteBits uint16
VoteBitsExt string
}

// NewGetBalanceToMaintainCmd creates a new GetBalanceToMaintainCmd.
func NewGetBalanceToMaintainCmd() *GetBalanceToMaintainCmd {
return &GetBalanceToMaintainCmd{}
// NewGenerateVoteCmd creates a new GenerateVoteCmd.
func NewGenerateVoteCmd(blockhash string, height int64, tickethash string, votebits uint16, voteBitsExt string) *GenerateVoteCmd {
return &GenerateVoteCmd{
BlockHash: blockhash,
Height: height,
TicketHash: tickethash,
VoteBits: votebits,
VoteBitsExt: voteBitsExt,
}
}

// GetMultisigOutInfoCmd is a type handling custom marshaling and
Expand Down Expand Up @@ -223,17 +233,6 @@ func NewGetTicketFeeCmd() *GetTicketFeeCmd {
return &GetTicketFeeCmd{}
}

// GetTicketMaxPriceCmd is a type handling custom marshaling and
// unmarshaling of getticketmaxprice JSON wallet extension
// commands.
type GetTicketMaxPriceCmd struct {
}

// NewGetTicketMaxPriceCmd creates a new GetTicketMaxPriceCmd.
func NewGetTicketMaxPriceCmd() *GetTicketMaxPriceCmd {
return &GetTicketMaxPriceCmd{}
}

// GetTicketsCmd is a type handling custom marshaling and
// unmarshaling of gettickets JSON wallet extension
// commands.
Expand Down Expand Up @@ -642,13 +641,12 @@ func init() {
MustRegisterCmd("createrawsstx", (*CreateRawSStxCmd)(nil), flags)
MustRegisterCmd("createrawssgentx", (*CreateRawSSGenTxCmd)(nil), flags)
MustRegisterCmd("createrawssrtx", (*CreateRawSSRtxCmd)(nil), flags)
MustRegisterCmd("getbalancetomaintain", (*GetBalanceToMaintainCmd)(nil), flags)
MustRegisterCmd("generatevote", (*GenerateVoteCmd)(nil), flags)
MustRegisterCmd("getmultisigoutinfo", (*GetMultisigOutInfoCmd)(nil), flags)
MustRegisterCmd("getmasterpubkey", (*GetMasterPubkeyCmd)(nil), flags)
MustRegisterCmd("getseed", (*GetSeedCmd)(nil), flags)
MustRegisterCmd("getstakeinfo", (*GetStakeInfoCmd)(nil), flags)
MustRegisterCmd("getticketfee", (*GetTicketFeeCmd)(nil), flags)
MustRegisterCmd("getticketmaxprice", (*GetTicketMaxPriceCmd)(nil), flags)
MustRegisterCmd("gettickets", (*GetTicketsCmd)(nil), flags)
MustRegisterCmd("getticketvotebits", (*GetTicketVoteBitsCmd)(nil), flags)
MustRegisterCmd("getticketsvotebits", (*GetTicketsVoteBitsCmd)(nil), flags)
Expand Down
5 changes: 5 additions & 0 deletions dcrjson/walletsvrresults.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

package dcrjson

// GenerateVoteResult models the data from the generatevote command.
type GenerateVoteResult struct {
Hex string `json:"hex"`
}

// GetAccountBalanceResult models the account data from the getbalance command.
type GetAccountBalanceResult struct {
AccountName string `json:"accountname"`
Expand Down