@@ -66,7 +66,6 @@ func TestActionStorage(t *testing.T) {
6666 action1Req := & AddActionReq {
6767 SessionID : fn .Some (sess1 .ID ),
6868 AccountID : fn .Some (acct1 .ID ),
69- MacaroonIdentifier : fn .Some ([4 ]byte (sess1 .ID )),
7069 MacaroonRootKeyID : fn .Some (sess1RootKeyID ),
7170 ActorName : "Autopilot" ,
7271 FeatureName : "auto-fees" ,
@@ -86,15 +85,14 @@ func TestActionStorage(t *testing.T) {
8685 sess2RootKeyID := litmac .NewSuperMacaroonRootKeyID (sess2 .ID )
8786
8887 action2Req := & AddActionReq {
89- SessionID : fn .Some (sess2 .ID ),
90- MacaroonIdentifier : fn .Some ([4 ]byte (sess2 .ID )),
91- MacaroonRootKeyID : fn .Some (sess2RootKeyID ),
92- ActorName : "Autopilot" ,
93- FeatureName : "rebalancer" ,
94- Trigger : "channels not balanced" ,
95- Intent : "balance" ,
96- RPCMethod : "SendToRoute" ,
97- RPCParamsJson : []byte ("hops, amount" ),
88+ SessionID : fn .Some (sess2 .ID ),
89+ MacaroonRootKeyID : fn .Some (sess2RootKeyID ),
90+ ActorName : "Autopilot" ,
91+ FeatureName : "rebalancer" ,
92+ Trigger : "channels not balanced" ,
93+ Intent : "balance" ,
94+ RPCMethod : "SendToRoute" ,
95+ RPCParamsJson : []byte ("hops, amount" ),
9896 }
9997
10098 action2 := & Action {
@@ -223,7 +221,6 @@ func TestListActions(t *testing.T) {
223221 sessRootKeyID := litmac .NewSuperMacaroonRootKeyID (sessionID )
224222
225223 actionReq := & AddActionReq {
226- MacaroonIdentifier : fn .Some (sessionID ),
227224 MacaroonRootKeyID : fn .Some (sessRootKeyID ),
228225 ActorName : "Autopilot" ,
229226 FeatureName : fmt .Sprintf ("%d" , actionIds ),
@@ -246,11 +243,13 @@ func TestListActions(t *testing.T) {
246243 assertActions := func (dbActions []* Action , al []* action ) {
247244 require .Len (t , dbActions , len (al ))
248245 for i , a := range al {
249- mID , err := dbActions [i ].MacaroonIdentifier .UnwrapOrErr (
250- fmt .Errorf ("macaroon identifier is none" ),
246+ rID , err := dbActions [i ].MacaroonRootKeyID .UnwrapOrErr (
247+ fmt .Errorf ("macaroon root key is none" ),
251248 )
252249 require .NoError (t , err )
253- require .EqualValues (t , a .sessionID , mID )
250+ require .EqualValues (
251+ t , a .sessionID , session .IDFromMacRootKeyID (rID ),
252+ )
254253 require .Equal (t , a .actionID , dbActions [i ].FeatureName )
255254 }
256255 }
@@ -438,7 +437,6 @@ func TestListGroupActions(t *testing.T) {
438437
439438 action1Req := & AddActionReq {
440439 SessionID : fn .Some (sess1 .ID ),
441- MacaroonIdentifier : fn .Some ([4 ]byte (sess1 .ID )),
442440 MacaroonRootKeyID : fn .Some (sess1RootKeyID ),
443441 ActorName : "Autopilot" ,
444442 FeatureName : "auto-fees" ,
@@ -458,15 +456,14 @@ func TestListGroupActions(t *testing.T) {
458456 sess2RootKeyID := litmac .NewSuperMacaroonRootKeyID (sess2 .ID )
459457
460458 action2Req := & AddActionReq {
461- SessionID : fn .Some (sess2 .ID ),
462- MacaroonIdentifier : fn .Some ([4 ]byte (sess2 .ID )),
463- MacaroonRootKeyID : fn .Some (sess2RootKeyID ),
464- ActorName : "Autopilot" ,
465- FeatureName : "rebalancer" ,
466- Trigger : "channels not balanced" ,
467- Intent : "balance" ,
468- RPCMethod : "SendToRoute" ,
469- RPCParamsJson : []byte ("hops, amount" ),
459+ SessionID : fn .Some (sess2 .ID ),
460+ MacaroonRootKeyID : fn .Some (sess2RootKeyID ),
461+ ActorName : "Autopilot" ,
462+ FeatureName : "rebalancer" ,
463+ Trigger : "channels not balanced" ,
464+ Intent : "balance" ,
465+ RPCMethod : "SendToRoute" ,
466+ RPCParamsJson : []byte ("hops, amount" ),
470467 }
471468
472469 action2 := & Action {
0 commit comments