@@ -125,6 +125,29 @@ describe('redelegatePermissionContext', () => {
125125 expect ( result . delegation . caveats ) . to . deep . include ( timestampCaveat ) ;
126126 } ) ;
127127
128+ it ( 'should sign successfully when inheriting from parent without scope or caveats' , async ( ) => {
129+ const permissionContext = buildRootPermissionContext ( ) ;
130+ const newDelegate : Address = '0x2000000000000000000000000000000000000002' ;
131+
132+ const result = await redelegatePermissionContext ( client , {
133+ environment : mockEnvironment ,
134+ permissionContext,
135+ chainId : mockChainId ,
136+ to : newDelegate ,
137+ // No scope and no caveats - should inherit entirely from parent
138+ // and still produce a valid signature.
139+ } ) ;
140+
141+ expect ( result . delegation . delegate ) . to . equal ( newDelegate ) ;
142+ expect ( result . delegation . delegator ) . to . equal ( account . address ) ;
143+ expect ( result . delegation . caveats ) . to . deep . equal ( [ ] ) ;
144+ expect ( result . delegation . signature ) . to . match ( / ^ 0 x [ a - f A - F 0 - 9 ] + $ / u) ;
145+ expect ( result . permissionContext ) . to . match ( / ^ 0 x [ a - f A - F 0 - 9 ] + $ / u) ;
146+ expect ( result . permissionContext . length ) . to . be . greaterThan (
147+ permissionContext . length ,
148+ ) ;
149+ } ) ;
150+
128151 it ( 'should allow scope override even with parent' , async ( ) => {
129152 const permissionContext = buildRootPermissionContext ( ) ;
130153 const newDelegate : Address = '0x2000000000000000000000000000000000000002' ;
@@ -256,6 +279,25 @@ describe('redelegatePermissionContextOpen', () => {
256279 expect ( result . delegation . caveats ) . to . deep . include ( timestampCaveat ) ;
257280 } ) ;
258281
282+ it ( 'should sign successfully when inheriting from parent without scope or caveats' , async ( ) => {
283+ const permissionContext = buildRootPermissionContext ( ) ;
284+
285+ const result = await redelegatePermissionContextOpen ( client , {
286+ environment : mockEnvironment ,
287+ permissionContext,
288+ chainId : mockChainId ,
289+ // No scope and no caveats - should inherit entirely from parent
290+ // and still produce a valid signature.
291+ } ) ;
292+
293+ expect ( result . delegation . delegate ) . to . equal (
294+ '0x0000000000000000000000000000000000000a11' , // ANY_BENEFICIARY
295+ ) ;
296+ expect ( result . delegation . delegator ) . to . equal ( account . address ) ;
297+ expect ( result . delegation . caveats ) . to . deep . equal ( [ ] ) ;
298+ expect ( result . delegation . signature ) . to . match ( / ^ 0 x [ a - f A - F 0 - 9 ] + $ / u) ;
299+ } ) ;
300+
259301 it ( 'should allow scope override on an open redelegation' , async ( ) => {
260302 const permissionContext = buildRootPermissionContext ( ) ;
261303
0 commit comments