Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Use HEX
Browse files Browse the repository at this point in the history
  • Loading branch information
eggplantzzz committed Feb 18, 2021
1 parent cf6d9d4 commit 609c25c
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ describe("api", () => {
});
it("returns the block difficulty", async () => {
const block = await provider.send("eth_getBlockByNumber", ["latest"]);
assert.strictEqual(block.difficulty, `0x${DEFAULT_DIFFICULTY}`);
assert.strictEqual(
block.difficulty,
`0x${DEFAULT_DIFFICULTY.toString(16)}`
);
});
});

Expand All @@ -47,7 +50,7 @@ describe("api", () => {
const block = await provider.send("eth_getBlockByNumber", ["0x0"]);
assert.strictEqual(
block.totalDifficulty,
`0x${DEFAULT_DIFFICULTY}`
`0x${DEFAULT_DIFFICULTY.toString(16)}`
);
});
it("equals the sum of the difficulty of all blocks (hex)", async () => {
Expand Down Expand Up @@ -79,7 +82,10 @@ describe("api", () => {

it("equals the block difficulty for the genesis block", async () => {
const block = await provider.send("eth_getBlockByNumber", ["0x0"]);
assert.strictEqual(block.totalDifficulty, `0x${difficulty}`);
assert.strictEqual(
block.totalDifficulty,
`0x${difficulty.toString(16)}`
);
});
it("equals the sum of the difficulty of all blocks (hex)", async () => {
const numberOfBlocksToMine = Math.floor(Math.random() * 10 + 1);
Expand Down

0 comments on commit 609c25c

Please sign in to comment.