added getwalletinfo cmd
This commit is contained in:
parent
5ab891177b
commit
b1606447b5
2 changed files with 21 additions and 0 deletions
|
@ -237,6 +237,15 @@ func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransaction
|
|||
}
|
||||
}
|
||||
|
||||
// GetWalletInfoCmd defines the getwalletinfo JSON-RPC command.
|
||||
type GetWalletInfoCmd struct{}
|
||||
|
||||
// NewGetWalletInfoCmd returns a new instance which can be used to issue a
|
||||
// getwalletinfo JSON-RPC command.
|
||||
func NewGetWalletInfoCmd() *GetWalletInfoCmd {
|
||||
return &GetWalletInfoCmd{}
|
||||
}
|
||||
|
||||
// ImportPrivKeyCmd defines the importprivkey JSON-RPC command.
|
||||
type ImportPrivKeyCmd struct {
|
||||
PrivKey string
|
||||
|
@ -650,6 +659,7 @@ func init() {
|
|||
MustRegisterCmd("getreceivedbyaccount", (*GetReceivedByAccountCmd)(nil), flags)
|
||||
MustRegisterCmd("getreceivedbyaddress", (*GetReceivedByAddressCmd)(nil), flags)
|
||||
MustRegisterCmd("gettransaction", (*GetTransactionCmd)(nil), flags)
|
||||
MustRegisterCmd("getwalletinfo", (*GetWalletInfoCmd)(nil), flags)
|
||||
MustRegisterCmd("importprivkey", (*ImportPrivKeyCmd)(nil), flags)
|
||||
MustRegisterCmd("keypoolrefill", (*KeyPoolRefillCmd)(nil), flags)
|
||||
MustRegisterCmd("listaccounts", (*ListAccountsCmd)(nil), flags)
|
||||
|
|
|
@ -345,6 +345,17 @@ func TestWalletSvrCmds(t *testing.T) {
|
|||
IncludeWatchOnly: btcjson.Bool(true),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "getwalletinfo",
|
||||
newCmd: func() (interface{}, error) {
|
||||
return btcjson.NewCmd("getwalletinfo")
|
||||
},
|
||||
staticCmd: func() interface{} {
|
||||
return btcjson.NewGetWalletInfoCmd()
|
||||
},
|
||||
marshalled: `{"jsonrpc":"1.0","method":"getwalletinfo","params":[],"id":1}`,
|
||||
unmarshalled: &btcjson.GetWalletInfoCmd{},
|
||||
},
|
||||
{
|
||||
name: "importprivkey",
|
||||
newCmd: func() (interface{}, error) {
|
||||
|
|
Loading…
Reference in a new issue