rpc/jsonrpc/types: Remove notifystakedifficulty.

This removes the notifystakedifficulty and associated stakedifficulty
type definitions as they are no longer used.
This commit is contained in:
Dave Collins 2020-12-23 23:28:49 -06:00
parent 8e2efc6b22
commit c3d0641c8a
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2
3 changed files with 2 additions and 50 deletions

View File

@ -111,17 +111,6 @@ func NewNotifyNewTicketsCmd() *NotifyNewTicketsCmd {
return &NotifyNewTicketsCmd{}
}
// NotifyStakeDifficultyCmd is a type handling custom marshaling and
// unmarshaling of notifystakedifficulty JSON websocket extension
// commands.
type NotifyStakeDifficultyCmd struct {
}
// NewNotifyStakeDifficultyCmd creates a new NotifyStakeDifficultyCmd.
func NewNotifyStakeDifficultyCmd() *NotifyStakeDifficultyCmd {
return &NotifyStakeDifficultyCmd{}
}
// RebroadcastMissedCmd is a type handling custom marshaling and
// unmarshaling of rebroadcastmissed JSON RPC commands.
type RebroadcastMissedCmd struct{}
@ -228,12 +217,8 @@ func init() {
dcrjson.MustRegister(Method("notifytspend"), (*NotifyTSpendCmd)(nil), flags)
dcrjson.MustRegister(Method("notifynewtransactions"), (*NotifyNewTransactionsCmd)(nil), flags)
dcrjson.MustRegister(Method("notifynewtickets"), (*NotifyNewTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("notifyspentandmissedtickets"),
(*NotifySpentAndMissedTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("notifystakedifficulty"),
(*NotifyStakeDifficultyCmd)(nil), flags)
dcrjson.MustRegister(Method("notifywinningtickets"),
(*NotifyWinningTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("notifyspentandmissedtickets"), (*NotifySpentAndMissedTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("notifywinningtickets"), (*NotifyWinningTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("rebroadcastmissed"), (*RebroadcastMissedCmd)(nil), flags)
dcrjson.MustRegister(Method("rebroadcastwinners"), (*RebroadcastWinnersCmd)(nil), flags)
dcrjson.MustRegister(Method("session"), (*SessionCmd)(nil), flags)

View File

@ -74,17 +74,6 @@ func TestChainSvrWsCmds(t *testing.T) {
marshalled: `{"jsonrpc":"1.0","method":"notifynewtickets","params":[],"id":1}`,
unmarshalled: &NotifyNewTicketsCmd{},
},
{
name: "notifystakedifficulty",
newCmd: func() (interface{}, error) {
return dcrjson.NewCmd(Method("notifystakedifficulty"))
},
staticCmd: func() interface{} {
return NewNotifyStakeDifficultyCmd()
},
marshalled: `{"jsonrpc":"1.0","method":"notifystakedifficulty","params":[],"id":1}`,
unmarshalled: &NotifyStakeDifficultyCmd{},
},
{
name: "notifyblocks",
newCmd: func() (interface{}, error) {

View File

@ -53,10 +53,6 @@ const (
// spentandmissedtickets notification.
SpentAndMissedTicketsNtfnMethod Method = "spentandmissedtickets"
// StakeDifficultyNtfnMethod is the method of the daemon stakedifficulty
// notification.
StakeDifficultyNtfnMethod Method = "stakedifficulty"
// WinningTicketsNtfnMethod is the method of the daemon winningtickets
// notification.
WinningTicketsNtfnMethod Method = "winningtickets"
@ -177,23 +173,6 @@ func NewSpentAndMissedTicketsNtfn(hash string, height int32, stakeDiff int64, ti
}
}
// StakeDifficultyNtfn is a type handling custom marshaling and
// unmarshaling of stakedifficulty JSON websocket notifications.
type StakeDifficultyNtfn struct {
BlockHash string
BlockHeight int32
StakeDiff int64
}
// NewStakeDifficultyNtfn creates a new StakeDifficultyNtfn.
func NewStakeDifficultyNtfn(hash string, height int32, stakeDiff int64) *StakeDifficultyNtfn {
return &StakeDifficultyNtfn{
BlockHash: hash,
BlockHeight: height,
StakeDiff: stakeDiff,
}
}
// TxAcceptedNtfn defines the txaccepted JSON-RPC notification.
type TxAcceptedNtfn struct {
TxID string `json:"txid"`
@ -266,6 +245,5 @@ func init() {
dcrjson.MustRegister(TxAcceptedVerboseNtfnMethod, (*TxAcceptedVerboseNtfn)(nil), flags)
dcrjson.MustRegister(RelevantTxAcceptedNtfnMethod, (*RelevantTxAcceptedNtfn)(nil), flags)
dcrjson.MustRegister(SpentAndMissedTicketsNtfnMethod, (*SpentAndMissedTicketsNtfn)(nil), flags)
dcrjson.MustRegister(StakeDifficultyNtfnMethod, (*StakeDifficultyNtfn)(nil), flags)
dcrjson.MustRegister(WinningTicketsNtfnMethod, (*WinningTicketsNtfn)(nil), flags)
}