Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 919cb0b1df | |
Derrick Hammer | 3d4d24e90b | |
Derrick Hammer | 87d8be615e |
|
@ -1,3 +1,10 @@
|
||||||
|
# [0.1.0-develop.60](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.59...v0.1.0-develop.60) (2023-09-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add method to reset the client ([87d8be6](https://git.lumeweb.com/LumeWeb/libethsync/commit/87d8be615e42fef0ae122a29b83cd1974e4ee1a7))
|
||||||
|
|
||||||
# [0.1.0-develop.59](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.58...v0.1.0-develop.59) (2023-09-16)
|
# [0.1.0-develop.59](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.58...v0.1.0-develop.59) (2023-09-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.59",
|
"version": "0.1.0-develop.60",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.59",
|
"version": "0.1.0-develop.60",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@chainsafe/as-sha256": "^0.3.1",
|
"@chainsafe/as-sha256": "^0.3.1",
|
||||||
"@chainsafe/bls": "7.1.1",
|
"@chainsafe/bls": "7.1.1",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libethsync",
|
"name": "@lumeweb/libethsync",
|
||||||
"version": "0.1.0-develop.59",
|
"version": "0.1.0-develop.60",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -46,6 +46,13 @@ export default class Client extends BaseClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public reset() {
|
||||||
|
this._latestPeriod = 0;
|
||||||
|
this.latestCommittee = undefined;
|
||||||
|
this.booted = false;
|
||||||
|
this.store.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public async syncFromCheckpoint(checkpoint: LightClientUpdate) {
|
public async syncFromCheckpoint(checkpoint: LightClientUpdate) {
|
||||||
this._latestPeriod = computeSyncPeriodAtSlot(
|
this._latestPeriod = computeSyncPeriodAtSlot(
|
||||||
checkpoint.attestedHeader.beacon.slot,
|
checkpoint.attestedHeader.beacon.slot,
|
||||||
|
|
|
@ -17,6 +17,7 @@ export interface IStore extends EventEmitter {
|
||||||
addUpdate(period: number, update: LightClientUpdate): void;
|
addUpdate(period: number, update: LightClientUpdate): void;
|
||||||
getUpdate(period: number): Uint8Array;
|
getUpdate(period: number): Uint8Array;
|
||||||
hasUpdate(period: number): boolean;
|
hasUpdate(period: number): boolean;
|
||||||
|
clear(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IVerifyingProvider {
|
export interface IVerifyingProvider {
|
||||||
|
|
|
@ -21,6 +21,10 @@ export default class Store extends EventEmitter implements IStore {
|
||||||
this.store.options.stdTTL = 0;
|
this.store.options.stdTTL = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clear(): void {
|
||||||
|
this.store.flushAll();
|
||||||
|
}
|
||||||
|
|
||||||
addUpdate(period: number, update: LightClientUpdate) {
|
addUpdate(period: number, update: LightClientUpdate) {
|
||||||
try {
|
try {
|
||||||
const serialized = capella.ssz.LightClientUpdate.serialize(update);
|
const serialized = capella.ssz.LightClientUpdate.serialize(update);
|
||||||
|
|
Loading…
Reference in New Issue