@@ -384,14 +384,6 @@ describe('Batch Utils', () => {
384
384
) ;
385
385
} ) ;
386
386
387
- it ( 'throws if chain not supported' , async ( ) => {
388
- doesChainSupportEIP7702Mock . mockReturnValueOnce ( false ) ;
389
-
390
- await expect ( addTransactionBatch ( request ) ) . rejects . toThrow (
391
- rpcErrors . internal ( 'Chain does not support EIP-7702' ) ,
392
- ) ;
393
- } ) ;
394
-
395
387
it ( 'throws if no public key' , async ( ) => {
396
388
doesChainSupportEIP7702Mock . mockReturnValueOnce ( true ) ;
397
389
@@ -570,6 +562,10 @@ describe('Batch Utils', () => {
570
562
} ) ;
571
563
572
564
describe ( 'with publish batch hook' , ( ) => {
565
+ beforeEach ( ( ) => {
566
+ doesChainSupportEIP7702Mock . mockReturnValueOnce ( false ) ;
567
+ } ) ;
568
+
573
569
it ( 'adds each nested transaction' , async ( ) => {
574
570
const publishBatchHook = jest . fn ( ) ;
575
571
@@ -581,7 +577,7 @@ describe('Batch Utils', () => {
581
577
addTransactionBatch ( {
582
578
...request ,
583
579
publishBatchHook,
584
- request : { ...request . request , useHook : true } ,
580
+ request : { ...request . request } ,
585
581
} ) . catch ( ( ) => {
586
582
// Intentionally empty
587
583
} ) ;
@@ -639,7 +635,7 @@ describe('Batch Utils', () => {
639
635
addTransactionBatch ( {
640
636
...request ,
641
637
publishBatchHook,
642
- request : { ...request . request , useHook : true } ,
638
+ request : { ...request . request } ,
643
639
} ) . catch ( ( ) => {
644
640
// Intentionally empty
645
641
} ) ;
@@ -718,7 +714,7 @@ describe('Batch Utils', () => {
718
714
addTransactionBatch ( {
719
715
...request ,
720
716
publishBatchHook,
721
- request : { ...request . request , useHook : true } ,
717
+ request : { ...request . request } ,
722
718
} ) . catch ( ( ) => {
723
719
// Intentionally empty
724
720
} ) ;
@@ -801,7 +797,6 @@ describe('Batch Utils', () => {
801
797
} ,
802
798
request . request . transactions [ 1 ] ,
803
799
] ,
804
- useHook : true ,
805
800
} ,
806
801
} ) . catch ( ( ) => {
807
802
// Intentionally empty
@@ -900,7 +895,6 @@ describe('Batch Utils', () => {
900
895
} ,
901
896
request . request . transactions [ 1 ] ,
902
897
] ,
903
- useHook : true ,
904
898
} ,
905
899
} ) . catch ( ( ) => {
906
900
// Intentionally empty
@@ -951,7 +945,7 @@ describe('Batch Utils', () => {
951
945
const resultPromise = addTransactionBatch ( {
952
946
...request ,
953
947
publishBatchHook,
954
- request : { ...request . request , useHook : true } ,
948
+ request : { ...request . request } ,
955
949
} ) ;
956
950
957
951
resultPromise . catch ( ( ) => {
@@ -1011,7 +1005,7 @@ describe('Batch Utils', () => {
1011
1005
addTransactionBatch ( {
1012
1006
...request ,
1013
1007
publishBatchHook,
1014
- request : { ...request . request , useHook : true } ,
1008
+ request : { ...request . request } ,
1015
1009
} ) . catch ( ( ) => {
1016
1010
// Intentionally empty
1017
1011
} ) ;
@@ -1064,7 +1058,7 @@ describe('Batch Utils', () => {
1064
1058
addTransactionBatch ( {
1065
1059
...request ,
1066
1060
publishBatchHook,
1067
- request : { ...request . request , useHook : true } ,
1061
+ request : { ...request . request } ,
1068
1062
} ) . catch ( ( ) => {
1069
1063
// Intentionally empty
1070
1064
} ) ;
@@ -1089,6 +1083,10 @@ describe('Batch Utils', () => {
1089
1083
} ) ;
1090
1084
1091
1085
describe ( 'with sequential publish batch hook' , ( ) => {
1086
+ beforeEach ( ( ) => {
1087
+ doesChainSupportEIP7702Mock . mockReturnValueOnce ( false ) ;
1088
+ } ) ;
1089
+
1092
1090
let sequentialPublishBatchHook : jest . MockedFn < PublishBatchHook > ;
1093
1091
1094
1092
beforeEach ( ( ) => {
@@ -1158,7 +1156,7 @@ describe('Batch Utils', () => {
1158
1156
addTransactionBatch ( {
1159
1157
...request ,
1160
1158
publishBatchHook : undefined ,
1161
- request : { ...request . request , useHook : true } ,
1159
+ request : { ...request . request } ,
1162
1160
} ) . catch ( ( ) => {
1163
1161
// Intentionally empty
1164
1162
} ) ;
@@ -1194,7 +1192,7 @@ describe('Batch Utils', () => {
1194
1192
const resultPromise = addTransactionBatch ( {
1195
1193
...request ,
1196
1194
publishBatchHook : undefined ,
1197
- request : { ...request . request , useHook : true } ,
1195
+ request : { ...request . request } ,
1198
1196
} ) ;
1199
1197
1200
1198
resultPromise . catch ( ( ) => {
@@ -1220,7 +1218,7 @@ describe('Batch Utils', () => {
1220
1218
addTransactionBatch ( {
1221
1219
...request ,
1222
1220
publishBatchHook : undefined ,
1223
- request : { ...request . request , useHook : true } ,
1221
+ request : { ...request . request } ,
1224
1222
} ) ,
1225
1223
) . rejects . toThrow ( 'Test error' ) ;
1226
1224
@@ -1230,6 +1228,10 @@ describe('Batch Utils', () => {
1230
1228
} ) ;
1231
1229
1232
1230
describe ( 'isAtomicBatchSupported' , ( ) => {
1231
+ beforeEach ( ( ) => {
1232
+ jest . resetAllMocks ( ) ;
1233
+ } ) ;
1234
+
1233
1235
it ( 'includes all feature flag chains if chain IDs not specified' , async ( ) => {
1234
1236
getEIP7702SupportedChainsMock . mockReturnValueOnce ( [
1235
1237
CHAIN_ID_MOCK ,
0 commit comments