@chainsafe/lodestar-db
Advanced tools
Comparing version 0.20.0 to 0.21.0
@@ -8,3 +8,3 @@ "use strict"; | ||
var _ = require("."); | ||
var _2 = require("."); | ||
@@ -52,3 +52,3 @@ var _schema = require("./schema"); | ||
decodeKey(key) { | ||
return key.slice(_.BUCKET_LENGTH); | ||
return key.slice(_2.BUCKET_LENGTH); | ||
} | ||
@@ -63,9 +63,5 @@ | ||
async getBinary(id) { | ||
try { | ||
const value = await this.db.get(this.encodeKey(id)); | ||
if (!value) return null; | ||
return value; | ||
} catch (e) { | ||
return null; | ||
} | ||
const value = await this.db.get(this.encodeKey(id)); | ||
if (!value) return null; | ||
return value; | ||
} | ||
@@ -105,3 +101,3 @@ | ||
length: items.length | ||
}, (ignored, i) => ({ | ||
}, (_, i) => ({ | ||
key: this.encodeKey(items[i].key), | ||
@@ -116,3 +112,3 @@ value: this.encodeValue(items[i].value) | ||
length: items.length | ||
}, (ignored, i) => ({ | ||
}, (_, i) => ({ | ||
key: this.encodeKey(items[i].key), | ||
@@ -126,3 +122,3 @@ value: items[i].value | ||
length: ids.length | ||
}, (ignored, i) => this.encodeKey(ids[i]))); | ||
}, (_, i) => this.encodeKey(ids[i]))); | ||
} | ||
@@ -133,3 +129,3 @@ | ||
length: values.length | ||
}, (ignored, i) => ({ | ||
}, (_, i) => ({ | ||
key: this.getId(values[i]), | ||
@@ -136,0 +132,0 @@ value: values[i] |
@@ -5,3 +5,3 @@ /** | ||
export { IDatabaseController, IFilterOptions, IKeyValue } from "./interface"; | ||
export { LevelDbController } from "./impl/level"; | ||
export { LevelDbController } from "./level"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -33,3 +33,3 @@ "use strict"; | ||
var _level = require("./impl/level"); | ||
var _level = require("./level"); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
export declare enum Bucket { | ||
phase0_stateArchive = 0, | ||
phase0_block = 1, | ||
phase0_blockArchive = 2, | ||
allForks_stateArchive = 0, | ||
allForks_block = 1, | ||
allForks_blockArchive = 2, | ||
index_blockArchiveParentRootIndex = 3, | ||
@@ -27,8 +27,4 @@ index_blockArchiveRootIndex = 4, | ||
index_slashingProtectionMaxSpanDistance = 24, | ||
phase0_pendingBlock = 25, | ||
allForks_pendingBlock = 25, | ||
index_stateArchiveRootIndex = 26, | ||
altair_block = 27, | ||
altair_blockArchive = 28, | ||
altair_pendingBlock = 29, | ||
altair_stateArchive = 30, | ||
altair_syncCommitteeSignature = 31, | ||
@@ -35,0 +31,0 @@ altair_contributionAndProof = 32 |
@@ -21,5 +21,5 @@ "use strict"; | ||
(function (Bucket) { | ||
Bucket[Bucket["phase0_stateArchive"] = 0] = "phase0_stateArchive"; | ||
Bucket[Bucket["phase0_block"] = 1] = "phase0_block"; | ||
Bucket[Bucket["phase0_blockArchive"] = 2] = "phase0_blockArchive"; | ||
Bucket[Bucket["allForks_stateArchive"] = 0] = "allForks_stateArchive"; | ||
Bucket[Bucket["allForks_block"] = 1] = "allForks_block"; | ||
Bucket[Bucket["allForks_blockArchive"] = 2] = "allForks_blockArchive"; | ||
Bucket[Bucket["index_blockArchiveParentRootIndex"] = 3] = "index_blockArchiveParentRootIndex"; | ||
@@ -46,8 +46,4 @@ Bucket[Bucket["index_blockArchiveRootIndex"] = 4] = "index_blockArchiveRootIndex"; | ||
Bucket[Bucket["index_slashingProtectionMaxSpanDistance"] = 24] = "index_slashingProtectionMaxSpanDistance"; | ||
Bucket[Bucket["phase0_pendingBlock"] = 25] = "phase0_pendingBlock"; | ||
Bucket[Bucket["allForks_pendingBlock"] = 25] = "allForks_pendingBlock"; | ||
Bucket[Bucket["index_stateArchiveRootIndex"] = 26] = "index_stateArchiveRootIndex"; | ||
Bucket[Bucket["altair_block"] = 27] = "altair_block"; | ||
Bucket[Bucket["altair_blockArchive"] = 28] = "altair_blockArchive"; | ||
Bucket[Bucket["altair_pendingBlock"] = 29] = "altair_pendingBlock"; | ||
Bucket[Bucket["altair_stateArchive"] = 30] = "altair_stateArchive"; | ||
Bucket[Bucket["altair_syncCommitteeSignature"] = 31] = "altair_syncCommitteeSignature"; | ||
@@ -54,0 +50,0 @@ Bucket[Bucket["altair_contributionAndProof"] = 32] = "altair_contributionAndProof"; |
{ | ||
"name": "@chainsafe/lodestar-db", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"description": "DB modules of Lodestar", | ||
@@ -38,11 +38,10 @@ "author": "ChainSafe Systems", | ||
"dependencies": { | ||
"@chainsafe/lodestar-config": "^0.20.0", | ||
"@chainsafe/lodestar-utils": "^0.20.0", | ||
"@chainsafe/ssz": "^0.8.2", | ||
"@chainsafe/lodestar-config": "^0.21.0", | ||
"@chainsafe/lodestar-utils": "^0.21.0", | ||
"@chainsafe/ssz": "^0.8.4", | ||
"it-all": "^1.0.2", | ||
"it-pushable": "^1.4.0", | ||
"level": "^6.0.1", | ||
"levelup": "^4.4.0" | ||
}, | ||
"gitHead": "9fd4283e8523ebfa39aeb8b9f3330c30cfcd9924" | ||
"gitHead": "58d4adda54d0b87f57c02af91345f0c2818816b9" | ||
} |
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
73056
6
781
+ Added@chainsafe/lodestar-config@0.21.0(transitive)
+ Added@chainsafe/lodestar-params@0.21.0(transitive)
+ Added@chainsafe/lodestar-types@0.21.0(transitive)
+ Added@chainsafe/lodestar-utils@0.21.0(transitive)
- Removedit-pushable@^1.4.0
- Removed@chainsafe/lodestar-config@0.20.0(transitive)
- Removed@chainsafe/lodestar-params@0.20.0(transitive)
- Removed@chainsafe/lodestar-types@0.20.0(transitive)
- Removed@chainsafe/lodestar-utils@0.20.0(transitive)
- Removedfast-fifo@1.3.2(transitive)
- Removedit-pushable@1.4.2(transitive)
Updated@chainsafe/ssz@^0.8.4