File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ export class Method extends MethodDataType {
88
88
export class EvmDataTypeFactory implements DataTypeFactory {
89
89
private static _instance : DataTypeFactory ;
90
90
91
+ private _registeredStructs : { [ structName : string ] : DataType } = { } ;
92
+
91
93
public static getInstance ( ) : DataTypeFactory {
92
94
if ( ! EvmDataTypeFactory . _instance ) {
93
95
EvmDataTypeFactory . _instance = new EvmDataTypeFactory ( ) ;
@@ -113,10 +115,15 @@ export class EvmDataTypeFactory implements DataTypeFactory {
113
115
dataType = new StaticBytes ( dataItem ) ;
114
116
} else if ( Tuple . matchType ( dataItem . type ) ) {
115
117
dataType = new Tuple ( dataItem ) ;
118
+ if ( dataItem . internalType ) {
119
+ this . _registeredStructs [ dataItem . internalType ] = dataType ;
120
+ }
116
121
} else if ( DynamicBytes . matchType ( dataItem . type ) ) {
117
122
dataType = new DynamicBytes ( dataItem ) ;
118
123
} else if ( String . matchType ( dataItem . type ) ) {
119
124
dataType = new String ( dataItem ) ;
125
+ } else if ( this . _registeredStructs [ dataItem . type ] ) {
126
+ dataType = this . _registeredStructs [ dataItem . type ] ;
120
127
}
121
128
// @TODO : DataTypeement Fixed/UFixed types
122
129
if ( dataType === undefined ) {
You can’t perform that action at this time.
0 commit comments