Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2.3.4' of https://github.com/LiskHQ/lisk-sdk-pri…
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Sep 12, 2019
2 parents cefffa7 + 87bf6d0 commit 87a989c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion framework/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-framework",
"version": "0.4.3",
"version": "0.4.4",
"description": "Lisk blockchain application platform",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand Down
6 changes: 5 additions & 1 deletion framework/src/modules/chain/rounds/delegates.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ class Delegates {
cause,
};

await this.storage.entities.Account.insertFork(fork);
try {
await this.storage.entities.Account.insertFork(fork);
} catch (err) {
this.logger.warn(err, 'Failed to insert fork info');
}
this.channel.publish('chain:delegates:fork', fork);
}

Expand Down
20 changes: 20 additions & 0 deletions framework/test/mocha/unit/modules/chain/submodules/delegates.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('delegates', () => {
const mockLogger = {
debug: sinonSandbox.stub(),
info: sinonSandbox.stub(),
warn: sinonSandbox.stub(),
error: sinonSandbox.stub(),
};
const mockStorage = {
Expand Down Expand Up @@ -112,6 +113,25 @@ describe('delegates', () => {
fork,
);
});

it('should not throw an error when the database fails', async () => {
const fork = {
delegatePublicKey: dummyBlock.generatorPublicKey,
blockTimestamp: dummyBlock.timestamp,
blockId: dummyBlock.id,
blockHeight: dummyBlock.height,
previousBlockId: dummyBlock.previousBlock,
cause,
};
mockStorage.entities.Account.insertFork.rejects(
new Error('invalid DB state'),
);
await delegatesModule.fork(dummyBlock, cause);
expect(mockChannel.publish).to.be.calledWithExactly(
'chain:delegates:fork',
fork,
);
});
});

describe('#generateDelegateList', () => {
Expand Down
2 changes: 1 addition & 1 deletion sdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-sdk",
"version": "2.3.3",
"version": "2.3.4",
"description": "Official SDK for the Lisk blockchain application platform",
"author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",
"license": "Apache-2.0",
Expand All @@ -25,6 +25,6 @@
"@liskhq/bignum": "1.3.1",
"@liskhq/lisk-cryptography": "2.3.0",
"@liskhq/lisk-transactions": "2.3.1",
"lisk-framework": "0.4.3"
"lisk-framework": "0.4.4"
}
}

0 comments on commit 87a989c

Please sign in to comment.