Commit ef848d44 authored by yann300's avatar yann300

renaming

parent 3ea4abeb
...@@ -170,7 +170,7 @@ function getStructMembers (typeName, stateDefinitions) { ...@@ -170,7 +170,7 @@ function getStructMembers (typeName, stateDefinitions) {
var offsets = computeOffsets(dec.children, stateDefinitions) var offsets = computeOffsets(dec.children, stateDefinitions)
return { return {
members: offsets.typesOffsets, members: offsets.typesOffsets,
storageBytes: offsets.endLocation.slot storageSlots: offsets.endLocation.slot
} }
} }
} }
...@@ -238,14 +238,14 @@ function computeOffsets (types, stateItems, cb) { ...@@ -238,14 +238,14 @@ function computeOffsets (types, stateItems, cb) {
for (var i in types) { for (var i in types) {
var variable = types[i] var variable = types[i]
var type = parseType(variable.attributes.type, stateItems) var type = parseType(variable.attributes.type, stateItems)
if (location.offset + type.storageBytes > 32) {
location.slot++
location.offset = 0
}
if (!type) { if (!type) {
console.log('unable to retrieve decode info of ' + variable.attributes.type) console.log('unable to retrieve decode info of ' + variable.attributes.type)
return null return null
} }
if (location.offset + type.storageBytes > 32) {
location.slot++
location.offset = 0
}
ret.push({ ret.push({
name: variable.attributes.name, name: variable.attributes.name,
type: type, type: type,
......
'use strict' 'use strict'
function Struct (memberDetails) { function Struct (memberDetails) {
this.storageSlots = memberDetails.storageBytes this.storageSlots = memberDetails.storageSlots
this.storageBytes = 32 this.storageBytes = 32
this.members = memberDetails.members this.members = memberDetails.members
this.typeName = 'struct' this.typeName = 'struct'
......
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