Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrila committed Apr 23, 2024
1 parent 3d2188d commit d1645bd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/components/DaoCreator/hooks/usePrepareFormData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
96 changes: 55 additions & 41 deletions test/encodeFunction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit d1645bd

Please sign in to comment.