1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/components/app/signature-request/signature-request.component.test.js

120 lines
3.5 KiB
JavaScript
Raw Normal View History

import React from 'react';
import configureMockStore from 'redux-mock-store';
import mockState from '../../../../test/data/mock-state.json';
import { renderWithProvider } from '../../../../test/lib/render-helpers';
import SignatureRequest from './signature-request.component';
describe('Signature Request Component', () => {
const store = configureMockStore()(mockState);
describe('render', () => {
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
let fromAddress;
let messageData;
beforeEach(() => {
fromAddress = '0x123456789abcdef';
messageData = {
domain: {
chainId: 97,
name: 'Ether Mail',
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
version: '1',
},
message: {
contents: 'Hello, Bob!',
from: {
name: 'Cow',
wallets: [
'0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
'0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF',
],
},
to: [
{
name: 'Bob',
wallets: [
'0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
'0xB0BdaBea57B0BDABeA57b0bdABEA57b0BDabEa57',
'0xB0B0b0b0b0b0B000000000000000000000000000',
],
},
],
},
primaryType: 'Mail',
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
Mail: [
{ name: 'from', type: 'Person' },
{ name: 'to', type: 'Person[]' },
{ name: 'contents', type: 'string' },
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'wallets', type: 'address[]' },
],
},
};
});
it('should match snapshot', () => {
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
const msgParams = {
data: JSON.stringify(messageData),
version: 'V4',
origin: 'test',
};
const { container } = renderWithProvider(
<SignatureRequest
hardwareWalletRequiresConnection={false}
clearConfirmTransaction={() => undefined}
cancel={() => undefined}
sign={() => undefined}
txData={{
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
msgParams,
}}
fromAccount={{ address: fromAddress }}
provider={{ type: 'rpc' }}
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
/>,
store,
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
);
expect(container).toMatchSnapshot();
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
});
it('should render a div message parsed without typeless data', () => {
messageData.message.do_not_display = 'one';
messageData.message.do_not_display_2 = {
do_not_display: 'two',
};
const msgParams = {
data: JSON.stringify(messageData),
version: 'V4',
origin: 'test',
};
const { queryByText } = renderWithProvider(
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
<SignatureRequest
hardwareWalletRequiresConnection={false}
"eth_signTypedData" presents fields that do not appear in 'types' filed (#12905) * Premilimary Sanitize data logic. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData v2 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitizeData: take 3 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Sanitize Data take 4 Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that version is v4 before sanitizing. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * sanitize arrays. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Tests to check that typeless data are not shwon Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Do not check value types, Iterate through the message, and ensure each property of the message is declared as a type Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Check that if data type is not defined, it is a solidity type. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint Fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Code cleanup Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Move sanitizeData to utils Tests for sanitizeData in utils Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Fix unit tests for signaturerequest Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Remove unused type include fixedMxN and ufixedMxN checks. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * move fixtures to before each Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * invert if condition to avoid indentations. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Lint fixes Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * We should exclude types with [] at the beginning or middle as well: Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * cache nestedType Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw error for undefined/invalid types definition Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com> * Throw if base type and types are not defined. Signed-off-by: Akintayo A. Olusegun <akintayo.segun@gmail.com>
2021-12-08 21:56:09 +01:00
clearConfirmTransaction={() => undefined}
cancel={() => undefined}
sign={() => undefined}
txData={{
msgParams,
}}
fromAccount={{ address: fromAddress }}
provider={{ type: 'rpc' }}
2020-11-03 00:41:28 +01:00
/>,
store,
);
expect(queryByText('do_not_display')).not.toBeInTheDocument();
expect(queryByText('one')).not.toBeInTheDocument();
expect(queryByText('do_not_display_2')).not.toBeInTheDocument();
expect(queryByText('two')).not.toBeInTheDocument();
});
});
});