@@ -18,18 +18,10 @@ import (
18
18
"github.com/btcsuite/btcd/btcec/v2"
19
19
"github.com/btcsuite/btcd/btcutil"
20
20
"github.com/lightninglabs/faraday/frdrpc"
21
- faraday "github.com/lightninglabs/faraday/frdrpcserver/perms"
22
21
"github.com/lightninglabs/lightning-node-connect/mailbox"
23
- terminal "github.com/lightninglabs/lightning-terminal"
24
22
"github.com/lightninglabs/lightning-terminal/litrpc"
25
- "github.com/lightninglabs/lightning-terminal/perms"
26
- "github.com/lightninglabs/lightning-terminal/session"
27
- "github.com/lightninglabs/lightning-terminal/subservers"
28
- loop "github.com/lightninglabs/loop/loopd/perms"
29
23
"github.com/lightninglabs/loop/looprpc"
30
- pool "github.com/lightninglabs/pool/perms"
31
24
"github.com/lightninglabs/pool/poolrpc"
32
- tap "github.com/lightninglabs/taproot-assets/perms"
33
25
"github.com/lightninglabs/taproot-assets/taprpc"
34
26
"github.com/lightninglabs/taproot-assets/taprpc/universerpc"
35
27
"github.com/lightningnetwork/lnd/keychain"
@@ -1382,53 +1374,34 @@ func connectRPC(ctx context.Context, hostPort,
1382
1374
}
1383
1375
1384
1376
func bakeSuperMacaroon (t * testing.T , cfg * LitNodeConfig , readOnly bool ) string {
1385
- lndAdminMac := lndMacaroonFn (cfg )
1377
+ litMac := litMacaroonFn (cfg )
1386
1378
1387
1379
ctxb := context .Background ()
1388
1380
ctxt , cancel := context .WithTimeout (ctxb , defaultTimeout )
1389
1381
defer cancel ()
1390
1382
1391
- rawConn , err := connectRPC (ctxt , cfg .RPCAddr (), cfg .TLSCertPath )
1383
+ rawConn , err := connectRPC (ctxt , cfg .LitAddr (), cfg .LitTLSCertPath )
1392
1384
require .NoError (t , err )
1393
1385
1394
1386
defer rawConn .Close ()
1395
1387
1396
- lndAdminMacBytes , err := os .ReadFile (lndAdminMac )
1388
+ litMacBytes , err := os .ReadFile (litMac )
1397
1389
require .NoError (t , err )
1398
1390
1399
- lndAdminCtx := macaroonContext (ctxt , lndAdminMacBytes )
1400
- lndConn := lnrpc . NewLightningClient (rawConn )
1391
+ litMacCtx := macaroonContext (ctxt , litMacBytes )
1392
+ litConn := litrpc . NewProxyClient (rawConn )
1401
1393
1402
- permsMgr , err := perms .NewManager (false )
1403
- require .NoError (t , err )
1404
-
1405
- permsMgr .RegisterSubServer (
1406
- subservers .LOOP , loop .RequiredPermissions , nil ,
1407
- )
1408
- permsMgr .RegisterSubServer (
1409
- subservers .POOL , pool .RequiredPermissions , nil ,
1410
- )
1411
- permsMgr .RegisterSubServer (
1412
- subservers .TAP , tap .RequiredPermissions , nil ,
1413
- )
1414
- permsMgr .RegisterSubServer (
1415
- subservers .FARADAY , faraday .RequiredPermissions , nil ,
1416
- )
1417
- permsMgr .RegisterSubServer (
1418
- subservers .TAP , tap .RequiredPermissions , nil ,
1419
- )
1420
-
1421
- superMacPermissions := permsMgr .ActivePermissions (readOnly )
1422
- nullID := [4 ]byte {}
1423
- superMacHex , err := terminal .BakeSuperMacaroon (
1424
- lndAdminCtx , lndConn , session .NewSuperMacaroonRootKeyID (nullID ),
1425
- superMacPermissions , nil ,
1394
+ bakeMacResp , err := litConn .BakeSuperMacaroon (
1395
+ litMacCtx , & litrpc.BakeSuperMacaroonRequest {
1396
+ RootKeyIdSuffix : 0 ,
1397
+ ReadOnly : readOnly ,
1398
+ },
1426
1399
)
1427
1400
require .NoError (t , err )
1428
1401
1429
1402
// The BakeSuperMacaroon function just hex encoded the macaroon, we know
1430
1403
// it's valid.
1431
- superMacBytes , _ := hex .DecodeString (superMacHex )
1404
+ superMacBytes , _ := hex .DecodeString (bakeMacResp . Macaroon )
1432
1405
1433
1406
tempDir := t .TempDir ()
1434
1407
tempFile , err := os .CreateTemp (tempDir , "lit-super-macaroon" )
0 commit comments