Compare commits

..

No commits in common. "v0.1.0-develop.25" and "v0.1.0-develop.24" have entirely different histories.

4 changed files with 11 additions and 19 deletions

View File

@ -1,5 +1,3 @@
# [0.1.0-develop.25](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.24...v0.1.0-develop.25) (2023-07-12)
# [0.1.0-develop.24](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.23...v0.1.0-develop.24) (2023-07-11) # [0.1.0-develop.24](https://git.lumeweb.com/LumeWeb/libethsync/compare/v0.1.0-develop.23...v0.1.0-develop.24) (2023-07-11)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.25", "version": "0.1.0-develop.24",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libethclient", "name": "@lumeweb/libethclient",
"version": "0.1.0-develop.25", "version": "0.1.0-develop.24",
"dependencies": { "dependencies": {
"@chainsafe/as-sha256": "^0.3.1", "@chainsafe/as-sha256": "^0.3.1",
"@chainsafe/bls": "7.1.1", "@chainsafe/bls": "7.1.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libethsync", "name": "@lumeweb/libethsync",
"version": "0.1.0-develop.25", "version": "0.1.0-develop.24",
"type": "module", "type": "module",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -28,8 +28,14 @@ interface Config extends BaseClientOptions {
} }
export default class Client extends BaseClient { export default class Client extends BaseClient {
async sync(): Promise<void> {
await super.sync();
this.subscribe();
}
private beaconUrl: string; private beaconUrl: string;
private http: AxiosInstance = consensusClient; private blockCache = new NodeCache({ stdTTL: 60 * 60 * 12 });
private blockHashCache = new NodeCache({ stdTTL: 60 * 60 * 12 });
constructor(config: Config) { constructor(config: Config) {
super(config); super(config);
@ -42,17 +48,7 @@ export default class Client extends BaseClient {
this.http.defaults.baseURL = this.beaconUrl; this.http.defaults.baseURL = this.beaconUrl;
} }
private _latestOptimisticUpdate: any; private http: AxiosInstance = consensusClient;
get latestOptimisticUpdate(): any {
return this._latestOptimisticUpdate;
}
async sync(): Promise<void> {
await super.sync();
this.subscribe();
}
async syncProver( async syncProver(
startPeriod: number, startPeriod: number,
@ -110,8 +106,6 @@ export default class Client extends BaseClient {
return null; return null;
} }
this._latestOptimisticUpdate = updateJSON;
return { return {
blockHash: toHexString(update.attestedHeader.execution.blockHash), blockHash: toHexString(update.attestedHeader.execution.blockHash),
blockNumber: update.attestedHeader.execution.blockNumber, blockNumber: update.attestedHeader.execution.blockNumber,