Commit bd6e4adc authored by yann300's avatar yann300

resolve input parameter that might contain created{adress} like token

parent 968f2bba
......@@ -212,6 +212,26 @@ class Recorder {
cb('cannot resolve abi')
return
}
if (tx.record.parameters) {
/* check if we have some params to resolve */
try {
tx.record.parameters.forEach((value, index) => {
var isString = true
if (typeof value !== 'string') {
isString = false
value = JSON.stringify(value)
}
for (var timestamp in self.data._createdContractsReverse) {
value = value.replace(new RegExp('created\\{' + timestamp + '\\}', 'g'), self.data._createdContractsReverse[timestamp])
}
if (!isString) value = JSON.parse(value)
tx.record.parameters[index] = value
})
} catch (e) {
modal.alert('cannot resolve input parameters ' + JSON.stringify(tx.record.parameters) + '. Execution stopped at ' + index)
return
}
}
var data = format.encodeData(fnABI, tx.record.parameters, tx.record.bytecode)
if (data.error) {
modal.alert(data.error + '. Record:' + JSON.stringify(record, null, '\t') + '. Execution stopped at ' + index)
......
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