string decoding

pull/7/head
yann300 8 years ago
parent e2413efbf9
commit 06dd2db331
  1. 9
      src/solidity/types/StringType.js

@ -10,6 +10,15 @@ function StringType () {
StringType.prototype.decodeFromStorage = function (location, storageContent) { StringType.prototype.decodeFromStorage = function (location, storageContent) {
var decoded = this.dynamicBytes.decodeFromStorage(location, storageContent) var decoded = this.dynamicBytes.decodeFromStorage(location, storageContent)
return format(decoded)
}
StringType.prototype.decodeLocals = function (stackHeight, stack, memory) {
var decoded = this.dynamicBytes.decodeLocals(stackHeight, stack, memory)
return format(decoded)
}
function format (decoded) {
var value = decoded.value var value = decoded.value
value = value.replace('0x', '').replace(/(..)/g, '%$1') value = value.replace('0x', '').replace(/(..)/g, '%$1')
var ret = { var ret = {

Loading…
Cancel
Save