add function type

pull/2120/head
yann300 3 years ago
parent e615f56cdd
commit 76f8549ae3
  1. 8
      libs/remix-debug/src/solidity-decoder/decodeInfo.ts
  2. 12
      libs/remix-debug/src/solidity-decoder/types/FunctionType.ts

@ -11,6 +11,7 @@ import { Struct as StructType } from './types/Struct'
import { Int as IntType } from './types/Int'
import { Uint as UintType } from './types/Uint'
import { Mapping as MappingType } from './types/Mapping'
import { FunctionType } from './types/FunctionType'
import { extractLocation, removeLocation } from './types/util'
/**
@ -78,6 +79,10 @@ function bool (type) {
return new BoolType()
}
function functionType (type, stateDefinitions, contractName, location) {
return new FunctionType(type, stateDefinitions, contractName, location)
}
/**
* DynamicByteArray decode the given @arg type
*
@ -300,7 +305,8 @@ function parseType (type, stateDefinitions, contractName, location) {
struct: struct,
int: int,
uint: uint,
mapping: mapping
mapping: mapping,
function: functionType
}
const currentType = typeClass(type)
if (currentType === null) {

@ -0,0 +1,12 @@
'use strict'
import { ValueType } from './ValueType'
export class FunctionType extends ValueType {
constructor (type, stateDefinitions, contractName, location) {
super(1, 8, 'function')
}
decodeValue (value) {
return value
}
}
Loading…
Cancel
Save