add storage location to bytes / string

pull/7/head
yann300 8 years ago
parent 97f8454cae
commit 32d1f4b3eb
  1. 14
      src/solidity/decodeInfo.js

@ -73,7 +73,12 @@ function Bool (type) {
* @return {Object} returns decoded info about the current type: { storageBytes, typeName} * @return {Object} returns decoded info about the current type: { storageBytes, typeName}
*/ */
function DynamicByteArray (type) { function DynamicByteArray (type) {
return new BytesType() var match = type.match(/( storage ref| storage pointer| memory| calldata)?$/)
if (match.length > 1) {
return new BytesType(match[1].trim())
} else {
return null
}
} }
/** /**
@ -94,7 +99,12 @@ function FixedByteArray (type) {
* @return {Object} returns decoded info about the current type: { storageBytes, typeName} * @return {Object} returns decoded info about the current type: { storageBytes, typeName}
*/ */
function String (type) { function String (type) {
return new StringType() var match = type.match(/( storage ref| storage pointer| memory| calldata)?$/)
if (match.length > 1) {
return new StringType(match[1].trim())
} else {
return null
}
} }
/** /**

Loading…
Cancel
Save