@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
21 lines • 702 B
JavaScript
import { ssz } from "@lodestar/types";
import { Bucket } from "../buckets.js";
export class PreGenesisStateLastProcessedBlock {
constructor(_config, db) {
this.db = db;
this.type = ssz.UintNum64;
this.bucket = Bucket.phase0_preGenesisStateLastProcessedBlock;
this.key = new Uint8Array([this.bucket]);
}
async put(value) {
await this.db.put(this.key, this.type.serialize(value));
}
async get() {
const value = await this.db.get(this.key);
return value ? this.type.deserialize(value) : null;
}
async delete() {
await this.db.delete(this.key);
}
}
//# sourceMappingURL=preGenesisStateLastProcessedBlock.js.map