From c59c71f60184dafb478fc7ce49db2ef722a59523 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Mon, 15 Feb 2021 20:58:15 +0200 Subject: [PATCH] Get current block upon initialization --- package.json | 2 +- src/blocks/blocksSaga.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c081bf..4b97ea2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ezerous/drizzle", - "version": "0.4.2", + "version": "0.4.3", "description": "A reactive data-store for web3 and smart contracts.", "license": "MIT", "author": "Ezerous ", diff --git a/src/blocks/blocksSaga.js b/src/blocks/blocksSaga.js index 1a1fd6b..44046d1 100644 --- a/src/blocks/blocksSaga.js +++ b/src/blocks/blocksSaga.js @@ -36,6 +36,10 @@ export function createBlockChannel ({ drizzle, web3 }) { } function * callCreateBlockChannel ({ drizzle, web3 }) { + // Get current block + const currentBlock = yield call(web3.eth.getBlock,"latest"); + yield put ({ type: BlocksActions.BLOCK_RECEIVED, blockHeader: currentBlock, drizzle, web3 }) + const blockChannel = yield call(createBlockChannel, { drizzle, web3