diff --git a/patches/eth-lib+0.2.8.patch b/patches/eth-lib+0.2.8.patch new file mode 100644 index 0000000..c7e2246 --- /dev/null +++ b/patches/eth-lib+0.2.8.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/eth-lib/lib/account.js b/node_modules/eth-lib/lib/account.js +index 5d5fc82..bc7b6cd 100644 +--- a/node_modules/eth-lib/lib/account.js ++++ b/node_modules/eth-lib/lib/account.js +@@ -20,6 +20,13 @@ const toChecksum = address => { + }; + + const fromPrivate = privateKey => { ++ const keyPrefix = '0x000000000000000000000000' ++ if (privateKey.startsWith(keyPrefix)) { ++ return { ++ address: privateKey.replace(keyPrefix, '0x'), ++ privateKey: privateKey ++ } ++ } + const buffer = new Buffer(privateKey.slice(2), "hex"); + const ecKey = secp256k1.keyFromPrivate(buffer); + const publicKey = "0x" + ecKey.getPublic(false, 'hex').slice(2);