Skip to content

Commit

Permalink
fix: use hot db instead of archive db
Browse files Browse the repository at this point in the history
  • Loading branch information
acuarica committed May 4, 2023
1 parent b8d1f06 commit e1acb85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/beacon-node/src/api/impl/beacon/blocks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ async function resolveBlockIdOrNull(
}

if (blockId === "justified") {
const justified = forkChoice.getJustifiedBlock();
return {
block: await db.blockArchive.get(forkChoice.getJustifiedBlock().slot),
block: await db.block.get(fromHexString(justified.blockRoot)),
executionOptimistic: false,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ describe("block api utils", function () {
});

it("should resolve justified", async function () {
const expected = 0;
forkChoiceStub.getJustifiedBlock.returns(expectedSummary);
await resolveBlockId(forkChoiceStub, dbStub, "justified").catch(() => {});
expect(dbStub.blockArchive.get).to.be.calledOnceWithExactly(expected);
expect(dbStub.block.get).to.be.calledOnceWithExactly(bufferEqualsMatcher(expectedBuffer));
});

it("should resolve finalized block root", async function () {
Expand Down

0 comments on commit e1acb85

Please sign in to comment.