-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStaticGlobalDataFetcher.ts
43 lines (40 loc) · 1.04 KB
/
StaticGlobalDataFetcher.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { constants, providers } from "ethers";
import { INITIAL_BLOCK_TIMESTAMP } from "../../mocks/global";
import { GlobalData } from "../../types";
import { GlobalDataFetcher } from "../fetchers.interfaces";
import { StaticFetcher } from "./StaticFetcher";
export class StaticGlobalDataFetcher
extends StaticFetcher
implements GlobalDataFetcher
{
constructor(
private _globalData: Omit<
GlobalData,
"lastFetchTimestamp" | "currentBlock"
>,
_longDelay: number,
_shortDelay?: number
) {
super(_longDelay, _shortDelay);
}
async fetchGlobalData() {
return {
...this._globalData,
lastFetchTimestamp: 1679584231593,
currentBlock: {
timestamp: INITIAL_BLOCK_TIMESTAMP,
number: 16000000,
extraData: "",
_difficulty: constants.Zero,
difficulty: 0,
gasLimit: constants.Zero,
hash: "",
gasUsed: constants.Zero,
miner: "",
nonce: "",
parentHash: "",
transactions: [],
} as providers.Block,
};
}
}