Commit 32d1f4b3 authored by yann300's avatar yann300

add storage location to bytes / string

parent 97f8454c
......@@ -73,7 +73,12 @@ function Bool (type) {
* @return {Object} returns decoded info about the current type: { storageBytes, typeName}
*/
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}
*/
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
}
}
/**
......
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