mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
macaroons: remember stateless init
To make sure no macaroons are created anywhere if the stateless initialization was requested, we keep the requested initialization mode in the memory of the macaroon service.
This commit is contained in:
@@ -67,7 +67,7 @@ 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, "lnd", macaroons.IPLockChecker,
|
||||
tempDir, "lnd", false, macaroons.IPLockChecker,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating new service: %v", err)
|
||||
@@ -118,7 +118,7 @@ func TestValidateMacaroon(t *testing.T) {
|
||||
tempDir := setupTestRootKeyStorage(t)
|
||||
defer os.RemoveAll(tempDir)
|
||||
service, err := macaroons.NewService(
|
||||
tempDir, "lnd", macaroons.IPLockChecker,
|
||||
tempDir, "lnd", false, macaroons.IPLockChecker,
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating new service: %v", err)
|
||||
@@ -178,7 +178,7 @@ 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, "lnd", macaroons.IPLockChecker,
|
||||
tempDir, "lnd", false, macaroons.IPLockChecker,
|
||||
)
|
||||
require.NoError(t, err, "Error creating new service")
|
||||
defer service.Close()
|
||||
@@ -210,7 +210,7 @@ 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, "lnd", macaroons.IPLockChecker,
|
||||
tempDir, "lnd", false, macaroons.IPLockChecker,
|
||||
)
|
||||
require.NoError(t, err, "Error creating new service")
|
||||
defer service.Close()
|
||||
|
Reference in New Issue
Block a user