fix: handle bignumber conversion on hash without prefix

pull/7/head
Andre Medeiros 6 years ago
parent de7f09f14d
commit 58eb6962c6
  1. 4
      remix-debug/src/solidity-decoder/types/util.js

@ -75,8 +75,8 @@ async function extractHexValue (location, storageResolver, byteLength) {
function toBN (value) {
if (value instanceof BN) {
return value
} else if (value.indexOf && value.indexOf('0x') === 0) {
value = ethutil.unpad(value.replace('Ox', ''))
} else if (value.match && value.match(/^(?:0x)?(?<hash>[a-f0-9])*$/)) {
value = ethutil.unpad(value.replace(/^(0x)/, ''))
value = new BN(value === '' ? '0' : value, 16)
} else if (!isNaN(value)) {
value = new BN(value)

Loading…
Cancel
Save