Skip to content

Commit 87adb57

Browse files
committed
multi: replace LSAT with L402
git mv ./cmd/loop/lsat.go ./cmd/loop/l402.go sed 's@lsat@l402@g' -i `git grep -l lsat` sed 's@Lsat@L402@g' -i `git grep -l Lsat` sed 's@LSAT@L402@g' -i `git grep -l LSAT` make rpc Updated release_notes.md.
1 parent a09d520 commit 87adb57

18 files changed

+174
-166
lines changed

client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var (
5656

5757
// globalCallTimeout is the maximum time any call of the client to the
5858
// server is allowed to take, including the time it may take to get
59-
// and pay for an LSAT token.
59+
// and pay for an L402 token.
6060
globalCallTimeout = serverRPCTimeout + l402.PaymentTimeout
6161

6262
// probeTimeout is the maximum time until a probe is allowed to take.
@@ -111,13 +111,13 @@ type ClientConfig struct {
111111
// Lnd is an instance of the lnd proxy.
112112
Lnd *lndclient.LndServices
113113

114-
// MaxLsatCost is the maximum price we are willing to pay to the server
114+
// MaxL402Cost is the maximum price we are willing to pay to the server
115115
// for the token.
116-
MaxLsatCost btcutil.Amount
116+
MaxL402Cost btcutil.Amount
117117

118-
// MaxLsatFee is the maximum that we are willing to pay in routing fees
118+
// MaxL402Fee is the maximum that we are willing to pay in routing fees
119119
// to obtain the token.
120-
MaxLsatFee btcutil.Amount
120+
MaxL402Fee btcutil.Amount
121121

122122
// LoopOutMaxParts defines the maximum number of parts that may be used
123123
// for a loop out swap. When greater than one, a multi-part payment may
@@ -138,12 +138,12 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore,
138138
sweeperDb sweepbatcher.BatcherStore, cfg *ClientConfig) (
139139
*Client, func(), error) {
140140

141-
lsatStore, err := l402.NewFileStore(dbDir)
141+
l402Store, err := l402.NewFileStore(dbDir)
142142
if err != nil {
143143
return nil, nil, err
144144
}
145145

146-
swapServerClient, err := newSwapServerClient(cfg, lsatStore)
146+
swapServerClient, err := newSwapServerClient(cfg, l402Store)
147147
if err != nil {
148148
return nil, nil, err
149149
}
@@ -153,7 +153,7 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore,
153153
Server: swapServerClient,
154154
Store: loopDB,
155155
Conn: swapServerClient.conn,
156-
LsatStore: lsatStore,
156+
L402Store: l402Store,
157157
CreateExpiryTimer: func(d time.Duration) <-chan time.Time {
158158
return time.NewTimer(d).C
159159
},

cmd/loop/lsat.go renamed to cmd/loop/l402.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type printableToken struct {
2626

2727
var listAuthCommand = cli.Command{
2828
Name: "listauth",
29-
Usage: "list all LSAT tokens",
30-
Description: "Shows a list of all LSAT tokens that loopd has paid for",
29+
Usage: "list all L402 tokens",
30+
Description: "Shows a list of all L402 tokens that loopd has paid for",
3131
Action: listAuth,
3232
}
3333

@@ -38,7 +38,7 @@ func listAuth(ctx *cli.Context) error {
3838
}
3939
defer cleanup()
4040

41-
resp, err := client.GetLsatTokens(
41+
resp, err := client.GetL402Tokens(
4242
context.Background(), &looprpc.TokensRequest{},
4343
)
4444
if err != nil {

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type clientConfig struct {
1515
Server swapServerClient
1616
Conn *grpc.ClientConn
1717
Store loopdb.SwapStore
18-
LsatStore l402.Store
18+
L402Store l402.Store
1919
CreateExpiryTimer func(expiry time.Duration) <-chan time.Time
2020
LoopOutMaxParts uint32
2121
}

instantout/reservation/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (m *Manager) fetchL402(ctx context.Context) {
185185
func (m *Manager) RegisterReservationNotifications(
186186
reservationChan chan *reservationrpc.ServerReservationNotification) error {
187187

188-
// In order to create a valid lsat we first are going to call
188+
// In order to create a valid l402 we first are going to call
189189
// the FetchL402 method. As a client might not have outbound capacity
190190
// yet, we'll retry until we get a valid response.
191191
if !m.hasL402 {

loopd/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ type Config struct {
160160
MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB."`
161161

162162
DebugLevel string `long:"debuglevel" description:"Logging level for all subsystems {trace, debug, info, warn, error, critical} -- You may also specify <subsystem>=<level>,<subsystem2>=<level>,... to set the log level for individual subsystems -- Use show to list available subsystems"`
163-
MaxLSATCost uint32 `long:"maxlsatcost" description:"Maximum cost in satoshis that loopd is going to pay for an LSAT token automatically. Does not include routing fees."`
164-
MaxLSATFee uint32 `long:"maxlsatfee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an LSAT token."`
163+
MaxL402Cost uint32 `long:"maxl402cost" description:"Maximum cost in satoshis that loopd is going to pay for an L402 token automatically. Does not include routing fees."`
164+
MaxL402Fee uint32 `long:"maxl402fee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an L402 token."`
165165

166166
LoopOutMaxParts uint32 `long:"loopoutmaxparts" description:"The maximum number of payment parts that may be used for a loop out swap."`
167167

@@ -206,8 +206,8 @@ func DefaultConfig() Config {
206206
TLSKeyPath: DefaultTLSKeyPath,
207207
TLSValidity: DefaultAutogenValidity,
208208
MacaroonPath: DefaultMacaroonPath,
209-
MaxLSATCost: l402.DefaultMaxCostSats,
210-
MaxLSATFee: l402.DefaultMaxRoutingFeeSats,
209+
MaxL402Cost: l402.DefaultMaxCostSats,
210+
MaxL402Fee: l402.DefaultMaxRoutingFeeSats,
211211
LoopOutMaxParts: defaultLoopOutMaxParts,
212212
TotalPaymentTimeout: defaultTotalPaymentTimeout,
213213
MaxPaymentRetries: defaultMaxPaymentRetries,

loopd/perms/perms.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var RequiredPermissions = map[string][]bakery.Op{
6969
Entity: "loop",
7070
Action: "in",
7171
}},
72-
"/looprpc.SwapClient/GetLsatTokens": {{
72+
"/looprpc.SwapClient/GetL402Tokens": {{
7373
Entity: "auth",
7474
Action: "read",
7575
}},

loopd/swapclient_server.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -920,18 +920,18 @@ func (s *swapClientServer) LoopIn(ctx context.Context,
920920
return response, nil
921921
}
922922

923-
// GetLsatTokens returns all tokens that are contained in the LSAT token store.
924-
func (s *swapClientServer) GetLsatTokens(ctx context.Context,
923+
// GetL402Tokens returns all tokens that are contained in the L402 token store.
924+
func (s *swapClientServer) GetL402Tokens(ctx context.Context,
925925
_ *clientrpc.TokensRequest) (*clientrpc.TokensResponse, error) {
926926

927-
log.Infof("Get LSAT tokens request received")
927+
log.Infof("Get L402 tokens request received")
928928

929-
tokens, err := s.impl.LsatStore.AllTokens()
929+
tokens, err := s.impl.L402Store.AllTokens()
930930
if err != nil {
931931
return nil, err
932932
}
933933

934-
rpcTokens := make([]*clientrpc.LsatToken, len(tokens))
934+
rpcTokens := make([]*clientrpc.L402Token, len(tokens))
935935
idx := 0
936936
for key, token := range tokens {
937937
macBytes, err := token.BaseMacaroon().MarshalBinary()
@@ -945,7 +945,7 @@ func (s *swapClientServer) GetLsatTokens(ctx context.Context,
945945
if err != nil {
946946
return nil, err
947947
}
948-
rpcTokens[idx] = &clientrpc.LsatToken{
948+
rpcTokens[idx] = &clientrpc.L402Token{
949949
BaseMacaroon: macBytes,
950950
PaymentHash: token.PaymentHash[:],
951951
PaymentPreimage: token.Preimage[:],

loopd/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ func getClient(cfg *Config, swapDb loopdb.SwapStore,
2727
SwapServerNoTLS: cfg.Server.NoTLS,
2828
TLSPathServer: cfg.Server.TLSPath,
2929
Lnd: lnd,
30-
MaxLsatCost: btcutil.Amount(cfg.MaxLSATCost),
31-
MaxLsatFee: btcutil.Amount(cfg.MaxLSATFee),
30+
MaxL402Cost: btcutil.Amount(cfg.MaxL402Cost),
31+
MaxL402Fee: btcutil.Amount(cfg.MaxL402Fee),
3232
LoopOutMaxParts: cfg.LoopOutMaxParts,
3333
TotalPaymentTimeout: cfg.TotalPaymentTimeout,
3434
MaxPaymentRetries: cfg.MaxPaymentRetries,

looprpc/client.pb.go

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)