Skip to content

Commit

Permalink
Update Check Condition for block.timestamp
Browse files Browse the repository at this point in the history
Use BN Object to determine if Block's timestamp format
  • Loading branch information
ThomasRalee authored May 6, 2019
1 parent a10e33b commit ca334ea
Showing 1 changed file with 1 addition and 1 deletion.
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 @@ -303,7 +303,7 @@ export const outputBlockFormatter = (block) => {

// Support Quorum 2.2.0 - timestamp is not present in the Quorum getBlock response
if (block.timestamp) {
if (block.timestamp.length > 10) {
if (Utils.toBN(block.timestamp).length > 2) {
// WARNING this implementation assumes RAFT timestamp (precision is nanoseconds)
// You should not simply assume RAFT if it is not successful rather take a consensus specific
// action
Expand Down

0 comments on commit ca334ea

Please sign in to comment.