Fix linked maps (#878)

* Fix linked maps

* Line breaks
This commit is contained in:
Amaury Martiny
2019-05-07 15:35:15 +02:00
committed by GitHub
parent a9e4153800
commit 6396c8df80
6 changed files with 42 additions and 19 deletions
+3 -7
View File
@@ -102,13 +102,9 @@ export class StorageFunctionType extends EnumType<PlainType | MapType> {
* @description Returns the string representation of the value
*/
toString (): string {
if (this.isMap) {
if (this.asMap.isLinked) {
return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`;
}
return this.asMap.value.toString();
}
return this.asType.toString();
return this.isMap
? this.asMap.value.toString()
: this.asType.toString();
}
}
+9 -3
View File
@@ -83,9 +83,15 @@ export class StorageFunctionType extends EnumType<PlainType | MapType> {
* @description Returns the string representation of the value
*/
toString (): string {
return this.isMap
? this.asMap.value.toString()
: this.asType.toString();
if (this.isMap) {
if (this.asMap.isLinked) {
return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`;
}
return this.asMap.value.toString();
}
return this.asType.toString();
}
}
+9 -3
View File
@@ -113,9 +113,15 @@ export class StorageFunctionType extends EnumType<PlainType | MapType | DoubleMa
return this.asDoubleMap.toString();
}
return this.isMap
? this.asMap.value.toString()
: this.asType.toString();
if (this.isMap) {
if (this.asMap.isLinked) {
return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`;
}
return this.asMap.value.toString();
}
return this.asType.toString();
}
}
+9 -3
View File
@@ -207,9 +207,15 @@ export class StorageFunctionType extends EnumType<PlainType | MapType | DoubleMa
return this.asDoubleMap.toString();
}
return this.isMap
? this.asMap.value.toString()
: this.asType.toString();
if (this.isMap) {
if (this.asMap.isLinked) {
return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`;
}
return this.asMap.value.toString();
}
return this.asType.toString();
}
}