From 7890e516e15bc23ab596213f184cc2c81d8269ca Mon Sep 17 00:00:00 2001 From: Antoine Estienne Date: Wed, 3 Feb 2021 15:25:38 +0100 Subject: [PATCH] added test to fetch genesis by hash (#209) * added test to fetch genesis by hash * add test as skipped --- moonbeam-types-bundle/package-lock.json | 2 +- tests/tests/test-block.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/moonbeam-types-bundle/package-lock.json b/moonbeam-types-bundle/package-lock.json index 0287d97d23..a0f2bdf089 100644 --- a/moonbeam-types-bundle/package-lock.json +++ b/moonbeam-types-bundle/package-lock.json @@ -1,6 +1,6 @@ { "name": "moonbeam-types-bundle", - "version": "1.1.0", + "version": "1.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tests/tests/test-block.ts b/tests/tests/test-block.ts index f669ecc216..ba1bb23fdb 100644 --- a/tests/tests/test-block.ts +++ b/tests/tests/test-block.ts @@ -42,6 +42,27 @@ describeWithMoonbeam("Moonbeam RPC (Block)", `simple-specs.json`, (context) => { expect(block.timestamp).to.be.a("number"); }); + // TODO: unskip this when https://github.com/paritytech/frontier/pull/279 is merged + it.skip("fetch genesis block by hash", async function () { + //fetch block again using hash + const block = await context.web3.eth.getBlock(0); + const blockByHash = await context.web3.eth.getBlock(block.hash); + console.log("blockbyhash", blockByHash); + expect(blockByHash).to.include({ + author: "0x0000000000000000000000000000000000000000", + difficulty: "0", + extraData: "0x", + gasLimit: 4294967295, + gasUsed: 0, + logsBloom: `0x${"0".repeat(512)}`, + number: 0, + receiptsRoot: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + totalDifficulty: null, + transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + }); + }); + let firstBlockCreated = false; step("should be at block 1 after block production", async function () { this.timeout(15000);