Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chainsafe/lodestar-config

Package Overview
Dependencies
Maintainers
3
Versions
840
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chainsafe/lodestar-config - npm Package Compare versions

Comparing version 0.23.0 to 0.23.1-alpha.0

lib/beaconConfig.d.ts

7

lib/index.d.ts

@@ -1,5 +0,4 @@

import { IBeaconParams } from "@chainsafe/lodestar-params";
import { IBeaconConfig } from "./interface";
export * from "./interface";
export declare function createIBeaconConfig(params: IBeaconParams): IBeaconConfig;
export * from "./chainConfig";
export * from "./forkConfig";
export * from "./beaconConfig";
//# sourceMappingURL=index.d.ts.map

@@ -6,21 +6,25 @@ "use strict";

});
var _exportNames = {
createIBeaconConfig: true
};
exports.createIBeaconConfig = createIBeaconConfig;
var _lodestarParams = require("@chainsafe/lodestar-params");
var _chainConfig = require("./chainConfig");
var _lodestarTypes = require("@chainsafe/lodestar-types");
Object.keys(_chainConfig).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _chainConfig[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _chainConfig[key];
}
});
});
var _interface = require("./interface");
var _forkConfig = require("./forkConfig");
Object.keys(_interface).forEach(function (key) {
Object.keys(_forkConfig).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _interface[key]) return;
if (key in exports && exports[key] === _forkConfig[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _interface[key];
return _forkConfig[key];
}

@@ -30,56 +34,14 @@ });

var _forkTypes = require("./forkTypes");
var _beaconConfig = require("./beaconConfig");
function createIBeaconConfig(params) {
const types = (0, _lodestarTypes.createIBeaconSSZTypes)(params);
const forkTypes = (0, _forkTypes.getForkTypesRecord)(types);
const phase0 = {
name: _interface.ForkName.phase0,
epoch: _lodestarParams.GENESIS_EPOCH,
version: params.GENESIS_FORK_VERSION
};
const altair = {
name: _interface.ForkName.altair,
epoch: params.ALTAIR_FORK_EPOCH,
version: params.ALTAIR_FORK_VERSION
};
/** Forks in order order of occurence, `phase0` first */
// Note: Downstream code relies on proper ordering.
const forks = {
phase0,
altair
}; // Prevents allocating an array on every getForkInfo() call
const forksDescendingEpochOrder = Object.values(forks).reverse();
return {
params,
types,
forks,
// Fork convenience methods
getForkInfo(slot) {
const epoch = Math.floor(slot / this.params.SLOTS_PER_EPOCH); // NOTE: forks must be sorted by descending epoch, latest fork first
for (const fork of forksDescendingEpochOrder) {
if (epoch >= fork.epoch) return fork;
}
return phase0;
},
getForkName(slot) {
return this.getForkInfo(slot).name;
},
getForkVersion(slot) {
return this.getForkInfo(slot).version;
},
getForkTypes(slot) {
return forkTypes[this.getForkName(slot)];
Object.keys(_beaconConfig).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (key in exports && exports[key] === _beaconConfig[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _beaconConfig[key];
}
};
}
});
});
//# sourceMappingURL=index.js.map
{
"name": "@chainsafe/lodestar-config",
"version": "0.23.0",
"version": "0.23.1-alpha.0+7ff5465",
"description": "Chain configuration required for lodestar",

@@ -47,6 +47,7 @@ "author": "ChainSafe Systems",

"dependencies": {
"@chainsafe/lodestar-params": "^0.23.0",
"@chainsafe/lodestar-types": "^0.23.0"
"@chainsafe/lodestar-params": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/lodestar-types": "^0.23.1-alpha.0+7ff5465",
"@chainsafe/ssz": "^0.8.7"
},
"gitHead": "8f4e720c0ed5b701149e2b432c22f0c2b536555a"
"gitHead": "7ff5465baa2414e78c9b0519ff3e262f1d09f36d"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc