File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ describe("epochHandler", () => {
11
11
const now = ( currentTimestamp + mockedEpochPeriod + 1 ) * 1000 ; // In ms
12
12
const startEpoch =
13
13
Math . floor ( ( currentTimestamp - ( mockedSeqDelayLimit + mockedEpochPeriod + startCoolDown ) ) / mockedEpochPeriod ) -
14
- 2 ;
14
+ 1 ;
15
15
it ( "should return the correct epoch range" , ( ) => {
16
16
const mockedFetchBridgeConfig = jest . fn ( ( ) => ( {
17
17
epochPeriod : mockedEpochPeriod ,
@@ -31,7 +31,7 @@ describe("epochHandler", () => {
31
31
now,
32
32
fetchBridgeConfig : mockedFetchBridgeConfig as any ,
33
33
} ) ;
34
- expect ( result [ result . length - 1 ] ) . toEqual ( currentEpoch - 1 ) ;
34
+ expect ( result [ result . length - 1 ] ) . toEqual ( currentEpoch ) ;
35
35
expect ( result [ 0 ] ) . toEqual ( startEpoch ) ;
36
36
} ) ;
37
37
} ) ;
Original file line number Diff line number Diff line change @@ -41,10 +41,11 @@ const setEpochRange = ({
41
41
42
42
let veaEpochOutboxClaimableNow = Math . floor ( timeLocal / epochPeriod ) - 1 ;
43
43
// only past epochs are claimable, hence shift by one here
44
- const veaEpochOutboxRange = veaEpochOutboxClaimableNow - veaEpochOutboxWatchLowerBound ;
45
- const veaEpochOutboxCheckClaimsRangeArray : number [ ] = new Array ( veaEpochOutboxRange )
46
- . fill ( veaEpochOutboxWatchLowerBound )
47
- . map ( ( el , i ) => el + i ) ;
44
+ const length = veaEpochOutboxClaimableNow - veaEpochOutboxWatchLowerBound ;
45
+ const veaEpochOutboxCheckClaimsRangeArray : number [ ] = Array . from (
46
+ { length } ,
47
+ ( _ , i ) => veaEpochOutboxWatchLowerBound + i + 1
48
+ ) ;
48
49
return veaEpochOutboxCheckClaimsRangeArray ;
49
50
} ;
50
51
You can’t perform that action at this time.
0 commit comments