Skip to content

Commit dd21649

Browse files
committed
perms: move perms.go into looprpc
Currently, the Lightning Node Connect WASM client imports looprpc and the entire loop module to access perms.go. This causes issues because loop imports taproot-assets, leading to too many symbols for the WASM build. To resolve this, we move perms.go—related to RPC endpoints—into looprpc. Looprpc then becomes the only module imported by the LNC WASM client, allowing the rest of loop to import taproot-assets freely.
1 parent 7e81916 commit dd21649

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

loopd/daemon.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"github.com/lightninglabs/loop/assets"
1919
"github.com/lightninglabs/loop/instantout"
2020
"github.com/lightninglabs/loop/instantout/reservation"
21-
"github.com/lightninglabs/loop/loopd/perms"
2221
"github.com/lightninglabs/loop/loopdb"
2322
loop_looprpc "github.com/lightninglabs/loop/looprpc"
2423
"github.com/lightninglabs/loop/notifications"
@@ -502,7 +501,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
502501
// Add our debug permissions to our main set of required permissions
503502
// if compiled in.
504503
for endpoint, perm := range debugRequiredPermissions {
505-
perms.RequiredPermissions[endpoint] = perm
504+
loop_looprpc.RequiredPermissions[endpoint] = perm
506505
}
507506

508507
rks, db, err := lndclient.NewBoltMacaroonStore(
@@ -530,7 +529,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
530529
Checkers: []macaroons.Checker{
531530
macaroons.IPLockChecker,
532531
},
533-
RequiredPerms: perms.RequiredPermissions,
532+
RequiredPerms: loop_looprpc.RequiredPermissions,
534533
DBPassword: macDbDefaultPw,
535534
LndClient: &d.lnd.LndServices,
536535
EphemeralKey: lndclient.SharedKeyNUMS,

loopd/perms/perms.go renamed to looprpc/perms.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package perms
1+
package looprpc
22

33
import "gopkg.in/macaroon-bakery.v2/bakery"
44

0 commit comments

Comments
 (0)