rpc: remove deprecated and unimplemented 'setaccount'
This commit is contained in:
parent
bb93a49349
commit
8d1005706b
4 changed files with 0 additions and 58 deletions
|
@ -650,21 +650,6 @@ func NewSendToAddressCmd(address string, amount float64, comment, commentTo *str
|
|||
}
|
||||
}
|
||||
|
||||
// SetAccountCmd defines the setaccount JSON-RPC command.
|
||||
type SetAccountCmd struct {
|
||||
Address string
|
||||
Account string
|
||||
}
|
||||
|
||||
// NewSetAccountCmd returns a new instance which can be used to issue a
|
||||
// setaccount JSON-RPC command.
|
||||
func NewSetAccountCmd(address, account string) *SetAccountCmd {
|
||||
return &SetAccountCmd{
|
||||
Address: address,
|
||||
Account: account,
|
||||
}
|
||||
}
|
||||
|
||||
// SetTxFeeCmd defines the settxfee JSON-RPC command.
|
||||
type SetTxFeeCmd struct {
|
||||
Amount float64 // In BTC
|
||||
|
@ -1123,7 +1108,6 @@ func init() {
|
|||
MustRegisterCmd("sendfrom", (*SendFromCmd)(nil), flags)
|
||||
MustRegisterCmd("sendmany", (*SendManyCmd)(nil), flags)
|
||||
MustRegisterCmd("sendtoaddress", (*SendToAddressCmd)(nil), flags)
|
||||
MustRegisterCmd("setaccount", (*SetAccountCmd)(nil), flags)
|
||||
MustRegisterCmd("settxfee", (*SetTxFeeCmd)(nil), flags)
|
||||
MustRegisterCmd("signmessage", (*SignMessageCmd)(nil), flags)
|
||||
MustRegisterCmd("signrawtransaction", (*SignRawTransactionCmd)(nil), flags)
|
||||
|
|
|
@ -1205,20 +1205,6 @@ func TestWalletSvrCmds(t *testing.T) {
|
|||
CommentTo: btcjson.String("commentto"),
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "setaccount",
|
||||
newCmd: func() (interface{}, error) {
|
||||
return btcjson.NewCmd("setaccount", "1Address", "acct")
|
||||
},
|
||||
staticCmd: func() interface{} {
|
||||
return btcjson.NewSetAccountCmd("1Address", "acct")
|
||||
},
|
||||
marshalled: `{"jsonrpc":"1.0","method":"setaccount","params":["1Address","acct"],"id":1}`,
|
||||
unmarshalled: &btcjson.SetAccountCmd{
|
||||
Address: "1Address",
|
||||
Account: "acct",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "settxfee",
|
||||
newCmd: func() (interface{}, error) {
|
||||
|
|
|
@ -1279,33 +1279,6 @@ func (c *Client) GetAccount(address btcutil.Address) (string, error) {
|
|||
return c.GetAccountAsync(address).Receive()
|
||||
}
|
||||
|
||||
// FutureSetAccountResult is a future promise to deliver the result of a
|
||||
// SetAccountAsync RPC invocation (or an applicable error).
|
||||
type FutureSetAccountResult chan *Response
|
||||
|
||||
// Receive waits for the Response promised by the future and returns the result
|
||||
// of setting the account to be associated with the passed address.
|
||||
func (r FutureSetAccountResult) Receive() error {
|
||||
_, err := ReceiveFuture(r)
|
||||
return err
|
||||
}
|
||||
|
||||
// SetAccountAsync returns an instance of a type that can be used to get the
|
||||
// result of the RPC at some future time by invoking the Receive function on the
|
||||
// returned instance.
|
||||
//
|
||||
// See SetAccount for the blocking version and more details.
|
||||
func (c *Client) SetAccountAsync(address btcutil.Address, account string) FutureSetAccountResult {
|
||||
addr := address.EncodeAddress()
|
||||
cmd := btcjson.NewSetAccountCmd(addr, account)
|
||||
return c.SendCmd(cmd)
|
||||
}
|
||||
|
||||
// SetAccount sets the account associated with the passed address.
|
||||
func (c *Client) SetAccount(address btcutil.Address, account string) error {
|
||||
return c.SetAccountAsync(address, account).Receive()
|
||||
}
|
||||
|
||||
// FutureGetAddressesByAccountResult is a future promise to deliver the result
|
||||
// of a GetAddressesByAccountAsync RPC invocation (or an applicable error).
|
||||
type FutureGetAddressesByAccountResult struct {
|
||||
|
|
|
@ -229,7 +229,6 @@ var rpcAskWallet = map[string]struct{}{
|
|||
"sendfrom": {},
|
||||
"sendmany": {},
|
||||
"sendtoaddress": {},
|
||||
"setaccount": {},
|
||||
"settxfee": {},
|
||||
"signmessage": {},
|
||||
"signrawtransaction": {},
|
||||
|
|
Loading…
Reference in a new issue