aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 19:02:25 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-09 19:02:25 +0800
commitea14913b412e78ff458bdfba47182f7363e776e5 (patch)
tree3ee220bfbbd9923b5e1adc36ee51f9b5d39ad640 /packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts
parent5868c91cfb54cfa9177572b201d88d1168bf5b06 (diff)
parent5dd55491b86bf8577405e37d0f2d668aa1273b10 (diff)
downloaddexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.gz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.bz2
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.lz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.xz
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.tar.zst
dexon-sol-tools-ea14913b412e78ff458bdfba47182f7363e776e5.zip
Merge development
Diffstat (limited to 'packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts')
-rw-r--r--packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts340
1 files changed, 340 insertions, 0 deletions
diff --git a/packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts b/packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts
new file mode 100644
index 000000000..7cfd7a118
--- /dev/null
+++ b/packages/utils/test/abi_encoder/abi_samples/optimizer_abis.ts
@@ -0,0 +1,340 @@
+/* tslint:disable max-file-line-count */
+import { MethodAbi } from 'ethereum-types';
+
+export const duplicateDynamicArraysWithStaticElements: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array1',
+ type: 'uint[]',
+ },
+ {
+ name: 'array2',
+ type: 'uint[]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateDynamicArraysWithDynamicElements: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array1',
+ type: 'string[]',
+ },
+ {
+ name: 'array2',
+ type: 'string[]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateStaticArraysWithStaticElements: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array1',
+ type: 'uint[2]',
+ },
+ {
+ name: 'array2',
+ type: 'uint[2]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateStaticArraysWithDynamicElements: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array1',
+ type: 'string[2]',
+ },
+ {
+ name: 'array2',
+ type: 'string[2]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateArrayElements: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array',
+ type: 'string[]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateTupleFields: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ components: [
+ {
+ name: 'field1',
+ type: 'string',
+ },
+ {
+ name: 'field2',
+ type: 'string',
+ },
+ ],
+ name: 'Tuple',
+ type: 'tuple',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateStrings: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'string1',
+ type: 'string',
+ },
+ {
+ name: 'string2',
+ type: 'string',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateBytes: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'bytes1',
+ type: 'bytes',
+ },
+ {
+ name: 'bytes2',
+ type: 'bytes',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateTuples: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ components: [
+ {
+ name: 'field1',
+ type: 'string',
+ },
+ {
+ name: 'field2',
+ type: 'uint',
+ },
+ ],
+ name: 'Tuple',
+ type: 'tuple',
+ },
+ {
+ components: [
+ {
+ name: 'field1',
+ type: 'string',
+ },
+ {
+ name: 'field2',
+ type: 'uint',
+ },
+ ],
+ name: 'Tuple',
+ type: 'tuple',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateArraysNestedInTuples: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ components: [
+ {
+ name: 'field',
+ type: 'uint[]',
+ },
+ ],
+ name: 'Tuple1',
+ type: 'tuple',
+ },
+ {
+ components: [
+ {
+ name: 'field',
+ type: 'uint[]',
+ },
+ {
+ name: 'extraField',
+ type: 'string',
+ },
+ ],
+ name: 'Tuple2',
+ type: 'tuple',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateTuplesNestedInTuples: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ components: [
+ {
+ components: [
+ {
+ name: 'nestedField',
+ type: 'string',
+ },
+ ],
+ name: 'field',
+ type: 'tuple',
+ },
+ ],
+ name: 'Tuple1',
+ type: 'tuple',
+ },
+ {
+ components: [
+ {
+ components: [
+ {
+ name: 'nestedField',
+ type: 'string',
+ },
+ ],
+ name: 'field',
+ type: 'tuple',
+ },
+ {
+ name: 'extraField',
+ type: 'string',
+ },
+ ],
+ name: 'Tuple1',
+ type: 'tuple',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const duplicateTwoDimensionalArrays: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'array1',
+ type: 'string[][]',
+ },
+ {
+ name: 'array2',
+ type: 'string[][]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const arrayElementsDuplicatedAsSeparateParameter: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'stringArray',
+ type: 'string[]',
+ },
+ {
+ name: 'string',
+ type: 'string',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};
+
+export const arrayElementsDuplicatedAsTupleFields: MethodAbi = {
+ constant: false,
+ inputs: [
+ {
+ name: 'uint8Array',
+ type: 'uint8[]',
+ },
+ {
+ components: [
+ {
+ name: 'uint',
+ type: 'uint',
+ },
+ ],
+ name: 'uintTuple',
+ type: 'tuple[]',
+ },
+ ],
+ name: 'simpleFunction',
+ outputs: [],
+ payable: false,
+ stateMutability: 'nonpayable',
+ type: 'function',
+};