@@ -12,12 +12,12 @@ import { ChainId, ILogger, ProcessorEvent, StrategyEvent } from "@grants-stack-i
12
12
13
13
import { UnsupportedEventException } from "../../../src/internal.js" ;
14
14
import {
15
- BaseDistributionUpdatedHandler ,
16
15
BaseFundsDistributedHandler ,
17
16
BaseRecipientStatusUpdatedHandler ,
18
17
} from "../../../src/processors/strategy/common/index.js" ;
19
18
import { EasyRetroFundingStrategyHandler } from "../../../src/processors/strategy/easyRetroFunding/easyRetroFunding.handler.js" ;
20
19
import {
20
+ ERFDistributionUpdatedHandler ,
21
21
ERFRegisteredHandler ,
22
22
ERFTimestampsUpdatedHandler ,
23
23
ERFUpdatedRegistrationHandler ,
@@ -27,38 +27,37 @@ vi.mock("../../../src/processors/strategy/easyRetroFunding/handlers/index.js", a
27
27
const ERFRegisteredHandler = vi . fn ( ) ;
28
28
const ERFTimestampsUpdatedHandler = vi . fn ( ) ;
29
29
const ERFUpdatedRegistrationHandler = vi . fn ( ) ;
30
-
30
+ const ERFDistributionUpdatedHandler = vi . fn ( ) ;
31
31
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
32
32
ERFRegisteredHandler . prototype . handle = vi . fn ( ) ;
33
33
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
34
34
ERFTimestampsUpdatedHandler . prototype . handle = vi . fn ( ) ;
35
35
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
36
36
ERFUpdatedRegistrationHandler . prototype . handle = vi . fn ( ) ;
37
37
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
38
+ ERFDistributionUpdatedHandler . prototype . handle = vi . fn ( ) ;
39
+
38
40
return {
39
41
ERFRegisteredHandler,
40
42
ERFTimestampsUpdatedHandler,
41
43
ERFUpdatedRegistrationHandler,
44
+ ERFDistributionUpdatedHandler,
42
45
} ;
43
46
} ) ;
44
47
45
48
vi . mock ( "../../../src/processors/strategy/common/index.js" , async ( importOriginal ) => {
46
49
const original =
47
50
await importOriginal < typeof import ( "../../../src/processors/strategy/common/index.js" ) > ( ) ;
48
51
const BaseFundsDistributedHandler = vi . fn ( ) ;
49
- const BaseDistributionUpdatedHandler = vi . fn ( ) ;
50
52
const BaseRecipientStatusUpdatedHandler = vi . fn ( ) ;
51
53
52
54
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
53
55
BaseFundsDistributedHandler . prototype . handle = vi . fn ( ) ;
54
56
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
55
- BaseDistributionUpdatedHandler . prototype . handle = vi . fn ( ) ;
56
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
57
57
BaseRecipientStatusUpdatedHandler . prototype . handle = vi . fn ( ) ;
58
58
return {
59
59
...original ,
60
60
BaseFundsDistributedHandler,
61
- BaseDistributionUpdatedHandler,
62
61
BaseRecipientStatusUpdatedHandler,
63
62
} ;
64
63
} ) ;
@@ -197,16 +196,16 @@ describe("EasyRetroFundingStrategyHandler", () => {
197
196
expect ( ERFTimestampsUpdatedHandler . prototype . handle ) . toHaveBeenCalled ( ) ;
198
197
} ) ;
199
198
200
- it ( "calls BaseDistributionUpdatedHandler for DistributionUpdated event" , async ( ) => {
199
+ it ( "calls ERFDistributionUpdatedHandler for DistributionUpdated event" , async ( ) => {
201
200
const mockEvent = {
202
201
eventName : "DistributionUpdated" ,
203
202
} as ProcessorEvent < "Strategy" , "DistributionUpdated" > ;
204
203
205
- vi . spyOn ( BaseDistributionUpdatedHandler . prototype , "handle" ) . mockResolvedValue ( [ ] ) ;
204
+ vi . spyOn ( ERFDistributionUpdatedHandler . prototype , "handle" ) . mockResolvedValue ( [ ] ) ;
206
205
207
206
await handler . handle ( mockEvent ) ;
208
207
209
- expect ( BaseDistributionUpdatedHandler ) . toHaveBeenCalledWith ( mockEvent , chainId , {
208
+ expect ( ERFDistributionUpdatedHandler ) . toHaveBeenCalledWith ( mockEvent , chainId , {
210
209
metadataProvider : mockMetadataProvider ,
211
210
roundRepository : mockRoundRepository ,
212
211
projectRepository : mockProjectRepository ,
@@ -215,7 +214,7 @@ describe("EasyRetroFundingStrategyHandler", () => {
215
214
applicationRepository : mockApplicationRepository ,
216
215
logger,
217
216
} ) ;
218
- expect ( BaseDistributionUpdatedHandler . prototype . handle ) . toHaveBeenCalled ( ) ;
217
+ expect ( ERFDistributionUpdatedHandler . prototype . handle ) . toHaveBeenCalled ( ) ;
219
218
} ) ;
220
219
221
220
it ( "calls FundsDistributedHandler for FundsDistributed event" , async ( ) => {
0 commit comments