aboutsummaryrefslogtreecommitdiffstats
path: root/packages/utils/test/abi_utils_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/utils/test/abi_utils_test.ts')
-rw-r--r--packages/utils/test/abi_utils_test.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/utils/test/abi_utils_test.ts b/packages/utils/test/abi_utils_test.ts
new file mode 100644
index 000000000..0ebee64c4
--- /dev/null
+++ b/packages/utils/test/abi_utils_test.ts
@@ -0,0 +1,19 @@
+import * as chai from 'chai';
+import 'mocha';
+
+import { abiUtils } from '../src';
+
+const expect = chai.expect;
+
+describe('abiUtils', () => {
+ describe('splitTupleTypes', () => {
+ it('handles basic types', () => {
+ const got = abiUtils.splitTupleTypes('tuple(bytes,uint256,address)');
+ expect(got).to.deep.equal(['bytes', 'uint256', 'address']);
+ });
+ it('handles nested tuple types', () => {
+ const got = abiUtils.splitTupleTypes('tuple(tuple(bytes,uint256),address)');
+ expect(got).to.deep.equal(['tuple(bytes,uint256)', 'address']);
+ });
+ });
+});