mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
macaroons: fix incorrect comparison in isRegistered, wrap long lines
This commit is contained in:
committed by
Oliver Gugger
parent
3eff9804ee
commit
f22b0ccdbc
@@ -97,7 +97,7 @@ func TestNewService(t *testing.T) {
|
||||
// TestValidateMacaroon tests the validation of a macaroon that is in an
|
||||
// incoming context.
|
||||
func TestValidateMacaroon(t *testing.T) {
|
||||
// First, initialize the service and unlock it
|
||||
// First, initialize the service and unlock it.
|
||||
tempDir := setupTestRootKeyStorage(t)
|
||||
defer os.RemoveAll(tempDir)
|
||||
service, err := macaroons.NewService(tempDir, macaroons.IPLockChecker)
|
||||
@@ -123,7 +123,9 @@ func TestValidateMacaroon(t *testing.T) {
|
||||
|
||||
// Because the macaroons are always passed in a context, we need to
|
||||
// mock one that has just the serialized macaroon as a value.
|
||||
md := metadata.New(map[string]string{"macaroon": hex.EncodeToString(macaroonBinary)})
|
||||
md := metadata.New(map[string]string{
|
||||
"macaroon": hex.EncodeToString(macaroonBinary),
|
||||
})
|
||||
mockContext := metadata.NewIncomingContext(context.Background(), md)
|
||||
|
||||
// Finally, validate the macaroon against the required permissions.
|
||||
|
Reference in New Issue
Block a user