Skip to content

multi: replace occurrences of "LSAT" to "L402" #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var (

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

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

// MaxLsatCost is the maximum price we are willing to pay to the server
// MaxL402Cost is the maximum price we are willing to pay to the server
// for the token.
MaxLsatCost btcutil.Amount
MaxL402Cost btcutil.Amount

// MaxLsatFee is the maximum that we are willing to pay in routing fees
// MaxL402Fee is the maximum that we are willing to pay in routing fees
// to obtain the token.
MaxLsatFee btcutil.Amount
MaxL402Fee btcutil.Amount

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

lsatStore, err := l402.NewFileStore(dbDir)
l402Store, err := l402.NewFileStore(dbDir)
if err != nil {
return nil, nil, err
}

swapServerClient, err := newSwapServerClient(cfg, lsatStore)
swapServerClient, err := newSwapServerClient(cfg, l402Store)
if err != nil {
return nil, nil, err
}
Expand All @@ -153,7 +153,7 @@ func NewClient(dbDir string, loopDB loopdb.SwapStore,
Server: swapServerClient,
Store: loopDB,
Conn: swapServerClient.conn,
LsatStore: lsatStore,
L402Store: l402Store,
CreateExpiryTimer: func(d time.Duration) <-chan time.Time {
return time.NewTimer(d).C
},
Expand Down
6 changes: 3 additions & 3 deletions cmd/loop/lsat.go → cmd/loop/l402.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ type printableToken struct {

var listAuthCommand = cli.Command{
Name: "listauth",
Usage: "list all LSAT tokens",
Description: "Shows a list of all LSAT tokens that loopd has paid for",
Usage: "list all L402 tokens",
Description: "Shows a list of all L402 tokens that loopd has paid for",
Action: listAuth,
}

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

resp, err := client.GetLsatTokens(
resp, err := client.GetL402Tokens(
context.Background(), &looprpc.TokensRequest{},
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type clientConfig struct {
Server swapServerClient
Conn *grpc.ClientConn
Store loopdb.SwapStore
LsatStore l402.Store
L402Store l402.Store
CreateExpiryTimer func(expiry time.Duration) <-chan time.Time
LoopOutMaxParts uint32
}
2 changes: 1 addition & 1 deletion instantout/reservation/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (m *Manager) fetchL402(ctx context.Context) {
func (m *Manager) RegisterReservationNotifications(
reservationChan chan *reservationrpc.ServerReservationNotification) error {

// In order to create a valid lsat we first are going to call
// In order to create a valid l402 we first are going to call
// the FetchL402 method. As a client might not have outbound capacity
// yet, we'll retry until we get a valid response.
if !m.hasL402 {
Expand Down
8 changes: 4 additions & 4 deletions loopd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ type Config struct {
MaxLogFileSize int `long:"maxlogfilesize" description:"Maximum logfile size in MB."`

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"`
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."`
MaxLSATFee uint32 `long:"maxlsatfee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an LSAT token."`
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."`
MaxL402Fee uint32 `long:"maxl402fee" description:"Maximum routing fee in satoshis that we are willing to pay while paying for an L402 token."`

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

Expand Down Expand Up @@ -206,8 +206,8 @@ func DefaultConfig() Config {
TLSKeyPath: DefaultTLSKeyPath,
TLSValidity: DefaultAutogenValidity,
MacaroonPath: DefaultMacaroonPath,
MaxLSATCost: l402.DefaultMaxCostSats,
MaxLSATFee: l402.DefaultMaxRoutingFeeSats,
MaxL402Cost: l402.DefaultMaxCostSats,
MaxL402Fee: l402.DefaultMaxRoutingFeeSats,
LoopOutMaxParts: defaultLoopOutMaxParts,
TotalPaymentTimeout: defaultTotalPaymentTimeout,
MaxPaymentRetries: defaultMaxPaymentRetries,
Expand Down
2 changes: 1 addition & 1 deletion loopd/perms/perms.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var RequiredPermissions = map[string][]bakery.Op{
Entity: "loop",
Action: "in",
}},
"/looprpc.SwapClient/GetLsatTokens": {{
"/looprpc.SwapClient/GetL402Tokens": {{
Entity: "auth",
Action: "read",
}},
Expand Down
12 changes: 6 additions & 6 deletions loopd/swapclient_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,18 +920,18 @@ func (s *swapClientServer) LoopIn(ctx context.Context,
return response, nil
}

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

log.Infof("Get LSAT tokens request received")
log.Infof("Get L402 tokens request received")

tokens, err := s.impl.LsatStore.AllTokens()
tokens, err := s.impl.L402Store.AllTokens()
if err != nil {
return nil, err
}

rpcTokens := make([]*clientrpc.LsatToken, len(tokens))
rpcTokens := make([]*clientrpc.L402Token, len(tokens))
idx := 0
for key, token := range tokens {
macBytes, err := token.BaseMacaroon().MarshalBinary()
Expand All @@ -945,7 +945,7 @@ func (s *swapClientServer) GetLsatTokens(ctx context.Context,
if err != nil {
return nil, err
}
rpcTokens[idx] = &clientrpc.LsatToken{
rpcTokens[idx] = &clientrpc.L402Token{
BaseMacaroon: macBytes,
PaymentHash: token.PaymentHash[:],
PaymentPreimage: token.Preimage[:],
Expand Down
4 changes: 2 additions & 2 deletions loopd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func getClient(cfg *Config, swapDb loopdb.SwapStore,
SwapServerNoTLS: cfg.Server.NoTLS,
TLSPathServer: cfg.Server.TLSPath,
Lnd: lnd,
MaxLsatCost: btcutil.Amount(cfg.MaxLSATCost),
MaxLsatFee: btcutil.Amount(cfg.MaxLSATFee),
MaxL402Cost: btcutil.Amount(cfg.MaxL402Cost),
MaxL402Fee: btcutil.Amount(cfg.MaxL402Fee),
LoopOutMaxParts: cfg.LoopOutMaxParts,
TotalPaymentTimeout: cfg.TotalPaymentTimeout,
MaxPaymentRetries: cfg.MaxPaymentRetries,
Expand Down
54 changes: 27 additions & 27 deletions looprpc/client.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading