From d1645bd3d16661d4e236e3a1e5b2e0082ae9a271 Mon Sep 17 00:00:00 2001 From: Kirill Klimenko Date: Tue, 23 Apr 2024 22:15:19 +0200 Subject: [PATCH] Prettier --- .../DaoCreator/hooks/usePrepareFormData.ts | 2 +- test/encodeFunction.test.ts | 96 +++++++++++-------- 2 files changed, 56 insertions(+), 42 deletions(-) diff --git a/src/components/DaoCreator/hooks/usePrepareFormData.ts b/src/components/DaoCreator/hooks/usePrepareFormData.ts index f4b751cce7..30946e0c30 100644 --- a/src/components/DaoCreator/hooks/usePrepareFormData.ts +++ b/src/components/DaoCreator/hooks/usePrepareFormData.ts @@ -173,7 +173,7 @@ export function usePrepareFormData() { nfts.map(async nft => { let address = nft.tokenAddress; if (couldBeENS(address)) { - address = await signer!.resolveName(nft.tokenAddress!) as Address; + address = (await signer!.resolveName(nft.tokenAddress!)) as Address; } return { tokenAddress: address, diff --git a/test/encodeFunction.test.ts b/test/encodeFunction.test.ts index f4ad3e631b..95985029f1 100644 --- a/test/encodeFunction.test.ts +++ b/test/encodeFunction.test.ts @@ -3,22 +3,26 @@ import { expect, test } from 'vitest'; import { encodeFunction } from '../src/utils/crypto'; test.skip('Function encoding with no parameters', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, args: [] }); expect(encodeFunction('foo')).toEqual(encoded); }); test.skip('Function encoding with [boolean=true]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'boolean' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'boolean' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, @@ -28,12 +32,14 @@ test.skip('Function encoding with [boolean=true]', () => { }); test.skip('Function encoding with [boolean=false]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'boolean' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'boolean' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, @@ -43,12 +49,14 @@ test.skip('Function encoding with [boolean=false]', () => { }); test.skip('Function encoding with [uint=0]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'uint' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'uint' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, @@ -58,12 +66,14 @@ test.skip('Function encoding with [uint=0]', () => { }); test.skip('Function encoding with [uint256=0]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'uint256' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'uint256' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, @@ -73,12 +83,14 @@ test.skip('Function encoding with [uint256=0]', () => { }); test.skip('Function encoding with [uint8=0]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'uint8' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'uint8' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems, @@ -88,12 +100,14 @@ test.skip('Function encoding with [uint8=0]', () => { }); test.skip('Function encoding with [uint8=100]', () => { - const abiItems = [{ - name: 'foo', - stateMutability: 'view', - type: 'function', - inputs: [{ name: 'foo', type: 'uint8' }], - }] + const abiItems = [ + { + name: 'foo', + stateMutability: 'view', + type: 'function', + inputs: [{ name: 'foo', type: 'uint8' }], + }, + ]; const encoded = encodeFunctionData({ functionName: 'foo', abi: abiItems,