From 65c0570234fdb4f809f2b911c72fca2052e45ead Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 11 Jun 2014 12:01:05 -0500 Subject: [PATCH] Remove SetId from Cmd interface. --- jsoncmd.go | 386 ------------------------------------------------ jsoncmd_test.go | 7 - 2 files changed, 393 deletions(-) diff --git a/jsoncmd.go b/jsoncmd.go index fa08a46e..5c9eae12 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -24,7 +24,6 @@ type Cmd interface { json.Marshaler json.Unmarshaler Id() interface{} - SetId(interface{}) Method() string } @@ -382,11 +381,6 @@ func (cmd *unparsableCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *unparsableCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *unparsableCmd) Method() string { return cmd.method @@ -456,11 +450,6 @@ func (cmd *AddMultisigAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *AddMultisigAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *AddMultisigAddressCmd) Method() string { return "addmultisigaddress" @@ -559,11 +548,6 @@ func (cmd *AddNodeCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *AddNodeCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *AddNodeCmd) Method() string { return "addnode" @@ -640,11 +624,6 @@ func (cmd *BackupWalletCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *BackupWalletCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *BackupWalletCmd) Method() string { return "backupwallet" @@ -717,11 +696,6 @@ func (cmd *CreateMultisigCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *CreateMultisigCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *CreateMultisigCmd) Method() string { return "createmultisig" @@ -806,11 +780,6 @@ func (cmd *CreateRawTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *CreateRawTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *CreateRawTransactionCmd) Method() string { return "createrawtransaction" @@ -903,11 +872,6 @@ func (cmd *DebugLevelCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *DebugLevelCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *DebugLevelCmd) Method() string { return "debuglevel" @@ -977,11 +941,6 @@ func (cmd *DecodeRawTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *DecodeRawTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *DecodeRawTransactionCmd) Method() string { return "decoderawtransaction" @@ -1051,11 +1010,6 @@ func (cmd *DecodeScriptCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *DecodeScriptCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *DecodeScriptCmd) Method() string { return "decodescript" @@ -1125,11 +1079,6 @@ func (cmd *DumpPrivKeyCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *DumpPrivKeyCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *DumpPrivKeyCmd) Method() string { return "dumpprivkey" @@ -1199,11 +1148,6 @@ func (cmd *DumpWalletCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *DumpWalletCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *DumpWalletCmd) Method() string { return "dumpwallet" @@ -1273,11 +1217,6 @@ func (cmd *EncryptWalletCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *EncryptWalletCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *EncryptWalletCmd) Method() string { return "encryptwallet" @@ -1347,11 +1286,6 @@ func (cmd *EstimateFeeCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *EstimateFeeCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *EstimateFeeCmd) Method() string { return "estimatefee" @@ -1421,11 +1355,6 @@ func (cmd *EstimatePriorityCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *EstimatePriorityCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *EstimatePriorityCmd) Method() string { return "estimatepriority" @@ -1495,11 +1424,6 @@ func (cmd *GetAccountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetAccountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetAccountCmd) Method() string { return "getaccount" @@ -1569,11 +1493,6 @@ func (cmd *GetAccountAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetAccountAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetAccountAddressCmd) Method() string { return "getaccountaddress" @@ -1654,11 +1573,6 @@ func (cmd *GetAddedNodeInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetAddedNodeInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetAddedNodeInfoCmd) Method() string { return "getaddednodeinfo" @@ -1739,11 +1653,6 @@ func (cmd *GetAddressesByAccountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetAddressesByAccountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetAddressesByAccountCmd) Method() string { return "getaddressesbyaccount" @@ -1838,11 +1747,6 @@ func (cmd *GetBalanceCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBalanceCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBalanceCmd) Method() string { return "getbalance" @@ -1926,11 +1830,6 @@ func (cmd *GetBestBlockHashCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBestBlockHashCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBestBlockHashCmd) Method() string { return "getbestblockhash" @@ -2013,11 +1912,6 @@ func (cmd *GetBlockCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBlockCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBlockCmd) Method() string { return "getblock" @@ -2109,11 +2003,6 @@ func (cmd *GetBlockChainInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBlockChainInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBlockChainInfoCmd) Method() string { return "getblockchaininfo" @@ -2172,11 +2061,6 @@ func (cmd *GetBlockCountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBlockCountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBlockCountCmd) Method() string { return "getblockcount" @@ -2237,11 +2121,6 @@ func (cmd *GetBlockHashCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBlockHashCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBlockHashCmd) Method() string { return "getblockhash" @@ -2327,11 +2206,6 @@ func (cmd *GetBlockTemplateCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetBlockTemplateCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetBlockTemplateCmd) Method() string { return "getblocktemplate" @@ -2404,11 +2278,6 @@ func (cmd *GetConnectionCountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetConnectionCountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetConnectionCountCmd) Method() string { return "getconnectioncount" @@ -2467,11 +2336,6 @@ func (cmd *GetDifficultyCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetDifficultyCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetDifficultyCmd) Method() string { return "getdifficulty" @@ -2530,11 +2394,6 @@ func (cmd *GetGenerateCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetGenerateCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetGenerateCmd) Method() string { return "getgenerate" @@ -2593,11 +2452,6 @@ func (cmd *GetHashesPerSecCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetHashesPerSecCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetHashesPerSecCmd) Method() string { return "gethashespersec" @@ -2656,11 +2510,6 @@ func (cmd *GetInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetInfoCmd) Method() string { return "getinfo" @@ -2719,11 +2568,6 @@ func (cmd *GetMiningInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetMiningInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetMiningInfoCmd) Method() string { return "getmininginfo" @@ -2782,11 +2626,6 @@ func (cmd *GetNetworkInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetNetworkInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetNetworkInfoCmd) Method() string { return "getnetworkinfo" @@ -2845,11 +2684,6 @@ func (cmd *GetNetTotalsCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetNetTotalsCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetNetTotalsCmd) Method() string { return "getnettotals" @@ -2926,11 +2760,6 @@ func (cmd *GetNetworkHashPSCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetNetworkHashPSCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetNetworkHashPSCmd) Method() string { return "getnetworkhashps" @@ -3023,11 +2852,6 @@ func (cmd *GetNewAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetNewAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetNewAddressCmd) Method() string { return "getnewaddress" @@ -3100,11 +2924,6 @@ func (cmd *GetPeerInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetPeerInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetPeerInfoCmd) Method() string { return "getpeerinfo" @@ -3173,11 +2992,6 @@ func (cmd *GetRawChangeAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetRawChangeAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetRawChangeAddressCmd) Method() string { return "getrawchangeaddress" @@ -3259,11 +3073,6 @@ func (cmd *GetRawMempoolCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetRawMempoolCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetRawMempoolCmd) Method() string { return "getrawmempool" @@ -3348,11 +3157,6 @@ func (cmd *GetRawTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetRawTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetRawTransactionCmd) Method() string { return "getrawtransaction" @@ -3442,11 +3246,6 @@ func (cmd *GetReceivedByAccountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetReceivedByAccountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetReceivedByAccountCmd) Method() string { return "getreceivedbyaccount" @@ -3536,11 +3335,6 @@ func (cmd *GetReceivedByAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetReceivedByAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetReceivedByAddressCmd) Method() string { return "getreceivedbyaddress" @@ -3621,11 +3415,6 @@ func (cmd *GetTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetTransactionCmd) Method() string { return "gettransaction" @@ -3706,11 +3495,6 @@ func (cmd *GetTxOutCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetTxOutCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetTxOutCmd) Method() string { return "gettxout" @@ -3795,11 +3579,6 @@ func (cmd *GetTxOutSetInfoCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetTxOutSetInfoCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetTxOutSetInfoCmd) Method() string { return "gettxoutsetinfo" @@ -3868,11 +3647,6 @@ func (cmd *GetWorkCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *GetWorkCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *GetWorkCmd) Method() string { return "getwork" @@ -3953,11 +3727,6 @@ func (cmd *HelpCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *HelpCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *HelpCmd) Method() string { return "help" @@ -4056,11 +3825,6 @@ func (cmd *ImportPrivKeyCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ImportPrivKeyCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ImportPrivKeyCmd) Method() string { return "importprivkey" @@ -4153,11 +3917,6 @@ func (cmd *ImportWalletCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ImportWalletCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ImportWalletCmd) Method() string { return "importwallet" @@ -4237,11 +3996,6 @@ func (cmd *KeyPoolRefillCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *KeyPoolRefillCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *KeyPoolRefillCmd) Method() string { return "keypoolrefill" @@ -4324,11 +4078,6 @@ func (cmd *ListAccountsCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListAccountsCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListAccountsCmd) Method() string { return "listaccounts" @@ -4402,11 +4151,6 @@ func (cmd *ListAddressGroupingsCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListAddressGroupingsCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListAddressGroupingsCmd) Method() string { return "listaddressgroupings" @@ -4466,11 +4210,6 @@ func (cmd *ListLockUnspentCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListLockUnspentCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListLockUnspentCmd) Method() string { return "listlockunspent" @@ -4555,11 +4294,6 @@ func (cmd *ListReceivedByAccountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListReceivedByAccountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListReceivedByAccountCmd) Method() string { return "listreceivedbyaccount" @@ -4668,11 +4402,6 @@ func (cmd *ListReceivedByAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListReceivedByAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListReceivedByAddressCmd) Method() string { return "listreceivedbyaddress" @@ -4781,11 +4510,6 @@ func (cmd *ListSinceBlockCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListSinceBlockCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListSinceBlockCmd) Method() string { return "listsinceblock" @@ -4905,11 +4629,6 @@ func (cmd *ListTransactionsCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListTransactionsCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListTransactionsCmd) Method() string { return "listtransactions" @@ -5037,11 +4756,6 @@ func (cmd *ListUnspentCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ListUnspentCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ListUnspentCmd) Method() string { return "listunspent" @@ -5149,11 +4863,6 @@ func (cmd *LockUnspentCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *LockUnspentCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *LockUnspentCmd) Method() string { return "lockunspent" @@ -5266,11 +4975,6 @@ func (cmd *MoveCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *MoveCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *MoveCmd) Method() string { return "move" @@ -5377,11 +5081,6 @@ func (cmd *PingCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *PingCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *PingCmd) Method() string { return "ping" @@ -5484,11 +5183,6 @@ func (cmd *SendFromCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SendFromCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SendFromCmd) Method() string { return "sendfrom" @@ -5635,11 +5329,6 @@ func (cmd *SendManyCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SendManyCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SendManyCmd) Method() string { return "sendmany" @@ -5760,11 +5449,6 @@ func (cmd *SendRawTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SendRawTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SendRawTransactionCmd) Method() string { return "sendrawtransaction" @@ -5874,11 +5558,6 @@ func (cmd *SendToAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SendToAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SendToAddressCmd) Method() string { return "sendtoaddress" @@ -5983,11 +5662,6 @@ func (cmd *SetAccountCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SetAccountCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SetAccountCmd) Method() string { return "setaccount" @@ -6075,11 +5749,6 @@ func (cmd *SetGenerateCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SetGenerateCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SetGenerateCmd) Method() string { return "setgenerate" @@ -6161,11 +5830,6 @@ func (cmd *SetTxFeeCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SetTxFeeCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SetTxFeeCmd) Method() string { return "settxfee" @@ -6242,11 +5906,6 @@ func (cmd *SignMessageCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SignMessageCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SignMessageCmd) Method() string { return "signmessage" @@ -6367,11 +6026,6 @@ func (cmd *SignRawTransactionCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SignRawTransactionCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SignRawTransactionCmd) Method() string { return "signrawtransaction" @@ -6474,11 +6128,6 @@ func (cmd *StopCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *StopCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *StopCmd) Method() string { return "stop" @@ -6557,11 +6206,6 @@ func (cmd *SubmitBlockCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *SubmitBlockCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *SubmitBlockCmd) Method() string { return "submitblock" @@ -6645,11 +6289,6 @@ func (cmd *ValidateAddressCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *ValidateAddressCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *ValidateAddressCmd) Method() string { return "validateaddress" @@ -6737,11 +6376,6 @@ func (cmd *VerifyChainCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *VerifyChainCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *VerifyChainCmd) Method() string { return "verifychain" @@ -6835,11 +6469,6 @@ func (cmd *VerifyMessageCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *VerifyMessageCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *VerifyMessageCmd) Method() string { return "verifymessage" @@ -6921,11 +6550,6 @@ func (cmd *WalletLockCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *WalletLockCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *WalletLockCmd) Method() string { return "walletlock" @@ -6990,11 +6614,6 @@ func (cmd *WalletPassphraseCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *WalletPassphraseCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *WalletPassphraseCmd) Method() string { return "walletpassphrase" @@ -7074,11 +6693,6 @@ func (cmd *WalletPassphraseChangeCmd) Id() interface{} { return cmd.id } -// SetId allows one to modify the Id of a Cmd to help in relaying them. -func (cmd *WalletPassphraseChangeCmd) SetId(id interface{}) { - cmd.id = id -} - // Method satisfies the Cmd interface by returning the json method. func (cmd *WalletPassphraseChangeCmd) Method() string { return "walletpassphrasechange" diff --git a/jsoncmd_test.go b/jsoncmd_test.go index 63eccf77..cbd2ac41 100644 --- a/jsoncmd_test.go +++ b/jsoncmd_test.go @@ -1615,13 +1615,6 @@ func TestCmds(t *testing.T) { "got %v wanted %v", name, spew.Sdump(c2), spew.Sdump(c)) } - newId := 2.0 - c.SetId(newId) - id, ok = (c.Id()).(float64) - if !ok || id != newId { - t.Errorf("%s: id not returned properly after change.", name) - } - } }