Closed nazarhussain closed 5 years ago
One who work own this, must use the shared logic of sort functions
on these two places
blocksLogic.storageRead(block);
I think this function can use blocks
functionality to read blocks and a pure function in blocksLogic
that only processes this.
Same for const block = blocksLogic.dbRead(rows[i]);
@nazarhussain
All dependepdecies to block/utils.js
must be passed as arguments.
Expected behavior
Blocks/Utils must be pure utility functions without have any dependency on any other module.
Actual behavior
Currently the
block/utils.js
is requiringblock.js
which is requiring theblock_v1.js
andblock_v2.js
. It violates the concepts of utility functions. Also in case we need to use some utility function insideblock_v1.js
orblock_v2.js
, it creates a circular dependency and failed.https://github.com/LiskHQ/lisk-sdk/blob/8920e9dd4bd1be8aa578d294395fe46d50b0f970/framework/src/modules/chain/blocks/utils.js#L20
Which version(s) does this affect? (Environment, OS, etc...)
2.3.0