Closed sandeepnRES closed 1 year ago
That exported function is used in the fabric-common code here:
That function really is only there to support the fabric-common implementation and it should generally not be necessary for application code since the BlockEvent exposed by the SDK to the application defines the block number as a Long object:
https://hyperledger.github.io/fabric-sdk-node/main/module-fabric-network.BlockEvent.html
The Long object has an add()
method to produce another Long result, and a toNumber()
method to convert to a JavaScript number.
okay, thanks that helps.
In file:
fabric-protos/index.js
, I can see it has following line:But when I do following:
It throws error:
Module '"fabric-protos"' has no exported member 'uint64ToNumber'
Is this expected? Because I was trying to add a number to
blockNumber
from ablock
which is of typeuint64
, but notnumber
, and the typescript compiler throws error thatuint64
orLong
doesn't overlap with typenumber
. I thought importing above function fromfabric-protos
would help, but not able to import. Any help would be appreciated. Thanks.