{"action":"created","comment":{"url":"https://api.github.com/repos/LiskHQ/lisk/pulls/comments/168154600","pull_request_review_id":96451770,"id":168154600,"diff_hunk":"@@ -15,462 +15,2332 @@\n \n 'use strict';\n \n-var async = require('async');\n-var constants = require('../../../../helpers/constants');\n-var clearDatabaseTable = require('../../../common/db_sandbox')\n-\t.clearDatabaseTable;\n-var genesisBlock = require('../../../data/genesis_block.json');\n-var application = require('../../../common/application');\n+var rewire = require('rewire');\n+var Promise = require('bluebird');\n var modulesLoader = require('../../../common/modules_loader');\n-var loadTables = require('./process_tables_data.json');\n+\n+var BlocksProcess = rewire('../../../../modules/blocks/process.js');\n \n describe('blocks/process', () => {\n-\tvar blocksProcess;\n-\tvar blocks;\n-\tvar db;\n-\tvar originalBlockRewardsOffset;\n-\tvar scope;\n-\n-\tbefore(done => {\n-\t\t// Force rewards start at 150-th block\n-\t\toriginalBlockRewardsOffset = constants.rewards.offset;\n-\t\tconstants.rewards.offset = 150;\n-\t\tapplication.init(\n-\t\t\t{ sandbox: { name: 'lisk_test_blocks_process' } },\n-\t\t\t(err, internalScope) => {\n-\t\t\t\tblocksProcess = internalScope.modules.blocks.process;\n-\t\t\t\tblocks = internalScope.modules.blocks;\n-\t\t\t\tdb = internalScope.db;\n-\t\t\t\tscope = internalScope;\n-\t\t\t\tdone(err);\n-\t\t\t}\n+\tvar __private;\n+\tvar library;\n+\tvar modules;\n+\tvar blocksProcessModule;\n+\tvar dbStub;\n+\tvar loggerStub;\n+\tvar dummyBlock;\n+\tvar dummyCommonBlock;\n+\tvar blockStub;\n+\tvar transactionStub;\n+\tvar peersStub;\n+\tvar schemaStub;\n+\tvar modulesStub;\n+\tvar definitions;\n+\n+\tbeforeEach(() => {\n+\t\t// Logic\n+\t\tdbStub = {\n+\t\t\tblocks: {\n+\t\t\t\tgetCommonBlock: sinonSandbox.stub(),\n+\t\t\t\tloadBlocksOffset: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t};\n+\n+\t\tblockStub = {\n+\t\t\tobjectNormalize: sinonSandbox.stub(),\n+\t\t\tcreate: input => {\n+\t\t\t\treturn input;\n+\t\t\t},\n+\t\t};\n+\n+\t\tvar peerStub = {\n+\t\t\trpc: {\n+\t\t\t\tblocksCommon: sinonSandbox.stub(),\n+\t\t\t\tblocks: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tapplyHeaders: sinonSandbox.stub(),\n+\t\t\tstring: 'ip:wsPort',\n+\t\t};\n+\t\tdummyCommonBlock = { id: '3', previousBlock: '2', height: '3' };\n+\t\tpeerStub.rpc.blocksCommon\n+\t\t\t.withArgs(sinonSandbox.match({ ids: 'ERR' }))\n+\t\t\t.callsArgWith(1, 'rpc.blocksCommon-ERR', null)\n+\t\t\t.withArgs(sinonSandbox.match({ ids: 'rpc.blocksCommon-Empty' }))\n+\t\t\t.callsArgWith(1, null, { common: undefined })\n+\t\t\t.withArgs(sinonSandbox.match({ ids: 'OK' }))\n+\t\t\t.callsArgWith(1, null, {\n+\t\t\t\tcommon: dummyCommonBlock,\n+\t\t\t});\n+\n+\t\tpeerStub.rpc.blocks\n+\t\t\t.withArgs(sinonSandbox.match({ lastBlockId: 'ERR', peer: 'me' }))\n+\t\t\t.callsArgWith(1, 'rpc.blocks-ERR', null)\n+\t\t\t.withArgs(sinonSandbox.match({ lastBlockId: 'cb-ERR', peer: 'me' }))\n+\t\t\t.callsArgWith(1, null, { error: 'rpc.blocks-cb-ERR' })\n+\t\t\t.withArgs(sinonSandbox.match({ lastBlockId: 'empty', peer: 'me' }))\n+\t\t\t.callsArgWith(1, null, {\n+\t\t\t\tblocks: [],\n+\t\t\t})\n+\t\t\t.withArgs(sinonSandbox.match({ lastBlockId: '3', peer: 'me' }))\n+\t\t\t.callsArgWith(1, null, {\n+\t\t\t\tblocks: [dummyCommonBlock],\n+\t\t\t});\n+\n+\t\tpeersStub = {\n+\t\t\tcreate: () => {\n+\t\t\t\treturn peerStub;\n+\t\t\t},\n+\t\t\tme: () => {\n+\t\t\t\treturn 'me';\n+\t\t\t},\n+\t\t\tapplyHeaders: peerStub.applyHeaders,\n+\t\t};\n+\t\ttransactionStub = {\n+\t\t\tready: sinonSandbox.stub(),\n+\t\t\tverify: sinonSandbox.stub(),\n+\t\t};\n+\n+\t\tloggerStub = {\n+\t\t\ttrace: sinonSandbox.spy(),\n+\t\t\tinfo: sinonSandbox.spy(),\n+\t\t\terror: sinonSandbox.spy(),\n+\t\t\twarn: sinonSandbox.spy(),\n+\t\t\tdebug: sinonSandbox.spy(),\n+\t\t};\n+\n+\t\tschemaStub = {\n+\t\t\tvalidate: sinonSandbox.stub(),\n+\t\t};\n+\n+\t\tblocksProcessModule = new BlocksProcess(\n+\t\t\tloggerStub,\n+\t\t\tblockStub,\n+\t\t\tpeersStub,\n+\t\t\ttransactionStub,\n+\t\t\tschemaStub,\n+\t\t\tdbStub,\n+\t\t\tmodulesLoader.scope.dbSequence,\n+\t\t\tmodulesLoader.scope.sequence,\n+\t\t\tmodulesLoader.scope.genesisblock\n \t\t);\n+\t\tlibrary = BlocksProcess.__get__('library');\n+\t\t__private = BlocksProcess.__get__('__private');\n+\t\t// Modules\n+\t\tdummyBlock = {\n+\t\t\tid: '4',\n+\t\t\theight: 4,\n+\t\t\ttimestamp: 41287231,\n+\t\t\treward: 100,\n+\t\t};\n+\n+\t\tvar modulesAccountsStub = {\n+\t\t\tgetAccount: sinonSandbox.stub(),\n+\t\t};\n+\t\tvar modulesBlocksStub = {\n+\t\t\tlastReceipt: {\n+\t\t\t\tupdate: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tverify: {\n+\t\t\t\tprocessBlock: sinonSandbox.stub(),\n+\t\t\t\tverifyReceipt: sinonSandbox.stub(),\n+\t\t\t\tverifyBlock: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tchain: {\n+\t\t\t\tdeleteLastBlock: sinonSandbox.stub(),\n+\t\t\t\trecoverChain: sinonSandbox.stub(),\n+\t\t\t\tapplyBlock: sinonSandbox.stub(),\n+\t\t\t\tapplyGenesisBlock: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tutils: {\n+\t\t\t\tgetIdSequence: sinonSandbox.stub(),\n+\t\t\t\treadDbRows: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tisCleaning: {\n+\t\t\t\tget: sinonSandbox.stub(),\n+\t\t\t},\n+\t\t\tlastBlock: {\n+\t\t\t\tget: sinonSandbox.stub().returns({\n+\t\t\t\t\tid: '2',\n+\t\t\t\t\theight: 2,\n+\t\t\t\t}),\n+\t\t\t},\n+\t\t};\n+\n+\t\tvar modulesDelegatesStub = {\n+\t\t\tfork: sinonSandbox.stub(),\n+\t\t\tvalidateBlockSlotAgainstPreviousRound: sinonSandbox.stub(),\n+\t\t\tvalidateBlockSlot: sinonSandbox.stub(),\n+\t\t};\n+\n+\t\tvar modulesLoaderStub = {\n+\t\t\tsyncing: sinonSandbox.stub(),\n+\t\t};\n+\t\tvar modulesRoundsStub = {\n+\t\t\tticking: sinonSandbox.stub(),\n+\t\t};\n+\t\tvar modulesTransactionsStub = {\n+\t\t\tgetUnconfirmedTransactionList: sinonSandbox.stub(),\n+\t\t};\n+\t\tvar modulesTransportStub = {\n+\t\t\tpoorConsensus: sinonSandbox.stub(),\n+\t\t};\n+\t\tvar swaggerDefinitionsStub = sinonSandbox.stub();\n+\n+\t\tmodulesStub = {\n+\t\t\taccounts: modulesAccountsStub,\n+\t\t\tblocks: modulesBlocksStub,\n+\t\t\tdelegates: modulesDelegatesStub,\n+\t\t\tloader: modulesLoaderStub,\n+\t\t\trounds: modulesRoundsStub,\n+\t\t\ttransactions: modulesTransactionsStub,\n+\t\t\ttransport: modulesTransportStub,\n+\t\t\tswagger: {\n+\t\t\t\tdefinitions: swaggerDefinitionsStub,\n+\t\t\t},\n+\t\t};\n+\t\tblocksProcessModule.onBind(modulesStub);\n+\t\tmodules = BlocksProcess.__get__('modules');\n+\t\tdefinitions = BlocksProcess.__get__('definitions');\n \t});\n \n-\tafter(done => {\n-\t\tconstants.rewards.offset = originalBlockRewardsOffset;\n-\t\tapplication.cleanup(done);\n+\tafterEach(() => {\n+\t\tsinonSandbox.restore();\n \t});\n \n-\tbeforeEach(done => {\n-\t\tasync.series(\n-\t\t\t{\n-\t\t\t\tclearTables(seriesCb) {\n-\t\t\t\t\tasync.every(\n-\t\t\t\t\t\t[\n-\t\t\t\t\t\t\t'blocks where height > 1',\n-\t\t\t\t\t\t\t'trs where \"blockId\" != \\'6524861224470851795\\'',\n-\t\t\t\t\t\t\t\"mem_accounts where address in ('2737453412992791987L', '2896019180726908125L')\",\n-\t\t\t\t\t\t\t'forks_stat',\n-\t\t\t\t\t\t\t'votes where \"transactionId\" = \\'17502993173215211070\\'',\n-\t\t\t\t\t\t],\n-\t\t\t\t\t\t(table, seriesCb) => {\n-\t\t\t\t\t\t\tclearDatabaseTable(db, modulesLoader.logger, table, seriesCb);\n-\t\t\t\t\t\t},\n-\t\t\t\t\t\terr => {\n-\t\t\t\t\t\t\tif (err) {\n-\t\t\t\t\t\t\t\treturn setImmediate(err);\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\treturn setImmediate(seriesCb);\n-\t\t\t\t\t\t}\n-\t\t\t\t\t);\n-\t\t\t\t},\n-\t\t\t\tloadTables(seriesCb) {\n-\t\t\t\t\tasync.everySeries(\n-\t\t\t\t\t\tloadTables,\n-\t\t\t\t\t\t(table, seriesCb) => {\n-\t\t\t\t\t\t\tvar cs = new db.$config.pgp.helpers.ColumnSet(table.fields, {\n-\t\t\t\t\t\t\t\ttable: table.name,\n-\t\t\t\t\t\t\t});\n-\t\t\t\t\t\t\tvar insert = db.$config.pgp.helpers.insert(table.data, cs);\n-\t\t\t\t\t\t\tdb\n-\t\t\t\t\t\t\t\t.none(insert)\n-\t\t\t\t\t\t\t\t.then(() => {\n-\t\t\t\t\t\t\t\t\tseriesCb(null, true);\n-\t\t\t\t\t\t\t\t})\n-\t\t\t\t\t\t\t\t.catch(err => {\n-\t\t\t\t\t\t\t\t\treturn setImmediate(err);\n-\t\t\t\t\t\t\t\t});\n-\t\t\t\t\t\t},\n-\t\t\t\t\t\terr => {\n-\t\t\t\t\t\t\tif (err) {\n-\t\t\t\t\t\t\t\treturn setImmediate(err);\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t\treturn setImmediate(seriesCb);\n-\t\t\t\t\t\t}\n-\t\t\t\t\t);\n-\t\t\t\t},\n-\t\t\t},\n-\t\t\terr => {\n-\t\t\t\tif (err) {\n-\t\t\t\t\treturn done(err);\n-\t\t\t\t}\n+\tdescribe('constructor', () => {\n+\t\tit('should assign params to library', () => {\n+\t\t\texpect(library.logger).to.eql(loggerStub);\n+\t\t\texpect(library.schema).to.eql(schemaStub);\n+\t\t\texpect(library.db).to.eql(dbStub);\n+\t\t\texpect(library.dbSequence).to.eql(modulesLoader.scope.dbSequence);\n+\t\t\texpect(library.sequence).to.eql(modulesLoader.scope.sequence);\n+\t\t\texpect(library.genesisblock).to.eql(modulesLoader.scope.genesisblock);\n+\t\t\texpect(library.logic.block).to.eql(blockStub);\n+\t\t\texpect(library.logic.peers).to.eql(peersStub);\n+\t\t\texpect(library.logic.transaction).to.eql(transactionStub);\n+\t\t});\n+\n+\t\tit('should call library.logger.trace with \"Blocks->Process: Submodule initialized.\"', () => {\n+\t\t\texpect(loggerStub.trace.args[0][0]).to.equal(\n+\t\t\t\t'Blocks->Process: Submodule initialized.'\n+\t\t\t);\n+\t\t});\n+\n+\t\tit('should return self', () => {\n+\t\t\texpect(blocksProcessModule).to.be.an('object');\n+\t\t\texpect(blocksProcessModule.getCommonBlock).to.be.a('function');\n+\t\t\texpect(blocksProcessModule.loadBlocksOffset).to.be.a('function');\n+\t\t\texpect(blocksProcessModule.loadBlocksFromPeer).to.be.a('function');\n+\t\t\texpect(blocksProcessModule.generateBlock).to.be.a('function');\n+\t\t\texpect(blocksProcessModule.onReceiveBlock).to.be.a('function');\n+\t\t\texpect(blocksProcessModule.onBind).to.be.a('function');\n+\t\t});\n+\t});\n+\n+\tdescribe('__private.receiveBlock', () => {\n+\t\tit('should return error when block is not valid', done => {\n+\t\t\tmodules.blocks.verify.processBlock.callsArgWith(\n+\t\t\t\t3,\n+\t\t\t\t'verify.processBlock-ERR',\n+\t\t\t\tnull\n+\t\t\t);\n+\n+\t\t\t__private.receiveBlock({ id: 'ERR' }, (err, cb) => {\n+\t\t\t\texpect(err).to.equal('verify.processBlock-ERR');\n+\t\t\t\texpect(cb).to.be.null;\n+\t\t\t\texpect(modules.blocks.lastReceipt.update.calledOnce).to.be.true;\n \t\t\t\tdone();\n-\t\t\t}\n-\t\t);\n+\t\t\t});\n+\t\t});\n+\n+\t\tit('should return cb when block is valid', done => {\n+\t\t\tmodules.blocks.verify.processBlock.callsArgWith(3, null, true);\n+\n+\t\t\t__private.receiveBlock(dummyBlock, (err, cb) => {\n+\t\t\t\texpect(err).to.be.null;\n+\t\t\t\texpect(cb).to.be.true;\n+\t\t\t\texpect(loggerStub.info.args[0]).to.contains(\n+\t\t\t\t\t'Received new block id: 4 height: 4 round: 1 slot: 4128723 reward: 100'\n+\t\t\t\t);\n+\t\t\t\texpect(modules.blocks.lastReceipt.update.calledOnce).to.be.true;\n+\t\t\t\tdone();\n+\t\t\t});\n+\t\t});\n \t});\n \n-\tdescribe('getCommonBlock()', () => {\n-\t\tdescribe('validation with definitions.CommonBlock', () => {\n-\t\t\tvar validCommonBlock;\n-\t\t\tvar blockHeightTwo = {\n-\t\t\t\tid: '3082931137036442832',\n-\t\t\t\tpreviousBlock: '6524861224470851795',\n-\t\t\t\ttimestamp: '52684260',\n-\t\t\t\theight: 2,\n-\t\t\t};\n+\tdescribe('__private.receiveForkOne', () => {\n+\t\tvar tempValidateBlockSlot;\n+\t\tbefore(() => {\n+\t\t\ttempValidateBlockSlot = __private.validateBlockSlot;\n+\t\t});\n \n-\t\t\tvar commonBlockValidationError;\n+\t\tafter(() => {\n+\t\t\t__private.validateBlockSlot = tempValidateBlockSlot;\n+\t\t});\n \n-\t\t\tbeforeEach(() => {\n-\t\t\t\tscope.schema.validate(\n-\t\t\t\t\tvalidCommonBlock,\n-\t\t\t\t\tscope.swagger.definitions.CommonBlock,\n-\t\t\t\t\terr => {\n-\t\t\t\t\t\tcommonBlockValidationError = err;\n+\t\tdescribe('Last block stands', () => {\n+\t\t\tafterEach(() => {\n+\t\t\t\texpect(loggerStub.info.args[0][0]).to.equal('Last block stands');\n+\t\t\t\texpect(\n+\t\t\t\t\tmodules.delegates.fork.calledWithExactly(sinonSandbox.match.object, 1)\n+\t\t\t\t).to.be.true;\n+\t\t\t});\n+\n+\t\t\tit('should return when block.timestamp > lastBlock.timestamp', done => {\n+\t\t\t\t__private.receiveForkOne(\n+\t\t\t\t\t{ timestamp: 2 },\n+\t\t\t\t\t{ timestamp: 1 },\n+\t\t\t\t\t(err, cb) => {\n+\t\t\t\t\t\texpect(err).to.be.undefined;\n+\t\t\t\t\t\texpect(cb).to.be.undefined;\n+\t\t\t\t\t\tdone();\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t});\n \n-\t\t\tdescribe('when rpc.commonBlock call returns valid result', () => {\n-\t\t\t\tbefore(() => {\n-\t\t\t\t\tvalidCommonBlock = Object.assign({}, blockHeightTwo);\n-\t\t\t\t});\n+\t\t\tit('should return when timestamps are equals and block.id > lastBlock.id', done => {\n+\t\t\t\t__private.receiveForkOne(\n+\t\t\t\t\t{ timestamp: 1, id: 2 },\n+\t\t\t\t\t{ timestamp: 1, id: 1 },\n+\t\t\t\t\t(err, cb) => {\n+\t\t\t\t\t\texpect(err).to.be.undefined;\n+\t\t\t\t\t\texpect(cb).to.be.undefined;\n+\t\t\t\t\t\tdone();\n+\t\t\t\t\t}\n+\t\t\t\t);\n+\t\t\t});\n+\t\t});\n \n-\t\t\t\tit('should return error = null', () => {\n-\t\t\t\t\texpect(commonBlockValidationError).to.be.undefined;\n-\t\t\t\t});\n+\t\tdescribe('Last block and parent loses', () => {\n+\t\t\tbeforeEach(() => {\n+\t\t\t\t__private.validateBlockSlot = sinonSandbox.stub();\n \t\t\t});\n \n-\t\t\tdescribe('when rpc.commonBlock call returns invalid result', () => {\n-\t\t\t\tdescribe('when id = null', () => {\n-\t\t\t\t\tbefore(() => {\n-\t\t\t\t\t\tvalidCommonBlock = Object.assign({}, blockHeightTwo);\n-\t\t\t\t\t\tvalidCommonBlock.id = null;\n-\t\t\t\t\t});\n+\t\t\tafterEach(() => {\n+\t\t\t\texpect(loggerStub.info.args[0][0]).to.equal(\n+\t\t\t\t\t'Last block and parent loses'\n+\t\t\t\t);\n+\t\t\t\texpect(\n+\t\t\t\t\tmodules.delegates.fork.calledWithExactly(sinonSandbox.match.object, 1)\n+\t\t\t\t).to.be.true;\n+\t\t\t});\n \n-\t\t\t\t\tit('should return array of errors', () => {\n-\t\t\t\t\t\texpect(commonBlockValidationError)\n-\t\t\t\t\t\t\t.to.be.an('array')\n-\t\t\t\t\t\t\t.of.length(1);\n+\t\t\tdescribe('library.logic.block.objectNormalize', () => {\n+\t\t\t\tdescribe('when fails', () => {\n+\t\t\t\t\tbeforeEach(() => {\n+\t\t\t\t\t\tlibrary.logic.block.objectNormalize.throws('objectNormalize-ERR');\n \t\t\t\t\t});\n \n-\t\t\t\t\tit('should return error containing message', () => {\n-\t\t\t\t\t\texpect(commonBlockValidationError)\n-\t\t\t\t\t\t\t.to.have.nested.property('0.message')\n-\t\t\t\t\t\t\t.equal('Expected type string but found type null');\n+\t\t\t\t\tit('should throw error', done => {","path":"test/unit/modules/blocks/process.js","position":441,"original_position":441,"commit_id":"c7a873d7d11287fd3330297b1768cdce8ba5edcd","original_commit_id":"c7a873d7d11287fd3330297b1768cdce8ba5edcd","user":{"login":"4miners","id":22824146,"avatar_url":"https://avatars0.githubusercontent.com/u/22824146?v=4","gravatar_id":"","url":"https://api.github.com/users/4miners","html_url":"https://github.com/4miners","followers_url":"https://api.github.com/users/4miners/followers","following_url":"https://api.github.com/users/4miners/following{/other_user}","gists_url":"https://api.github.com/users/4miners/gists{/gist_id}","starred_url":"https://api.github.com/users/4miners/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/4miners/subscriptions","organizations_url":"https://api.github.com/users/4miners/orgs","repos_url":"https://api.github.com/users/4miners/repos","events_url":"https://api.github.com/users/4miners/events{/privacy}","received_events_url":"https://api.github.com/users/4miners/received_events","type":"User","site_admin":false},"body":"should call a callback with error","created_at":"2018-02-14T12:06:42Z","updated_at":"2018-02-14T12:28:04Z","html_url":"https://github.com/LiskHQ/lisk/pull/1524#discussion_r168154600","pull_request_url":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/comments/168154600"},"html":{"href":"https://github.com/LiskHQ/lisk/pull/1524#discussion_r168154600"},"pull_request":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524"}}},"pull_request":{"url":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524","id":167564699,"html_url":"https://github.com/LiskHQ/lisk/pull/1524","diff_url":"https://github.com/LiskHQ/lisk/pull/1524.diff","patch_url":"https://github.com/LiskHQ/lisk/pull/1524.patch","issue_url":"https://api.github.com/repos/LiskHQ/lisk/issues/1524","number":1524,"state":"open","locked":false,"title":"Add unit test coverage for modules blocks.process - Closes #1483","user":{"login":"LucasIsasmendi","id":4970546,"avatar_url":"https://avatars3.githubusercontent.com/u/4970546?v=4","gravatar_id":"","url":"https://api.github.com/users/LucasIsasmendi","html_url":"https://github.com/LucasIsasmendi","followers_url":"https://api.github.com/users/LucasIsasmendi/followers","following_url":"https://api.github.com/users/LucasIsasmendi/following{/other_user}","gists_url":"https://api.github.com/users/LucasIsasmendi/gists{/gist_id}","starred_url":"https://api.github.com/users/LucasIsasmendi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucasIsasmendi/subscriptions","organizations_url":"https://api.github.com/users/LucasIsasmendi/orgs","repos_url":"https://api.github.com/users/LucasIsasmendi/repos","events_url":"https://api.github.com/users/LucasIsasmendi/events{/privacy}","received_events_url":"https://api.github.com/users/LucasIsasmendi/received_events","type":"User","site_admin":false},"body":"### What was the problem?\r\nMissed unit test for modules blocks process\r\n### How did I fix it?\r\nMoved current test to functional.\r\nAdded unit tests to skeleton file.\r\n### Review checklist\r\n\r\n* The PR solves #1483\r\n* All new code is covered with unit tests\r\n* All new code was formatted with Prettier\r\n* Linting passes\r\n* Tests pass\r\n* Commit messages follow the [commit guidelines](CONTRIBUTING.md#git-commit-messages)\r\n* Documentation has been added/updated\r\n","created_at":"2018-02-07T00:08:40Z","updated_at":"2018-02-14T12:28:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"826fe74c6152b462c99a954466882dce44feb3e4","assignee":{"login":"karmacoma","id":8068,"avatar_url":"https://avatars0.githubusercontent.com/u/8068?v=4","gravatar_id":"","url":"https://api.github.com/users/karmacoma","html_url":"https://github.com/karmacoma","followers_url":"https://api.github.com/users/karmacoma/followers","following_url":"https://api.github.com/users/karmacoma/following{/other_user}","gists_url":"https://api.github.com/users/karmacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/karmacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmacoma/subscriptions","organizations_url":"https://api.github.com/users/karmacoma/orgs","repos_url":"https://api.github.com/users/karmacoma/repos","events_url":"https://api.github.com/users/karmacoma/events{/privacy}","received_events_url":"https://api.github.com/users/karmacoma/received_events","type":"User","site_admin":false},"assignees":[{"login":"karmacoma","id":8068,"avatar_url":"https://avatars0.githubusercontent.com/u/8068?v=4","gravatar_id":"","url":"https://api.github.com/users/karmacoma","html_url":"https://github.com/karmacoma","followers_url":"https://api.github.com/users/karmacoma/followers","following_url":"https://api.github.com/users/karmacoma/following{/other_user}","gists_url":"https://api.github.com/users/karmacoma/gists{/gist_id}","starred_url":"https://api.github.com/users/karmacoma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karmacoma/subscriptions","organizations_url":"https://api.github.com/users/karmacoma/orgs","repos_url":"https://api.github.com/users/karmacoma/repos","events_url":"https://api.github.com/users/karmacoma/events{/privacy}","received_events_url":"https://api.github.com/users/karmacoma/received_events","type":"User","site_admin":false},{"login":"LucasIsasmendi","id":4970546,"avatar_url":"https://avatars3.githubusercontent.com/u/4970546?v=4","gravatar_id":"","url":"https://api.github.com/users/LucasIsasmendi","html_url":"https://github.com/LucasIsasmendi","followers_url":"https://api.github.com/users/LucasIsasmendi/followers","following_url":"https://api.github.com/users/LucasIsasmendi/following{/other_user}","gists_url":"https://api.github.com/users/LucasIsasmendi/gists{/gist_id}","starred_url":"https://api.github.com/users/LucasIsasmendi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucasIsasmendi/subscriptions","organizations_url":"https://api.github.com/users/LucasIsasmendi/orgs","repos_url":"https://api.github.com/users/LucasIsasmendi/repos","events_url":"https://api.github.com/users/LucasIsasmendi/events{/privacy}","received_events_url":"https://api.github.com/users/LucasIsasmendi/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":655482394,"url":"https://api.github.com/repos/LiskHQ/lisk/labels/pending%20review","name":"pending review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524/commits","review_comments_url":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524/comments","review_comment_url":"https://api.github.com/repos/LiskHQ/lisk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LiskHQ/lisk/issues/1524/comments","statuses_url":"https://api.github.com/repos/LiskHQ/lisk/statuses/c7a873d7d11287fd3330297b1768cdce8ba5edcd","head":{"label":"LiskHQ:1483-unit-test-m-blocks-process","ref":"1483-unit-test-m-blocks-process","sha":"c7a873d7d11287fd3330297b1768cdce8ba5edcd","user":{"login":"LiskHQ","id":16600915,"avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":50873641,"name":"lisk","full_name":"LiskHQ/lisk","owner":{"login":"LiskHQ","id":16600915,"avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LiskHQ/lisk","description":"📟 Lisk blockchain application platform","fork":false,"url":"https://api.github.com/repos/LiskHQ/lisk","forks_url":"https://api.github.com/repos/LiskHQ/lisk/forks","keys_url":"https://api.github.com/repos/LiskHQ/lisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiskHQ/lisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiskHQ/lisk/teams","hooks_url":"https://api.github.com/repos/LiskHQ/lisk/hooks","issue_events_url":"https://api.github.com/repos/LiskHQ/lisk/issues/events{/number}","events_url":"https://api.github.com/repos/LiskHQ/lisk/events","assignees_url":"https://api.github.com/repos/LiskHQ/lisk/assignees{/user}","branches_url":"https://api.github.com/repos/LiskHQ/lisk/branches{/branch}","tags_url":"https://api.github.com/repos/LiskHQ/lisk/tags","blobs_url":"https://api.github.com/repos/LiskHQ/lisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiskHQ/lisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiskHQ/lisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiskHQ/lisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiskHQ/lisk/statuses/{sha}","languages_url":"https://api.github.com/repos/LiskHQ/lisk/languages","stargazers_url":"https://api.github.com/repos/LiskHQ/lisk/stargazers","contributors_url":"https://api.github.com/repos/LiskHQ/lisk/contributors","subscribers_url":"https://api.github.com/repos/LiskHQ/lisk/subscribers","subscription_url":"https://api.github.com/repos/LiskHQ/lisk/subscription","commits_url":"https://api.github.com/repos/LiskHQ/lisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiskHQ/lisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiskHQ/lisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiskHQ/lisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiskHQ/lisk/contents/{+path}","compare_url":"https://api.github.com/repos/LiskHQ/lisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiskHQ/lisk/merges","archive_url":"https://api.github.com/repos/LiskHQ/lisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiskHQ/lisk/downloads","issues_url":"https://api.github.com/repos/LiskHQ/lisk/issues{/number}","pulls_url":"https://api.github.com/repos/LiskHQ/lisk/pulls{/number}","milestones_url":"https://api.github.com/repos/LiskHQ/lisk/milestones{/number}","notifications_url":"https://api.github.com/repos/LiskHQ/lisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiskHQ/lisk/labels{/name}","releases_url":"https://api.github.com/repos/LiskHQ/lisk/releases{/id}","deployments_url":"https://api.github.com/repos/LiskHQ/lisk/deployments","created_at":"2016-02-01T21:45:35Z","updated_at":"2018-02-14T10:03:07Z","pushed_at":"2018-02-14T11:42:12Z","git_url":"git://github.com/LiskHQ/lisk.git","ssh_url":"git@github.com:LiskHQ/lisk.git","clone_url":"https://github.com/LiskHQ/lisk.git","svn_url":"https://github.com/LiskHQ/lisk","homepage":"https://lisk.io/","size":15108,"stargazers_count":1922,"watchers_count":1922,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":274,"mirror_url":null,"archived":false,"open_issues_count":91,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":274,"open_issues":91,"watchers":1922,"default_branch":"development"}},"base":{"label":"LiskHQ:1.0.0","ref":"1.0.0","sha":"34340bf2076fa94f0490d105500934b51b2121b1","user":{"login":"LiskHQ","id":16600915,"avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":50873641,"name":"lisk","full_name":"LiskHQ/lisk","owner":{"login":"LiskHQ","id":16600915,"avatar_url":"https://avatars1.githubusercontent.com/u/16600915?v=4","gravatar_id":"","url":"https://api.github.com/users/LiskHQ","html_url":"https://github.com/LiskHQ","followers_url":"https://api.github.com/users/LiskHQ/followers","following_url":"https://api.github.com/users/LiskHQ/following{/other_user}","gists_url":"https://api.github.com/users/LiskHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/LiskHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiskHQ/subscriptions","organizations_url":"https://api.github.com/users/LiskHQ/orgs","repos_url":"https://api.github.com/users/LiskHQ/repos","events_url":"https://api.github.com/users/LiskHQ/events{/privacy}","received_events_url":"https://api.github.com/users/LiskHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LiskHQ/lisk","description":"📟 Lisk blockchain application platform","fork":false,"url":"https://api.github.com/repos/LiskHQ/lisk","forks_url":"https://api.github.com/repos/LiskHQ/lisk/forks","keys_url":"https://api.github.com/repos/LiskHQ/lisk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiskHQ/lisk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiskHQ/lisk/teams","hooks_url":"https://api.github.com/repos/LiskHQ/lisk/hooks","issue_events_url":"https://api.github.com/repos/LiskHQ/lisk/issues/events{/number}","events_url":"https://api.github.com/repos/LiskHQ/lisk/events","assignees_url":"https://api.github.com/repos/LiskHQ/lisk/assignees{/user}","branches_url":"https://api.github.com/repos/LiskHQ/lisk/branches{/branch}","tags_url":"https://api.github.com/repos/LiskHQ/lisk/tags","blobs_url":"https://api.github.com/repos/LiskHQ/lisk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiskHQ/lisk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiskHQ/lisk/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiskHQ/lisk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiskHQ/lisk/statuses/{sha}","languages_url":"https://api.github.com/repos/LiskHQ/lisk/languages","stargazers_url":"https://api.github.com/repos/LiskHQ/lisk/stargazers","contributors_url":"https://api.github.com/repos/LiskHQ/lisk/contributors","subscribers_url":"https://api.github.com/repos/LiskHQ/lisk/subscribers","subscription_url":"https://api.github.com/repos/LiskHQ/lisk/subscription","commits_url":"https://api.github.com/repos/LiskHQ/lisk/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiskHQ/lisk/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiskHQ/lisk/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiskHQ/lisk/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiskHQ/lisk/contents/{+path}","compare_url":"https://api.github.com/repos/LiskHQ/lisk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiskHQ/lisk/merges","archive_url":"https://api.github.com/repos/LiskHQ/lisk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiskHQ/lisk/downloads","issues_url":"https://api.github.com/repos/LiskHQ/lisk/issues{/number}","pulls_url":"https://api.github.com/repos/LiskHQ/lisk/pulls{/number}","milestones_url":"https://api.github.com/repos/LiskHQ/lisk/milestones{/number}","notifications_url":"https://api.github.com/repos/LiskHQ/lisk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiskHQ/lisk/labels{/name}","releases_url":"https://api.github.com/repos/LiskHQ/lisk/releases{/id}","deployments_url":"https://api.github.com/repos/LiskHQ/lisk/deployments","created_at":"2016-02-01T21:45:35Z","updated_at":"2018-02-14T10:03:07Z","pushed_at":"2018-02-14T11:42:12Z","git_url":"git://github.com/LiskHQ/lisk.git","ssh_url":"git@github.com:LiskHQ/lisk.git","clone_url":"https://github.com/LiskHQ/lisk.git","svn_url":"https://github.com/LiskHQ/lisk","homepage":"https://lisk.io/","size":15108,"stargazers_count":1922,"watchers_count":1922,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":274,"mirror_url":null,"archived":false,"open_issues_count":91,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":274,"open_issues":91,"watchers":1922,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524"},"html":{"href":"https://github.com/LiskHQ/lisk/pull/1524"},"issue":{"href":"https://api.github.com/repos/LiskHQ/lisk/issues/1524"},"comments":{"href":"https://api.github.com/repos/LiskHQ/lisk/issues/1524/comments"},"review_comments":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524/comments"},"review_comment":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LiskHQ/lisk/pulls/1524/commits"},"statuses":{"href":"https://api.github.com/repos/LiskHQ/lisk/statuses/c7a873d7d11287fd3330297b1768cdce8ba5edcd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"4miners"}}