@chainsafe/lodestar-config
Advanced tools
Comparing version 0.16.0 to 0.17.0
@@ -28,7 +28,33 @@ "use strict"; | ||
function createIBeaconConfig(params) { | ||
const types = (0, _lodestarTypes.createIBeaconSSZTypes)(params); | ||
return { | ||
params, | ||
types: (0, _lodestarTypes.createIBeaconSSZTypes)(params) | ||
types, | ||
getForkName(slot) { | ||
if (slot < params.LIGHTCLIENT_PATCH_FORK_SLOT) { | ||
return "phase0"; | ||
} else if (slot < params.PHASE_1_FORK_SLOT) { | ||
return "lightclient"; | ||
} else { | ||
return "phase1"; | ||
} | ||
}, | ||
getForkVersion(slot) { | ||
if (slot < params.LIGHTCLIENT_PATCH_FORK_SLOT) { | ||
return params.GENESIS_FORK_VERSION; | ||
} else if (slot < params.PHASE_1_FORK_SLOT) { | ||
return params.LIGHTCLIENT_PATCH_FORK_VERSION; | ||
} else { | ||
return params.PHASE_1_FORK_VERSION; | ||
} | ||
}, | ||
getTypes(slot) { | ||
return types[this.getForkName(slot)]; | ||
} | ||
}; | ||
} | ||
//# sourceMappingURL=index.js.map |
import { IBeaconParams } from "@chainsafe/lodestar-params"; | ||
import { IBeaconSSZTypes } from "@chainsafe/lodestar-types"; | ||
import { IBeaconSSZTypes, ILightclientSSZTypes, IPhase0SSZTypes, IPhase1SSZTypes, Slot, Version } from "@chainsafe/lodestar-types"; | ||
export declare type IForkName = "phase0" | "lightclient" | "phase1"; | ||
export interface IBeaconConfig { | ||
params: IBeaconParams; | ||
types: IBeaconSSZTypes; | ||
/** | ||
* Get the hard-fork name at a given slot | ||
*/ | ||
getForkName(slot: Slot): IForkName; | ||
/** | ||
* Get the hard-fork version at a given slot | ||
*/ | ||
getForkVersion(slot: Slot): Version; | ||
/** | ||
* Get SSZ types by hard-fork | ||
*/ | ||
getTypes(slot: Slot): IPhase0SSZTypes | ILightclientSSZTypes | IPhase1SSZTypes; | ||
} | ||
//# sourceMappingURL=interface.d.ts.map |
@@ -1,4 +0,3 @@ | ||
import { IBeaconConfig } from "../interface"; | ||
export declare const config: IBeaconConfig; | ||
export declare const mainnetConfig: IBeaconConfig; | ||
export declare const config: import("..").IBeaconConfig; | ||
export declare const mainnetConfig: import("..").IBeaconConfig; | ||
//# sourceMappingURL=mainnet.d.ts.map |
@@ -10,8 +10,5 @@ "use strict"; | ||
var _mainnet2 = require("@chainsafe/lodestar-types/lib/ssz/presets/mainnet"); | ||
var _ = require("../"); | ||
const config = { | ||
params: _mainnet.params, | ||
types: _mainnet2.types | ||
}; | ||
const config = (0, _.createIBeaconConfig)(_mainnet.params); | ||
exports.config = config; | ||
@@ -18,0 +15,0 @@ const mainnetConfig = config; |
@@ -1,4 +0,3 @@ | ||
import { IBeaconConfig } from "../interface"; | ||
export declare const config: IBeaconConfig; | ||
export declare const minimalConfig: IBeaconConfig; | ||
export declare const config: import("..").IBeaconConfig; | ||
export declare const minimalConfig: import("..").IBeaconConfig; | ||
//# sourceMappingURL=minimal.d.ts.map |
@@ -10,8 +10,5 @@ "use strict"; | ||
var _minimal2 = require("@chainsafe/lodestar-types/lib/ssz/presets/minimal"); | ||
var _ = require("../"); | ||
const config = { | ||
params: _minimal.params, | ||
types: _minimal2.types | ||
}; | ||
const config = (0, _.createIBeaconConfig)(_minimal.params); | ||
exports.config = config; | ||
@@ -18,0 +15,0 @@ const minimalConfig = config; |
{ | ||
"name": "@chainsafe/lodestar-config", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Chain configuration required for lodestar", | ||
@@ -46,6 +46,6 @@ "author": "ChainSafe Systems", | ||
"dependencies": { | ||
"@chainsafe/lodestar-params": "^0.16.0", | ||
"@chainsafe/lodestar-types": "^0.16.0" | ||
"@chainsafe/lodestar-params": "^0.17.0", | ||
"@chainsafe/lodestar-types": "^0.17.0" | ||
}, | ||
"gitHead": "fe7e44bd008601b71972bee9d50b87246ac943d7" | ||
"gitHead": "083db35cb33eb46e5e4ea6d647dccbfc0854a1b2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21927
105
+ Added@chainsafe/lodestar-params@0.17.0(transitive)
+ Added@chainsafe/lodestar-types@0.17.0(transitive)
+ Added@chainsafe/persistent-merkle-tree@0.3.7(transitive)
+ Added@chainsafe/ssz@0.7.1(transitive)
- Removed@chainsafe/lodestar-params@0.16.0(transitive)
- Removed@chainsafe/lodestar-types@0.16.0(transitive)
- Removed@chainsafe/persistent-merkle-tree@0.2.3(transitive)
- Removed@chainsafe/ssz@0.6.13(transitive)