mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 17:47:01 +02:00
lnd+macaroons: specify location when creating macaroon service
To allow the macaroon service to be used in other projects, we want the location to be passed in as a parameter instead of being hard coded.
This commit is contained in:
@@ -66,7 +66,9 @@ func TestNewService(t *testing.T) {
|
||||
|
||||
// Second, create the new service instance, unlock it and pass in a
|
||||
// checker that we expect it to add to the bakery.
|
||||
service, err := macaroons.NewService(tempDir, macaroons.IPLockChecker)
|
||||
service, err := macaroons.NewService(
|
||||
tempDir, "lnd", macaroons.IPLockChecker,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating new service: %v", err)
|
||||
}
|
||||
@@ -115,7 +117,9 @@ func TestValidateMacaroon(t *testing.T) {
|
||||
// First, initialize the service and unlock it.
|
||||
tempDir := setupTestRootKeyStorage(t)
|
||||
defer os.RemoveAll(tempDir)
|
||||
service, err := macaroons.NewService(tempDir, macaroons.IPLockChecker)
|
||||
service, err := macaroons.NewService(
|
||||
tempDir, "lnd", macaroons.IPLockChecker,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating new service: %v", err)
|
||||
}
|
||||
@@ -173,7 +177,9 @@ func TestListMacaroonIDs(t *testing.T) {
|
||||
|
||||
// Second, create the new service instance, unlock it and pass in a
|
||||
// checker that we expect it to add to the bakery.
|
||||
service, err := macaroons.NewService(tempDir, macaroons.IPLockChecker)
|
||||
service, err := macaroons.NewService(
|
||||
tempDir, "lnd", macaroons.IPLockChecker,
|
||||
)
|
||||
require.NoError(t, err, "Error creating new service")
|
||||
defer service.Close()
|
||||
|
||||
@@ -203,7 +209,9 @@ func TestDeleteMacaroonID(t *testing.T) {
|
||||
|
||||
// Second, create the new service instance, unlock it and pass in a
|
||||
// checker that we expect it to add to the bakery.
|
||||
service, err := macaroons.NewService(tempDir, macaroons.IPLockChecker)
|
||||
service, err := macaroons.NewService(
|
||||
tempDir, "lnd", macaroons.IPLockChecker,
|
||||
)
|
||||
require.NoError(t, err, "Error creating new service")
|
||||
defer service.Close()
|
||||
|
||||
|
Reference in New Issue
Block a user