Skip to content

Commit

Permalink
OutputBlockFormatterTest updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Furter committed May 7, 2019
1 parent 71f1202 commit 90c69ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/web3-core-helpers/src/Formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export const outputBlockFormatter = (block) => {
const timestamp = Utils.toBN(block.timestamp);

if (timestamp.bitLength() <= 53) {
block.timestamp = Utils.hexToNumber(block.timestamp);
block.timestamp = timestamp.toNumber();
} else {
block.timestamp = timestamp.toString(10);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('OutputBlockFormatterTest', () => {
gasLimit: 0x0,
gasUsed: 0x0,
size: 0x0,
timestamp: 0x0,
timestamp: 0,
number: 0x0,
difficulty: '100', // Strange some numbers will be handled as string and some as number (gas & nonce)
totalDifficulty: '100',
Expand All @@ -54,7 +54,7 @@ describe('OutputBlockFormatterTest', () => {

it('[Quorum] call outputBlockFormatter with a valid block without a timestamp who has nano seconds', () => {
const block = {
timestamp: Number.MAX_SAFE_INTEGER + 1,
timestamp: '0x20000000000000',
gasLimit: 0x0,
gasUsed: 0x0,
size: 0x0,
Expand Down

0 comments on commit 90c69ad

Please sign in to comment.