Skip to content

Commit 201a900

Browse files
committed
perms: move perms.go into looprpc
The Lightning Node Connect (LNC) WASM client currently imports both `looprpc` and the entire `loop` module to access `perms.go`. This creates problems because `loop` imports `taproot-assets`, resulting in too many symbols for the WASM build. To fix this, we will move `perms.go`—which defines RPC endpoint permissions—into `looprpc`. After this change, the LNC WASM client will import only `looprpc`, while the rest of `loop` can continue importing `taproot-assets` without affecting the LNC WASM build.
1 parent 7e81916 commit 201a900

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

loopd/daemon.go

+2-3
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

+1-1
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)