-
Notifications
You must be signed in to change notification settings - Fork 109
Description
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.