diff --git a/client.go b/client.go index 6e78b6b0f..cad224cb4 100644 --- a/client.go +++ b/client.go @@ -17,6 +17,7 @@ import ( "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/swap" "github.com/lightninglabs/loop/sweep" + "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/routing/route" "google.golang.org/grpc/status" ) @@ -68,6 +69,11 @@ type Client struct { started uint32 // To be used atomically. errChan chan error + // abandonChans allows for accessing a swap's abandon channel by + // providing its swap hash. This map is used to look up the abandon + // channel of a swap if the client requests to abandon it. + abandonChans map[lntypes.Hash]chan struct{} + lndServices *lndclient.LndServices sweeper *sweep.Sweeper executor *executor @@ -179,6 +185,7 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore, sweeper: sweeper, executor: executor, resumeReady: make(chan struct{}), + abandonChans: make(map[lntypes.Hash]chan struct{}), } cleanup := func() { @@ -317,10 +324,10 @@ func (s *Client) Run(ctx context.Context, statusChan chan<- SwapInfo) error { }() // Main event loop. - err = s.executor.run(mainCtx, statusChan) + err = s.executor.run(mainCtx, statusChan, s.abandonChans) // Consider canceled as happy flow. - if err == context.Canceled { + if errors.Is(err, context.Canceled) { err = nil } @@ -374,6 +381,12 @@ func (s *Client) resumeSwaps(ctx context.Context, continue } + // Store the swap's abandon channel so that the client can + // abandon the swap by providing the swap hash. + s.executor.Lock() + s.abandonChans[swap.hash] = swap.abandonChan + s.executor.Unlock() + s.executor.initiateSwap(ctx, swap) } } @@ -578,6 +591,10 @@ func (s *Client) LoopIn(globalCtx context.Context, } swap := initResult.swap + s.executor.Lock() + s.abandonChans[swap.hash] = swap.abandonChan + s.executor.Unlock() + // Post swap to the main loop. s.executor.initiateSwap(globalCtx, swap) @@ -753,3 +770,26 @@ func (s *Client) Probe(ctx context.Context, req *ProbeRequest) error { req.RouteHints, ) } + +// AbandonSwap sends a signal on the abandon channel of the swap identified by +// the passed swap hash. This will cause the swap to abandon itself. +func (s *Client) AbandonSwap(ctx context.Context, + req *AbandonSwapRequest) error { + + if req == nil { + return errors.New("no request provided") + } + + s.executor.Lock() + defer s.executor.Unlock() + + select { + case s.abandonChans[req.SwapHash] <- struct{}{}: + case <-ctx.Done(): + return ctx.Err() + default: + // This is to avoid writing to a full channel. + } + + return nil +} diff --git a/cmd/loop/main.go b/cmd/loop/main.go index e71170520..42ffba319 100644 --- a/cmd/loop/main.go +++ b/cmd/loop/main.go @@ -147,7 +147,7 @@ func main() { monitorCommand, quoteCommand, listAuthCommand, listSwapsCommand, swapInfoCommand, getLiquidityParamsCommand, setLiquidityRuleCommand, suggestSwapCommand, setParamsCommand, - getInfoCommand, + getInfoCommand, abandonSwapCommand, } err := app.Run(os.Args) diff --git a/cmd/loop/swaps.go b/cmd/loop/swaps.go index dfab4711a..8c8dcc67b 100644 --- a/cmd/loop/swaps.go +++ b/cmd/loop/swaps.go @@ -90,3 +90,73 @@ func swapInfo(ctx *cli.Context) error { printRespJSON(resp) return nil } + +var abandonSwapCommand = cli.Command{ + Name: "abandonswap", + Usage: "abandon a swap with a given swap hash", + Description: "This command overrides the database and abandons a " + + "swap with a given swap hash.\n\n" + + "!!! This command might potentially lead to loss of funds if " + + "it is applied to swaps that are still waiting for pending " + + "user funds. Before executing this command make sure that " + + "no funds are locked by the swap.", + ArgsUsage: "ID", + Flags: []cli.Flag{ + cli.BoolFlag{ + Name: "i_know_what_i_am_doing", + Usage: "Specify this flag if you made sure that you " + + "read and understood the following " + + "consequence of applying this command.", + }, + }, + Action: abandonSwap, +} + +func abandonSwap(ctx *cli.Context) error { + args := ctx.Args() + + var id string + switch { + case ctx.IsSet("id"): + id = ctx.String("id") + + case ctx.NArg() > 0: + id = args[0] + args = args.Tail() // nolint:wastedassign + + default: + // Show command help if no arguments and flags were provided. + return cli.ShowCommandHelp(ctx, "abandonswap") + } + + if len(id) != hex.EncodedLen(lntypes.HashSize) { + return fmt.Errorf("invalid swap ID") + } + idBytes, err := hex.DecodeString(id) + if err != nil { + return fmt.Errorf("cannot hex decode id: %v", err) + } + + client, cleanup, err := getClient(ctx) + if err != nil { + return err + } + defer cleanup() + + if !ctx.Bool("i_know_what_i_am_doing") { + return cli.ShowCommandHelp(ctx, "abandonswap") + } + + resp, err := client.AbandonSwap( + context.Background(), &looprpc.AbandonSwapRequest{ + Id: idBytes, + IKnowWhatIAmDoing: ctx.Bool("i_know_what_i_am_doing"), + }, + ) + if err != nil { + return err + } + + printRespJSON(resp) + return nil +} diff --git a/executor.go b/executor.go index 2775ea0e6..10921833b 100644 --- a/executor.go +++ b/executor.go @@ -13,6 +13,7 @@ import ( "github.com/lightninglabs/lndclient" "github.com/lightninglabs/loop/loopdb" "github.com/lightninglabs/loop/sweep" + "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/queue" ) @@ -46,6 +47,8 @@ type executor struct { currentHeight uint32 ready chan struct{} + sync.Mutex + executorConfig } @@ -61,7 +64,8 @@ func newExecutor(cfg *executorConfig) *executor { // run starts the executor event loop. It accepts and executes new swaps, // providing them with required config data. func (s *executor) run(mainCtx context.Context, - statusChan chan<- SwapInfo) error { + statusChan chan<- SwapInfo, + abandonChans map[lntypes.Hash]chan struct{}) error { var ( err error @@ -167,6 +171,15 @@ func (s *executor) run(mainCtx context.Context, log.Errorf("Execute error: %v", err) } + // If a loop-in ended we have to remove its + // abandon channel from our abandonChans map + // since the swap finalized. + if swap, ok := newSwap.(*loopInSwap); ok { + s.Lock() + delete(abandonChans, swap.hash) + s.Unlock() + } + select { case swapDoneChan <- swapID: case <-mainCtx.Done(): diff --git a/interface.go b/interface.go index 3476fd757..2d1d191e4 100644 --- a/interface.go +++ b/interface.go @@ -394,3 +394,9 @@ type ProbeRequest struct { // Optional hop hints. RouteHints [][]zpay32.HopHint } + +// AbandonSwapRequest specifies the swap to abandon. It is identified by its +// swap hash. +type AbandonSwapRequest struct { + SwapHash lntypes.Hash +} diff --git a/loopd/perms/perms.go b/loopd/perms/perms.go index 0179e305a..90b7aa2fa 100644 --- a/loopd/perms/perms.go +++ b/loopd/perms/perms.go @@ -31,6 +31,16 @@ var RequiredPermissions = map[string][]bakery.Op{ Entity: "swap", Action: "read", }}, + "/looprpc.SwapClient/AbandonSwap": {{ + Entity: "swap", + Action: "execute", + }, { + Entity: "loop", + Action: "in", + }, { + Entity: "loop", + Action: "out", + }}, "/looprpc.SwapClient/LoopOutTerms": {{ Entity: "terms", Action: "read", diff --git a/loopd/swapclient_server.go b/loopd/swapclient_server.go index c42249fcf..be135a7be 100644 --- a/loopd/swapclient_server.go +++ b/loopd/swapclient_server.go @@ -288,6 +288,9 @@ func (s *swapClientServer) marshallSwap(loopSwap *loop.SwapInfo) ( case loopdb.StateFailIncorrectHtlcAmt: failureReason = clientrpc.FailureReason_FAILURE_REASON_INCORRECT_AMOUNT + case loopdb.StateFailAbandoned: + failureReason = clientrpc.FailureReason_FAILURE_REASON_ABANDONED + default: return nil, fmt.Errorf("unknown swap state: %v", loopSwap.State) } @@ -508,6 +511,49 @@ func (s *swapClientServer) SwapInfo(_ context.Context, return s.marshallSwap(&swp) } +// AbandonSwap requests the server to abandon a swap with the given hash. +func (s *swapClientServer) AbandonSwap(ctx context.Context, + req *clientrpc.AbandonSwapRequest) (*clientrpc.AbandonSwapResponse, + error) { + + if !req.IKnowWhatIAmDoing { + return nil, fmt.Errorf("please read the AbandonSwap API " + + "documentation") + } + + swapHash, err := lntypes.MakeHash(req.Id) + if err != nil { + return nil, fmt.Errorf("error parsing swap hash: %v", err) + } + + s.swapsLock.Lock() + swap, ok := s.swaps[swapHash] + s.swapsLock.Unlock() + if !ok { + return nil, fmt.Errorf("swap with hash %s not found", req.Id) + } + + if swap.SwapType.IsOut() { + return nil, fmt.Errorf("abandoning loop out swaps is not " + + "supported yet") + } + + // If the swap is in a final state, we cannot abandon it. + if swap.State.IsFinal() { + return nil, fmt.Errorf("cannot abandon swap in final state, "+ + "state = %s, hash = %s", swap.State.String(), swapHash) + } + + err = s.impl.AbandonSwap(ctx, &loop.AbandonSwapRequest{ + SwapHash: swapHash, + }) + if err != nil { + return nil, fmt.Errorf("error abandoning swap: %v", err) + } + + return &clientrpc.AbandonSwapResponse{}, nil +} + // LoopOutTerms returns the terms that the server enforces for loop out swaps. func (s *swapClientServer) LoopOutTerms(ctx context.Context, _ *clientrpc.TermsRequest) (*clientrpc.OutTermsResponse, error) { diff --git a/loopdb/swapstate.go b/loopdb/swapstate.go index 15d0b7422..12c207b52 100644 --- a/loopdb/swapstate.go +++ b/loopdb/swapstate.go @@ -64,6 +64,10 @@ const ( // StateFailIncorrectHtlcAmt indicates that the amount of an externally // published loop in htlc didn't match the swap amount. StateFailIncorrectHtlcAmt SwapState = 10 + + // StateFailAbandoned indicates that a swap has been abandoned. Its + // execution has been canceled. It won't further be processed. + StateFailAbandoned SwapState = 11 ) // SwapStateType defines the types of swap states that exist. Every swap state @@ -98,6 +102,18 @@ func (s SwapState) Type() SwapStateType { return StateTypeFail } +// IsPending returns true if the swap is in a pending state. +func (s SwapState) IsPending() bool { + return s == StateInitiated || s == StateHtlcPublished || + s == StatePreimageRevealed || s == StateFailTemporary || + s == StateInvoiceSettled +} + +// IsFinal returns true if the swap is in a final state. +func (s SwapState) IsFinal() bool { + return !s.IsPending() +} + // String returns a string representation of the swap's state. func (s SwapState) String() string { switch s { @@ -134,6 +150,9 @@ func (s SwapState) String() string { case StateFailIncorrectHtlcAmt: return "IncorrectHtlcAmt" + case StateFailAbandoned: + return "FailAbandoned" + default: return "Unknown" } diff --git a/loopin.go b/loopin.go index 2bd2c3299..e22196d54 100644 --- a/loopin.go +++ b/loopin.go @@ -48,6 +48,10 @@ var ( // TimeoutTxConfTarget defines the confirmation target for the loop in // timeout tx. TimeoutTxConfTarget = int32(2) + + // ErrSwapFinalized is returned when a to be executed swap is already in + // a final state. + ErrSwapFinalized = errors.New("swap is in a final state") ) // loopInSwap contains all the in-memory state related to a pending loop in @@ -70,6 +74,8 @@ type loopInSwap struct { timeoutAddr btcutil.Address + abandonChan chan struct{} + wg sync.WaitGroup } @@ -308,6 +314,8 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig, swap.log.Infof("Server message: %v", swapResp.serverMessage) } + swap.abandonChan = make(chan struct{}, 1) + return &loopInInitResult{ swap: swap, serverMessage: swapResp.serverMessage, @@ -413,6 +421,10 @@ func resumeLoopInSwap(_ context.Context, cfg *swapConfig, swap.cost = lastUpdate.Cost } + // Upon restoring the swap we also need to assign a new abandon channel + // that the client can use to signal that the swap should be abandoned. + swap.abandonChan = make(chan struct{}, 1) + return swap, nil } @@ -518,6 +530,11 @@ func (s *loopInSwap) execute(mainCtx context.Context, // error occurs. err = s.executeSwap(mainCtx) + // Stop the execution if the swap has been abandoned. + if err != nil && s.state == loopdb.StateFailAbandoned { + return err + } + // Sanity check. If there is no error, the swap must be in a final // state. if err == nil && s.state.Type() == loopdb.StateTypePending { @@ -553,6 +570,11 @@ func (s *loopInSwap) execute(mainCtx context.Context, func (s *loopInSwap) executeSwap(globalCtx context.Context) error { var err error + // If the swap is already in a final state, we can return immediately. + if s.state.IsFinal() { + return ErrSwapFinalized + } + // For loop in, the client takes the first step by publishing the // on-chain htlc. Only do this if we haven't already done so in a // previous run. @@ -688,6 +710,11 @@ func (s *loopInSwap) waitForHtlcConf(globalCtx context.Context) ( case notification := <-s.blockEpochChan: s.height = notification.(int32) + // If the client requested the swap to be abandoned, we override + // the status in the database. + case <-s.abandonChan: + return nil, s.setStateAbandoned(ctx) + // Cancel. case <-globalCtx.Done(): return nil, globalCtx.Err() @@ -840,6 +867,11 @@ func (s *loopInSwap) waitForSwapComplete(ctx context.Context, htlcKeyRevealed := false for !htlcSpend || !invoiceFinalized { select { + // If the client requested the swap to be abandoned, we override + // the status in the database. + case <-s.abandonChan: + return s.setStateAbandoned(ctx) + // Spend notification error. case err := <-spendErr: return err @@ -1062,6 +1094,31 @@ func (s *loopInSwap) publishTimeoutTx(ctx context.Context, return fee, nil } +// setStateAbandoned stores the abandoned state and announces it. It also +// cancels the swap invoice so the server can't settle it. +func (s *loopInSwap) setStateAbandoned(ctx context.Context) error { + s.log.Infof("Abandoning swap %v...", s.hash) + + if !s.state.IsPending() { + return fmt.Errorf("cannot abandon swap in state %v", s.state) + } + + s.setState(loopdb.StateFailAbandoned) + + err := s.persistAndAnnounceState(ctx) + if err != nil { + return err + } + + // If the invoice is already settled or canceled, this is a nop. + _ = s.lnd.Invoices.CancelInvoice(ctx, s.hash) + + return fmt.Errorf("swap hash "+ + "abandoned by client, "+ + "swap ID: %v, %v", + s.hash, err) +} + // persistAndAnnounceState updates the swap state on disk and sends out an // update notification. func (s *loopInSwap) persistAndAnnounceState(ctx context.Context) error { diff --git a/loopin_test.go b/loopin_test.go index 52dee188d..b648d8c0a 100644 --- a/loopin_test.go +++ b/loopin_test.go @@ -574,3 +574,205 @@ func testLoopInResume(t *testing.T, state loopdb.SwapState, expired bool, cost.Server = btcutil.Amount(htlcTx.TxOut[0].Value) - amtPaid require.Equal(t, cost, finalState.Cost) } + +// TestAbandonPublishedHtlcState advances a loop-in swap to StateHtlcPublished, +// then abandons it and ensures that executing the same swap would not progress. +func TestAbandonPublishedHtlcState(t *testing.T) { + defer test.Guard(t)() + + ctx := newLoopInTestContext(t) + + height := int32(600) + + cfg, err, inSwap := startNewLoopIn(t, ctx, height) + require.NoError(t, err) + + advanceToPublishedHtlc(t, ctx) + + // The client requests to abandon the published htlc state. + inSwap.abandonChan <- struct{}{} + + // Ensure that the swap is now in the StateFailAbandoned state. + ctx.assertState(loopdb.StateFailAbandoned) + + // Ensure that the swap is also in the StateFailAbandoned state in the + // database. + ctx.store.assertLoopInState(loopdb.StateFailAbandoned) + + // Ensure that the swap was abandoned and the execution stopped. + err = <-ctx.errChan + require.Error(t, err) + require.Contains(t, err.Error(), "swap hash abandoned by client") + + // We re-instantiate the swap and ensure that it does not progress. + pendSwap := &loopdb.LoopIn{ + Contract: &inSwap.LoopInContract, + Loop: loopdb.Loop{ + Events: []*loopdb.LoopEvent{ + { + SwapStateData: loopdb.SwapStateData{ + State: inSwap.state, + }, + }, + }, + Hash: testPreimage.Hash(), + }, + } + resumedSwap, err := resumeLoopInSwap( + context.Background(), cfg, pendSwap, + ) + require.NoError(t, err) + + // Execute the abandoned swap. + go func() { + err := resumedSwap.execute( + context.Background(), ctx.cfg, height, + ) + if err != nil { + log.Error(err) + } + ctx.errChan <- err + }() + + // Ensure that the swap is still in the StateFailAbandoned state. + swapInfo := <-ctx.statusChan + require.Equal(t, loopdb.StateFailAbandoned, swapInfo.State) + + // Ensure that the execution flagged the abandoned swap as finalized. + err = <-ctx.errChan + require.Error(t, err) + require.Equal(t, ErrSwapFinalized, err) +} + +// TestAbandonSettledInvoiceState advances a loop-in swap to +// StateInvoiceSettled, then abandons it and ensures that executing the same +// swap would not progress. +func TestAbandonSettledInvoiceState(t *testing.T) { + defer test.Guard(t)() + + ctx := newLoopInTestContext(t) + + height := int32(600) + + cfg, err, inSwap := startNewLoopIn(t, ctx, height) + require.NoError(t, err) + + advanceToPublishedHtlc(t, ctx) + + // Client starts listening for swap invoice updates. + ctx.assertSubscribeInvoice(ctx.server.swapHash) + + // Server has already paid invoice before spending the htlc. Signal + // settled. + ctx.updateInvoiceState(49000, invpkg.ContractSettled) + + // Swap is expected to move to the state InvoiceSettled + ctx.assertState(loopdb.StateInvoiceSettled) + ctx.store.assertLoopInState(loopdb.StateInvoiceSettled) + + // The client requests to abandon the published htlc state. + inSwap.abandonChan <- struct{}{} + + // Ensure that the swap is now in the StateFailAbandoned state. + ctx.assertState(loopdb.StateFailAbandoned) + + // Ensure that the swap is also in the StateFailAbandoned state in the + // database. + ctx.store.assertLoopInState(loopdb.StateFailAbandoned) + + // Ensure that the swap was abandoned and the execution stopped. + err = <-ctx.errChan + require.Error(t, err) + require.Contains(t, err.Error(), "swap hash abandoned by client") + + // We re-instantiate the swap and ensure that it does not progress. + pendSwap := &loopdb.LoopIn{ + Contract: &inSwap.LoopInContract, + Loop: loopdb.Loop{ + Events: []*loopdb.LoopEvent{ + { + SwapStateData: loopdb.SwapStateData{ + State: inSwap.state, + }, + }, + }, + Hash: testPreimage.Hash(), + }, + } + resumedSwap, err := resumeLoopInSwap(context.Background(), cfg, pendSwap) + require.NoError(t, err) + + // Execute the abandoned swap. + go func() { + err := resumedSwap.execute( + context.Background(), ctx.cfg, height, + ) + if err != nil { + log.Error(err) + } + ctx.errChan <- err + }() + + // Ensure that the swap is still in the StateFailAbandoned state. + swapInfo := <-ctx.statusChan + require.Equal(t, loopdb.StateFailAbandoned, swapInfo.State) + + // Ensure that the execution flagged the abandoned swap as finalized. + err = <-ctx.errChan + require.Error(t, err) + require.Equal(t, ErrSwapFinalized, err) +} + +func advanceToPublishedHtlc(t *testing.T, ctx *loopInTestContext) SwapInfo { + swapInfo := <-ctx.statusChan + require.Equal(t, loopdb.StateInitiated, swapInfo.State) + + ctx.assertState(loopdb.StateHtlcPublished) + ctx.store.assertLoopInState(loopdb.StateHtlcPublished) + + // Expect htlc to be published. + htlcTx := <-ctx.lnd.SendOutputsChannel + + // Expect the same state to be written again with the htlc tx hash + // and on chain fee. + ctx.store.assertLoopInState(loopdb.StateHtlcPublished) + + // Expect register for htlc conf (only one, since the htlc is p2tr). + <-ctx.lnd.RegisterConfChannel + + // Confirm htlc. + ctx.lnd.ConfChannel <- &chainntnfs.TxConfirmation{ + Tx: &htlcTx, + } + + // Client starts listening for spend of htlc. + <-ctx.lnd.RegisterSpendChannel + return swapInfo +} + +func startNewLoopIn(t *testing.T, ctx *loopInTestContext, height int32) ( + *swapConfig, error, *loopInSwap) { + + cfg := newSwapConfig(&ctx.lnd.LndServices, ctx.store, ctx.server) + + req := &testLoopInRequest + + initResult, err := newLoopInSwap( + context.Background(), cfg, + height, req, + ) + require.NoError(t, err) + + inSwap := initResult.swap + + ctx.store.assertLoopInStored() + + go func() { + err := inSwap.execute(context.Background(), ctx.cfg, height) + if err != nil { + log.Error(err) + } + ctx.errChan <- err + }() + return cfg, err, inSwap +} diff --git a/loopin_testcontext_test.go b/loopin_testcontext_test.go index 7d3ffcda9..6bf0ad12f 100644 --- a/loopin_testcontext_test.go +++ b/loopin_testcontext_test.go @@ -22,6 +22,7 @@ type loopInTestContext struct { sweeper *sweep.Sweeper cfg *executeConfig statusChan chan SwapInfo + errChan chan error blockEpochChan chan interface{} swapInvoiceSubscription *test.SingleInvoiceSubscription @@ -35,6 +36,7 @@ func newLoopInTestContext(t *testing.T) *loopInTestContext { blockEpochChan := make(chan interface{}) statusChan := make(chan SwapInfo) + errChan := make(chan error) expiryChan := make(chan time.Time) timerFactory := func(expiry time.Duration) <-chan time.Time { @@ -57,6 +59,7 @@ func newLoopInTestContext(t *testing.T) *loopInTestContext { sweeper: &sweeper, cfg: &cfg, statusChan: statusChan, + errChan: errChan, blockEpochChan: blockEpochChan, } } diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 7ea0c7e72..ae732cb0a 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.6.1 // source: client.proto @@ -234,6 +234,10 @@ const ( //FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed //because the amount extended by an external loop in htlc is insufficient. FailureReason_FAILURE_REASON_INCORRECT_AMOUNT FailureReason = 6 + // + //FAILURE_REASON_ABANDONED indicates that a swap permanently failed because + //the client manually abandoned the swap. + FailureReason_FAILURE_REASON_ABANDONED FailureReason = 7 ) // Enum value maps for FailureReason. @@ -246,6 +250,7 @@ var ( 4: "FAILURE_REASON_INSUFFICIENT_VALUE", 5: "FAILURE_REASON_TEMPORARY", 6: "FAILURE_REASON_INCORRECT_AMOUNT", + 7: "FAILURE_REASON_ABANDONED", } FailureReason_value = map[string]int32{ "FAILURE_REASON_NONE": 0, @@ -255,6 +260,7 @@ var ( "FAILURE_REASON_INSUFFICIENT_VALUE": 4, "FAILURE_REASON_TEMPORARY": 5, "FAILURE_REASON_INCORRECT_AMOUNT": 6, + "FAILURE_REASON_ABANDONED": 7, } ) @@ -3132,6 +3138,106 @@ func (x *SuggestSwapsResponse) GetDisqualified() []*Disqualified { return nil } +type AbandonSwapRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // + //The swap identifier which currently is the hash that locks the HTLCs. When + //using REST, this field must be encoded as URL safe base64. + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // + //A flag that tries to ensure that the client understands that they are + //risking loss of funds by abandoning a swap. This could happen if an + //abandoned swap would wait on a timeout sweep by the client. + IKnowWhatIAmDoing bool `protobuf:"varint,2,opt,name=i_know_what_i_am_doing,json=iKnowWhatIAmDoing,proto3" json:"i_know_what_i_am_doing,omitempty"` +} + +func (x *AbandonSwapRequest) Reset() { + *x = AbandonSwapRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AbandonSwapRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AbandonSwapRequest) ProtoMessage() {} + +func (x *AbandonSwapRequest) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AbandonSwapRequest.ProtoReflect.Descriptor instead. +func (*AbandonSwapRequest) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{30} +} + +func (x *AbandonSwapRequest) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *AbandonSwapRequest) GetIKnowWhatIAmDoing() bool { + if x != nil { + return x.IKnowWhatIAmDoing + } + return false +} + +type AbandonSwapResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AbandonSwapResponse) Reset() { + *x = AbandonSwapResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_client_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AbandonSwapResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AbandonSwapResponse) ProtoMessage() {} + +func (x *AbandonSwapResponse) ProtoReflect() protoreflect.Message { + mi := &file_client_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AbandonSwapResponse.ProtoReflect.Descriptor instead. +func (*AbandonSwapResponse) Descriptor() ([]byte, []int) { + return file_client_proto_rawDescGZIP(), []int{31} +} + var File_client_proto protoreflect.FileDescriptor var file_client_proto_rawDesc = []byte{ @@ -3518,7 +3624,14 @@ var file_client_proto_rawDesc = []byte{ 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x69, 0x73, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x2a, 0x3b, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x79, + 0x69, 0x65, 0x64, 0x22, 0x57, 0x0a, 0x12, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, + 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x16, 0x69, 0x5f, 0x6b, + 0x6e, 0x6f, 0x77, 0x5f, 0x77, 0x68, 0x61, 0x74, 0x5f, 0x69, 0x5f, 0x61, 0x6d, 0x5f, 0x64, 0x6f, + 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x69, 0x4b, 0x6e, 0x6f, 0x77, + 0x57, 0x68, 0x61, 0x74, 0x49, 0x41, 0x6d, 0x44, 0x6f, 0x69, 0x6e, 0x67, 0x22, 0x15, 0x0a, 0x13, + 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2a, 0x3b, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x41, 0x50, 0x52, 0x4f, 0x4f, 0x54, 0x5f, 0x50, 0x55, 0x42, 0x4b, 0x45, 0x59, 0x10, 0x01, @@ -3531,7 +3644,7 @@ var file_client_proto_rawDesc = []byte{ 0x4c, 0x43, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x49, 0x4e, 0x56, 0x4f, 0x49, - 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, 0xed, 0x01, 0x0a, + 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x2a, 0x8b, 0x02, 0x0a, 0x0d, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x46, 0x41, 0x49, 0x4c, 0x55, @@ -3546,104 +3659,111 @@ var file_client_proto_rawDesc = []byte{ 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x52, 0x59, 0x10, 0x05, 0x12, 0x23, 0x0a, 0x1f, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x43, 0x4f, 0x52, 0x52, - 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4d, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x06, 0x2a, 0x2f, 0x0a, 0x11, - 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, - 0x0a, 0x09, 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x2a, 0xa6, 0x03, - 0x0a, 0x0a, 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, - 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, - 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, - 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x55, 0x54, - 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x46, - 0x45, 0x45, 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x45, 0x4c, 0x41, 0x50, - 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, 0x04, - 0x12, 0x18, 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, - 0x53, 0x57, 0x41, 0x50, 0x5f, 0x46, 0x45, 0x45, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, - 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x45, 0x52, 0x5f, - 0x46, 0x45, 0x45, 0x10, 0x06, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, - 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x59, 0x10, 0x07, 0x12, 0x1f, 0x0a, - 0x1b, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, - 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x4f, 0x46, 0x46, 0x10, 0x08, 0x12, 0x18, - 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, - 0x4f, 0x50, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, - 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, - 0x0a, 0x12, 0x1c, 0x0a, 0x18, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, - 0x5f, 0x4c, 0x49, 0x51, 0x55, 0x49, 0x44, 0x49, 0x54, 0x59, 0x5f, 0x4f, 0x4b, 0x10, 0x0b, 0x12, - 0x23, 0x0a, 0x1f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, - 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, - 0x4e, 0x54, 0x10, 0x0c, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x45, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, - 0x49, 0x45, 0x4e, 0x54, 0x10, 0x0d, 0x32, 0x80, 0x08, 0x0a, 0x0a, 0x53, 0x77, 0x61, 0x70, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, - 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, - 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, - 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x37, 0x0a, 0x06, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, - 0x73, 0x12, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x77, 0x61, 0x70, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x77, 0x61, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, - 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x12, 0x40, 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x54, 0x65, - 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, - 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, - 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, - 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, - 0x6f, 0x70, 0x49, 0x6e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, - 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x54, 0x65, 0x72, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, - 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, - 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, - 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, - 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x73, 0x61, 0x74, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, - 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, + 0x45, 0x43, 0x54, 0x5f, 0x41, 0x4d, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x06, 0x12, 0x1c, 0x0a, 0x18, + 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x41, + 0x42, 0x41, 0x4e, 0x44, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x07, 0x2a, 0x2f, 0x0a, 0x11, 0x4c, 0x69, + 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x52, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, + 0x54, 0x48, 0x52, 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x10, 0x01, 0x2a, 0xa6, 0x03, 0x0a, 0x0a, + 0x41, 0x75, 0x74, 0x6f, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, + 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x54, + 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x41, 0x55, 0x54, 0x4f, 0x5f, + 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, 0x45, 0x45, 0x50, 0x5f, 0x46, 0x45, 0x45, + 0x53, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, 0x47, 0x45, 0x54, 0x5f, 0x45, 0x4c, 0x41, 0x50, 0x53, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, 0x04, 0x12, 0x18, + 0x0a, 0x14, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x53, 0x57, + 0x41, 0x50, 0x5f, 0x46, 0x45, 0x45, 0x10, 0x05, 0x12, 0x19, 0x0a, 0x15, 0x41, 0x55, 0x54, 0x4f, + 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4d, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x46, 0x45, + 0x45, 0x10, 0x06, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, + 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x59, 0x10, 0x07, 0x12, 0x1f, 0x0a, 0x1b, 0x41, + 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x55, + 0x52, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x4f, 0x46, 0x46, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, + 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, + 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x09, 0x12, 0x17, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, + 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, 0x4f, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x10, 0x0a, 0x12, + 0x1c, 0x0a, 0x18, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x4c, + 0x49, 0x51, 0x55, 0x49, 0x44, 0x49, 0x54, 0x59, 0x5f, 0x4f, 0x4b, 0x10, 0x0b, 0x12, 0x23, 0x0a, + 0x1f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x44, + 0x47, 0x45, 0x54, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, + 0x10, 0x0c, 0x12, 0x20, 0x0a, 0x1c, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, + 0x4e, 0x5f, 0x46, 0x45, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55, 0x46, 0x46, 0x49, 0x43, 0x49, 0x45, + 0x4e, 0x54, 0x10, 0x0d, 0x32, 0xca, 0x08, 0x0a, 0x0a, 0x53, 0x77, 0x61, 0x70, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x12, 0x17, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, + 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, + 0x0a, 0x06, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, + 0x70, 0x63, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, + 0x6f, 0x72, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x6f, 0x6e, + 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x30, 0x01, 0x12, 0x42, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x12, + 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, + 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x53, 0x77, 0x61, 0x70, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, + 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6c, + 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x77, 0x61, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x48, 0x0a, 0x0b, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, + 0x12, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, 0x61, 0x6e, 0x64, + 0x6f, 0x6e, 0x53, 0x77, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x41, 0x62, 0x61, 0x6e, 0x64, 0x6f, 0x6e, 0x53, + 0x77, 0x61, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x4c, + 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4f, 0x75, 0x74, + 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x0c, 0x4c, 0x6f, 0x6f, 0x70, 0x4f, 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4f, + 0x75, 0x74, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x54, 0x65, 0x72, 0x6d, + 0x73, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x65, 0x72, 0x6d, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, + 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x54, 0x65, 0x72, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x6f, 0x70, 0x49, 0x6e, 0x51, + 0x75, 0x6f, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x51, + 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x49, 0x6e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, 0x15, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, + 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, + 0x0d, 0x47, 0x65, 0x74, 0x4c, 0x73, 0x61, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, + 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x6c, 0x6f, 0x6f, + 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, + 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, + 0x63, 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, + 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, - 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x5d, 0x0a, - 0x12, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x22, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, - 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, - 0x63, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, - 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x12, 0x1c, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, - 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, - 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x72, - 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x23, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x69, 0x71, + 0x75, 0x69, 0x64, 0x69, 0x74, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, + 0x77, 0x61, 0x70, 0x73, 0x12, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, + 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x67, + 0x67, 0x65, 0x73, 0x74, 0x53, 0x77, 0x61, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x6f, + 0x6f, 0x70, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -3659,7 +3779,7 @@ func file_client_proto_rawDescGZIP() []byte { } var file_client_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_client_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_client_proto_goTypes = []interface{}{ (AddressType)(0), // 0: looprpc.AddressType (SwapType)(0), // 1: looprpc.SwapType @@ -3697,17 +3817,19 @@ var file_client_proto_goTypes = []interface{}{ (*SuggestSwapsRequest)(nil), // 33: looprpc.SuggestSwapsRequest (*Disqualified)(nil), // 34: looprpc.Disqualified (*SuggestSwapsResponse)(nil), // 35: looprpc.SuggestSwapsResponse - (*swapserverrpc.RouteHint)(nil), // 36: looprpc.RouteHint + (*AbandonSwapRequest)(nil), // 36: looprpc.AbandonSwapRequest + (*AbandonSwapResponse)(nil), // 37: looprpc.AbandonSwapResponse + (*swapserverrpc.RouteHint)(nil), // 38: looprpc.RouteHint } var file_client_proto_depIdxs = []int32{ 0, // 0: looprpc.LoopOutRequest.account_addr_type:type_name -> looprpc.AddressType - 36, // 1: looprpc.LoopInRequest.route_hints:type_name -> looprpc.RouteHint + 38, // 1: looprpc.LoopInRequest.route_hints:type_name -> looprpc.RouteHint 1, // 2: looprpc.SwapStatus.type:type_name -> looprpc.SwapType 2, // 3: looprpc.SwapStatus.state:type_name -> looprpc.SwapState 3, // 4: looprpc.SwapStatus.failure_reason:type_name -> looprpc.FailureReason 10, // 5: looprpc.ListSwapsResponse.swaps:type_name -> looprpc.SwapStatus - 36, // 6: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint - 36, // 7: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint + 38, // 6: looprpc.QuoteRequest.loop_in_route_hints:type_name -> looprpc.RouteHint + 38, // 7: looprpc.ProbeRequest.route_hints:type_name -> looprpc.RouteHint 24, // 8: looprpc.TokensResponse.tokens:type_name -> looprpc.LsatToken 25, // 9: looprpc.GetInfoResponse.loop_out_stats:type_name -> looprpc.LoopStats 25, // 10: looprpc.GetInfoResponse.loop_in_stats:type_name -> looprpc.LoopStats @@ -3725,33 +3847,35 @@ var file_client_proto_depIdxs = []int32{ 9, // 22: looprpc.SwapClient.Monitor:input_type -> looprpc.MonitorRequest 11, // 23: looprpc.SwapClient.ListSwaps:input_type -> looprpc.ListSwapsRequest 13, // 24: looprpc.SwapClient.SwapInfo:input_type -> looprpc.SwapInfoRequest - 14, // 25: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest - 17, // 26: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest - 14, // 27: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest - 17, // 28: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest - 20, // 29: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest - 22, // 30: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest - 26, // 31: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest - 28, // 32: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest - 31, // 33: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest - 33, // 34: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest - 8, // 35: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse - 8, // 36: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse - 10, // 37: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus - 12, // 38: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse - 10, // 39: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus - 16, // 40: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse - 19, // 41: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse - 15, // 42: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse - 18, // 43: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse - 21, // 44: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse - 23, // 45: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse - 27, // 46: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse - 29, // 47: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters - 32, // 48: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse - 35, // 49: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse - 35, // [35:50] is the sub-list for method output_type - 20, // [20:35] is the sub-list for method input_type + 36, // 25: looprpc.SwapClient.AbandonSwap:input_type -> looprpc.AbandonSwapRequest + 14, // 26: looprpc.SwapClient.LoopOutTerms:input_type -> looprpc.TermsRequest + 17, // 27: looprpc.SwapClient.LoopOutQuote:input_type -> looprpc.QuoteRequest + 14, // 28: looprpc.SwapClient.GetLoopInTerms:input_type -> looprpc.TermsRequest + 17, // 29: looprpc.SwapClient.GetLoopInQuote:input_type -> looprpc.QuoteRequest + 20, // 30: looprpc.SwapClient.Probe:input_type -> looprpc.ProbeRequest + 22, // 31: looprpc.SwapClient.GetLsatTokens:input_type -> looprpc.TokensRequest + 26, // 32: looprpc.SwapClient.GetInfo:input_type -> looprpc.GetInfoRequest + 28, // 33: looprpc.SwapClient.GetLiquidityParams:input_type -> looprpc.GetLiquidityParamsRequest + 31, // 34: looprpc.SwapClient.SetLiquidityParams:input_type -> looprpc.SetLiquidityParamsRequest + 33, // 35: looprpc.SwapClient.SuggestSwaps:input_type -> looprpc.SuggestSwapsRequest + 8, // 36: looprpc.SwapClient.LoopOut:output_type -> looprpc.SwapResponse + 8, // 37: looprpc.SwapClient.LoopIn:output_type -> looprpc.SwapResponse + 10, // 38: looprpc.SwapClient.Monitor:output_type -> looprpc.SwapStatus + 12, // 39: looprpc.SwapClient.ListSwaps:output_type -> looprpc.ListSwapsResponse + 10, // 40: looprpc.SwapClient.SwapInfo:output_type -> looprpc.SwapStatus + 37, // 41: looprpc.SwapClient.AbandonSwap:output_type -> looprpc.AbandonSwapResponse + 16, // 42: looprpc.SwapClient.LoopOutTerms:output_type -> looprpc.OutTermsResponse + 19, // 43: looprpc.SwapClient.LoopOutQuote:output_type -> looprpc.OutQuoteResponse + 15, // 44: looprpc.SwapClient.GetLoopInTerms:output_type -> looprpc.InTermsResponse + 18, // 45: looprpc.SwapClient.GetLoopInQuote:output_type -> looprpc.InQuoteResponse + 21, // 46: looprpc.SwapClient.Probe:output_type -> looprpc.ProbeResponse + 23, // 47: looprpc.SwapClient.GetLsatTokens:output_type -> looprpc.TokensResponse + 27, // 48: looprpc.SwapClient.GetInfo:output_type -> looprpc.GetInfoResponse + 29, // 49: looprpc.SwapClient.GetLiquidityParams:output_type -> looprpc.LiquidityParameters + 32, // 50: looprpc.SwapClient.SetLiquidityParams:output_type -> looprpc.SetLiquidityParamsResponse + 35, // 51: looprpc.SwapClient.SuggestSwaps:output_type -> looprpc.SuggestSwapsResponse + 36, // [36:52] is the sub-list for method output_type + 20, // [20:36] is the sub-list for method input_type 20, // [20:20] is the sub-list for extension type_name 20, // [20:20] is the sub-list for extension extendee 0, // [0:20] is the sub-list for field type_name @@ -4123,6 +4247,30 @@ func file_client_proto_init() { return nil } } + file_client_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AbandonSwapRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_client_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AbandonSwapResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -4130,7 +4278,7 @@ func file_client_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_client_proto_rawDesc, NumEnums: 6, - NumMessages: 30, + NumMessages: 32, NumExtensions: 0, NumServices: 1, }, diff --git a/looprpc/client.proto b/looprpc/client.proto index 7bf3c705c..6bb93a62c 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -43,6 +43,11 @@ service SwapClient { */ rpc SwapInfo (SwapInfoRequest) returns (SwapStatus); + /* loop: `abandonswap` + AbandonSwap allows the client to abandon a swap. + */ + rpc AbandonSwap (AbandonSwapRequest) returns (AbandonSwapResponse); + /* loop: `terms` LoopOutTerms returns the terms that the server enforces for a loop out swap. */ @@ -524,6 +529,12 @@ enum FailureReason { because the amount extended by an external loop in htlc is insufficient. */ FAILURE_REASON_INCORRECT_AMOUNT = 6; + + /* + FAILURE_REASON_ABANDONED indicates that a swap permanently failed because + the client manually abandoned the swap. + */ + FAILURE_REASON_ABANDONED = 7; } message ListSwapsRequest { @@ -1180,3 +1191,21 @@ message SuggestSwapsResponse { */ repeated Disqualified disqualified = 2; } + +message AbandonSwapRequest { + /* + The swap identifier which currently is the hash that locks the HTLCs. When + using REST, this field must be encoded as URL safe base64. + */ + bytes id = 1; + + /* + A flag that tries to ensure that the client understands that they are + risking loss of funds by abandoning a swap. This could happen if an + abandoned swap would wait on a timeout sweep by the client. + */ + bool i_know_what_i_am_doing = 2; +} + +message AbandonSwapResponse { +} \ No newline at end of file diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index 50819b829..87b54124b 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -492,6 +492,9 @@ } }, "definitions": { + "looprpcAbandonSwapResponse": { + "type": "object" + }, "looprpcAddressType": { "type": "string", "enum": [ @@ -551,10 +554,11 @@ "FAILURE_REASON_SWEEP_TIMEOUT", "FAILURE_REASON_INSUFFICIENT_VALUE", "FAILURE_REASON_TEMPORARY", - "FAILURE_REASON_INCORRECT_AMOUNT" + "FAILURE_REASON_INCORRECT_AMOUNT", + "FAILURE_REASON_ABANDONED" ], "default": "FAILURE_REASON_NONE", - "description": " - FAILURE_REASON_NONE: FAILURE_REASON_NONE is set when the swap did not fail, it is either in\nprogress or succeeded.\n - FAILURE_REASON_OFFCHAIN: FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't\npossible to find a route for one or both off chain payments that met the fee\nand timelock limits required.\n - FAILURE_REASON_TIMEOUT: FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc\ndid not confirm before its expiry, or it confirmed too late for us to reveal\nour preimage and claim.\n - FAILURE_REASON_SWEEP_TIMEOUT: FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed\nbecause the on chain htlc wasn't swept before the server revoked the\nhtlc.\n - FAILURE_REASON_INSUFFICIENT_VALUE: FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed\nbecause the on chain htlc had a lower value than requested.\n - FAILURE_REASON_TEMPORARY: FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an\ninternal error. Manual intervention such as a restart is required.\n - FAILURE_REASON_INCORRECT_AMOUNT: FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed\nbecause the amount extended by an external loop in htlc is insufficient." + "description": " - FAILURE_REASON_NONE: FAILURE_REASON_NONE is set when the swap did not fail, it is either in\nprogress or succeeded.\n - FAILURE_REASON_OFFCHAIN: FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't\npossible to find a route for one or both off chain payments that met the fee\nand timelock limits required.\n - FAILURE_REASON_TIMEOUT: FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc\ndid not confirm before its expiry, or it confirmed too late for us to reveal\nour preimage and claim.\n - FAILURE_REASON_SWEEP_TIMEOUT: FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed\nbecause the on chain htlc wasn't swept before the server revoked the\nhtlc.\n - FAILURE_REASON_INSUFFICIENT_VALUE: FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed\nbecause the on chain htlc had a lower value than requested.\n - FAILURE_REASON_TEMPORARY: FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an\ninternal error. Manual intervention such as a restart is required.\n - FAILURE_REASON_INCORRECT_AMOUNT: FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed\nbecause the amount extended by an external loop in htlc is insufficient.\n - FAILURE_REASON_ABANDONED: FAILURE_REASON_ABANDONED indicates that a swap permanently failed because\nthe client manually abandoned the swap." }, "looprpcGetInfoResponse": { "type": "object", diff --git a/looprpc/client_grpc.pb.go b/looprpc/client_grpc.pb.go index 83272ff2b..09917de15 100644 --- a/looprpc/client_grpc.pb.go +++ b/looprpc/client_grpc.pb.go @@ -40,6 +40,9 @@ type SwapClientClient interface { // loop: `swapinfo` //SwapInfo returns all known details about a single swap. SwapInfo(ctx context.Context, in *SwapInfoRequest, opts ...grpc.CallOption) (*SwapStatus, error) + // loop: `abandonswap` + //AbandonSwap allows the client to abandon a swap. + AbandonSwap(ctx context.Context, in *AbandonSwapRequest, opts ...grpc.CallOption) (*AbandonSwapResponse, error) // loop: `terms` //LoopOutTerms returns the terms that the server enforces for a loop out swap. LoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*OutTermsResponse, error) @@ -158,6 +161,15 @@ func (c *swapClientClient) SwapInfo(ctx context.Context, in *SwapInfoRequest, op return out, nil } +func (c *swapClientClient) AbandonSwap(ctx context.Context, in *AbandonSwapRequest, opts ...grpc.CallOption) (*AbandonSwapResponse, error) { + out := new(AbandonSwapResponse) + err := c.cc.Invoke(ctx, "/looprpc.SwapClient/AbandonSwap", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *swapClientClient) LoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*OutTermsResponse, error) { out := new(OutTermsResponse) err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOutTerms", in, out, opts...) @@ -274,6 +286,9 @@ type SwapClientServer interface { // loop: `swapinfo` //SwapInfo returns all known details about a single swap. SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error) + // loop: `abandonswap` + //AbandonSwap allows the client to abandon a swap. + AbandonSwap(context.Context, *AbandonSwapRequest) (*AbandonSwapResponse, error) // loop: `terms` //LoopOutTerms returns the terms that the server enforces for a loop out swap. LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error) @@ -336,6 +351,9 @@ func (UnimplementedSwapClientServer) ListSwaps(context.Context, *ListSwapsReques func (UnimplementedSwapClientServer) SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method SwapInfo not implemented") } +func (UnimplementedSwapClientServer) AbandonSwap(context.Context, *AbandonSwapRequest) (*AbandonSwapResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AbandonSwap not implemented") +} func (UnimplementedSwapClientServer) LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LoopOutTerms not implemented") } @@ -472,6 +490,24 @@ func _SwapClient_SwapInfo_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _SwapClient_AbandonSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AbandonSwapRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SwapClientServer).AbandonSwap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/looprpc.SwapClient/AbandonSwap", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SwapClientServer).AbandonSwap(ctx, req.(*AbandonSwapRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _SwapClient_LoopOutTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TermsRequest) if err := dec(in); err != nil { @@ -675,6 +711,10 @@ var SwapClient_ServiceDesc = grpc.ServiceDesc{ MethodName: "SwapInfo", Handler: _SwapClient_SwapInfo_Handler, }, + { + MethodName: "AbandonSwap", + Handler: _SwapClient_AbandonSwap_Handler, + }, { MethodName: "LoopOutTerms", Handler: _SwapClient_LoopOutTerms_Handler, diff --git a/looprpc/debug.pb.go b/looprpc/debug.pb.go index 7be01ed06..fa69da2c0 100644 --- a/looprpc/debug.pb.go +++ b/looprpc/debug.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v3.6.1 // source: debug.proto diff --git a/looprpc/swapclient.pb.json.go b/looprpc/swapclient.pb.json.go index 93c85ee5d..44ecb1409 100644 --- a/looprpc/swapclient.pb.json.go +++ b/looprpc/swapclient.pb.json.go @@ -163,6 +163,31 @@ func RegisterSwapClientJSONCallbacks(registry map[string]func(ctx context.Contex callback(string(respBytes), nil) } + registry["looprpc.SwapClient.AbandonSwap"] = func(ctx context.Context, + conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { + + req := &AbandonSwapRequest{} + err := marshaler.Unmarshal([]byte(reqJSON), req) + if err != nil { + callback("", err) + return + } + + client := NewSwapClientClient(conn) + resp, err := client.AbandonSwap(ctx, req) + if err != nil { + callback("", err) + return + } + + respBytes, err := marshaler.Marshal(resp) + if err != nil { + callback("", err) + return + } + callback(string(respBytes), nil) + } + registry["looprpc.SwapClient.LoopOutTerms"] = func(ctx context.Context, conn *grpc.ClientConn, reqJSON string, callback func(string, error)) { diff --git a/swap/type.go b/swap/type.go index 02afdc317..20942c747 100644 --- a/swap/type.go +++ b/swap/type.go @@ -11,6 +11,12 @@ const ( TypeOut ) +// IsOut returns true if the swap is a loop out swap, false if it is a loop in +// swap. +func (t Type) IsOut() bool { + return t == TypeOut +} + func (t Type) String() string { switch t { case TypeIn: diff --git a/swapserverrpc/common.pb.go b/swapserverrpc/common.pb.go index 3b88ee304..a5452d220 100644 --- a/swapserverrpc/common.pb.go +++ b/swapserverrpc/common.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.6.1 // source: common.proto diff --git a/swapserverrpc/server.pb.go b/swapserverrpc/server.pb.go index d220abdd4..e539c9ff4 100644 --- a/swapserverrpc/server.pb.go +++ b/swapserverrpc/server.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.6.1 // source: server.proto @@ -541,7 +541,7 @@ type ServerLoopOutResponse struct { // The height at which the on-chain htlc will expire. Deprecated because the // field is already specified in the request. // - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. Expiry int32 `protobuf:"varint,4,opt,name=expiry,proto3" json:"expiry,omitempty"` // A human-readable message from the loop server. ServerMessage string `protobuf:"bytes,5,opt,name=server_message,json=serverMessage,proto3" json:"server_message,omitempty"` @@ -600,7 +600,7 @@ func (x *ServerLoopOutResponse) GetSenderKey() []byte { return nil } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopOutResponse) GetExpiry() int32 { if x != nil { return x.Expiry @@ -717,17 +717,17 @@ type ServerLoopOutQuote struct { SwapFee int64 `protobuf:"varint,2,opt,name=swap_fee,json=swapFee,proto3" json:"swap_fee,omitempty"` /// Deprecated, total swap fee given quote amt is calculated in swap_fee. // - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` PrepayAmt uint64 `protobuf:"varint,4,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"` - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. MinSwapAmount uint64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. MaxSwapAmount uint64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` // The server-proposed cltv delta of the on-chain htlc. Deprecated because // the field is already specified in the request. // - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. CltvDelta int32 `protobuf:"varint,7,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` } @@ -777,7 +777,7 @@ func (x *ServerLoopOutQuote) GetSwapFee() int64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopOutQuote) GetSwapFeeRate() int64 { if x != nil { return x.SwapFeeRate @@ -792,7 +792,7 @@ func (x *ServerLoopOutQuote) GetPrepayAmt() uint64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopOutQuote) GetMinSwapAmount() uint64 { if x != nil { return x.MinSwapAmount @@ -800,7 +800,7 @@ func (x *ServerLoopOutQuote) GetMinSwapAmount() uint64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopOutQuote) GetMaxSwapAmount() uint64 { if x != nil { return x.MaxSwapAmount @@ -808,7 +808,7 @@ func (x *ServerLoopOutQuote) GetMaxSwapAmount() uint64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopOutQuote) GetCltvDelta() int32 { if x != nil { return x.CltvDelta @@ -1249,11 +1249,11 @@ type ServerLoopInQuoteResponse struct { unknownFields protoimpl.UnknownFields SwapFee int64 `protobuf:"varint,1,opt,name=swap_fee,json=swapFee,proto3" json:"swap_fee,omitempty"` - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. SwapFeeRate int64 `protobuf:"varint,2,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. MinSwapAmount uint64 `protobuf:"varint,4,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` - // Deprecated: Do not use. + // Deprecated: Marked as deprecated in server.proto. MaxSwapAmount uint64 `protobuf:"varint,5,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` CltvDelta int32 `protobuf:"varint,6,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` } @@ -1297,7 +1297,7 @@ func (x *ServerLoopInQuoteResponse) GetSwapFee() int64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopInQuoteResponse) GetSwapFeeRate() int64 { if x != nil { return x.SwapFeeRate @@ -1305,7 +1305,7 @@ func (x *ServerLoopInQuoteResponse) GetSwapFeeRate() int64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopInQuoteResponse) GetMinSwapAmount() uint64 { if x != nil { return x.MinSwapAmount @@ -1313,7 +1313,7 @@ func (x *ServerLoopInQuoteResponse) GetMinSwapAmount() uint64 { return 0 } -// Deprecated: Do not use. +// Deprecated: Marked as deprecated in server.proto. func (x *ServerLoopInQuoteResponse) GetMaxSwapAmount() uint64 { if x != nil { return x.MaxSwapAmount diff --git a/testcontext_test.go b/testcontext_test.go index 2e4b99668..e465037dc 100644 --- a/testcontext_test.go +++ b/testcontext_test.go @@ -125,10 +125,7 @@ func createClientTestContext(t *testing.T, ctx.stop = stop go func() { - err := swapClient.Run( - runCtx, - statusChan, - ) + err := swapClient.Run(runCtx, statusChan) log.Errorf("client run: %v", err) ctx.runErr <- err }()