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

Commit

Permalink
Fix transport test and block fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ishantiw committed May 12, 2020
1 parent 197a13a commit 139a223
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions framework/test/fixtures/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Block = stampit({
// Must to provide
this.previousBlockId = previousBlockId;

this.id = id || randomstring.generate({ charset: 'numeric', length: 20 });
this.id = id || randomstring.generate({ charset: 'numeric', length: 64 });
this.generatorPublicKey =
generatorPublicKey ||
randomstring
Expand Down Expand Up @@ -79,7 +79,7 @@ const GenesisBlock = stampit(Block, {
generatorPublicKey || genesisBlock.generatorPublicKey;
this.blockSignature = genesisBlock.blockSignature;
this.payloadHash = genesisBlock.payloadHash;
this.previousBlockId = null;
this.previousBlockId = genesisBlock.id;
this.height = 1;
this.numberOfTransactions = 0;
this.reward = '111';
Expand Down Expand Up @@ -107,7 +107,7 @@ const BlockHeader = stampit({
maxHeightPrevoted,
}) {
this.blockId =
blockId || randomstring.generate({ charset: 'numeric', length: 20 });
blockId || randomstring.generate({ charset: 'numeric', length: 64 });
this.height = height || Math.floor(Math.random() * Math.floor(5000));
this.delegatePublicKey =
delegatePublicKey ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,9 @@ describe('transport', () => {
it('should throw an error', async () => {
await expect(
transportModule.handleEventPostBlock(
{ block: { ...postBlockQuery.block, id: 'dummy' } },
{
block: { ...postBlockQuery.block, id: 'test'.repeat(16) },
},
defaultPeerId,
),
).rejects.toEqual([
Expand Down

0 comments on commit 139a223

Please sign in to comment.