Commit 28ec08e1 authored by yann300's avatar yann300

fix mapping parsing

parent 7c5b1854
...@@ -20,9 +20,9 @@ var util = require('./types/util') ...@@ -20,9 +20,9 @@ var util = require('./types/util')
* @return {Object} returns decoded info about the current type: { storageBytes, typeName} * @return {Object} returns decoded info about the current type: { storageBytes, typeName}
*/ */
function mapping (type, stateDefinitions, contractName) { function mapping (type, stateDefinitions, contractName) {
var match = type.match(/mapping\((.*?)( =>)? (.*)\)$/) var match = type.match(/mapping\((.*?)=>(.*)\)$/)
var keyTypeName = match[1] var keyTypeName = match[1].trim()
var valueTypeName = match[3] var valueTypeName = match[2].trim()
var keyType = parseType(keyTypeName, stateDefinitions, contractName, 'storage') var keyType = parseType(keyTypeName, stateDefinitions, contractName, 'storage')
var valueType = parseType(valueTypeName, stateDefinitions, contractName, 'storage') var valueType = parseType(valueTypeName, stateDefinitions, contractName, 'storage')
......
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