@@ -60,12 +60,12 @@ describe('isValid7702Implementation', () => {
6060
6161 it ( 'should return true when delegation code uses different case but matches implementation' , async ( ) => {
6262 const testAddress = '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd' ;
63- const delegationCode = '0xef01004000000000000000000000000000000000000000 ' ;
63+ const delegationCode = '0xef0100abcdef1234567890abcdef1234567890abcdef00 ' ;
6464 mockGetCode . mockResolvedValue ( delegationCode ) ;
6565
66- // Update environment with uppercase address
66+ // Update environment with uppercase address to test case insensitivity
6767 mockEnvironment . implementations . EIP7702StatelessDeleGatorImpl =
68- '0x4000000000000000000000000000000000000000 ' ;
68+ '0xABCDEF1234567890ABCDEF1234567890ABCDEF00 ' ;
6969
7070 const result = await isValid7702Implementation ( {
7171 client : publicClient ,
@@ -75,6 +75,21 @@ describe('isValid7702Implementation', () => {
7575
7676 expect ( result ) . toBe ( true ) ;
7777 } ) ;
78+
79+ it ( 'should return false when delegation prefix uses different case (case-sensitive prefix)' , async ( ) => {
80+ const testAddress = '0xdddddddddddddddddddddddddddddddddddddddd' ;
81+ // Use uppercase delegation prefix - this should fail because startsWith is case-sensitive
82+ const delegationCode = '0xEF01004000000000000000000000000000000000000000' ;
83+ mockGetCode . mockResolvedValue ( delegationCode ) ;
84+
85+ const result = await isValid7702Implementation ( {
86+ client : publicClient ,
87+ accountAddress : testAddress ,
88+ environment : mockEnvironment ,
89+ } ) ;
90+
91+ expect ( result ) . toBe ( false ) ;
92+ } ) ;
7893 } ) ;
7994
8095 describe ( 'Failure Cases' , ( ) => {
0 commit comments