message: add a test case for parsing tuples
diff: import { expect } from 'chai'
  -import { parseEvmType, UnsignedIntegerType, IntegerType, ArrayType, BytesType } from '../../src/parser/parseEvmType'
  +import {
  + parseEvmType,
  + UnsignedIntegerType,
  + IntegerType,
  + ArrayType,
  + BytesType,
  +} from '../../src/parser/parseEvmType'
  describe('parseEvmType function', () => {
  - it('should parse unsigned integer', () => {
  + it('parses unsigned integer', () => {
  const parsedType = parseEvmType('uint8')
  expect(parsedType.type).to.be.eq('uinteger')
  expect((parsedType as UnsignedIntegerType).bits).to.be.eq(8)
  })
  - it('should parse signed integer', () => {
  + it('parses signed integer', () => {
  const parsedType = parseEvmType('int')
  expect(parsedType.type).to.be.eq('integer')
  expect((parsedType as IntegerType).bits).to.be.eq(256)
  })
  - it('should parse boolean', () => {
  + it('parses boolean', () => {
  const parsedType = parseEvmType('bool')
  expect(parsedType.type).to.be.eq('boolean')
  })
  - it('should parse bytes2', () => {
  + it('parses bytes2', () => {
  const parsedType = parseEvmType('bytes2')
  expect(parsedType.type).to.be.eq('bytes')
  expect((parsedType as BytesType).size).to.be.eq(2)
  })
  - it('should parse bytes', () => {
  + it('parses bytes', () => {
  const parsedType = parseEvmType('bytes')
  expect(parsedType.type).to.be.eq('dynamic-bytes')
  })
  - it('should parse arrays', () => {
  + it('parses arrays', () => {
  const parsedType = parseEvmType('uint[]')
  expect(parsedType.type).to.be.eq('array')
  expect((parsedType as ArrayType).itemType.type).to.be.eq('uinteger')
  })
  - it('should parse fixed size arrays', () => {
  + it('parses fixed size arrays', () => {
  const parsedType = parseEvmType('uint[8]')
  expect(parsedType.type).to.be.eq('array')
  @@ -50,7 +56,7 @@ describe('parseEvmType function', () => {
  expect((parsedType as ArrayType).size).to.be.eq(8)
  })
  - it('should parse nested arrays', () => {
  + it('parses nested arrays', () => {
  const parsedType = parseEvmType('uint16[8][256]')
  expect(parsedType.type).to.be.eq('array')
  @@ -60,4 +66,24 @@ describe('parseEvmType function', () => {
  expect(((parsedType as ArrayType).itemType as ArrayType).size).to.be.eq(8)
  expect((((parsedType as ArrayType).itemType as ArrayType).itemType as UnsignedIntegerType).bits).to.be.eq(16)
  })
  +
  + it('parses tuples', () => {
  + const parsedType = parseEvmType('tuple', [
  + {
  + name: 'uint256_0',
  + type: { type: 'uinteger', bits: 256 },
  + },
  + {
  + name: 'uint256_1',
  + type: { type: 'uinteger', bits: 256 },
  + },
  + ])
  + expect(parsedType).to.be.deep.eq({
  + type: 'tuple',
  + components: [
  + { name: 'uint256_0', type: { type: 'uinteger', bits: 256 } },
  + { name: 'uint256_1', type: { type: 'uinteger', bits: 256 } },
  + ],
  + })
  + })
  })
  