aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-11-07 05:28:59 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-11-29 08:38:10 +0800
commitbce62056d953abc424a5171adbaff1641f8f6626 (patch)
tree98601c93ce68a2ca323f172a3b6d689a42825cfe
parent331cca37e2bce35a1351f75a85b97ab60dfad196 (diff)
downloaddexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar.gz
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar.bz2
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar.lz
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar.xz
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.tar.zst
dexon-sol-tools-bce62056d953abc424a5171adbaff1641f8f6626.zip
cleaner name/type for pointer
-rw-r--r--packages/order-utils/test/abi_encoder_test.ts18
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/order-utils/test/abi_encoder_test.ts b/packages/order-utils/test/abi_encoder_test.ts
index 6b32d59aa..4b8ed48cc 100644
--- a/packages/order-utils/test/abi_encoder_test.ts
+++ b/packages/order-utils/test/abi_encoder_test.ts
@@ -137,6 +137,10 @@ namespace AbiEncoder {
return this.hexValue;
}
+ public getDataItem(): DataItem {
+ return this.dataItem;
+ }
+
public abstract assignValue(value: any): void;
// abstract match(type: string): Bool;
@@ -373,15 +377,25 @@ namespace AbiEncoder {
class Pointer extends StaticDataType {
destDataType: DynamicDataType;
- static metaDataItem = { name: '[ptr]', type: '[ptr]' } as DataItem;
constructor(destDataType: DynamicDataType) {
- super(Pointer.metaDataItem);
+ const destDataItem = destDataType.getDataItem();
+ const dataItem = { name: `ptr<${destDataItem.name}>`, type: `ptr<${destDataItem.type}>` } as DataItem;
+ super(dataItem);
this.destDataType = destDataType;
}
+ /*
public assignValue(destDataType: DynamicDataType) {
this.destDataType = destDataType;
+ }*/
+
+ public assignValue(value: any) {
+ this.destDataType.assignValue(value);
+ }
+
+ public getHexValue(): string {
+ return this.destDataType.getHexValue();
}
}