rpcclient: Remove existsexpiredtickets.
This removes support for the deprecated existsexpiredtickets method from the RPC client. This is part of the overall removal of deprecated RPCs related to missed and expired tickets.
This commit is contained in:
parent
5f8936c7fb
commit
c19282ba4f
@ -191,48 +191,6 @@ func (c *Client) ExistsAddresses(ctx context.Context, addresses []stdaddr.Addres
|
||||
return c.ExistsAddressesAsync(ctx, addresses).Receive()
|
||||
}
|
||||
|
||||
// FutureExistsExpiredTicketsResult is a future promise to deliver the result
|
||||
// of a FutureExistsExpiredTicketsResultAsync RPC invocation (or an
|
||||
// applicable error).
|
||||
type FutureExistsExpiredTicketsResult cmdRes
|
||||
|
||||
// Receive waits for the response promised by the future and returns whether
|
||||
// or not the tickets exist in the expired ticket database.
|
||||
func (r *FutureExistsExpiredTicketsResult) Receive() (string, error) {
|
||||
res, err := receiveFuture(r.ctx, r.c)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Unmarshal the result as a string.
|
||||
var exists string
|
||||
err = json.Unmarshal(res, &exists)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return exists, nil
|
||||
}
|
||||
|
||||
// ExistsExpiredTicketsAsync 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.
|
||||
func (c *Client) ExistsExpiredTicketsAsync(ctx context.Context, hashes []*chainhash.Hash) *FutureExistsExpiredTicketsResult {
|
||||
strHashes := make([]string, len(hashes))
|
||||
for i := range hashes {
|
||||
strHashes[i] = hashes[i].String()
|
||||
}
|
||||
cmd := chainjson.NewExistsExpiredTicketsCmd(strHashes)
|
||||
return (*FutureExistsExpiredTicketsResult)(c.sendCmd(ctx, cmd))
|
||||
}
|
||||
|
||||
// ExistsExpiredTickets returns information about whether or not a ticket hash exists
|
||||
// in the expired ticket database.
|
||||
//
|
||||
// NOTE: This is a dcrd extension.
|
||||
func (c *Client) ExistsExpiredTickets(ctx context.Context, hashes []*chainhash.Hash) (string, error) {
|
||||
return c.ExistsExpiredTicketsAsync(ctx, hashes).Receive()
|
||||
}
|
||||
|
||||
// FutureExistsLiveTicketResult is a future promise to deliver the result
|
||||
// of a FutureExistsLiveTicketResultAsync RPC invocation (or an
|
||||
// applicable error).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user