From 0ebd7aa23b2c8acceff835669afb0ad50a9d03a1 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 30 May 2019 17:32:35 -0400 Subject: [PATCH] add transactions to get block methods --- remix-simulator/src/methods/blocks.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/remix-simulator/src/methods/blocks.js b/remix-simulator/src/methods/blocks.js index 0df94a0bbc..f9a831f117 100644 --- a/remix-simulator/src/methods/blocks.js +++ b/remix-simulator/src/methods/blocks.js @@ -38,9 +38,7 @@ Blocks.prototype.eth_getBlockByNumber = function (payload, cb) { 'gasLimit': toHex(block.header.gasLimit), 'gasUsed': toHex(block.header.gasUsed), "timestamp": toHex(block.header.timestamp), - // TODO: add transactions - // block.transactions - "transactions": [], + "transactions": block.transactions.map((t) => "0x" + t.hash().toString('hex')), "uncles": [] } @@ -79,9 +77,7 @@ Blocks.prototype.eth_getBlockByHash = function (payload, cb) { 'gasLimit': toHex(block.header.gasLimit), 'gasUsed': toHex(block.header.gasUsed), "timestamp": toHex(block.header.timestamp), - // TODO: add transactions - // block.transactions - "transactions": [], + "transactions": block.transactions.map((t) => "0x" + t.hash().toString('hex')), "uncles": [] }