Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
patch missing strip() in bn@v5
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed May 14, 2020
1 parent 03bb3ff commit 2edd2de
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ Object.assign(exports, ethjsUtil)
/**
* [`BN`](https://github.com/indutny/bn.js)
*/
export { BN }
// PatchedBN applies a temporary fix for missing `strip()` when
// a bn.js@v4 instance uses a bn.js@v5 instance:
// https://github.com/indutny/bn.js/issues/239#issuecomment-626237202
class PatchedBN extends BN {
strip() {
// @ts-ignore
return this._strip()
}
}
export { PatchedBN as BN }

/**
* [`rlp`](https://github.com/ethereumjs/rlp)
Expand Down

0 comments on commit 2edd2de

Please sign in to comment.