Skip to content

Commit

Permalink
jsonrpc/types: Remove notifyspentandmissedtickets.
Browse files Browse the repository at this point in the history
This removes the type and associated code for the deprecated
notifyspentandmissedtickets RPC.

This is part of the overall removal of deprecated RPCs related to missed
and expired tickets.
  • Loading branch information
davecgh committed Apr 25, 2022
1 parent 2d38a15 commit 54c41c2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 52 deletions.
12 changes: 0 additions & 12 deletions rpc/jsonrpc/types/chainsvrwscmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ func NewNotifyWinningTicketsCmd() *NotifyWinningTicketsCmd {
return &NotifyWinningTicketsCmd{}
}

// NotifySpentAndMissedTicketsCmd is a type handling custom marshaling and
// unmarshaling of notifyspentandmissedtickets JSON websocket extension
// commands.
type NotifySpentAndMissedTicketsCmd struct {
}

// NewNotifySpentAndMissedTicketsCmd creates a new NotifySpentAndMissedTicketsCmd.
func NewNotifySpentAndMissedTicketsCmd() *NotifySpentAndMissedTicketsCmd {
return &NotifySpentAndMissedTicketsCmd{}
}

// NotifyNewTicketsCmd is a type handling custom marshaling and
// unmarshaling of notifynewtickets JSON websocket extension
// commands.
Expand Down Expand Up @@ -207,7 +196,6 @@ 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("notifywinningtickets"), (*NotifyWinningTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("rebroadcastwinners"), (*RebroadcastWinnersCmd)(nil), flags)
dcrjson.MustRegister(Method("session"), (*SessionCmd)(nil), flags)
Expand Down
24 changes: 0 additions & 24 deletions rpc/jsonrpc/types/chainsvrwsntfns.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ const (
// transaction was accepted by the mempool.
RelevantTxAcceptedNtfnMethod Method = "relevanttxaccepted"

// SpentAndMissedTicketsNtfnMethod is the method of the daemon
// spentandmissedtickets notification.
SpentAndMissedTicketsNtfnMethod Method = "spentandmissedtickets"

// WinningTicketsNtfnMethod is the method of the daemon winningtickets
// notification.
WinningTicketsNtfnMethod Method = "winningtickets"
Expand Down Expand Up @@ -154,25 +150,6 @@ func NewReorganizationNtfn(oldHash string, oldHeight int32, newHash string,
}
}

// SpentAndMissedTicketsNtfn is a type handling custom marshaling and
// unmarshaling of spentandmissedtickets JSON websocket notifications.
type SpentAndMissedTicketsNtfn struct {
Hash string
Height int32
StakeDiff int64
Tickets map[string]string
}

// NewSpentAndMissedTicketsNtfn creates a new SpentAndMissedTicketsNtfn.
func NewSpentAndMissedTicketsNtfn(hash string, height int32, stakeDiff int64, tickets map[string]string) *SpentAndMissedTicketsNtfn {
return &SpentAndMissedTicketsNtfn{
Hash: hash,
Height: height,
StakeDiff: stakeDiff,
Tickets: tickets,
}
}

// TxAcceptedNtfn defines the txaccepted JSON-RPC notification.
type TxAcceptedNtfn struct {
TxID string `json:"txid"`
Expand Down Expand Up @@ -244,6 +221,5 @@ func init() {
dcrjson.MustRegister(TxAcceptedNtfnMethod, (*TxAcceptedNtfn)(nil), flags)
dcrjson.MustRegister(TxAcceptedVerboseNtfnMethod, (*TxAcceptedVerboseNtfn)(nil), flags)
dcrjson.MustRegister(RelevantTxAcceptedNtfnMethod, (*RelevantTxAcceptedNtfn)(nil), flags)
dcrjson.MustRegister(SpentAndMissedTicketsNtfnMethod, (*SpentAndMissedTicketsNtfn)(nil), flags)
dcrjson.MustRegister(WinningTicketsNtfnMethod, (*WinningTicketsNtfn)(nil), flags)
}
16 changes: 0 additions & 16 deletions rpc/jsonrpc/types/chainsvrwsntfns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,6 @@ func TestChainSvrWsNtfns(t *testing.T) {
Transaction: "001122",
},
},
{
name: "spentandmissedtickets",
newNtfn: func() (interface{}, error) {
return dcrjson.NewCmd(Method("spentandmissedtickets"), "123", 100, 3, map[string]string{"a": "b"})
},
staticNtfn: func() interface{} {
return NewSpentAndMissedTicketsNtfn("123", 100, 3, map[string]string{"a": "b"})
},
marshalled: `{"jsonrpc":"1.0","method":"spentandmissedtickets","params":["123",100,3,{"a":"b"}],"id":null}`,
unmarshalled: &SpentAndMissedTicketsNtfn{
Hash: "123",
Height: 100,
StakeDiff: 3,
Tickets: map[string]string{"a": "b"},
},
},
{
name: "txaccepted",
newNtfn: func() (interface{}, error) {
Expand Down

0 comments on commit 54c41c2

Please sign in to comment.