ignore mapping if struct in memory (#1308)

fix https://github.com/ethereum/remix-project/issues/271
pull/5370/head
yann300 3 years ago committed by GitHub
parent e6ff6f03af
commit 8a402969b0
  1. 2
      libs/remix-debug/src/solidity-decoder/types/Mapping.ts
  2. 3
      libs/remix-debug/src/solidity-decoder/types/Struct.ts

@ -38,7 +38,7 @@ export class Mapping extends RefType {
decodeFromMemoryInternal (offset, memory) {
// mappings can only exist in storage and not in memory
// so this should never be called
return { value: '<not implemented>', length: '0x', type: this.typeName }
return { value: '', length: '0x0', type: this.typeName }
}
async decodeMappingsLocation (preimages, location, storageResolver) {

@ -1,6 +1,7 @@
'use strict'
import { add } from './util'
import { RefType } from './RefType'
import { Mapping } from './Mapping'
export class Struct extends RefType {
members
@ -33,7 +34,7 @@ export class Struct extends RefType {
var contentOffset = offset
var member = item.type.decodeFromMemory(contentOffset, memory)
ret[item.name] = member
offset += 32
if (!(item.type instanceof Mapping)) offset += 32
})
return { value: ret, type: this.typeName }
}

Loading…
Cancel
Save