1
1
import { Contract , EventFilter } from "ethers" ;
2
- import {
3
- BigNumber ,
4
- DepositSearchResult ,
5
- getDepositIdAtBlock ,
6
- getNetworkName ,
7
- InvalidFill ,
8
- MakeOptional ,
9
- toBN ,
10
- } from "../../utils" ;
2
+ import { BigNumber , DepositSearchResult , getNetworkName , InvalidFill , MakeOptional , toBN } from "../../utils" ;
11
3
import {
12
4
EventSearchConfig ,
13
5
paginatedEventQuery ,
@@ -18,15 +10,16 @@ import { isUpdateFailureReason } from "../BaseAbstractClient";
18
10
import { knownEventNames , SpokePoolClient , SpokePoolUpdate } from "./SpokePoolClient" ;
19
11
import winston from "winston" ;
20
12
import { HubPoolClient } from "../HubPoolClient" ;
21
- import { SpokePool } from "../../typechain" ;
22
13
import {
23
14
findDepositBlock ,
24
15
getMaxFillDeadlineInRange as getMaxFillDeadline ,
25
16
getTimeAt as _getTimeAt ,
26
17
relayFillStatus ,
27
18
isZeroAddress ,
19
+ getDepositIdAtBlock ,
28
20
} from "../../utils/SpokeUtils" ;
29
21
import { DepositWithBlock , FillStatus , RelayData } from "../../interfaces" ;
22
+ import { SpokePool } from "../../typechain" ;
30
23
31
24
/**
32
25
* An EVM-specific SpokePoolClient.
@@ -43,12 +36,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
43
36
super ( logger , hubPoolClient , chainId , deploymentBlock , eventSearchConfig ) ;
44
37
}
45
38
46
- public async getTimestampForBlock ( blockTag : number ) : Promise < number > {
47
- const block = await this . spokePool . provider . getBlock ( blockTag ) ;
48
- return Number ( block . timestamp ) ;
49
- }
50
-
51
- public relayFillStatus (
39
+ public override relayFillStatus (
52
40
relayData : RelayData ,
53
41
blockTag ?: number | "latest" ,
54
42
destinationChainId ?: number
@@ -148,21 +136,11 @@ export class EVMSpokePoolClient extends SpokePoolClient {
148
136
} ;
149
137
}
150
138
151
- /**
152
- * Retrieves the time from the SpokePool contract at a particular block.
153
- * @returns The time at the specified block tag.
154
- */
155
- public getTimeAt ( blockNumber : number ) : Promise < number > {
139
+ public override getTimeAt ( blockNumber : number ) : Promise < number > {
156
140
return _getTimeAt ( this . spokePool , blockNumber ) ;
157
141
}
158
142
159
- /**
160
- * For a given origin chain depositId, resolve the corresponding Deposit.
161
- * Note: This method can only be used for depositIds within the non-deterministic range (0 < depositId < 2^32 - 1).
162
- * @param depositId Deposit ID of the deposit to resolve.
163
- * @returns A DepositSearchResult instance.
164
- */
165
- async findDeposit ( depositId : BigNumber ) : Promise < DepositSearchResult > {
143
+ public override async findDeposit ( depositId : BigNumber ) : Promise < DepositSearchResult > {
166
144
let deposit = this . getDeposit ( depositId ) ;
167
145
if ( deposit ) {
168
146
return { found : true , deposit } ;
0 commit comments