mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopd: re-add GetLsatTokens method in gRPC
This is needed not to break existing client binaries, e.g. `loop listauth`, Terminal Web, RTL. The API should be removed in a couple of releases. For now, GetLsatTokens just prints a warning message about the API being deprecated and that the client binary should be updated, and calls GetL402Tokens API, as a wrapper. Type LsatToken used by GetLsatTokens in the past was renamed to L402Token, but this does not affect binary encoding, so type L402Token can be used (as part of TokensResponse) without breaking backward compatibility. Updated release_notes.md. See https://github.com/lightninglabs/loop/pull/730#discussion_r1579251294
This commit is contained in:
parent
14dc8e165d
commit
5a1f79557d
7 changed files with 185 additions and 77 deletions
|
|
@ -73,6 +73,10 @@ var RequiredPermissions = map[string][]bakery.Op{
|
|||
Entity: "auth",
|
||||
Action: "read",
|
||||
}},
|
||||
"/looprpc.SwapClient/GetLsatTokens": {{
|
||||
Entity: "auth",
|
||||
Action: "read",
|
||||
}},
|
||||
"/looprpc.SwapClient/SuggestSwaps": {{
|
||||
Entity: "suggestions",
|
||||
Action: "read",
|
||||
|
|
|
|||
|
|
@ -964,6 +964,21 @@ func (s *swapClientServer) GetL402Tokens(ctx context.Context,
|
|||
return &clientrpc.TokensResponse{Tokens: rpcTokens}, nil
|
||||
}
|
||||
|
||||
// GetLsatTokens returns all tokens that are contained in the L402 token store.
|
||||
// Deprecated: use GetL402Tokens.
|
||||
// This API is provided to maintain backward compatibility with gRPC clients
|
||||
// (e.g. `loop listauth`, Terminal Web, RTL).
|
||||
// Type LsatToken used by GetLsatTokens in the past was renamed to L402Token,
|
||||
// but this does not affect binary encoding, so we can use type L402Token here.
|
||||
func (s *swapClientServer) GetLsatTokens(ctx context.Context,
|
||||
req *clientrpc.TokensRequest) (*clientrpc.TokensResponse, error) {
|
||||
|
||||
log.Warnf("Received deprecated call GetLsatTokens. Please update the " +
|
||||
"client software. Calling GetL402Tokens now.")
|
||||
|
||||
return s.GetL402Tokens(ctx, req)
|
||||
}
|
||||
|
||||
// GetInfo returns basic information about the loop daemon and details to swaps
|
||||
// from the swap store.
|
||||
func (s *swapClientServer) GetInfo(ctx context.Context,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue