You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the bn.js file within dashcore-lib, the bn.js npm module is brought into scope. Note that bn.js here refers to two different things, the file within this lib and the module published to npm. The file pulls in the module and then overrides some methods from the module (aka monkey patching). This can cause unexpected and hard to find errors when using dashcore-lib. For example, I have a repository that uses ethereumjs-abi, which pulls in the bn.js npm module. Pulling dashcore-lib into that repository started breaking ethereum functionality because the BN.prototype.toBuffer had been dynamically overridden by dashcore-lib. This is a frustrating developer experience as a user of dashcore-lib and I don't see a good reason why the library is built this way.
The text was updated successfully, but these errors were encountered:
In the
bn.js
file withindashcore-lib
, thebn.js
npm module is brought into scope. Note thatbn.js
here refers to two different things, the file within this lib and the module published to npm. The file pulls in the module and then overrides some methods from the module (aka monkey patching). This can cause unexpected and hard to find errors when usingdashcore-lib
. For example, I have a repository that usesethereumjs-abi
, which pulls in thebn.js
npm module. Pullingdashcore-lib
into that repository started breaking ethereum functionality because theBN.prototype.toBuffer
had been dynamically overridden bydashcore-lib
. This is a frustrating developer experience as a user ofdashcore-lib
and I don't see a good reason why the library is built this way.The text was updated successfully, but these errors were encountered: