Unverified Commit ce771912 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1165 from andremedeiros/fix-regex-for-firefox

fix: update regex to be Firefox compatible
parents d4a87381 4f975021
...@@ -75,7 +75,7 @@ async function extractHexValue (location, storageResolver, byteLength) { ...@@ -75,7 +75,7 @@ async function extractHexValue (location, storageResolver, byteLength) {
function toBN (value) { function toBN (value) {
if (value instanceof BN) { if (value instanceof BN) {
return value return value
} else if (value.match && value.match(/^(?:0x)?(?<hash>[a-f0-9])*$/)) { } else if (value.match && value.match(/^(0x)?([a-f0-9]*)$/)) {
value = ethutil.unpad(value.replace(/^(0x)/, '')) value = ethutil.unpad(value.replace(/^(0x)/, ''))
value = new BN(value === '' ? '0' : value, 16) value = new BN(value === '' ? '0' : value, 16)
} else if (!isNaN(value)) { } else if (!isNaN(value)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment