@lodestar/beacon-node
Version:
A Typescript implementation of the beacon chain
26 lines • 1.13 kB
JavaScript
import { Repository } from "@lodestar/db";
import { ssz } from "@lodestar/types";
import { Bucket, getBucketNameByValue } from "../buckets.js";
/**
* Store temporary checkpoint states.
* We should only put/get binary data from this repository, consumer will load it into an existing state ViewDU object.
*/
export class CheckpointStateRepository extends Repository {
constructor(config, db) {
// Pick some type but won't be used. Casted to any because no type can match `BeaconStateAllForks`
const type = ssz.phase0.BeaconState;
const bucket = Bucket.allForks_checkpointState;
// biome-ignore lint/suspicious/noExplicitAny: The type is complex to specify a proper override
super(config, db, bucket, type, getBucketNameByValue(bucket));
}
getId() {
throw Error("CheckpointStateRepository does not work with value");
}
encodeValue() {
throw Error("CheckpointStateRepository does not work with value");
}
decodeValue() {
throw Error("CheckpointStateRepository does not work with value");
}
}
//# sourceMappingURL=checkpointState.js.map