@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
17 lines • 518 B
JavaScript
export class Eth1DataCache {
constructor(config, db) {
this.config = config;
this.db = db;
}
async get({ timestampRange }) {
return this.db.eth1Data.values(timestampRange);
}
async add(eth1Datas) {
await this.db.eth1Data.batchPutValues(eth1Datas);
}
async getHighestCachedBlockNumber() {
const highestEth1Data = await this.db.eth1Data.lastValue();
return highestEth1Data?.blockNumber ?? null;
}
}
//# sourceMappingURL=eth1DataCache.js.map